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 ViewTypeDecorator extends TypeDecorator { View(obj: ViewArgs): ViewTypeDecorator }
export interface Directive { export interface Directive {
(obj: any): DirectiveTypeDecorator; (obj: DirectiveArgs): DirectiveTypeDecorator;
new (obj: DirectiveAnnotation): DirectiveAnnotation; new (obj: DirectiveAnnotation): DirectiveAnnotation;
} }
export interface Component { export interface Component {
(obj: any): ComponentTypeDecorator; (obj: ComponentArgs): ComponentTypeDecorator;
new (obj: ComponentAnnotation): ComponentAnnotation; new (obj: ComponentAnnotation): ComponentAnnotation;
} }

View File

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