2016-06-08 19:38:52 -04:00
|
|
|
import {ViewEncapsulation} from '@angular/core';
|
|
|
|
|
2016-04-28 20:50:03 -04:00
|
|
|
import {unimplemented} from '../src/facade/exceptions';
|
2016-06-15 17:56:56 -04:00
|
|
|
import {assertionsEnabled} from '../src/facade/lang';
|
2016-06-08 19:38:52 -04:00
|
|
|
|
2016-01-06 17:13:44 -05:00
|
|
|
import {CompileIdentifierMetadata} from './compile_metadata';
|
2016-06-08 19:38:52 -04:00
|
|
|
import {Identifiers} from './identifiers';
|
2016-01-06 17:13:44 -05:00
|
|
|
|
|
|
|
export class CompilerConfig {
|
|
|
|
public renderTypes: RenderTypes;
|
2016-04-02 19:34:44 -04:00
|
|
|
public defaultEncapsulation: ViewEncapsulation;
|
2016-06-13 13:06:40 -04:00
|
|
|
public genDebugInfo: boolean;
|
|
|
|
public logBindingUpdate: boolean;
|
|
|
|
public useJit: boolean;
|
|
|
|
public platformDirectives: any[];
|
|
|
|
public platformPipes: any[];
|
2016-04-02 19:34:44 -04:00
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
constructor(
|
2016-06-13 13:06:40 -04:00
|
|
|
{renderTypes = new DefaultRenderTypes(), defaultEncapsulation = ViewEncapsulation.Emulated,
|
|
|
|
genDebugInfo = assertionsEnabled(), logBindingUpdate = assertionsEnabled(), useJit = true,
|
|
|
|
platformDirectives = [], platformPipes = []}: {
|
|
|
|
renderTypes?: RenderTypes,
|
|
|
|
defaultEncapsulation?: ViewEncapsulation,
|
|
|
|
genDebugInfo?: boolean,
|
|
|
|
logBindingUpdate?: boolean,
|
|
|
|
useJit?: boolean,
|
|
|
|
platformDirectives?: any[],
|
|
|
|
platformPipes?: any[]
|
|
|
|
} = {}) {
|
2016-01-06 17:13:44 -05:00
|
|
|
this.renderTypes = renderTypes;
|
2016-04-02 19:34:44 -04:00
|
|
|
this.defaultEncapsulation = defaultEncapsulation;
|
2016-06-13 13:06:40 -04:00
|
|
|
this.genDebugInfo = genDebugInfo;
|
|
|
|
this.logBindingUpdate = logBindingUpdate;
|
|
|
|
this.useJit = useJit;
|
|
|
|
this.platformDirectives = platformDirectives;
|
|
|
|
this.platformPipes = platformPipes;
|
2016-01-06 17:13:44 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Types used for the renderer.
|
|
|
|
* Can be replaced to specialize the generated output to a specific renderer
|
|
|
|
* to help tree shaking.
|
|
|
|
*/
|
|
|
|
export abstract class RenderTypes {
|
|
|
|
get renderer(): CompileIdentifierMetadata { return unimplemented(); }
|
|
|
|
get renderText(): CompileIdentifierMetadata { return unimplemented(); }
|
|
|
|
get renderElement(): CompileIdentifierMetadata { return unimplemented(); }
|
|
|
|
get renderComment(): CompileIdentifierMetadata { return unimplemented(); }
|
|
|
|
get renderNode(): CompileIdentifierMetadata { return unimplemented(); }
|
|
|
|
get renderEvent(): CompileIdentifierMetadata { return unimplemented(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DefaultRenderTypes implements RenderTypes {
|
|
|
|
renderer = Identifiers.Renderer;
|
2016-06-08 18:45:15 -04:00
|
|
|
renderText: any /** TODO #9100 */ = null;
|
|
|
|
renderElement: any /** TODO #9100 */ = null;
|
|
|
|
renderComment: any /** TODO #9100 */ = null;
|
|
|
|
renderNode: any /** TODO #9100 */ = null;
|
|
|
|
renderEvent: any /** TODO #9100 */ = null;
|
2016-01-06 17:13:44 -05:00
|
|
|
}
|