fix(angular2.d.ts): show typing for Component, etc

We had the same symbol exported as the interface
for Component decorator as well as the class for
Component annotation, and dgeni only showed the
latter.
Rename the interfaces for decorators with an ‘I’
prefix so they are retained in the .d.ts output.
This commit is contained in:
Alex Eagle 2015-07-06 16:07:29 -07:00
parent a56d33d7ca
commit b10d7a2e51
1 changed files with 8 additions and 6 deletions

View File

@ -9,6 +9,8 @@ import {AttributeAnnotation, QueryAnnotation} from './di';
import {makeDecorator, makeParamDecorator, TypeDecorator, Class} from '../../util/decorators';
import {Type} from 'angular2/src/facade/lang';
export {ClassDefinition, TypeDecorator} from '../../util/decorators';
export interface DirectiveTypeDecorator extends TypeDecorator {}
export interface ComponentTypeDecorator extends TypeDecorator {
@ -17,28 +19,28 @@ export interface ComponentTypeDecorator extends TypeDecorator {
export interface ViewTypeDecorator extends TypeDecorator { View(obj: ViewArgs): ViewTypeDecorator }
export interface Directive {
export interface IDirective {
(obj: DirectiveArgs): DirectiveTypeDecorator;
new (obj: DirectiveAnnotation): DirectiveAnnotation;
}
export interface Component {
export interface IComponent {
(obj: ComponentArgs): ComponentTypeDecorator;
new (obj: ComponentAnnotation): ComponentAnnotation;
}
export interface View {
export interface IView {
(obj: ViewArgs): ViewTypeDecorator;
new (obj: ViewArgs): ViewAnnotation;
}
/* from annotations */
export var Component = <Component>makeDecorator(ComponentAnnotation, (fn: any) => fn.View = View);
export var Directive = <Directive>makeDecorator(DirectiveAnnotation);
export var Component: IComponent = <IComponent>makeDecorator(ComponentAnnotation, (fn: any) => fn.View = View);
export var Directive: IDirective = <IDirective>makeDecorator(DirectiveAnnotation);
/* from view */
export var View = <View>makeDecorator(ViewAnnotation, (fn: any) => fn.View = View);
export var View: IView = <IView>makeDecorator(ViewAnnotation, (fn: any) => fn.View = View);
/* from di */
export var Attribute = makeParamDecorator(AttributeAnnotation);