2016-07-28 04:54:49 -07:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 12:08:49 -07:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2016-07-28 04:54:49 -07: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 08:19:33 -08:00
|
|
|
import {Compiler, CompilerOptions, Component, ComponentFactory, Directive, Injectable, Injector, NgModule, Pipe, Type} from '@angular/core';
|
2016-08-30 18:07:40 -07:00
|
|
|
|
2016-07-28 04:54:49 -07:00
|
|
|
import {MetadataOverride} from './metadata_override';
|
|
|
|
|
2017-01-27 13:19:00 -08:00
|
|
|
function unimplemented(): any {
|
|
|
|
throw Error('unimplemented');
|
|
|
|
}
|
2016-08-30 18:07:40 -07:00
|
|
|
|
2016-07-28 04:54:49 -07:00
|
|
|
/**
|
|
|
|
* Special interface to the compiler only used by testing
|
|
|
|
*
|
2018-10-19 12:12:20 +01:00
|
|
|
* @publicApi
|
2016-07-28 04:54:49 -07:00
|
|
|
*/
|
2018-02-13 08:19:33 -08:00
|
|
|
@Injectable()
|
2016-07-28 04:54:49 -07:00
|
|
|
export class TestingCompiler extends Compiler {
|
2020-04-13 16:40:21 -07:00
|
|
|
get injector(): Injector {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 09:44:20 -07:00
|
|
|
overrideModule(module: Type<any>, overrides: MetadataOverride<NgModule>): void {
|
2016-07-28 04:54:49 -07:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 09:44:20 -07:00
|
|
|
overrideDirective(directive: Type<any>, overrides: MetadataOverride<Directive>): void {
|
2016-07-28 04:54:49 -07:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 09:44:20 -07:00
|
|
|
overrideComponent(component: Type<any>, overrides: MetadataOverride<Component>): void {
|
2016-07-28 04:54:49 -07:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-09-12 09:44:20 -07:00
|
|
|
overridePipe(directive: Type<any>, overrides: MetadataOverride<Pipe>): void {
|
2016-07-28 04:54:49 -07:00
|
|
|
throw unimplemented();
|
|
|
|
}
|
2017-04-26 09:24:42 -07: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 16:40:21 -07:00
|
|
|
loadAotSummaries(summaries: () => any[]) {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2017-04-26 09:24:42 -07: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 16:40:21 -07:00
|
|
|
getComponentFactory<T>(component: Type<T>): ComponentFactory<T> {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2017-08-16 09:00:03 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the component type that is stored in the given error.
|
|
|
|
* This can be used for errors created by compileModule...
|
|
|
|
*/
|
2020-04-13 16:40:21 -07:00
|
|
|
getComponentFromError(error: Error): Type<any>|null {
|
|
|
|
throw unimplemented();
|
|
|
|
}
|
2016-07-28 04:54:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A factory for creating a Compiler
|
|
|
|
*
|
2018-10-19 12:12:20 +01:00
|
|
|
* @publicApi
|
2016-07-28 04:54:49 -07:00
|
|
|
*/
|
|
|
|
export abstract class TestingCompilerFactory {
|
|
|
|
abstract createTestingCompiler(options?: CompilerOptions[]): TestingCompiler;
|
|
|
|
}
|