chore: update public api

- `precompile` -> `entryComponents`
- introduce `ModuleWithProviders`
- introduce `@NgModule.schema`
- update to bootstrap

Closes #10268
This commit is contained in:
Tobias Bosch 2016-07-25 05:47:16 -07:00
parent 5a21f168d6
commit b42411ba1f
10 changed files with 85 additions and 37 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
export {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS, BrowserModule, platformBrowser} from './src/browser'; export {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS, BROWSER_SANITIZATION_PROVIDERS, BrowserModule, browserPlatform, platformBrowser} from './src/browser';
export {BrowserPlatformLocation} from './src/browser/location/browser_platform_location'; export {BrowserPlatformLocation} from './src/browser/location/browser_platform_location';
export {Title} from './src/browser/title'; export {Title} from './src/browser/title';
export {disableDebugTools, enableDebugTools} from './src/browser/tools/tools'; export {disableDebugTools, enableDebugTools} from './src/browser/tools/tools';

View File

@ -6,4 +6,4 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
export {SERVER_PLATFORM_PROVIDERS, platformDynamicServer, platformServer, serverBootstrap} from './src/server'; export {SERVER_PLATFORM_PROVIDERS, platformDynamicServer, platformServer, serverBootstrap, serverDynamicPlatform, serverPlatform} from './src/server';

View File

