2016-07-28 07:54:49 -04:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 15:08:49 -04:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2016-07-28 07:54:49 -04:00
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2018-02-13 11:19:33 -05:00
|
|
|
import {Compiler, CompilerOptions, Component, ComponentFactory, Directive, Injectable, Injector, NgModule, Pipe, Type} from '@angular/core';
|
2016-08-30 21:07:40 -04:00
|
|
|
|
2016-07-28 07:54:49 -04:00
|
|
|
import {MetadataOverride} from './metadata_override';
|
|
|
|
|
2017-01-27 16:19:00 -05:00
|
|
|
function unimplemented(): any {
|
|
|
|
throw Error('unimplemented');
|
|
|
|
}
|
2016-08-30 21:07:40 -04:00
|
|
|
|
2016-07-28 07:54:49 -04:00
|
|
|
/**
|
|
|
|
* Special interface to the compiler only used by testing
|
|
|
|
*
|
2018-10-19 07:12:20 -04:00
|
|
|
* @publicApi
|
2016-07-28 07:54:49 -04:00
|
|
|
*/
|
2018-02-13 11:19:33 -05:00
|
|
|
@Injectable()
|
2016-07-28 07:54:49 -04:00
|
|
|
export class TestingCompiler extends Compiler {
|
2020-04-13 19:40:21 -04:00
|
|
|
get injector(): Injector {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 12:44:20 -04:00
|
|
|
overrideModule(module: Type<any>, overrides: MetadataOverride<NgModule>): void {
|
2016-07-28 07:54:49 -04:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 12:44:20 -04:00
|
|
|
overrideDirective(directive: Type<any>, overrides: MetadataOverride<Directive>): void {
|
2016-07-28 07:54:49 -04:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 12:44:20 -04:00
|
|
|
overrideComponent(component: Type<any>, overrides: MetadataOverride<Component>): void {
|
2016-07-28 07:54:49 -04:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 12:44:20 -04:00
|
|
|
overridePipe(directive: Type<any>, overrides: MetadataOverride<Pipe>): void {
|
2016-07-28 07:54:49 -04:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2017-04-26 12:24:42 -04:00
|
|
|
/**
|
|
|
|
* Allows to pass the compile summary from AOT compilation to the JIT compiler,
|
|
|
|
* so that it can use the code generated by AOT.
|
|
|
|
*/
|
2020-04-13 19:40:21 -04:00
|
|
|
loadAotSummaries(summaries: () => any[]) {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2017-04-26 12:24:42 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the component factory for the given component.
|
|
|
|
* This assumes that the component has been compiled before calling this call using
|
|
|
|
* `compileModuleAndAllComponents*`.
|
|
|
|
*/
|
2020-04-13 19:40:21 -04:00
|
|
|
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2017-08-16 12:00:03 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the component type that is stored in the given error.
|
|
|
|
* This can be used for errors created by compileModule...
|
|
|
|
*/
|
2020-04-13 19:40:21 -04:00
|
|
|
getComponentFromError(error: Error): Type<any>|null {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-07-28 07:54:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A factory for creating a Compiler
|
|
|
|
*
|
2018-10-19 07:12:20 -04:00
|
|
|
* @publicApi
|
2016-07-28 07:54:49 -04:00
|
|
|
*/
|
|
|
|
export abstract class TestingCompilerFactory {
|
|
|
|
abstract createTestingCompiler(options?: CompilerOptions[]): TestingCompiler;
|
|
|
|
}
|