chore(typing): extract abstract superclasses to replace @private constructors

This commit is contained in:
Alex Eagle
2015-10-06 06:53:39 -07:00
committed by vsavkin
parent ee32b1bc37
commit 6075509f26
65 changed files with 994 additions and 797 deletions

View File

@ -1,4 +1,5 @@
import {global, Type, isFunction, stringify} from 'angular2/src/core/facade/lang';
import {ConcreteType} from "../facade/lang";
/**
* Declares the interface to be used with {@link Class}.
@ -71,7 +72,7 @@ export interface TypeDecorator {
/**
* Generate a class from the definition and annotate it with {@link TypeDecorator#annotations}.
*/
Class(obj: ClassDefinition): Type;
Class(obj: ClassDefinition): ConcreteType;
}
function extractAnnotation(annotation: any): any {
@ -205,7 +206,7 @@ function applyParams(fnOrArray: (Function | any[]), key: string): Function {
* });
* ```
*/
export function Class(clsDef: ClassDefinition): Type {
export function Class(clsDef: ClassDefinition): ConcreteType {
var constructor = applyParams(
clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor');
var proto = constructor.prototype;
@ -228,7 +229,7 @@ export function Class(clsDef: ClassDefinition): Type {
Reflect.defineMetadata('annotations', this.annotations, constructor);
}
return <Type>constructor;
return <ConcreteType>constructor;
}
var Reflect = global.Reflect;