X Tutup
Skip to content

Commit b10d7a2

Browse files
committed
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.
1 parent a56d33d commit b10d7a2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

modules/angular2/src/core/annotations/decorators.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {AttributeAnnotation, QueryAnnotation} from './di';
99
import {makeDecorator, makeParamDecorator, TypeDecorator, Class} from '../../util/decorators';
1010
import {Type} from 'angular2/src/facade/lang';
1111

12+
export {ClassDefinition, TypeDecorator} from '../../util/decorators';
13+
1214
export interface DirectiveTypeDecorator extends TypeDecorator {}
1315

1416
export interface ComponentTypeDecorator extends TypeDecorator {
@@ -17,28 +19,28 @@ export interface ComponentTypeDecorator extends TypeDecorator {
1719

1820
export interface ViewTypeDecorator extends TypeDecorator { View(obj: ViewArgs): ViewTypeDecorator }
1921

20-
export interface Directive {
22+
export interface IDirective {
2123
(obj: DirectiveArgs): DirectiveTypeDecorator;
2224
new (obj: DirectiveAnnotation): DirectiveAnnotation;
2325
}
2426

25-
export interface Component {
27+
export interface IComponent {
2628
(obj: ComponentArgs): ComponentTypeDecorator;
2729
new (obj: ComponentAnnotation): ComponentAnnotation;
2830
}
2931

30-
export interface View {
32+
export interface IView {
3133
(obj: ViewArgs): ViewTypeDecorator;
3234
new (obj: ViewArgs): ViewAnnotation;
3335
}
3436

3537

3638
/* from annotations */
37-
export var Component = <Component>makeDecorator(ComponentAnnotation, (fn: any) => fn.View = View);
38-
export var Directive = <Directive>makeDecorator(DirectiveAnnotation);
39+
export var Component: IComponent = <IComponent>makeDecorator(ComponentAnnotation, (fn: any) => fn.View = View);
40+
export var Directive: IDirective = <IDirective>makeDecorator(DirectiveAnnotation);
3941

4042
/* from view */
41-
export var View = <View>makeDecorator(ViewAnnotation, (fn: any) => fn.View = View);
43+
export var View: IView = <IView>makeDecorator(ViewAnnotation, (fn: any) => fn.View = View);
4244

4345
/* from di */
4446
export var Attribute = makeParamDecorator(AttributeAnnotation);

0 commit comments

Comments
 (0)
X Tutup