From b10d7a2e51d8176bcf1a629d4db7e34febadd3a1 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 6 Jul 2015 16:07:29 -0700 Subject: [PATCH] fix(angular2.d.ts): show typing for Component, etc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../angular2/src/core/annotations/decorators.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/angular2/src/core/annotations/decorators.ts b/modules/angular2/src/core/annotations/decorators.ts index 7359ab518d..c101f8be45 100644 --- a/modules/angular2/src/core/annotations/decorators.ts +++ b/modules/angular2/src/core/annotations/decorators.ts @@ -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 = makeDecorator(ComponentAnnotation, (fn: any) => fn.View = View); -export var Directive = makeDecorator(DirectiveAnnotation); +export var Component: IComponent = makeDecorator(ComponentAnnotation, (fn: any) => fn.View = View); +export var Directive: IDirective = makeDecorator(DirectiveAnnotation); /* from view */ -export var View = makeDecorator(ViewAnnotation, (fn: any) => fn.View = View); +export var View: IView = makeDecorator(ViewAnnotation, (fn: any) => fn.View = View); /* from di */ export var Attribute = makeParamDecorator(AttributeAnnotation);