refactor(size): Use abstract keyword where possible to decrease file size. (#14112)

This commit is contained in:
Misko Hevery 2017-01-25 22:36:38 -08:00 committed by Miško Hevery
parent f7fba74c58
commit 670b680b0a
3 changed files with 15 additions and 18 deletions

View File

@ -204,10 +204,9 @@ export abstract class PlatformRef {
* ```
* @stable
*/
bootstrapModule<M>(moduleType: Type<M>, compilerOptions: CompilerOptions|CompilerOptions[] = []):
Promise<NgModuleRef<M>> {
throw unimplemented();
}
abstract bootstrapModule<M>(
moduleType: Type<M>,
compilerOptions?: CompilerOptions|CompilerOptions[]): Promise<NgModuleRef<M>>;
/**
* Register a listener to be called when the platform is disposed.

View File

@ -523,9 +523,7 @@ export abstract class ReflectiveInjector implements Injector {
* expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));
* ```
*/
createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector {
return unimplemented();
}
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
/**
* Resolves a provider and instantiates an object in the context of the injector.

View File

@ -171,10 +171,10 @@ export declare class ApplicationModule {
export declare abstract class ApplicationRef {
componentTypes: Type<any>[];
components: ComponentRef<any>[];
viewCount: any;
attachView(view: ViewRef): void;
viewCount: number;
abstract attachView(view: ViewRef): void;
abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
detachView(view: ViewRef): void;
abstract detachView(view: ViewRef): void;
abstract tick(): void;
}
@ -521,8 +521,8 @@ export declare class InjectionToken<T> extends OpaqueToken {
/** @stable */
export declare abstract class Injector {
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T): T;
/** @deprecated */ get(token: any, notFoundValue?: any): any;
abstract get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T): T;
/** @deprecated */ abstract get(token: any, notFoundValue?: any): any;
static NULL: Injector;
static THROW_IF_NOT_FOUND: Object;
}
@ -741,8 +741,8 @@ export declare const platformCore: (extraProviders?: Provider[]) => PlatformRef;
export declare abstract class PlatformRef {
destroyed: boolean;
injector: Injector;
/** @stable */ bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
/** @stable */ abstract bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ abstract bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
abstract destroy(): void;
abstract onDestroy(callback: () => void): void;
}
@ -777,11 +777,11 @@ export declare class QueryList<T> {
/** @stable */
export declare abstract class ReflectiveInjector implements Injector {
parent: Injector;
createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
abstract get(token: any, notFoundValue?: any): any;
instantiateResolved(provider: ResolvedReflectiveProvider): any;
resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;
resolveAndInstantiate(provider: Provider): any;
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;
abstract resolveAndInstantiate(provider: Provider): any;
/** @experimental */ static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector;
static resolve(providers: Provider[]): ResolvedReflectiveProvider[];
static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector;