diff --git a/docs/docs-package/templates/angular2/angular2.d.ts.template.html b/docs/docs-package/templates/angular2/angular2.d.ts.template.html deleted file mode 100644 index 0b577a9c07..0000000000 --- a/docs/docs-package/templates/angular2/angular2.d.ts.template.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends '../type-definition.template.html' %} -{% block staticDeclarations %} -// Angular depends transitively on these libraries. -// If you don't have them installed you can run -// $ tsd query es6-promise rx rx-lite --action install --save -/// -/// - -interface List extends Array {} -interface Map {} -interface StringMap extends Map {} - -declare module ng { - type SetterFn = typeof Function; - type int = number; - interface Type extends Function { - new (...args): any; - } - - // See https://github.com/Microsoft/TypeScript/issues/1168 - class BaseException /* extends Error */ { - message: string; - stack: string; - toString(): string; - } - interface InjectableReference {} -} -{% endblock %} - -declare module "angular2/angular2" { - export = ng; -} diff --git a/docs/typescript-definition-package/templates/angular2/angular2.d.ts.template.html b/docs/typescript-definition-package/templates/angular2/angular2.d.ts.template.html index 5b6b38dc1d..0746331b5e 100644 --- a/docs/typescript-definition-package/templates/angular2/angular2.d.ts.template.html +++ b/docs/typescript-definition-package/templates/angular2/angular2.d.ts.template.html @@ -11,12 +11,6 @@ interface Map {} interface StringMap extends Map {} declare module ng { - type SetterFn = typeof Function; - type int = number; - interface Type extends Function { - new (...args: any[]): any; - } - // See https://github.com/Microsoft/TypeScript/issues/1168 class BaseException /* extends Error */ { message: string; diff --git a/modules/angular2/core.ts b/modules/angular2/core.ts index e59fe5a3d2..efbb7ddd13 100644 --- a/modules/angular2/core.ts +++ b/modules/angular2/core.ts @@ -5,6 +5,7 @@ */ export {appComponentTypeToken} from 'angular2/src/core/application_tokens'; export {ApplicationRef} from 'angular2/src/core/application_common'; +export {Type} from 'angular2/src/facade/lang'; // Compiler Related Dependencies. diff --git a/modules/angular2/src/facade/lang.ts b/modules/angular2/src/facade/lang.ts index df5956b56a..686800f349 100644 --- a/modules/angular2/src/facade/lang.ts +++ b/modules/angular2/src/facade/lang.ts @@ -3,7 +3,13 @@ var _global: BrowserNodeGlobal = (typeof window === 'undefined' ? global : export {_global as global}; export var Type = Function; -export type Type = new (...args: any[]) => any; + +/** + * Runtime representation of a type. + * + * In JavaScript a Type is a constructor function. + */ +export interface Type extends Function { new (...args): any; } export function getTypeNameForDebugging(type: Type): string { return type['name'];