chore: improve angular2.d.ts file
- support ambient and import format for .d.ts
This commit is contained in:
@@ -9,11 +9,14 @@
|
||||
interface List<T> extends Array<T> {}
|
||||
interface Map<K,V> {}
|
||||
interface StringMap<K,V> extends Map<K,V> {}
|
||||
interface Type {}
|
||||
declare type Type = ng.Type;
|
||||
|
||||
declare module "angular2/angular2" {
|
||||
declare module ng {
|
||||
type SetterFn = typeof Function;
|
||||
type int = number;
|
||||
interface Type extends Function {
|
||||
new (...args);
|
||||
}
|
||||
|
||||
// See https://github.com/Microsoft/TypeScript/issues/1168
|
||||
class BaseException /* extends Error */ {
|
||||
@@ -22,4 +25,8 @@ declare module "angular2/angular2" {
|
||||
toString(): string;
|
||||
}
|
||||
}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
declare module "angular2/angular2" {
|
||||
export = ng;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{% block staticDeclarations %}{% endblock %}
|
||||
{% for alias, module in doc.moduleDocs %}
|
||||
{$ commentBlock(module.doc, 1) $}
|
||||
declare module "{$ module.id $}" {
|
||||
declare module ng {
|
||||
|
||||
{%- for export in module.doc.exports -%}
|
||||
{%- if export.content -%}
|
||||
@@ -68,3 +68,6 @@ declare module "{$ module.id $}" {
|
||||
|
||||
{% endfor %}
|
||||
|
||||
declare module "angular2/angular2" {
|
||||
export = ng;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user