X Tutup
Skip to content

Commit 12a427e

Browse files
mheveryalexeagle
authored andcommitted
fix(.d.ts): correct ComponentAnnotation inheritance
Closes #2356
1 parent 0052c6b commit 12a427e

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

docs/dgeni-package/templates/angular2/angular2.d.ts.template.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
interface List<T> extends Array<T> {}
1010
interface Map<K,V> {}
1111
interface StringMap<K,V> extends Map<K,V> {}
12-
declare type Type = ng.Type;
1312

1413
declare module ng {
1514
type SetterFn = typeof Function;

docs/dgeni-package/templates/type-definition.template.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
{$ member.name $}{% if member.optional %}?{% endif -%}
1414
{% if member.typeParameters %}<{% for typeParam in member.typeParameters %}{$ typeParam $}{% if not loop.last %}, {% endif %}{% endfor %}>{% endif -%}
1515
{%- if member.parameters -%}({% for param in member.parameters %}{$ param $}{% if not loop.last %}, {% endif %}{% endfor %}){%- endif -%}
16-
{%- if member.returnType -%}
17-
: {$ member.returnType $}{%- else -%}: void
16+
{%- if member.returnType == 'Directive' %}: DirectiveAnnotation{%- elif member.returnType -%}: {$ member.returnType $}{%- else -%}: void
1817
{%- endif -%};
1918
{%- endmacro -%}
2019

@@ -38,7 +37,7 @@
3837
{%- if export.content -%}
3938
{$ commentBlock(export, 3) $}
4039
{%- endif %}
41-
{$ export.docType $} {$ export.name $}{$ export.typeParams $}{$ export.heritage $}
40+
{$ export.docType $} {$ export.name $}{$ export.typeParams $}{%- if export.heritage == ' extends Directive' %} extends DirectiveAnnotation{% else %}{$ export.heritage $}{% endif %}
4241
{%- if export.docType == 'class' or export.docType == 'interface' %} {
4342
{%- if export.newMember %}
4443
{$ memberInfo(export.newMember) $}

modules/angular2/angular2.api.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ export * from './angular2';
1111
// 1) if the symbol is intended to be part of the public API, then re-export somewhere else
1212
// 2) if the symbol should be omitted from the public API, then the class exposing it should
1313
// not be exported, or should avoid exposing the symbol.
14-
export {ProtoRecord, RecordType} from './src/change_detection/proto_record';
1514
export * from './src/core/compiler/element_injector';
1615
export {DependencyAnnotation} from './src/di/annotations_impl';
17-
// FIXME: this is a workaround for https://github.com/angular/angular/issues/2356
18-
// We export the Directive *annotation* instead of the *decorator*.
19-
// But it breaks the build.
20-
export {Directive, LifecycleEvent} from './src/core/annotations_impl/annotations';
16+
export {LifecycleEvent} from './src/core/annotations_impl/annotations';
2117
export {Form} from './src/forms/directives/form_interface';
2218
export {TypeDecorator, ClassDefinition} from './src/util/decorators';
2319
export {Query} from './src/core/annotations_impl/di';

0 commit comments

Comments
 (0)
X Tutup