chore: update public api

Closes #10355
This commit is contained in:
Tobias Bosch 2016-07-29 04:19:02 -07:00
parent d0a95e35af
commit 0eca7abdd8
2 changed files with 122 additions and 271 deletions

View File

@ -237,11 +237,12 @@ export declare class CollectionChangeRecord {
/** @stable */
export declare class Compiler {
_injector: Injector;
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>;
}
@ -259,17 +260,6 @@ export declare var Component: ComponentMetadataFactory;
/** @stable */
export interface ComponentDecorator extends TypeDecorator {
View(obj: {
templateUrl?: string;
template?: string;
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
renderer?: string;
styles?: string[];
styleUrls?: string[];
animations?: AnimationEntryMetadata[];
interpolation?: [string, string];
}): ViewDecorator;
}
/** @stable */
@ -287,7 +277,7 @@ export declare abstract class ComponentFactoryResolver {
}
/** @stable */
export declare class ComponentMetadata extends DirectiveMetadata {
export declare class ComponentMetadata extends DirectiveMetadata implements ComponentMetadataType {
animations: AnimationEntryMetadata[];
changeDetection: ChangeDetectionStrategy;
directives: Array<Type | any[]>;
@ -301,93 +291,30 @@ export declare class ComponentMetadata extends DirectiveMetadata {
template: string;
templateUrl: string;
viewProviders: any[];
constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, providers, viewProviders, changeDetection, queries, templateUrl, template, styleUrls, styles, animations, directives, pipes, encapsulation, interpolation, precompile, entryComponents}?: {
selector?: string;
inputs?: string[];
outputs?: string[]; properties?: string[]; events?: string[];
host?: {
[key: string]: string;
};
providers?: any[];
exportAs?: string;
moduleId?: string;
viewProviders?: any[];
queries?: {
[key: string]: any;
};
changeDetection?: ChangeDetectionStrategy;
templateUrl?: string;
template?: string;
styleUrls?: string[];
styles?: string[];
animations?: AnimationEntryMetadata[];
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation;
interpolation?: [string, string];
precompile?: Array<Type | any[]>;
entryComponents?: Array<Type | any[]>;
});
constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, providers, viewProviders, changeDetection, queries, templateUrl, template, styleUrls, styles, animations, directives, pipes, encapsulation, interpolation, entryComponents}?: ComponentMetadataType);
}
/** @stable */
export interface ComponentMetadataFactory {
(obj: {
selector?: string;
inputs?: string[];
outputs?: string[];
properties?: string[];
events?: string[];
host?: {
[key: string]: string;
};
providers?: any[];
exportAs?: string;
moduleId?: string;
queries?: {
[key: string]: any;
};
viewProviders?: any[];
changeDetection?: ChangeDetectionStrategy;
templateUrl?: string;
template?: string;
styleUrls?: string[];
styles?: string[];
animations?: AnimationEntryMetadata[];
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation;
interpolation?: [string, string];
entryComponents?: Array<Type | any[]>;
}): ComponentDecorator;
new (obj: {
selector?: string;
inputs?: string[];
outputs?: string[];
properties?: string[];
events?: string[];
host?: {
[key: string]: string;
};
providers?: any[];
exportAs?: string;
moduleId?: string;
queries?: {
[key: string]: any;
};
viewProviders?: any[];
changeDetection?: ChangeDetectionStrategy;
templateUrl?: string;
template?: string;
styleUrls?: string[];
styles?: string[];
animations?: AnimationEntryMetadata[];
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation;
interpolation?: [string, string];
entryComponents?: Array<Type | any[]>;
}): ComponentMetadata;
(obj: ComponentMetadataType): ComponentDecorator;
new (obj: ComponentMetadataType): ComponentMetadata;
}
/** @experimental */
export interface ComponentMetadataType extends DirectiveMetadataType {
animations?: AnimationEntryMetadata[];
changeDetection?: ChangeDetectionStrategy;
directives?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation;
entryComponents?: Array<Type | any[]>;
interpolation?: [string, string];
moduleId?: string;
pipes?: Array<Type | any[]>;
styleUrls?: string[];
styles?: string[];
template?: string;
templateUrl?: string;
viewProviders?: any[];
}
/** @stable */
@ -550,7 +477,7 @@ export interface DirectiveDecorator extends TypeDecorator {
}
/** @stable */
export declare class DirectiveMetadata extends InjectableMetadata {
export declare class DirectiveMetadata extends InjectableMetadata implements DirectiveMetadataType {
/** @deprecated */ events: string[];
exportAs: string;
host: {
@ -564,53 +491,30 @@ export declare class DirectiveMetadata extends InjectableMetadata {
[key: string]: any;
};
selector: string;
constructor({selector, inputs, outputs, properties, events, host, providers, exportAs, queries}?: {
selector?: string;
inputs?: string[];
outputs?: string[]; properties?: string[]; events?: string[];
host?: {
[key: string]: string;
};
providers?: any[];
exportAs?: string;
queries?: {
[key: string]: any;
};
});
constructor({selector, inputs, outputs, properties, events, host, providers, exportAs, queries}?: DirectiveMetadataType);
}
/** @stable */
export interface DirectiveMetadataFactory {
(obj: {
selector?: string;
inputs?: string[];
outputs?: string[];
properties?: string[];
events?: string[];
host?: {
[key: string]: string;
};
providers?: any[];
exportAs?: string;
queries?: {
[key: string]: any;
};
}): DirectiveDecorator;
new (obj: {
selector?: string;
inputs?: string[];
outputs?: string[];
properties?: string[];
events?: string[];
host?: {
[key: string]: string;
};
providers?: any[];
exportAs?: string;
queries?: {
[key: string]: any;
};
}): DirectiveMetadata;
(obj: DirectiveMetadataType): DirectiveDecorator;
new (obj: DirectiveMetadataType): DirectiveMetadata;
}
/** @experimental */
export interface DirectiveMetadataType {
events?: string[];
exportAs?: string;
host?: {
[key: string]: string;
};
inputs?: string[];
outputs?: string[];
properties?: string[];
providers?: any[];
queries?: {
[key: string]: any;
};
selector?: string;
}
/** @experimental */
@ -859,6 +763,13 @@ export declare class KeyValueDiffers {
/** @deprecated */
export declare function lockRunMode(): void;
/** @experimental */
export declare class ModuleWithComponentFactories<T> {
componentFactories: ComponentFactory<any>[];
ngModuleFactory: NgModuleFactory<T>;
constructor(ngModuleFactory: NgModuleFactory<T>, componentFactories: ComponentFactory<any>[]);
}
/** @experimental */
export interface ModuleWithProviders {
ngModule: Type;
@ -887,41 +798,30 @@ export declare abstract class NgModuleFactoryLoader {
}
/** @experimental */
export declare class NgModuleMetadata extends InjectableMetadata {
export declare class NgModuleMetadata extends InjectableMetadata implements NgModuleMetadataType {
declarations: Array<Type | any[]>;
entryComponents: Array<Type | any[]>;
exports: Array<Type | any[]>;
imports: Array<Type | ModuleWithProviders | any[]>;
providers: any[];
schemas: Array<SchemaMetadata | any[]>;
constructor({providers, declarations, imports, exports, entryComponents, schemas}?: {
providers?: any[];
declarations?: Array<Type | any[]>;
imports?: Array<Type | any[]>;
exports?: Array<Type | any[]>;
entryComponents?: Array<Type | any[]>;
schemas?: Array<SchemaMetadata | any[]>;
});
constructor({providers, declarations, imports, exports, entryComponents, schemas}?: NgModuleMetadataType);
}
/** @experimental */
export interface NgModuleMetadataFactory {
(obj?: {
providers?: any[];
declarations?: Array<Type | any[]>;
imports?: Array<Type | ModuleWithProviders | any[]>;
exports?: Array<Type | any[]>;
entryComponents?: Array<Type | any[]>;
schemas?: Array<SchemaMetadata | any[]>;
}): NgModuleDecorator;
new (obj?: {
providers?: any[];
declarations?: Array<Type | any[]>;
imports?: Array<Type | any[]>;
exports?: Array<Type | any[]>;
entryComponents?: Array<Type | any[]>;
schemas?: Array<SchemaMetadata | any[]>;
}): NgModuleMetadata;
(obj?: NgModuleMetadataType): NgModuleDecorator;
new (obj?: NgModuleMetadataType): NgModuleMetadata;
}
/** @experimental */
export interface NgModuleMetadataType {
declarations?: Array<Type | any[]>;
entryComponents?: Array<Type | any[]>;
exports?: Array<Type | any[]>;
imports?: Array<Type | ModuleWithProviders | any[]>;
providers?: any[];
schemas?: Array<SchemaMetadata | any[]>;
}
/** @experimental */
@ -1036,25 +936,22 @@ export declare const PACKAGE_ROOT_URL: any;
export declare var Pipe: PipeMetadataFactory;
/** @stable */
export declare class PipeMetadata extends InjectableMetadata {
export declare class PipeMetadata extends InjectableMetadata implements PipeMetadataType {
name: string;
pure: boolean;
constructor({name, pure}: {
name: string;
pure?: boolean;
});
constructor({name, pure}: PipeMetadataType);
}
/** @stable */
export interface PipeMetadataFactory {
(obj: {
name: string;
pure?: boolean;
}): any;
new (obj: {
name: string;
pure?: boolean;
}): any;
(obj: PipeMetadataType): any;
new (obj: PipeMetadataType): any;
}
/** @experimental */
export interface PipeMetadataType {
name: string;
pure?: boolean;
}
/** @stable */
@ -1476,21 +1373,6 @@ export declare abstract class ViewContainerRef {
abstract remove(index?: number): void;
}
/** @experimental */
export interface ViewDecorator extends TypeDecorator {
View(obj: {
templateUrl?: string;
template?: string;
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
renderer?: string;
styles?: string[];
styleUrls?: string[];
animations?: AnimationEntryMetadata[];
interpolation?: [string, string];
}): ViewDecorator;
}
/** @stable */
export declare enum ViewEncapsulation {
Emulated = 0,
@ -1498,7 +1380,7 @@ export declare enum ViewEncapsulation {
None = 2,
}
/** @experimental */
/** @deprecated */
export declare class ViewMetadata {
animations: AnimationEntryMetadata[];
directives: Array<Type | any[]>;
@ -1522,32 +1404,6 @@ export declare class ViewMetadata {
});
}
/** @experimental */
export interface ViewMetadataFactory {
(obj: {
templateUrl?: string;
template?: string;
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation;
styles?: string[];
styleUrls?: string[];
animations?: AnimationEntryMetadata[];
interpolation?: [string, string];
}): ViewDecorator;
new (obj: {
templateUrl?: string;
template?: string;
directives?: Array<Type | any[]>;
pipes?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation;
styles?: string[];
styleUrls?: string[];
animations?: AnimationEntryMetadata[];
interpolation?: [string, string];
}): ViewMetadata;
}
/** @deprecated */
export declare var ViewQuery: QueryMetadataFactory;

View File

@ -1,4 +1,4 @@
/** @stable */
/** @deprecated */
export declare function addProviders(providers: Array<any>): void;
/** @stable */
@ -28,27 +28,9 @@ export declare var ComponentFixtureAutoDetect: OpaqueToken;
/** @experimental */
export declare var ComponentFixtureNoNgZone: OpaqueToken;
/** @stable */
export declare function configureCompiler(config: {
providers?: any[];
useJit?: boolean;
}): void;
/** @stable */
export declare function configureModule(moduleDef: {
providers?: any[];
declarations?: any[];
imports?: any[];
entryComponents?: any[];
schemas?: Array<SchemaMetadata | any[]>;
}): void;
/** @experimental */
export declare function discardPeriodicTasks(): void;
/** @experimental */
export declare function doAsyncEntryPointCompilation(): Promise<any>;
/** @experimental */
export declare function fakeAsync(fn: Function): (...args: any[]) => any;
@ -61,29 +43,25 @@ export declare function getTestBed(): TestBed;
/** @deprecated */
export declare function getTestInjector(): TestBed;
/** @experimental */
export declare function initTestEnvironment(ngModule: Type, platform: PlatformRef): Injector;
/** @stable */
export declare function inject(tokens: any[], fn: Function): () => any;
/** @experimental */
export declare class InjectSetupWrapper {
constructor(_moduleDef: () => {
providers?: any[];
declarations?: any[];
imports?: any[];
entryComponents?: any[];
});
constructor(_moduleDef: () => TestModuleMetadata);
inject(tokens: any[], fn: Function): () => any;
}
/** @experimental */
export declare type MetadataOverride<T> = {
add?: T;
remove?: T;
set?: T;
};
/** @deprecated */
export declare function resetBaseTestProviders(): void;
/** @experimental */
export declare function resetTestEnvironment(): void;
/** @deprecated */
export declare function setBaseTestProviders(platformProviders: Array<Type | Provider | any[]>, applicationProviders: Array<Type | Provider | any[]>): void;
@ -91,32 +69,47 @@ export declare function setBaseTestProviders(platformProviders: Array<Type | Pro
export declare class TestBed implements Injector {
ngModule: Type;
platform: PlatformRef;
compileComponents(): Promise<any>;
configureCompiler(config: {
providers?: any[];
useJit?: boolean;
}): void;
configureModule(moduleDef: {
providers?: any[];
declarations?: any[];
imports?: any[];
entryComponents?: any[];
schemas?: Array<SchemaMetadata | any>;
}): void;
createModuleFactory(): Promise<NgModuleFactory<any>>;
configureTestingModule(moduleDef: TestModuleMetadata): void;
createComponent<T>(component: ConcreteType<T>): ComponentFixture<T>;
execute(tokens: any[], fn: Function): any;
get(token: any, notFoundValue?: any): any;
initTestModule(): void;
reset(): void;
/** @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;
/** @deprecated */ reset(): void;
/** @experimental */ resetTestEnvironment(): void;
resetTestingModule(): void;
static compileComponents(): Promise<any>;
static configureCompiler(config: {
providers?: any[];
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;
/** @experimental */ static resetTestEnvironment(): void;
static resetTestingModule(): typeof TestBed;
}
/** @stable */
/** @deprecated */
export declare class TestComponentBuilder {
protected _injector: Injector;
constructor(_injector: Injector);
createAsync<T>(rootComponentType: ConcreteType<T>, ngModule?: ConcreteType<any>): Promise<ComponentFixture<T>>;
createFakeAsync<T>(rootComponentType: ConcreteType<T>, ngModule?: ConcreteType<any>): ComponentFixture<T>;
createAsync<T>(rootComponentType: ConcreteType<T>): Promise<ComponentFixture<T>>;
createFakeAsync<T>(rootComponentType: ConcreteType<T>): ComponentFixture<T>;
protected createFromFactory<C>(ngZone: NgZone, componentFactory: ComponentFactory<C>): ComponentFixture<C>;
createSync<T>(rootComponentType: ConcreteType<T>, ngModule?: ConcreteType<any>): ComponentFixture<T>;
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;
@ -131,16 +124,18 @@ export declare class TestComponentRenderer {
}
/** @experimental */
export declare function tick(millis?: number): void;
/** @experimental */
export declare function withModule(moduleDef: () => {
export declare type TestModuleMetadata = {
providers?: any[];
declarations?: any[];
imports?: any[];
entryComponents?: any[];
schemas?: Array<SchemaMetadata | any[]>;
}): InjectSetupWrapper;
};
/** @experimental */
export declare function tick(millis?: number): void;
/** @experimental */
export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
/** @deprecated */
export declare function withProviders(providers: () => any): InjectSetupWrapper;