@ -26,7 +26,7 @@ export declare abstract class AfterViewInit {
} }
/** @experimental */ /** @experimental */
export declare const ANALYZE_FOR_PRECOMPILE: OpaqueToken; export declare const ANALYZE_FOR_ENTRY_COMPONENTS: OpaqueToken;
/** @experimental */ /** @experimental */
export declare function animate(timing: string | number, styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata): AnimationAnimateMetadata; export declare function animate(timing: string | number, styles?: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata): AnimationAnimateMetadata;
@ -200,12 +200,6 @@ export declare class Binding extends Provider {
}); });
} }
/** @stable */
export declare function bootstrapModule<M>(moduleType: ConcreteType<M>, platform: PlatformRef, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */
export declare function bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>, platform: PlatformRef): NgModuleRef<M>;
/** @stable */ /** @stable */
export declare enum ChangeDetectionStrategy { export declare enum ChangeDetectionStrategy {
OnPush = 0, OnPush = 0,
@ -297,16 +291,16 @@ export declare class ComponentMetadata extends DirectiveMetadata {
changeDetection: ChangeDetectionStrategy; changeDetection: ChangeDetectionStrategy;
directives: Array<Type | any[]>; directives: Array<Type | any[]>;
encapsulation: ViewEncapsulation; encapsulation: ViewEncapsulation;
entryComponents: Array<Type | any[]>;
interpolation: [string, string]; interpolation: [string, string];
moduleId: string; moduleId: string;
pipes: Array<Type | any[]>; pipes: Array<Type | any[]>;
precompile: Array<Type | any[]>;
styleUrls: string[]; styleUrls: string[];
styles: string[]; styles: string[];
template: string; template: string;
templateUrl: string; templateUrl: string;
viewProviders: any[]; 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}?: { 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; selector?: string;
inputs?: string[]; inputs?: string[];
outputs?: string[]; properties?: string[]; events?: string[]; outputs?: string[]; properties?: string[]; events?: string[];
@ -331,6 +325,7 @@ export declare class ComponentMetadata extends DirectiveMetadata {
encapsulation?: ViewEncapsulation; encapsulation?: ViewEncapsulation;
interpolation?: [string, string]; interpolation?: [string, string];
precompile?: Array<Type | any[]>; precompile?: Array<Type | any[]>;
entryComponents?: Array<Type | any[]>;
}); });
} }
@ -362,7 +357,7 @@ export interface ComponentMetadataFactory {
pipes?: Array<Type | any[]>; pipes?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation; encapsulation?: ViewEncapsulation;
interpolation?: [string, string]; interpolation?: [string, string];
precompile?: Array<Type | any[]>; entryComponents?: Array<Type | any[]>;
}): ComponentDecorator; }): ComponentDecorator;
new (obj: { new (obj: {
selector?: string; selector?: string;
@ -390,7 +385,7 @@ export interface ComponentMetadataFactory {
pipes?: Array<Type | any[]>; pipes?: Array<Type | any[]>;
encapsulation?: ViewEncapsulation; encapsulation?: ViewEncapsulation;
interpolation?: [string, string]; interpolation?: [string, string];
precompile?: Array<Type | any[]>; entryComponents?: Array<Type | any[]>;
}): ComponentMetadata; }): ComponentMetadata;
} }
@ -469,15 +464,15 @@ export declare function coreBootstrap<C>(componentFactory: ComponentFactory<C>,
/** @deprecated */ /** @deprecated */
export declare function coreLoadAndBootstrap(componentType: Type, injector: Injector): Promise<ComponentRef<any>>; export declare function coreLoadAndBootstrap(componentType: Type, injector: Injector): Promise<ComponentRef<any>>;
/** @experimental */
export declare const corePlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */ /** @experimental */
export declare function createPlatform(injector: Injector): PlatformRef; export declare function createPlatform(injector: Injector): PlatformRef;
/** @experimental */ /** @experimental */
export declare function createPlatformFactory(parentPlaformFactory: PlatformFactory, name: string, providers?: any[]): PlatformFactory; export declare function createPlatformFactory(parentPlaformFactory: PlatformFactory, name: string, providers?: any[]): PlatformFactory;
/** @experimental */
export declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata;
/** @stable */ /** @stable */
export declare class CyclicDependencyError extends AbstractProviderError { export declare class CyclicDependencyError extends AbstractProviderError {
constructor(injector: ReflectiveInjector, key: ReflectiveKey); constructor(injector: ReflectiveInjector, key: ReflectiveKey);
@ -863,6 +858,12 @@ export declare class KeyValueDiffers {
/** @deprecated */ /** @deprecated */
export declare function lockRunMode(): void; export declare function lockRunMode(): void;
/** @experimental */
export interface ModuleWithProviders {
ngModule: Type;
providers?: any[];
}
/** @experimental */ /** @experimental */
export declare var NgModule: NgModuleMetadataFactory; export declare var NgModule: NgModuleMetadataFactory;
@ -887,16 +888,18 @@ export declare abstract class NgModuleFactoryLoader {
/** @experimental */ /** @experimental */
export declare class NgModuleMetadata extends InjectableMetadata { export declare class NgModuleMetadata extends InjectableMetadata {
declarations: Array<Type | any[]>; declarations: Array<Type | any[]>;
entryComponents: Array<Type | any[]>;
exports: Array<Type | any[]>; exports: Array<Type | any[]>;
imports: Array<Type | any[]>; imports: Array<Type | ModuleWithProviders | any[]>;
precompile: Array<Type | any[]>;
providers: any[]; providers: any[];
constructor({providers, declarations, imports, exports, precompile}?: { schemas: Array<SchemaMetadata | any[]>;
constructor({providers, declarations, imports, exports, entryComponents, schemas}?: {
providers?: any[]; providers?: any[];
declarations?: Array<Type | any[]>; declarations?: Array<Type | any[]>;
imports?: Array<Type | any[]>; imports?: Array<Type | any[]>;
exports?: Array<Type | any[]>; exports?: Array<Type | any[]>;
precompile?: Array<Type | any[]>; entryComponents?: Array<Type | any[]>;
schemas?: Array<SchemaMetadata | any[]>;
}); });
} }
@ -905,16 +908,18 @@ export interface NgModuleMetadataFactory {
(obj?: { (obj?: {
providers?: any[]; providers?: any[];
declarations?: Array<Type | any[]>; declarations?: Array<Type | any[]>;
imports?: Array<Type | any[]>; imports?: Array<Type | ModuleWithProviders | any[]>;
exports?: Array<Type | any[]>; exports?: Array<Type | any[]>;
precompile?: Array<Type | any[]>; entryComponents?: Array<Type | any[]>;
schemas?: Array<SchemaMetadata | any[]>;
}): NgModuleDecorator; }): NgModuleDecorator;
new (obj?: { new (obj?: {
providers?: any[]; providers?: any[];
declarations?: Array<Type | any[]>; declarations?: Array<Type | any[]>;
imports?: Array<Type | any[]>; imports?: Array<Type | any[]>;
exports?: Array<Type | any[]>; exports?: Array<Type | any[]>;
precompile?: Array<Type | any[]>; entryComponents?: Array<Type | any[]>;
schemas?: Array<SchemaMetadata | any[]>;
}): NgModuleMetadata; }): NgModuleMetadata;
} }
@ -1068,10 +1073,15 @@ export declare const PLATFORM_INITIALIZER: any;
/** @deprecated */ /** @deprecated */
export declare const PLATFORM_PIPES: OpaqueToken; export declare const PLATFORM_PIPES: OpaqueToken;
/** @experimental */
export declare const platformCore: (extraProviders?: any[]) => PlatformRef;
/** @experimental */ /** @experimental */
export declare abstract class PlatformRef { export declare abstract class PlatformRef {
disposed: boolean; disposed: boolean;
injector: Injector; injector: Injector;
/** @stable */ bootstrapModule<M>(moduleType: ConcreteType<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): NgModuleRef<M>;
abstract dispose(): void; abstract dispose(): void;
abstract registerDisposeListener(dispose: () => void): void; abstract registerDisposeListener(dispose: () => void): void;
} }
@ -1267,6 +1277,11 @@ export declare abstract class SanitizationService {
abstract sanitize(context: SecurityContext, value: string): string; abstract sanitize(context: SecurityContext, value: string): string;
} }
/** @experimental */
export interface SchemaMetadata {
name: string;
}
/** @stable */ /** @stable */
export declare enum SecurityContext { export declare enum SecurityContext {
NONE = 0, NONE = 0,

View File

@ -39,14 +39,15 @@ export declare function configureModule(moduleDef: {
providers?: any[]; providers?: any[];
declarations?: any[]; declarations?: any[];
imports?: any[]; imports?: any[];
precompile?: any[]; entryComponents?: any[];
schemas?: Array<SchemaMetadata | any[]>;
}): void; }): void;
/** @experimental */ /** @experimental */
export declare function discardPeriodicTasks(): void; export declare function discardPeriodicTasks(): void;
/** @experimental */ /** @experimental */
export declare function doAsyncPrecompilation(): Promise<any>; export declare function doAsyncEntryPointCompilation(): Promise<any>;
/** @experimental */ /** @experimental */
export declare function fakeAsync(fn: Function): (...args: any[]) => any; export declare function fakeAsync(fn: Function): (...args: any[]) => any;
@ -72,7 +73,7 @@ export declare class InjectSetupWrapper {
providers?: any[]; providers?: any[];
declarations?: any[]; declarations?: any[];
imports?: any[]; imports?: any[];
precompile?: any[]; entryComponents?: any[];
}); });
inject(tokens: any[], fn: Function): () => any; inject(tokens: any[], fn: Function): () => any;
} }
@ -98,7 +99,8 @@ export declare class TestBed implements Injector {
providers?: any[]; providers?: any[];
declarations?: any[]; declarations?: any[];
imports?: any[]; imports?: any[];
precompile?: any[]; entryComponents?: any[];
schemas?: Array<SchemaMetadata | any>;
}): void; }): void;
createModuleFactory(): Promise<NgModuleFactory<any>>; createModuleFactory(): Promise<NgModuleFactory<any>>;
execute(tokens: any[], fn: Function): any; execute(tokens: any[], fn: Function): any;
@ -136,7 +138,8 @@ export declare function withModule(moduleDef: () => {
providers?: any[]; providers?: any[];
declarations?: any[]; declarations?: any[];
imports?: any[]; imports?: any[];
precompile?: any[]; entryComponents?: any[];
schemas?: Array<SchemaMetadata | any[]>;
}): InjectSetupWrapper; }): InjectSetupWrapper;
/** @experimental */ /** @experimental */

