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 * @stable
*/ */
bootstrapModule<M>(moduleType: Type<M>, compilerOptions: CompilerOptions|CompilerOptions[] = []): abstract bootstrapModule<M>(
Promise<NgModuleRef<M>> { moduleType: Type<M>,
throw unimplemented(); compilerOptions?: CompilerOptions|CompilerOptions[]): Promise<NgModuleRef<M>>;
}
/** /**
* Register a listener to be called when the platform is disposed. * 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)); * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));
* ``` * ```
*/ */
createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector { abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
return unimplemented();
}
/** /**
* Resolves a provider and instantiates an object in the context of the injector. * 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 { export declare abstract class ApplicationRef {
componentTypes: Type<any>[]; componentTypes: Type<any>[];
components: ComponentRef<any>[]; components: ComponentRef<any>[];
viewCount: any; viewCount: number;
attachView(view: ViewRef): void; abstract attachView(view: ViewRef): void;
abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>; abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
detachView(view: ViewRef): void; abstract detachView(view: ViewRef): void;
abstract tick(): void; abstract tick(): void;
} }
@ -521,8 +521,8 @@ export declare class InjectionToken<T> extends OpaqueToken {
/** @stable */ /** @stable */
export declare abstract class Injector { export declare abstract class Injector {
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T): T; abstract get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T): T;
/** @deprecated */ get(token: any, notFoundValue?: any): any; /** @deprecated */ abstract get(token: any, notFoundValue?: any): any;
static NULL: Injector; static NULL: Injector;
static THROW_IF_NOT_FOUND: Object; static THROW_IF_NOT_FOUND: Object;
} }
@ -741,8 +741,8 @@ export declare const platformCore: (extraProviders?: Provider[]) => PlatformRef;
export declare abstract class PlatformRef { export declare abstract class PlatformRef {
destroyed: boolean; destroyed: boolean;
injector: Injector; injector: Injector;
/** @stable */ bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>; /** @stable */ abstract bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>; /** @experimental */ abstract bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
abstract destroy(): void; abstract destroy(): void;
abstract onDestroy(callback: () => void): void; abstract onDestroy(callback: () => void): void;
} }
@ -777,11 +777,11 @@ export declare class QueryList<T> {
/** @stable */ /** @stable */
export declare abstract class ReflectiveInjector implements Injector { export declare abstract class ReflectiveInjector implements Injector {
parent: Injector; parent: Injector;
createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector; abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
abstract get(token: any, notFoundValue?: any): any; abstract get(token: any, notFoundValue?: any): any;
instantiateResolved(provider: ResolvedReflectiveProvider): any; abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
resolveAndCreateChild(providers: Provider[]): ReflectiveInjector; abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;
resolveAndInstantiate(provider: Provider): any; abstract resolveAndInstantiate(provider: Provider): any;
/** @experimental */ static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector; /** @experimental */ static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector): ReflectiveInjector;
static resolve(providers: Provider[]): ResolvedReflectiveProvider[]; static resolve(providers: Provider[]): ResolvedReflectiveProvider[];
static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector; static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector;