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
*/
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 {Title} from './src/browser/title';
export {disableDebugTools, enableDebugTools} from './src/browser/tools/tools';

View File

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

View File

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

View File

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

View File

@ -2,9 +2,12 @@
export declare class BrowserDynamicTestingModule {
}
/** @experimental */
/** @deprecated */
export declare const browserDynamicTestingPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformBrowserDynamicTesting: (extraProviders?: any[]) => PlatformRef;
/** @deprecated */
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 {
}
/** @experimental */
/** @deprecated */
export declare const browserPlatform: (extraProviders?: any[]) => PlatformRef;
/** @stable */
@ -126,6 +126,15 @@ export interface MessageBusSource {
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 */
export declare const PRIMITIVE: Type;
@ -230,8 +239,8 @@ export declare const WORKER_UI_STARTABLE_MESSAGING_SERVICE: OpaqueToken;
export declare class WorkerAppModule {
}
/** @experimental */
/** @deprecated */
export declare const workerAppPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
/** @deprecated */
export declare const workerUiPlatform: (extraProviders?: any[]) => PlatformRef;

View File

@ -2,9 +2,12 @@
export declare class BrowserTestingModule {
}
/** @experimental */
/** @deprecated */
export declare const browserTestingPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
export declare const platformBrowserTesting: (extraProviders?: any[]) => PlatformRef;
/** @deprecated */
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 */
export declare const SERVER_PLATFORM_PROVIDERS: Array<any>;
/** @deprecated */
export declare function serverBootstrap<T>(appComponentType: ConcreteType<T>, customProviders: Array<any>): Promise<ComponentRef<T>>;
/** @experimental */
/** @deprecated */
export declare const serverDynamicPlatform: (extraProviders?: any[]) => PlatformRef;
/** @experimental */
/** @deprecated */
export declare const serverPlatform: (extraProviders?: any[]) => PlatformRef;

View File

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