Tobias Bosch 1b15170c89 refactor(core): simplify decorators
Every decorator now is made of the following:
- a function that can be used
as a decorator or as a constructor. This function
also can be used for `instanceof` checks.
- a type for this function (callable and newable)
- a type that describes the shape of the data
  that the user needs to pass to the decorator
  as well as the instance of the metadata

The docs for decorators live at the followig places
so that IDEs can discover them correctly:
- General description of the decorator is placed on the
  `...Decorator` interface on the callable function
  definition
- Property descriptions are placed on the interface
  that describes the metadata produces by the decorator
2016-09-12 22:47:54 -07:00

44 lines
1.9 KiB
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* This indirection is needed to free up Component, etc symbols in the public API
* to be used by the decorator versions of these annotations.
*/
import {Attribute, ContentChild, ContentChildren, Query, ViewChild, ViewChildren} from './metadata/di';
import {Component, Directive, HostBinding, HostListener, Input, Output, Pipe} from './metadata/directives';
import {ModuleWithProviders, NgModule, SchemaMetadata} from './metadata/ng_module';
import {ViewEncapsulation} from './metadata/view';
import {Type} from './type';
import {TypeDecorator, makeParamDecorator, makePropDecorator} from './util/decorators';
export {ANALYZE_FOR_ENTRY_COMPONENTS, Attribute, ContentChild, ContentChildren, Query, ViewChild, ViewChildren} from './metadata/di';
export {Component, Directive, HostBinding, HostListener, Input, Output, Pipe} from './metadata/directives';
export {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit} from './metadata/lifecycle_hooks';
export {CUSTOM_ELEMENTS_SCHEMA, ModuleWithProviders, NO_ERRORS_SCHEMA, NgModule, SchemaMetadata} from './metadata/ng_module';
export {ViewEncapsulation} from './metadata/view';
// TODO(vicb): delete ?
export {Directive as DirectiveMetadata};
export {Component as ComponentMetadata};
export {NgModule as NgModuleMetadata};
export {Pipe as PipeMetadata};
export {Output as OutputMetadata};
export {Input as InputMetadata};
export {HostBinding as HostBindingMetadata};
export {HostListener as HostListenerMetadata};
export {Attribute as AttributeMetadata};
export {ContentChildren as ContentChildrenMetadata};
export {ContentChild as ContentChildMetadata};
export {ViewChildren as ViewChildrenMetadata};
export {ViewChild as ViewChildMetadata};
export {Query as QueryMetadata};