View File

@ -10,11 +10,17 @@ export declare function bootstrapWorkerUi(workerScriptUri: string, customProvide
/** @deprecated */ /** @deprecated */
export declare const BROWSER_APP_COMPILER_PROVIDERS: Array<any>; export declare const BROWSER_APP_COMPILER_PROVIDERS: Array<any>;
/** @experimental */ /** @deprecated */
export declare const browserDynamicPlatform: (extraProviders?: any[]) => PlatformRef; export declare const browserDynamicPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */ /** @experimental */
export declare const CACHED_TEMPLATE_PROVIDER: Array<any>; export declare const CACHED_TEMPLATE_PROVIDER: Array<any>;
/** @experimental */ /** @experimental */
export declare const platformBrowserDynamic: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformWorkerAppDynamic: (extraProviders?: any[]) => PlatformRef;
/** @deprecated */
export declare const workerAppDynamicPlatform: (extraProviders?: any[]) => PlatformRef; export declare const workerAppDynamicPlatform: (extraProviders?: any[]) => PlatformRef;

View File

@ -2,9 +2,12 @@
export declare class BrowserDynamicTestingModule { export declare class BrowserDynamicTestingModule {
} }
/** @experimental */ /** @deprecated */
export declare const browserDynamicTestingPlatform: (extraProviders?: any[]) => PlatformRef; export declare const browserDynamicTestingPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformBrowserDynamicTesting: (extraProviders?: any[]) => PlatformRef;
/** @deprecated */ /** @deprecated */
export declare const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any>; export declare const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any>;

View File

@ -20,7 +20,7 @@ export declare const BROWSER_SANITIZATION_PROVIDERS: Array<any>;
export declare class BrowserModule { export declare class BrowserModule {
} }
/** @experimental */ /** @deprecated */
export declare const browserPlatform: (extraProviders?: any[]) => PlatformRef; export declare const browserPlatform: (extraProviders?: any[]) => PlatformRef;
/** @stable */ /** @stable */
@ -126,6 +126,15 @@ export interface MessageBusSource {
initChannel(channel: string, runInZone: boolean): void; initChannel(channel: string, runInZone: boolean): void;
} }
/** @experimental */
export declare const platformBrowser: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformWorkerApp: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformWorkerUi: (extraProviders?: any[]) => PlatformRef;
/** @experimental */ /** @experimental */
export declare const PRIMITIVE: Type; export declare const PRIMITIVE: Type;
@ -230,8 +239,8 @@ export declare const WORKER_UI_STARTABLE_MESSAGING_SERVICE: OpaqueToken;
export declare class WorkerAppModule { export declare class WorkerAppModule {
} }
/** @experimental */ /** @deprecated */
export declare const workerAppPlatform: (extraProviders?: any[]) => PlatformRef; export declare const workerAppPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */ /** @deprecated */
export declare const workerUiPlatform: (extraProviders?: any[]) => PlatformRef; export declare const workerUiPlatform: (extraProviders?: any[]) => PlatformRef;

