refactor(Type): merge Type and ConcreType<?> into Type<?> (#10616)

Closes #9729

BREAKING CHANGE:

`Type` is now `Type<T>` which means that in most cases you have to
use `Type<any>` in place of `Type`.

We don't expect that any user applications use the `Type` type.
This commit is contained in:
Miško Hevery
2016-08-10 18:21:28 -07:00
committed by vikerman
parent 6f4ee6101c
commit b96869afd2
91 changed files with 637 additions and 714 deletions

View File

@ -75,7 +75,7 @@ export declare class CheckboxControlValueAccessor implements ControlValueAccesso
}
/** @experimental */
export declare const COMMON_DIRECTIVES: Type[][];
export declare const COMMON_DIRECTIVES: any[];
/** @experimental */
export declare const COMMON_PIPES: (typeof AsyncPipe | typeof SlicePipe | typeof ReplacePipe | typeof I18nPluralPipe | typeof I18nSelectPipe)[];
@ -139,7 +139,7 @@ export interface ControlValueAccessor {
}
/** @stable */
export declare const CORE_DIRECTIVES: Type[];
export declare const CORE_DIRECTIVES: Type<any>[];
/** @experimental */
export declare class CurrencyPipe implements PipeTransform {
@ -182,10 +182,10 @@ export interface Form {
}
/** @experimental */
export declare const FORM_DIRECTIVES: Type[];
export declare const FORM_DIRECTIVES: Type<any>[];
/** @experimental */
export declare const FORM_PROVIDERS: Type[];
export declare const FORM_PROVIDERS: Type<any>[];
/** @experimental */
export declare class FormBuilder {

View File

@ -128,7 +128,7 @@ export declare const APP_ID: any;
export declare const APP_INITIALIZER: any;
/** @deprecated */
export declare const APPLICATION_COMMON_PROVIDERS: Array<Type | {
export declare const APPLICATION_COMMON_PROVIDERS: Array<Type<any> | {
[k: string]: any;
} | any[]>;
@ -145,11 +145,11 @@ export declare class ApplicationModule {
/** @experimental */
export declare abstract class ApplicationRef {
componentTypes: Type[];
componentTypes: Type<any>[];
components: ComponentRef<any>[];
/** @deprecated */ injector: Injector;
/** @deprecated */ zone: NgZone;
abstract bootstrap<C>(componentFactory: ComponentFactory<C> | ConcreteType<C>): ComponentRef<C>;
abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
/** @deprecated */ abstract dispose(): void;
/** @deprecated */ abstract registerBootstrapListener(listener: (ref: ComponentRef<any>) => void): void;
/** @deprecated */ abstract registerDisposeListener(dispose: () => void): void;
@ -198,11 +198,11 @@ export declare function bind(token: any): ProviderBuilder;
/** @deprecated */
export declare class Binding extends Provider {
/** @deprecated */ toAlias: any;
/** @deprecated */ toClass: Type;
/** @deprecated */ toClass: Type<any>;
/** @deprecated */ toFactory: Function;
/** @deprecated */ toValue: any;
constructor(token: any, {toClass, toValue, toAlias, toFactory, deps, multi}: {
toClass?: Type;
toClass?: Type<any>;
toValue?: any;
toAlias?: any;
toFactory: Function;
@ -227,13 +227,13 @@ export declare abstract class ChangeDetectorRef {
}
/** @stable */
export declare function Class(clsDef: ClassDefinition): ConcreteType<any>;
export declare function Class(clsDef: ClassDefinition): Type<any>;
/** @stable */
export interface ClassDefinition {
constructor: Function | any[];
extends?: Type;
[x: string]: Type | Function | any[];
extends?: Type<any>;
[x: string]: Type<any> | Function | any[];
}
/** @stable */
@ -249,13 +249,13 @@ export declare class CollectionChangeRecord {
/** @stable */
export declare class Compiler {
clearCache(): void;
clearCacheFor(type: Type): void;
compileComponentAsync<T>(component: ConcreteType<T>, ngModule?: Type): Promise<ComponentFactory<T>>;
compileComponentSync<T>(component: ConcreteType<T>, ngModule?: Type): ComponentFactory<T>;
compileModuleAndAllComponentsAsync<T>(moduleType: ConcreteType<T>): Promise<ModuleWithComponentFactories<T>>;
compileModuleAndAllComponentsSync<T>(moduleType: ConcreteType<T>): ModuleWithComponentFactories<T>;
compileModuleAsync<T>(moduleType: ConcreteType<T>): Promise<NgModuleFactory<T>>;
compileModuleSync<T>(moduleType: ConcreteType<T>): NgModuleFactory<T>;
clearCacheFor(type: Type<any>): void;
compileComponentAsync<T>(component: Type<T>, ngModule?: Type<any>): Promise<ComponentFactory<T>>;
compileComponentSync<T>(component: Type<T>, ngModule?: Type<any>): ComponentFactory<T>;
compileModuleAndAllComponentsAsync<T>(moduleType: Type<T>): Promise<ModuleWithComponentFactories<T>>;
compileModuleAndAllComponentsSync<T>(moduleType: Type<T>): ModuleWithComponentFactories<T>;
compileModuleAsync<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>>;
compileModuleSync<T>(moduleType: Type<T>): NgModuleFactory<T>;
}
/** @experimental */
@ -283,15 +283,15 @@ export interface ComponentDecorator extends TypeDecorator {
/** @stable */
export declare class ComponentFactory<C> {
componentType: Type;
componentType: Type<any>;
selector: string;
constructor(selector: string, _viewFactory: Function, _componentType: Type);
constructor(selector: string, _viewFactory: Function, _componentType: Type<any>);
create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any): ComponentRef<C>;
}
/** @stable */
export declare abstract class ComponentFactoryResolver {
abstract resolveComponentFactory<T>(component: ConcreteType<T>): ComponentFactory<T>;
abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;
static NULL: ComponentFactoryResolver;
}
@ -299,12 +299,12 @@ export declare abstract class ComponentFactoryResolver {
export declare class ComponentMetadata extends DirectiveMetadata implements ComponentMetadataType {
animations: AnimationEntryMetadata[];
changeDetection: ChangeDetectionStrategy;
directives: Array<Type | any[]>;
directives: Array<Type<any> | any[]>;
encapsulation: ViewEncapsulation;
entryComponents: Array<Type | any[]>;
entryComponents: Array<Type<any> | any[]>;
interpolation: [string, string];
moduleId: string;
pipes: Array<Type | any[]>;
pipes: Array<Type<any> | any[]>;
styleUrls: string[];
styles: string[];
template: string;
@ -323,12 +323,12 @@ export interface ComponentMetadataFactory {
export interface ComponentMetadataType extends DirectiveMetadataType {
animations?: AnimationEntryMetadata[];
changeDetection?: ChangeDetectionStrategy;
directives?: Array<Type | any[]>;
directives?: Array<Type<any> | any[]>;
encapsulation?: ViewEncapsulation;
entryComponents?: Array<Type | any[]>;
entryComponents?: Array<Type<any> | any[]>;
interpolation?: [string, string];
moduleId?: string;
pipes?: Array<Type | any[]>;
pipes?: Array<Type<any> | any[]>;
styleUrls?: string[];
styles?: string[];
template?: string;
@ -339,7 +339,7 @@ export interface ComponentMetadataType extends DirectiveMetadataType {
/** @stable */
export declare abstract class ComponentRef<C> {
changeDetectorRef: ChangeDetectorRef;
componentType: Type;
componentType: Type<any>;
hostView: ViewRef;
injector: Injector;
instance: C;
@ -351,15 +351,15 @@ export declare abstract class ComponentRef<C> {
/** @deprecated */
export declare abstract class ComponentResolver {
abstract clearCache(): void;
abstract resolveComponent(component: Type | string): Promise<ComponentFactory<any>>;
abstract resolveComponent(component: Type<any> | string): Promise<ComponentFactory<any>>;
static DynamicCompilationDeprecationMsg: string;
static LazyLoadingDeprecationMsg: string;
}
/** @stable */
export declare class ComponentStillLoadingError extends BaseException {
compType: Type;
constructor(compType: Type);
compType: Type<any>;
constructor(compType: Type<any>);
}
/** @stable */
@ -367,17 +367,17 @@ export declare var ContentChild: ContentChildMetadataFactory;
/** @stable */
export declare class ContentChildMetadata extends QueryMetadata {
constructor(_selector: Type | string, {read}?: {
constructor(_selector: Type<any> | string, {read}?: {
read?: any;
});
}
/** @stable */
export interface ContentChildMetadataFactory {
(selector: Type | string, {read}?: {
(selector: Type<any> | Function | string, {read}?: {
read?: any;
}): any;
new (selector: Type | string, {read}?: {
new (selector: Type<any> | Function | string, {read}?: {
read?: any;
}): ContentChildMetadataFactory;
}
@ -387,7 +387,7 @@ export declare var ContentChildren: ContentChildrenMetadataFactory;
/** @stable */
export declare class ContentChildrenMetadata extends QueryMetadata {
constructor(_selector: Type | string, {descendants, read}?: {
constructor(_selector: Type<any> | string, {descendants, read}?: {
descendants?: boolean;
read?: any;
});
@ -395,11 +395,11 @@ export declare class ContentChildrenMetadata extends QueryMetadata {
/** @stable */
export interface ContentChildrenMetadataFactory {
(selector: Type | string, {descendants, read}?: {
(selector: Type<any> | Function | string, {descendants, read}?: {
descendants?: boolean;
read?: any;
}): any;
new (selector: Type | string, {descendants, read}?: {
new (selector: Type<any> | Function | string, {descendants, read}?: {
descendants?: boolean;
read?: any;
}): ContentChildrenMetadata;
@ -409,7 +409,7 @@ export interface ContentChildrenMetadataFactory {
export declare function coreBootstrap<C>(componentFactory: ComponentFactory<C>, injector: Injector): ComponentRef<C>;
/** @deprecated */
export declare function coreLoadAndBootstrap(componentType: Type, injector: Injector): Promise<ComponentRef<any>>;
export declare function coreLoadAndBootstrap(componentType: Type<any>, injector: Injector): Promise<ComponentRef<any>>;
/** @experimental */
export declare function createPlatform(injector: Injector): PlatformRef;
@ -547,8 +547,8 @@ export declare abstract class DoCheck {
/** @deprecated */
export declare abstract class DynamicComponentLoader {
abstract loadAsRoot(type: Type, overrideSelectorOrNode: string | any, injector: Injector, onDispose?: () => void, projectableNodes?: any[][]): Promise<ComponentRef<any>>;
abstract loadNextToLocation(type: Type, location: ViewContainerRef, providers?: ResolvedReflectiveProvider[], projectableNodes?: any[][]): Promise<ComponentRef<any>>;
abstract loadAsRoot(type: Type<any>, overrideSelectorOrNode: string | any, injector: Injector, onDispose?: () => void, projectableNodes?: any[][]): Promise<ComponentRef<any>>;
abstract loadNextToLocation(type: Type<any>, location: ViewContainerRef, providers?: ResolvedReflectiveProvider[], projectableNodes?: any[][]): Promise<ComponentRef<any>>;
}
/** @stable */
@ -589,7 +589,7 @@ export declare class ExpressionChangedAfterItHasBeenCheckedException extends Bas
}
/** @experimental */
export declare function forwardRef(forwardRefFn: ForwardRefFn): Type;
export declare function forwardRef(forwardRefFn: ForwardRefFn): Type<any>;
/** @experimental */
export interface ForwardRefFn {
@ -792,7 +792,7 @@ export declare class ModuleWithComponentFactories<T> {
/** @experimental */
export interface ModuleWithProviders {
ngModule: Type;
ngModule: Type<any>;
providers?: any[];
}
@ -805,10 +805,10 @@ export interface NgModuleDecorator extends TypeDecorator {
/** @experimental */
export declare class NgModuleFactory<T> {
moduleType: ConcreteType<T>;
moduleType: Type<T>;
constructor(_injectorClass: {
new (parentInjector: Injector): NgModuleInjector<T>;
}, _moduleype: ConcreteType<T>);
}, _moduleype: Type<T>);
create(parentInjector: Injector): NgModuleRef<T>;
}
@ -819,11 +819,11 @@ export declare abstract class NgModuleFactoryLoader {
/** @experimental */
export declare class NgModuleMetadata extends InjectableMetadata implements NgModuleMetadataType {
bootstrap: Array<Type | any[]>;
declarations: Array<Type | any[]>;
entryComponents: Array<Type | any[]>;
exports: Array<Type | any[]>;
imports: Array<Type | ModuleWithProviders | any[]>;
bootstrap: Array<Type<any> | any[]>;
declarations: Array<Type<any> | any[]>;
entryComponents: Array<Type<any> | any[]>;
exports: Array<Type<any> | any[]>;
imports: Array<Type<any> | ModuleWithProviders | any[]>;
providers: any[];
schemas: Array<SchemaMetadata | any[]>;
constructor(options?: NgModuleMetadataType);
@ -837,11 +837,11 @@ export interface NgModuleMetadataFactory {
/** @experimental */
export interface NgModuleMetadataType {
bootstrap?: Array<Type | any[]>;
declarations?: Array<Type | any[]>;
entryComponents?: Array<Type | any[]>;
exports?: Array<Type | any[]>;
imports?: Array<Type | ModuleWithProviders | any[]>;
bootstrap?: Array<Type<any> | any[]>;
declarations?: Array<Type<any> | any[]>;
entryComponents?: Array<Type<any> | any[]>;
exports?: Array<Type<any> | any[]>;
imports?: Array<Type<any> | ModuleWithProviders | any[]>;
providers?: any[];
schemas?: Array<SchemaMetadata | any[]>;
}
@ -884,7 +884,7 @@ export declare class NgZoneError {
/** @stable */
export declare class NoAnnotationError extends BaseException {
constructor(typeOrFunc: Type | Function, params: any[][]);
constructor(typeOrFunc: Type<any> | Function, params: any[][]);
}
/** @stable */
@ -1003,7 +1003,7 @@ export declare abstract class PlatformRef {
destroyed: boolean;
/** @deprecated */ disposed: boolean;
injector: Injector;
/** @stable */ bootstrapModule<M>(moduleType: ConcreteType<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @stable */ bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
abstract destroy(): void;
/** @deprecated */ abstract dispose(): void;
@ -1013,7 +1013,7 @@ export declare abstract class PlatformRef {
/** @deprecated */
export declare function provide(token: any, {useClass, useValue, useExisting, useFactory, deps, multi}: {
useClass?: Type;
useClass?: Type<any>;
useValue?: any;
useExisting?: any;
useFactory?: Function;
@ -1026,12 +1026,12 @@ export declare class Provider {
dependencies: Object[];
multi: boolean;
token: any;
useClass: Type;
useClass: Type<any>;
useExisting: any;
useFactory: Function;
useValue: any;
constructor(token: any, {useClass, useValue, useExisting, useFactory, deps, multi}: {
useClass?: Type;
useClass?: Type<any>;
useValue?: any;
useExisting?: any;
useFactory?: Function;
@ -1045,7 +1045,7 @@ export declare class ProviderBuilder {
token: any;
constructor(token: any);
toAlias(aliasToken: any): Provider;
toClass(type: Type): Provider;
toClass(type: Type<any>): Provider;
toFactory(factory: Function, dependencies?: any[]): Provider;
toValue(value: any): Provider;
}
@ -1081,7 +1081,7 @@ export declare class QueryMetadata extends DependencyMetadata {
read: any;
selector: any;
varBindings: string[];
constructor(_selector: Type | string, {descendants, first, read}?: {
constructor(_selector: Type<any> | string, {descendants, first, read}?: {
descendants?: boolean;
first?: boolean;
read?: any;
@ -1091,11 +1091,11 @@ export declare class QueryMetadata extends DependencyMetadata {
/** @deprecated */
export interface QueryMetadataFactory {
(selector: Type | string, {descendants, read}?: {
(selector: Type<any> | Function | string, {descendants, read}?: {
descendants?: boolean;
read?: any;
}): ParameterDecorator;
new (selector: Type | string, {descendants, read}?: {
new (selector: Type<any> | Function | string, {descendants, read}?: {
descendants?: boolean;
read?: any;
}): QueryMetadata;
@ -1107,16 +1107,16 @@ export declare abstract class ReflectiveInjector implements Injector {
createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
abstract get(token: any, notFoundValue?: any): any;
instantiateResolved(provider: ResolvedReflectiveProvider): any;
resolveAndCreateChild(providers: Array<Type | Provider | {
resolveAndCreateChild(providers: Array<Type<any> | Provider | {
[k: string]: any;
} | any[]>): ReflectiveInjector;
resolveAndInstantiate(provider: Type | Provider): any;
resolveAndInstantiate(provider: Type<any> | Provider): any;
/** @deprecated */ static fromResolvedBindings(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
/** @experimental */ static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector;
static resolve(providers: Array<Type | Provider | {
static resolve(providers: Array<Type<any> | Provider | {
[k: string]: any;
} | any[]>): ResolvedReflectiveProvider[];
static resolveAndCreate(providers: Array<Type | Provider | {
static resolveAndCreate(providers: Array<Type<any> | Provider | {
[k: string]: any;
} | any[]>, parent?: Injector): ReflectiveInjector;
}
@ -1278,14 +1278,14 @@ export declare function style(tokens: string | {
export declare class SystemJsCmpFactoryResolver implements ComponentResolver {
constructor(_console: Console);
clearCache(): void;
resolveComponent(componentType: string | Type): Promise<ComponentFactory<any>>;
resolveComponent(componentType: string | Type<any>): Promise<ComponentFactory<any>>;
}
/** @deprecated */
export declare class SystemJsComponentResolver implements ComponentResolver {
constructor(_resolver: ComponentResolver, _console: Console);
clearCache(): void;
resolveComponent(componentType: string | Type): Promise<ComponentFactory<any>>;
resolveComponent(componentType: string | Type<any>): Promise<ComponentFactory<any>>;
}
/** @experimental */
@ -1340,8 +1340,8 @@ export declare var Type: FunctionConstructor;
export interface TypeDecorator {
annotations: any[];
(target: Object, propertyKey?: string | symbol, parameterIndex?: number): void;
<T extends Type>(type: T): T;
Class(obj: ClassDefinition): ConcreteType<any>;
<T extends Type<any>>(type: T): T;
Class(obj: ClassDefinition): Type<any>;
}
/** @stable */
@ -1349,17 +1349,17 @@ export declare var ViewChild: ViewChildMetadataFactory;
/** @stable */
export declare class ViewChildMetadata extends ViewQueryMetadata {
constructor(_selector: Type | string, {read}?: {
constructor(_selector: Type<any> | string, {read}?: {
read?: any;
});
}
/** @stable */
export interface ViewChildMetadataFactory {
(selector: Type | string, {read}?: {
(selector: Type<any> | Function | string, {read}?: {
read?: any;
}): any;
new (selector: Type | string, {read}?: {
new (selector: Type<any> | Function | string, {read}?: {
read?: any;
}): ViewChildMetadataFactory;
}
@ -1369,17 +1369,17 @@ export declare var ViewChildren: ViewChildrenMetadataFactory;
/** @stable */
export declare class ViewChildrenMetadata extends ViewQueryMetadata {
constructor(_selector: Type | string, {read}?: {
constructor(_selector: Type<any> | string, {read}?: {
read?: any;
});
}
/** @stable */
export interface ViewChildrenMetadataFactory {
(selector: Type | string, {read}?: {
(selector: Type<any> | Function | string, {read}?: {
read?: any;
}): any;
new (selector: Type | string, {read}?: {
new (selector: Type<any> | Function | string, {read}?: {
read?: any;
}): ViewChildrenMetadata;
}
@ -1411,10 +1411,10 @@ export declare enum ViewEncapsulation {
/** @deprecated */
export declare class ViewMetadata {
animations: AnimationEntryMetadata[];
directives: Array<Type | any[]>;
directives: Array<Type<any> | any[]>;
encapsulation: ViewEncapsulation;
interpolation: [string, string];
pipes: Array<Type | any[]>;
pipes: Array<Type<any> | any[]>;
styleUrls: string[];
styles: string[];
template: string;
@ -1422,8 +1422,8 @@ export declare class ViewMetadata {
constructor({templateUrl, template, directives, pipes, encapsulation, styles, styleUrls, animations, interpolation}?: {
templateUrl?: string;
template?: string;
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
directives?: Array<Type<any> | any[]>;
pipes?: Array<Type<any> | any[]>;
encapsulation?: ViewEncapsulation;
styles?: string[];
styleUrls?: string[];
@ -1438,7 +1438,7 @@ export declare var ViewQuery: QueryMetadataFactory;
/** @deprecated */
export declare class ViewQueryMetadata extends QueryMetadata {
isViewQuery: boolean;
constructor(_selector: Type | string, {descendants, first, read}?: {
constructor(_selector: Type<any> | string, {descendants, first, read}?: {
descendants?: boolean;
first?: boolean;
read?: any;

View File

@ -61,7 +61,7 @@ export declare function resetFakeAsyncZone(): void;
/** @experimental */
export declare class TestBed implements Injector {
ngModule: Type;
ngModule: Type<any>;
platform: PlatformRef;
compileComponents(): Promise<any>;
configureCompiler(config: {
@ -69,14 +69,14 @@ export declare class TestBed implements Injector {
useJit?: boolean;
}): void;
configureTestingModule(moduleDef: TestModuleMetadata): void;
createComponent<T>(component: ConcreteType<T>): ComponentFixture<T>;
createComponent<T>(component: Type<T>): ComponentFixture<T>;
execute(tokens: any[], fn: Function): any;
get(token: any, notFoundValue?: any): any;
/** @experimental */ initTestEnvironment(ngModule: Type, platform: PlatformRef): void;
overrideComponent(component: ConcreteType<any>, override: MetadataOverride<ComponentMetadataType>): void;
overrideDirective(directive: ConcreteType<any>, override: MetadataOverride<DirectiveMetadataType>): void;
overrideModule(ngModule: ConcreteType<any>, override: MetadataOverride<NgModuleMetadataType>): void;
overridePipe(pipe: ConcreteType<any>, override: MetadataOverride<PipeMetadataType>): void;
/** @experimental */ initTestEnvironment(ngModule: Type<any>, platform: PlatformRef): void;
overrideComponent(component: Type<any>, override: MetadataOverride<ComponentMetadataType>): void;
overrideDirective(directive: Type<any>, override: MetadataOverride<DirectiveMetadataType>): void;
overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModuleMetadataType>): void;
overridePipe(pipe: Type<any>, override: MetadataOverride<PipeMetadataType>): void;
/** @deprecated */ reset(): void;
/** @experimental */ resetTestEnvironment(): void;
resetTestingModule(): void;
@ -86,12 +86,12 @@ export declare class TestBed implements Injector {
useJit?: boolean;
}): typeof TestBed;
static configureTestingModule(moduleDef: TestModuleMetadata): typeof TestBed;
static createComponent<T>(component: ConcreteType<T>): ComponentFixture<T>;
/** @experimental */ static initTestEnvironment(ngModule: Type, platform: PlatformRef): TestBed;
static overrideComponent(component: ConcreteType<any>, override: MetadataOverride<ComponentMetadataType>): typeof TestBed;
static overrideDirective(directive: ConcreteType<any>, override: MetadataOverride<DirectiveMetadataType>): typeof TestBed;
static overrideModule(ngModule: ConcreteType<any>, override: MetadataOverride<NgModuleMetadataType>): typeof TestBed;
static overridePipe(pipe: ConcreteType<any>, override: MetadataOverride<PipeMetadataType>): typeof TestBed;
static createComponent<T>(component: Type<T>): ComponentFixture<T>;
/** @experimental */ static initTestEnvironment(ngModule: Type<any>, platform: PlatformRef): TestBed;
static overrideComponent(component: Type<any>, override: MetadataOverride<ComponentMetadataType>): typeof TestBed;
static overrideDirective(directive: Type<any>, override: MetadataOverride<DirectiveMetadataType>): typeof TestBed;
static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModuleMetadataType>): typeof TestBed;
static overridePipe(pipe: Type<any>, override: MetadataOverride<PipeMetadataType>): typeof TestBed;
/** @experimental */ static resetTestEnvironment(): void;
static resetTestingModule(): typeof TestBed;
}
@ -100,16 +100,16 @@ export declare class TestBed implements Injector {
export declare class TestComponentBuilder {
protected _injector: Injector;
constructor(_injector: Injector);
createAsync<T>(rootComponentType: ConcreteType<T>): Promise<ComponentFixture<T>>;
createFakeAsync<T>(rootComponentType: ConcreteType<T>): ComponentFixture<T>;
createAsync<T>(rootComponentType: Type<T>): Promise<ComponentFixture<T>>;
createFakeAsync<T>(rootComponentType: Type<T>): ComponentFixture<T>;
protected createFromFactory<C>(ngZone: NgZone, componentFactory: ComponentFactory<C>): ComponentFixture<C>;
createSync<T>(rootComponentType: ConcreteType<T>): ComponentFixture<T>;
overrideAnimations(componentType: Type, animations: AnimationEntryMetadata[]): TestComponentBuilder;
overrideDirective(componentType: Type, from: Type, to: Type): TestComponentBuilder;
overrideProviders(type: Type, providers: any[]): TestComponentBuilder;
overrideTemplate(componentType: Type, template: string): TestComponentBuilder;
overrideView(componentType: Type, view: ViewMetadata): TestComponentBuilder;
overrideViewProviders(type: Type, providers: any[]): TestComponentBuilder;
createSync<T>(rootComponentType: Type<T>): ComponentFixture<T>;
overrideAnimations(componentType: Type<any>, animations: AnimationEntryMetadata[]): TestComponentBuilder;
overrideDirective(componentType: Type<any>, from: Type<any>, to: Type<any>): TestComponentBuilder;
overrideProviders(type: Type<any>, providers: any[]): TestComponentBuilder;
overrideTemplate(componentType: Type<any>, template: string): TestComponentBuilder;
overrideView(componentType: Type<any>, view: ViewMetadata): TestComponentBuilder;
overrideViewProviders(type: Type<any>, providers: any[]): TestComponentBuilder;
}
/** @experimental */

View File

@ -141,10 +141,10 @@ export interface Form {
}
/** @experimental */
export declare const FORM_DIRECTIVES: Type[][];
export declare const FORM_DIRECTIVES: Type<any>[][];
/** @experimental */
export declare const FORM_PROVIDERS: Type[];
export declare const FORM_PROVIDERS: Type<any>[];
/** @experimental */
export declare class FormArray extends AbstractControl {
@ -433,10 +433,10 @@ export declare class PatternValidator implements Validator {
export declare function provideForms(): any[];
/** @experimental */
export declare const REACTIVE_FORM_DIRECTIVES: Type[][];
export declare const REACTIVE_FORM_DIRECTIVES: Type<any>[][];
/** @experimental */
export declare const REACTIVE_FORM_PROVIDERS: Type[];
export declare const REACTIVE_FORM_PROVIDERS: Type<any>[];
/** @experimental */
export declare class ReactiveFormsModule {

View File

@ -1,8 +1,8 @@
/** @deprecated */
export declare function bootstrap<C>(appComponentType: ConcreteType<C>, customProviders?: Array<any>): Promise<ComponentRef<C>>;
export declare function bootstrap<C>(appComponentType: Type<C>, customProviders?: Array<any>): Promise<ComponentRef<C>>;
/** @deprecated */
export declare function bootstrapWorkerApp<T>(appComponentType: ConcreteType<T>, customProviders?: Array<any>): Promise<ComponentRef<T>>;
export declare function bootstrapWorkerApp<T>(appComponentType: Type<T>, customProviders?: Array<any>): Promise<ComponentRef<T>>;
/** @experimental */
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Array<any>): Promise<PlatformRef>;

View File

@ -42,12 +42,12 @@ export declare class BrowserPlatformLocation extends PlatformLocation {
export declare class By {
static all(): Predicate<DebugElement>;
static css(selector: string): Predicate<DebugElement>;
static directive(type: Type): Predicate<DebugElement>;
static directive(type: Type<any>): Predicate<DebugElement>;
}
/** @experimental */
export declare abstract class ClientMessageBroker {
abstract runOnService(args: UiArguments, returnType: Type): Promise<any>;
abstract runOnService(args: UiArguments, returnType: Type<any>): Promise<any>;
}
/** @experimental */
@ -87,9 +87,9 @@ export declare class EventManager {
/** @experimental */
export declare class FnArg {
type: Type;
type: Type<any>;
value: any;
constructor(value: any, type: Type);
constructor(value: any, type: Type<any>);
}
/** @experimental */
@ -136,7 +136,7 @@ export declare const platformWorkerApp: (extraProviders?: any[]) => PlatformRef;
export declare const platformWorkerUi: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const PRIMITIVE: Type;
export declare const PRIMITIVE: Type<any>;
/** @experimental */
export declare class ReceivedMessage {
@ -171,7 +171,7 @@ export interface SafeUrl extends SafeValue {
/** @experimental */
export declare abstract class ServiceMessageBroker {
abstract registerMethod(methodName: string, signature: Type[], method: Function, returnType?: Type): void;
abstract registerMethod(methodName: string, signature: Type<any>[], method: Function, returnType?: Type<any>): void;
}
/** @experimental */

View File

@ -8,7 +8,7 @@ export declare const platformServer: (extraProviders?: any[]) => PlatformRef;
export declare const SERVER_PLATFORM_PROVIDERS: Array<any>;
/** @deprecated */
export declare function serverBootstrap<T>(appComponentType: ConcreteType<T>, customProviders: Array<any>): Promise<ComponentRef<T>>;
export declare function serverBootstrap<T>(appComponentType: Type<T>, customProviders: Array<any>): Promise<ComponentRef<T>>;
/** @deprecated */
export declare const serverDynamicPlatform: (extraProviders?: any[]) => PlatformRef;

View File

@ -1,7 +1,7 @@
/** @stable */
export declare class ActivatedRoute {
children: ActivatedRoute[];
component: Type | string;
component: Type<any> | string;
data: Observable<Data>;
firstChild: ActivatedRoute;
fragment: Observable<string>;
@ -20,7 +20,7 @@ export declare class ActivatedRoute {
/** @stable */
export declare class ActivatedRouteSnapshot {
children: ActivatedRouteSnapshot[];
component: Type | string;
component: Type<any> | string;
data: Data;
firstChild: ActivatedRouteSnapshot;
fragment: string;
@ -153,7 +153,7 @@ export interface Route {
canDeactivate?: any[];
canLoad?: any[];
children?: Route[];
component?: Type | string;
component?: Type<any> | string;
data?: Data;
loadChildren?: string;
outlet?: string;
@ -170,7 +170,7 @@ export declare class Router {
/** @experimental */ navigated: boolean;
routerState: RouterState;
url: string;
constructor(rootComponentType: Type, resolver: ComponentResolver, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, loader: NgModuleFactoryLoader, config: Routes);
constructor(rootComponentType: Type<any>, resolver: ComponentResolver, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, loader: NgModuleFactoryLoader, config: Routes);
createUrlTree(commands: any[], {relativeTo, queryParams, fragment, preserveQueryParams, preserveFragment}?: NavigationExtras): UrlTree;
dispose(): void;
initialNavigation(): void;

View File

@ -1,11 +1,11 @@
/** @experimental */
export declare class UpgradeAdapter {
constructor(ng2AppModule?: Type);
/** @deprecated */ addProvider(provider: Type | Provider | any[] | any): void;
constructor(ng2AppModule?: Type<any>);
/** @deprecated */ addProvider(provider: Type<any> | Provider | any[] | any): void;
bootstrap(element: Element, modules?: any[], config?: angular.IAngularBootstrapConfig): UpgradeAdapterRef;
downgradeNg2Component(type: Type): Function;
downgradeNg2Component(type: Type<any>): Function;
downgradeNg2Provider(token: any): Function;
upgradeNg1Component(name: string): Type;
upgradeNg1Component(name: string): Type<any>;
upgradeNg1Provider(name: string, options?: {
asToken: any;
}): void;