fix(annotations): swap DirectiveArgs & ComponentArgs

This commit is contained in:
Victor Berchet 2015-06-17 19:34:24 +02:00
parent 5dee8e26cc
commit dcc4bc2735
2 changed files with 7 additions and 15 deletions

View File

@ -24,12 +24,12 @@ export interface ComponentTypeDecorator extends TypeDecorator {
export interface ViewTypeDecorator extends TypeDecorator { View(obj: ViewArgs): ViewTypeDecorator }
export interface Directive {
(obj: any): DirectiveTypeDecorator;
(obj: DirectiveArgs): DirectiveTypeDecorator;
new (obj: DirectiveAnnotation): DirectiveAnnotation;
}
export interface Component {
(obj: any): ComponentTypeDecorator;
(obj: ComponentArgs): ComponentTypeDecorator;
new (obj: ComponentAnnotation): ComponentAnnotation;
}

View File

@ -787,7 +787,7 @@ export class Directive extends Injectable {
constructor({
selector, properties, events, host, lifecycle, hostInjector, exportAs,
compileChildren = true,
}: ComponentArgs = {}) {
}: DirectiveArgs = {}) {
super();
this.selector = selector;
this.properties = properties;
@ -800,7 +800,7 @@ export class Directive extends Injectable {
}
}
export interface ComponentArgs {
export interface DirectiveArgs {
selector?: string;
properties?: List<string>;
events?: List<string>;
@ -962,7 +962,7 @@ export class Component extends Directive {
constructor({selector, properties, events, host, exportAs, appInjector, lifecycle, hostInjector,
viewInjector, changeDetection = DEFAULT,
compileChildren = true}: DirectiveArgs = {}) {
compileChildren = true}: ComponentArgs = {}) {
super({
selector: selector,
properties: properties,
@ -979,21 +979,13 @@ export class Component extends Directive {
this.viewInjector = viewInjector;
}
}
export interface DirectiveArgs {
selector?: string;
properties?: List<string>;
events?: List<string>;
host?: StringMap<string, string>;
exportAs?: string;
export interface ComponentArgs extends DirectiveArgs {
appInjector?: List<any>;
lifecycle?: List<LifecycleEvent>;
hostInjector?: List<any>;
viewInjector?: List<any>;
changeDetection?: string;
compileChildren?: boolean;
}
/**
* Lifecycle events are guaranteed to be called in the following order:
* - `onChange` (optional if any bindings have changed),