View File

@ -2,9 +2,12 @@
export declare class BrowserTestingModule { export declare class BrowserTestingModule {
} }
/** @experimental */ /** @deprecated */
export declare const browserTestingPlatform: (extraProviders?: any[]) => PlatformRef; export declare const browserTestingPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformBrowserTesting: (extraProviders?: any[]) => PlatformRef;
/** @deprecated */ /** @deprecated */
export declare const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any>; export declare const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any>;

View File

@ -1,11 +1,17 @@
/** @experimental */
export declare const platformDynamicServer: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformServer: (extraProviders?: any[]) => PlatformRef;
/** @deprecated */ /** @deprecated */
export declare const SERVER_PLATFORM_PROVIDERS: Array<any>; export declare const SERVER_PLATFORM_PROVIDERS: Array<any>;
/** @deprecated */ /** @deprecated */
export declare function serverBootstrap<T>(appComponentType: ConcreteType<T>, customProviders: Array<any>): Promise<ComponentRef<T>>; export declare function serverBootstrap<T>(appComponentType: ConcreteType<T>, customProviders: Array<any>): Promise<ComponentRef<T>>;
/** @experimental */ /** @deprecated */
export declare const serverDynamicPlatform: (extraProviders?: any[]) => PlatformRef; export declare const serverDynamicPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */ /** @deprecated */
export declare const serverPlatform: (extraProviders?: any[]) => PlatformRef; export declare const serverPlatform: (extraProviders?: any[]) => PlatformRef;

View File

@ -1,8 +1,11 @@
/** @experimental */
export declare const platformServerTesting: (extraProviders?: any[]) => PlatformRef;
/** @experimental */ /** @experimental */
export declare class ServerTestingModule { export declare class ServerTestingModule {
} }
/** @experimental */ /** @deprecated */
export declare const serverTestingPlatform: (extraProviders?: any[]) => PlatformRef; export declare const serverTestingPlatform: (extraProviders?: any[]) => PlatformRef;
/** @deprecated */ /** @deprecated */