Skip to content

Commit

Permalink
fix(.d.ts): correct ComponentAnnotation inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Jul 7, 2015
1 parent 5376ae8 commit 245a43a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
interface List<T> extends Array<T> {}
interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
declare type Type = ng.Type;

declare module ng {
type SetterFn = typeof Function;
Expand Down
14 changes: 9 additions & 5 deletions docs/dgeni-package/templates/type-definition.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@

{%- macro memberInfo(member, level) -%}
{$ commentBlock(member, level) $}
{$ member.name $}{% if member.optional %}?{% endif -%}
{% if member.name == '__new' -%}
new
{%- elif member.name == '__call' -%}
{%- else -%}
{$ member.name $}
{%- endif -%}{% if member.optional %}?{% endif -%}
{% if member.typeParameters %}<{% for typeParam in member.typeParameters %}{$ typeParam $}{% if not loop.last %}, {% endif %}{% endfor %}>{% endif -%}
{%- if member.parameters -%}({% for param in member.parameters %}{$ param $}{% if not loop.last %}, {% endif %}{% endfor %}){%- endif -%}
{%- if member.returnType -%}
: {$ member.returnType $}{%- else -%}: any
{%- endif -%};
{%- if member.returnType == 'Directive' %}: DirectiveAnnotation{%- elif member.returnType -%}: {$ member.returnType $}{%- else -%}: any{%- endif -%}
;
{%- endmacro -%}


Expand All @@ -38,7 +42,7 @@
{%- if export.content -%}
{$ commentBlock(export, 3) $}
{%- endif %}
{$ export.docType $} {$ export.name $}{$ export.typeParams $}{$ export.heritage $}
{$ export.docType $} {$ export.name $}{$ export.typeParams $}{%- if export.heritage == ' extends Directive' %} extends DirectiveAnnotation{% else %}{$ export.heritage $}{% endif %}
{%- if export.docType == 'class' or export.docType == 'interface' %} {
{%- if export.newMember %}
{$ memberInfo(export.newMember, 5) $}
Expand Down
6 changes: 1 addition & 5 deletions modules/angular2/angular2.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ export * from './angular2';
// 1) if the symbol is intended to be part of the public API, then re-export somewhere else
// 2) if the symbol should be omitted from the public API, then the class exposing it should
// not be exported, or should avoid exposing the symbol.
export {ProtoRecord, RecordType} from './src/change_detection/proto_record';
export * from './src/core/compiler/element_injector';
export {DependencyAnnotation} from './src/di/annotations_impl';
// FIXME: this is a workaround for https://github.com/angular/angular/issues/2356
// We export the Directive *annotation* instead of the *decorator*.
// But it breaks the build.
export {Directive, LifecycleEvent} from './src/core/annotations_impl/annotations';
export {LifecycleEvent} from './src/core/annotations_impl/annotations';
export {Form} from './src/forms/directives/form_interface';
export {TypeDecorator, ClassDefinition} from './src/util/decorators';
export {Query} from './src/core/annotations_impl/di';
Expand Down

0 comments on commit 245a43a

Please sign in to comment.