/** * @license Angular v19.2.4 * (c) 2010-2025 Google LLC. https://angular.io/ * License: MIT */ declare const emitDistinctChangesOnlyDefaultValue = true; declare enum ViewEncapsulation { Emulated = 0, None = 2, ShadowDom = 3 } declare enum ChangeDetectionStrategy { OnPush = 0, Default = 1 } interface Input { alias?: string; required?: boolean; transform?: (value: any) => any; isSignal: boolean; } /** Flags describing an input for a directive. */ declare enum InputFlags { None = 0, SignalBased = 1, HasDecoratorInputTransform = 2 } interface Output { alias?: string; } interface HostBinding { hostPropertyName?: string; } interface HostListener { eventName?: string; args?: string[]; } interface SchemaMetadata { name: string; } declare const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata; declare const NO_ERRORS_SCHEMA: SchemaMetadata; interface Type$1 extends Function { new (...args: any[]): any; } declare const Type$1: FunctionConstructor; declare enum SecurityContext { NONE = 0, HTML = 1, STYLE = 2, SCRIPT = 3, URL = 4, RESOURCE_URL = 5 } /** * Injection flags for DI. */ declare const enum InjectFlags { Default = 0, /** * Specifies that an injector should retrieve a dependency from any injector until reaching the * host element of the current component. (Only used with Element Injector) */ Host = 1, /** Don't descend into ancestors of the node requesting injection. */ Self = 2, /** Skip the node that is requesting injection. */ SkipSelf = 4, /** Inject `defaultValue` instead if token not found. */ Optional = 8 } declare enum MissingTranslationStrategy { Error = 0, Warning = 1, Ignore = 2 } /** * Flags used to generate R3-style CSS Selectors. They are pasted from * core/src/render3/projection.ts because they cannot be referenced directly. */ declare const enum SelectorFlags { /** Indicates this is the beginning of a new negative selector */ NOT = 1, /** Mode for matching attributes */ ATTRIBUTE = 2, /** Mode for matching tag names */ ELEMENT = 4, /** Mode for matching class names */ CLASS = 8 } type R3CssSelector = (string | SelectorFlags)[]; type R3CssSelectorList = R3CssSelector[]; declare function parseSelectorToR3Selector(selector: string | null): R3CssSelectorList; /** * Flags passed into template functions to determine which blocks (i.e. creation, update) * should be executed. * * Typically, a template runs both the creation block and the update block on initialization and * subsequent runs only execute the update block. However, dynamically created views require that * the creation block be executed separately from the update block (for backwards compat). */ declare const enum RenderFlags { Create = 1, Update = 2 } /** * A set of marker values to be used in the attributes arrays. These markers indicate that some * items are not regular attributes and the processing should be adapted accordingly. */ declare const enum AttributeMarker { /** * Marker indicates that the following 3 values in the attributes array are: * namespaceUri, attributeName, attributeValue * in that order. */ NamespaceURI = 0, /** * Signals class declaration. * * Each value following `Classes` designates a class name to include on the element. * ## Example: * * Given: * ```html *
...
* ``` * * the generated code is: * ```ts * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz']; * ``` */ Classes = 1, /** * Signals style declaration. * * Each pair of values following `Styles` designates a style name and value to include on the * element. * ## Example: * * Given: * ```html *
...
* ``` * * the generated code is: * ```ts * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red']; * ``` */ Styles = 2, /** * Signals that the following attribute names were extracted from input or output bindings. * * For example, given the following HTML: * * ```html *
* ``` * * the generated code is: * * ```ts * var _c1 = ['moo', 'car', AttributeMarker.Bindings, 'foo', 'bar']; * ``` */ Bindings = 3, /** * Signals that the following attribute names were hoisted from an inline-template declaration. * * For example, given the following HTML: * * ```html *
* ``` * * the generated code for the `template()` instruction would include: * * ``` * ['dirA', '', AttributeMarker.Bindings, 'dirB', AttributeMarker.Template, 'ngFor', 'ngForOf', * 'ngForTrackBy', 'let-value'] * ``` * * while the generated code for the `element()` instruction inside the template function would * include: * * ``` * ['dirA', '', AttributeMarker.Bindings, 'dirB'] * ``` */ Template = 4, /** * Signals that the following attribute is `ngProjectAs` and its value is a parsed `CssSelector`. * * For example, given the following HTML: * * ```html *

* ``` * * the generated code for the `element()` instruction would include: * * ``` * ['attr', 'value', AttributeMarker.ProjectAs, ['', 'title', '']] * ``` */ ProjectAs = 5, /** * Signals that the following attribute will be translated by runtime i18n * * For example, given the following HTML: * * ```html *
* ``` * * the generated code is: * * ```ts * var _c1 = ['moo', 'car', AttributeMarker.I18n, 'foo', 'bar']; * ``` */ I18n = 6 } type core_d_AttributeMarker = AttributeMarker; declare const core_d_AttributeMarker: typeof AttributeMarker; declare const core_d_CUSTOM_ELEMENTS_SCHEMA: typeof CUSTOM_ELEMENTS_SCHEMA; type core_d_ChangeDetectionStrategy = ChangeDetectionStrategy; declare const core_d_ChangeDetectionStrategy: typeof ChangeDetectionStrategy; type core_d_HostBinding = HostBinding; type core_d_HostListener = HostListener; type core_d_InjectFlags = InjectFlags; declare const core_d_InjectFlags: typeof InjectFlags; type core_d_Input = Input; type core_d_InputFlags = InputFlags; declare const core_d_InputFlags: typeof InputFlags; type core_d_MissingTranslationStrategy = MissingTranslationStrategy; declare const core_d_MissingTranslationStrategy: typeof MissingTranslationStrategy; declare const core_d_NO_ERRORS_SCHEMA: typeof NO_ERRORS_SCHEMA; type core_d_Output = Output; type core_d_R3CssSelector = R3CssSelector; type core_d_R3CssSelectorList = R3CssSelectorList; type core_d_RenderFlags = RenderFlags; declare const core_d_RenderFlags: typeof RenderFlags; type core_d_SchemaMetadata = SchemaMetadata; type core_d_SecurityContext = SecurityContext; declare const core_d_SecurityContext: typeof SecurityContext; type core_d_SelectorFlags = SelectorFlags; declare const core_d_SelectorFlags: typeof SelectorFlags; type core_d_ViewEncapsulation = ViewEncapsulation; declare const core_d_ViewEncapsulation: typeof ViewEncapsulation; declare const core_d_emitDistinctChangesOnlyDefaultValue: typeof emitDistinctChangesOnlyDefaultValue; declare const core_d_parseSelectorToR3Selector: typeof parseSelectorToR3Selector; declare namespace core_d { export { core_d_AttributeMarker as AttributeMarker, core_d_CUSTOM_ELEMENTS_SCHEMA as CUSTOM_ELEMENTS_SCHEMA, core_d_ChangeDetectionStrategy as ChangeDetectionStrategy, type core_d_HostBinding as HostBinding, type core_d_HostListener as HostListener, core_d_InjectFlags as InjectFlags, type core_d_Input as Input, core_d_InputFlags as InputFlags, core_d_MissingTranslationStrategy as MissingTranslationStrategy, core_d_NO_ERRORS_SCHEMA as NO_ERRORS_SCHEMA, type core_d_Output as Output, type core_d_R3CssSelector as R3CssSelector, type core_d_R3CssSelectorList as R3CssSelectorList, core_d_RenderFlags as RenderFlags, type core_d_SchemaMetadata as SchemaMetadata, core_d_SecurityContext as SecurityContext, core_d_SelectorFlags as SelectorFlags, Type$1 as Type, core_d_ViewEncapsulation as ViewEncapsulation, core_d_emitDistinctChangesOnlyDefaultValue as emitDistinctChangesOnlyDefaultValue, core_d_parseSelectorToR3Selector as parseSelectorToR3Selector }; } declare class Version { full: string; readonly major: string; readonly minor: string; readonly patch: string; constructor(full: string); } interface Console { log(message: string): void; warn(message: string): void; } /** * @module * @description * Entry point for all public APIs of the compiler package. */ declare const VERSION: Version; declare class CompilerConfig { defaultEncapsulation: ViewEncapsulation | null; preserveWhitespaces: boolean; strictInjectionParameters: boolean; constructor({ defaultEncapsulation, preserveWhitespaces, strictInjectionParameters, }?: { defaultEncapsulation?: ViewEncapsulation; preserveWhitespaces?: boolean; strictInjectionParameters?: boolean; }); } declare function preserveWhitespacesDefault(preserveWhitespacesOption: boolean | null, defaultSetting?: boolean): boolean; /** * An interface for retrieving documents by URL that the compiler uses to * load templates. * * This is an abstract class, rather than an interface, so that it can be used * as injection token. */ declare abstract class ResourceLoader { abstract get(url: string): Promise | string; } declare class ParseLocation { file: ParseSourceFile; offset: number; line: number; col: number; constructor(file: ParseSourceFile, offset: number, line: number, col: number); toString(): string; moveBy(delta: number): ParseLocation; getContext(maxChars: number, maxLines: number): { before: string; after: string; } | null; } declare class ParseSourceFile { content: string; url: string; constructor(content: string, url: string); } declare class ParseSourceSpan { start: ParseLocation; end: ParseLocation; fullStart: ParseLocation; details: string | null; /** * Create an object that holds information about spans of tokens/nodes captured during * lexing/parsing of text. * * @param start * The location of the start of the span (having skipped leading trivia). * Skipping leading trivia makes source-spans more "user friendly", since things like HTML * elements will appear to begin at the start of the opening tag, rather than at the start of any * leading trivia, which could include newlines. * * @param end * The location of the end of the span. * * @param fullStart * The start of the token without skipping the leading trivia. * This is used by tooling that splits tokens further, such as extracting Angular interpolations * from text tokens. Such tooling creates new source-spans relative to the original token's * source-span. If leading trivia characters have been skipped then the new source-spans may be * incorrectly offset. * * @param details * Additional information (such as identifier names) that should be associated with the span. */ constructor(start: ParseLocation, end: ParseLocation, fullStart?: ParseLocation, details?: string | null); toString(): string; } declare enum ParseErrorLevel { WARNING = 0, ERROR = 1 } declare class ParseError { /** Location of the error. */ readonly span: ParseSourceSpan; /** Error message. */ readonly msg: string; /** Severity level of the error. */ readonly level: ParseErrorLevel; /** * Error that caused the error to be surfaced. For example, an error in a sub-expression that * couldn't be parsed. Not guaranteed to be defined, but can be used to provide more context. */ readonly relatedError?: unknown | undefined; constructor( /** Location of the error. */ span: ParseSourceSpan, /** Error message. */ msg: string, /** Severity level of the error. */ level?: ParseErrorLevel, /** * Error that caused the error to be surfaced. For example, an error in a sub-expression that * couldn't be parsed. Not guaranteed to be defined, but can be used to provide more context. */ relatedError?: unknown | undefined); contextualMessage(): string; toString(): string; } /** * Generates Source Span object for a given R3 Type for JIT mode. * * @param kind Component or Directive. * @param typeName name of the Component or Directive. * @param sourceUrl reference to Component or Directive source. * @returns instance of ParseSourceSpan that represent a given Component or Directive. */ declare function r3JitTypeSourceSpan(kind: string, typeName: string, sourceUrl: string): ParseSourceSpan; declare function identifierName(compileIdentifier: CompileIdentifierMetadata | null | undefined): string | null; interface CompileIdentifierMetadata { reference: any; } declare function sanitizeIdentifier(name: string): string; /** * Describes the text contents of a placeholder as it appears in an ICU expression, including its * source span information. */ interface MessagePlaceholder { /** The text contents of the placeholder */ text: string; /** The source span of the placeholder */ sourceSpan: ParseSourceSpan; } declare class Message { nodes: Node$2[]; placeholders: { [phName: string]: MessagePlaceholder; }; placeholderToMessage: { [phName: string]: Message; }; meaning: string; description: string; customId: string; sources: MessageSpan[]; id: string; /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */ legacyIds: string[]; messageString: string; /** * @param nodes message AST * @param placeholders maps placeholder names to static content and their source spans * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages) * @param meaning * @param description * @param customId */ constructor(nodes: Node$2[], placeholders: { [phName: string]: MessagePlaceholder; }, placeholderToMessage: { [phName: string]: Message; }, meaning: string, description: string, customId: string); } interface MessageSpan { filePath: string; startLine: number; startCol: number; endLine: number; endCol: number; } interface Node$2 { sourceSpan: ParseSourceSpan; visit(visitor: Visitor$2, context?: any): any; } declare class Text$2 implements Node$2 { value: string; sourceSpan: ParseSourceSpan; constructor(value: string, sourceSpan: ParseSourceSpan); visit(visitor: Visitor$2, context?: any): any; } declare class Container implements Node$2 { children: Node$2[]; sourceSpan: ParseSourceSpan; constructor(children: Node$2[], sourceSpan: ParseSourceSpan); visit(visitor: Visitor$2, context?: any): any; } declare class Icu$1 implements Node$2 { expression: string; type: string; cases: { [k: string]: Node$2; }; sourceSpan: ParseSourceSpan; expressionPlaceholder?: string | undefined; constructor(expression: string, type: string, cases: { [k: string]: Node$2; }, sourceSpan: ParseSourceSpan, expressionPlaceholder?: string | undefined); visit(visitor: Visitor$2, context?: any): any; } declare class TagPlaceholder implements Node$2 { tag: string; attrs: { [k: string]: string; }; startName: string; closeName: string; children: Node$2[]; isVoid: boolean; sourceSpan: ParseSourceSpan; startSourceSpan: ParseSourceSpan | null; endSourceSpan: ParseSourceSpan | null; constructor(tag: string, attrs: { [k: string]: string; }, startName: string, closeName: string, children: Node$2[], isVoid: boolean, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan | null, endSourceSpan: ParseSourceSpan | null); visit(visitor: Visitor$2, context?: any): any; } declare class Placeholder implements Node$2 { value: string; name: string; sourceSpan: ParseSourceSpan; constructor(value: string, name: string, sourceSpan: ParseSourceSpan); visit(visitor: Visitor$2, context?: any): any; } declare class IcuPlaceholder implements Node$2 { value: Icu$1; name: string; sourceSpan: ParseSourceSpan; /** Used to capture a message computed from a previous processing pass (see `setI18nRefs()`). */ previousMessage?: Message; constructor(value: Icu$1, name: string, sourceSpan: ParseSourceSpan); visit(visitor: Visitor$2, context?: any): any; } declare class BlockPlaceholder implements Node$2 { name: string; parameters: string[]; startName: string; closeName: string; children: Node$2[]; sourceSpan: ParseSourceSpan; startSourceSpan: ParseSourceSpan | null; endSourceSpan: ParseSourceSpan | null; constructor(name: string, parameters: string[], startName: string, closeName: string, children: Node$2[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan | null, endSourceSpan: ParseSourceSpan | null); visit(visitor: Visitor$2, context?: any): any; } /** * Each HTML node that is affect by an i18n tag will also have an `i18n` property that is of type * `I18nMeta`. * This information is either a `Message`, which indicates it is the root of an i18n message, or a * `Node`, which indicates is it part of a containing `Message`. */ type I18nMeta$1 = Message | Node$2; interface Visitor$2 { visitText(text: Text$2, context?: any): any; visitContainer(container: Container, context?: any): any; visitIcu(icu: Icu$1, context?: any): any; visitTagPlaceholder(ph: TagPlaceholder, context?: any): any; visitPlaceholder(ph: Placeholder, context?: any): any; visitIcuPlaceholder(ph: IcuPlaceholder, context?: any): any; visitBlockPlaceholder(ph: BlockPlaceholder, context?: any): any; } declare const enum TokenType$1 { TAG_OPEN_START = 0, TAG_OPEN_END = 1, TAG_OPEN_END_VOID = 2, TAG_CLOSE = 3, INCOMPLETE_TAG_OPEN = 4, TEXT = 5, ESCAPABLE_RAW_TEXT = 6, RAW_TEXT = 7, INTERPOLATION = 8, ENCODED_ENTITY = 9, COMMENT_START = 10, COMMENT_END = 11, CDATA_START = 12, CDATA_END = 13, ATTR_NAME = 14, ATTR_QUOTE = 15, ATTR_VALUE_TEXT = 16, ATTR_VALUE_INTERPOLATION = 17, DOC_TYPE = 18, EXPANSION_FORM_START = 19, EXPANSION_CASE_VALUE = 20, EXPANSION_CASE_EXP_START = 21, EXPANSION_CASE_EXP_END = 22, EXPANSION_FORM_END = 23, BLOCK_OPEN_START = 24, BLOCK_OPEN_END = 25, BLOCK_CLOSE = 26, BLOCK_PARAMETER = 27, INCOMPLETE_BLOCK_OPEN = 28, LET_START = 29, LET_VALUE = 30, LET_END = 31, INCOMPLETE_LET = 32, EOF = 33 } type InterpolatedTextToken = TextToken | InterpolationToken | EncodedEntityToken; type InterpolatedAttributeToken = AttributeValueTextToken | AttributeValueInterpolationToken | EncodedEntityToken; interface TokenBase { type: TokenType$1; parts: string[]; sourceSpan: ParseSourceSpan; } interface TextToken extends TokenBase { type: TokenType$1.TEXT | TokenType$1.ESCAPABLE_RAW_TEXT | TokenType$1.RAW_TEXT; parts: [text: string]; } interface InterpolationToken extends TokenBase { type: TokenType$1.INTERPOLATION; parts: [startMarker: string, expression: string, endMarker: string] | [startMarker: string, expression: string]; } interface EncodedEntityToken extends TokenBase { type: TokenType$1.ENCODED_ENTITY; parts: [decoded: string, encoded: string]; } interface AttributeValueTextToken extends TokenBase { type: TokenType$1.ATTR_VALUE_TEXT; parts: [value: string]; } interface AttributeValueInterpolationToken extends TokenBase { type: TokenType$1.ATTR_VALUE_INTERPOLATION; parts: [startMarker: string, expression: string, endMarker: string] | [startMarker: string, expression: string]; } interface BaseNode { sourceSpan: ParseSourceSpan; visit(visitor: Visitor$1, context: any): any; } type Node$1 = Attribute | Comment$1 | Element$1 | Expansion | ExpansionCase | Text$1 | Block | BlockParameter; declare abstract class NodeWithI18n implements BaseNode { sourceSpan: ParseSourceSpan; i18n?: I18nMeta$1 | undefined; constructor(sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); abstract visit(visitor: Visitor$1, context: any): any; } declare class Text$1 extends NodeWithI18n { value: string; tokens: InterpolatedTextToken[]; constructor(value: string, sourceSpan: ParseSourceSpan, tokens: InterpolatedTextToken[], i18n?: I18nMeta$1); visit(visitor: Visitor$1, context: any): any; } declare class Expansion extends NodeWithI18n { switchValue: string; type: string; cases: ExpansionCase[]; switchValueSourceSpan: ParseSourceSpan; constructor(switchValue: string, type: string, cases: ExpansionCase[], sourceSpan: ParseSourceSpan, switchValueSourceSpan: ParseSourceSpan, i18n?: I18nMeta$1); visit(visitor: Visitor$1, context: any): any; } declare class ExpansionCase implements BaseNode { value: string; expression: Node$1[]; sourceSpan: ParseSourceSpan; valueSourceSpan: ParseSourceSpan; expSourceSpan: ParseSourceSpan; constructor(value: string, expression: Node$1[], sourceSpan: ParseSourceSpan, valueSourceSpan: ParseSourceSpan, expSourceSpan: ParseSourceSpan); visit(visitor: Visitor$1, context: any): any; } declare class Attribute extends NodeWithI18n { name: string; value: string; readonly keySpan: ParseSourceSpan | undefined; valueSpan: ParseSourceSpan | undefined; valueTokens: InterpolatedAttributeToken[] | undefined; constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan: ParseSourceSpan | undefined, valueTokens: InterpolatedAttributeToken[] | undefined, i18n: I18nMeta$1 | undefined); visit(visitor: Visitor$1, context: any): any; } declare class Element$1 extends NodeWithI18n { name: string; attrs: Attribute[]; children: Node$1[]; startSourceSpan: ParseSourceSpan; endSourceSpan: ParseSourceSpan | null; constructor(name: string, attrs: Attribute[], children: Node$1[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null, i18n?: I18nMeta$1); visit(visitor: Visitor$1, context: any): any; } declare class Comment$1 implements BaseNode { value: string | null; sourceSpan: ParseSourceSpan; constructor(value: string | null, sourceSpan: ParseSourceSpan); visit(visitor: Visitor$1, context: any): any; } declare class Block extends NodeWithI18n { name: string; parameters: BlockParameter[]; children: Node$1[]; nameSpan: ParseSourceSpan; startSourceSpan: ParseSourceSpan; endSourceSpan: ParseSourceSpan | null; constructor(name: string, parameters: BlockParameter[], children: Node$1[], sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan?: ParseSourceSpan | null, i18n?: I18nMeta$1); visit(visitor: Visitor$1, context: any): any; } declare class BlockParameter implements BaseNode { expression: string; sourceSpan: ParseSourceSpan; constructor(expression: string, sourceSpan: ParseSourceSpan); visit(visitor: Visitor$1, context: any): any; } declare class LetDeclaration$1 implements BaseNode { name: string; value: string; sourceSpan: ParseSourceSpan; readonly nameSpan: ParseSourceSpan; valueSpan: ParseSourceSpan; constructor(name: string, value: string, sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan, valueSpan: ParseSourceSpan); visit(visitor: Visitor$1, context: any): any; } interface Visitor$1 { visit?(node: Node$1, context: any): any; visitElement(element: Element$1, context: any): any; visitAttribute(attribute: Attribute, context: any): any; visitText(text: Text$1, context: any): any; visitComment(comment: Comment$1, context: any): any; visitExpansion(expansion: Expansion, context: any): any; visitExpansionCase(expansionCase: ExpansionCase, context: any): any; visitBlock(block: Block, context: any): any; visitBlockParameter(parameter: BlockParameter, context: any): any; visitLetDeclaration(decl: LetDeclaration$1, context: any): any; } declare function visitAll$1(visitor: Visitor$1, nodes: Node$1[], context?: any): any[]; declare class RecursiveVisitor$1 implements Visitor$1 { constructor(); visitElement(ast: Element$1, context: any): any; visitAttribute(ast: Attribute, context: any): any; visitText(ast: Text$1, context: any): any; visitComment(ast: Comment$1, context: any): any; visitExpansion(ast: Expansion, context: any): any; visitExpansionCase(ast: ExpansionCase, context: any): any; visitBlock(block: Block, context: any): any; visitBlockParameter(ast: BlockParameter, context: any): any; visitLetDeclaration(decl: LetDeclaration$1, context: any): void; private visitChildren; } declare class InterpolationConfig { start: string; end: string; static fromArray(markers: [string, string] | null): InterpolationConfig; constructor(start: string, end: string); } declare const DEFAULT_INTERPOLATION_CONFIG: InterpolationConfig; declare enum TagContentType { RAW_TEXT = 0, ESCAPABLE_RAW_TEXT = 1, PARSABLE_DATA = 2 } interface TagDefinition { closedByParent: boolean; implicitNamespacePrefix: string | null; isVoid: boolean; ignoreFirstLf: boolean; canSelfClose: boolean; preventNamespaceInheritance: boolean; isClosedByChild(name: string): boolean; getContentType(prefix?: string): TagContentType; } declare function splitNsName(elementName: string, fatal?: boolean): [string | null, string]; declare function isNgContainer(tagName: string): boolean; declare function isNgContent(tagName: string): boolean; declare function isNgTemplate(tagName: string): boolean; declare function getNsPrefix(fullName: string): string; declare function getNsPrefix(fullName: null): null; declare function mergeNsAndName(prefix: string, localName: string): string; interface LexerRange { startPos: number; startLine: number; startCol: number; endPos: number; } /** * Options that modify how the text is tokenized. */ interface TokenizeOptions { /** Whether to tokenize ICU messages (considered as text nodes when false). */ tokenizeExpansionForms?: boolean; /** How to tokenize interpolation markers. */ interpolationConfig?: InterpolationConfig; /** * The start and end point of the text to parse within the `source` string. * The entire `source` string is parsed if this is not provided. * */ range?: LexerRange; /** * If this text is stored in a JavaScript string, then we have to deal with escape sequences. * * **Example 1:** * * ``` * "abc\"def\nghi" * ``` * * - The `\"` must be converted to `"`. * - The `\n` must be converted to a new line character in a token, * but it should not increment the current line for source mapping. * * **Example 2:** * * ``` * "abc\ * def" * ``` * * The line continuation (`\` followed by a newline) should be removed from a token * but the new line should increment the current line for source mapping. */ escapedString?: boolean; /** * If this text is stored in an external template (e.g. via `templateUrl`) then we need to decide * whether or not to normalize the line-endings (from `\r\n` to `\n`) when processing ICU * expressions. * * If `true` then we will normalize ICU expression line endings. * The default is `false`, but this will be switched in a future major release. */ i18nNormalizeLineEndingsInICUs?: boolean; /** * An array of characters that should be considered as leading trivia. * Leading trivia are characters that are not important to the developer, and so should not be * included in source-map segments. A common example is whitespace. */ leadingTriviaChars?: string[]; /** * If true, do not convert CRLF to LF. */ preserveLineEndings?: boolean; /** * Whether to tokenize @ block syntax. Otherwise considered text, * or ICU tokens if `tokenizeExpansionForms` is enabled. */ tokenizeBlocks?: boolean; /** * Whether to tokenize the `@let` syntax. Otherwise will be considered either * text or an incomplete block, depending on whether `tokenizeBlocks` is enabled. */ tokenizeLet?: boolean; } declare class TreeError extends ParseError { elementName: string | null; static create(elementName: string | null, span: ParseSourceSpan, msg: string): TreeError; constructor(elementName: string | null, span: ParseSourceSpan, msg: string); } declare class ParseTreeResult { rootNodes: Node$1[]; errors: ParseError[]; constructor(rootNodes: Node$1[], errors: ParseError[]); } declare class Parser$1 { getTagDefinition: (tagName: string) => TagDefinition; constructor(getTagDefinition: (tagName: string) => TagDefinition); parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult; } type I18nMeta = { id?: string; customId?: string; legacyIds?: string[]; description?: string; meaning?: string; }; declare enum TypeModifier { None = 0, Const = 1 } declare abstract class Type { modifiers: TypeModifier; constructor(modifiers?: TypeModifier); abstract visitType(visitor: TypeVisitor, context: any): any; hasModifier(modifier: TypeModifier): boolean; } declare enum BuiltinTypeName { Dynamic = 0, Bool = 1, String = 2, Int = 3, Number = 4, Function = 5, Inferred = 6, None = 7 } declare class BuiltinType extends Type { name: BuiltinTypeName; constructor(name: BuiltinTypeName, modifiers?: TypeModifier); visitType(visitor: TypeVisitor, context: any): any; } declare class ExpressionType extends Type { value: Expression; typeParams: Type[] | null; constructor(value: Expression, modifiers?: TypeModifier, typeParams?: Type[] | null); visitType(visitor: TypeVisitor, context: any): any; } declare class ArrayType extends Type { of: Type; constructor(of: Type, modifiers?: TypeModifier); visitType(visitor: TypeVisitor, context: any): any; } declare class MapType extends Type { valueType: Type | null; constructor(valueType: Type | null | undefined, modifiers?: TypeModifier); visitType(visitor: TypeVisitor, context: any): any; } declare class TransplantedType extends Type { readonly type: T; constructor(type: T, modifiers?: TypeModifier); visitType(visitor: TypeVisitor, context: any): any; } declare const DYNAMIC_TYPE: BuiltinType; declare const INFERRED_TYPE: BuiltinType; declare const BOOL_TYPE: BuiltinType; declare const INT_TYPE: BuiltinType; declare const NUMBER_TYPE: BuiltinType; declare const STRING_TYPE: BuiltinType; declare const FUNCTION_TYPE: BuiltinType; declare const NONE_TYPE: BuiltinType; interface TypeVisitor { visitBuiltinType(type: BuiltinType, context: any): any; visitExpressionType(type: ExpressionType, context: any): any; visitArrayType(type: ArrayType, context: any): any; visitMapType(type: MapType, context: any): any; visitTransplantedType(type: TransplantedType, context: any): any; } declare enum UnaryOperator { Minus = 0, Plus = 1 } declare enum BinaryOperator { Equals = 0, NotEquals = 1, Identical = 2, NotIdentical = 3, Minus = 4, Plus = 5, Divide = 6, Multiply = 7, Modulo = 8, And = 9, Or = 10, BitwiseOr = 11, BitwiseAnd = 12, Lower = 13, LowerEquals = 14, Bigger = 15, BiggerEquals = 16, NullishCoalesce = 17 } declare function nullSafeIsEquivalent(base: T | null, other: T | null): boolean; declare function areAllEquivalent(base: T[], other: T[]): boolean; declare abstract class Expression { type: Type | null; sourceSpan: ParseSourceSpan | null; constructor(type: Type | null | undefined, sourceSpan?: ParseSourceSpan | null); abstract visitExpression(visitor: ExpressionVisitor, context: any): any; /** * Calculates whether this expression produces the same value as the given expression. * Note: We don't check Types nor ParseSourceSpans nor function arguments. */ abstract isEquivalent(e: Expression): boolean; /** * Return true if the expression is constant. */ abstract isConstant(): boolean; abstract clone(): Expression; prop(name: string, sourceSpan?: ParseSourceSpan | null): ReadPropExpr; key(index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadKeyExpr; callFn(params: Expression[], sourceSpan?: ParseSourceSpan | null, pure?: boolean): InvokeFunctionExpr; instantiate(params: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): InstantiateExpr; conditional(trueCase: Expression, falseCase?: Expression | null, sourceSpan?: ParseSourceSpan | null): ConditionalExpr; equals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; notEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; identical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; notIdentical(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; minus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; plus(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; divide(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; multiply(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; modulo(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; and(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; bitwiseOr(rhs: Expression, sourceSpan?: ParseSourceSpan | null, parens?: boolean): BinaryOperatorExpr; bitwiseAnd(rhs: Expression, sourceSpan?: ParseSourceSpan | null, parens?: boolean): BinaryOperatorExpr; or(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; lower(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; lowerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; bigger(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; biggerEquals(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; isBlank(sourceSpan?: ParseSourceSpan | null): Expression; nullishCoalesce(rhs: Expression, sourceSpan?: ParseSourceSpan | null): BinaryOperatorExpr; toStmt(): Statement; } declare class ReadVarExpr extends Expression { name: string; constructor(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): ReadVarExpr; set(value: Expression): WriteVarExpr; } declare class TypeofExpr extends Expression { expr: Expression; constructor(expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null); visitExpression(visitor: ExpressionVisitor, context: any): any; isEquivalent(e: Expression): boolean; isConstant(): boolean; clone(): TypeofExpr; } declare class WrappedNodeExpr extends Expression { node: T; constructor(node: T, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): WrappedNodeExpr; } declare class WriteVarExpr extends Expression { name: string; value: Expression; constructor(name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): WriteVarExpr; toDeclStmt(type?: Type | null, modifiers?: StmtModifier): DeclareVarStmt; toConstDecl(): DeclareVarStmt; } declare class WriteKeyExpr extends Expression { receiver: Expression; index: Expression; value: Expression; constructor(receiver: Expression, index: Expression, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): WriteKeyExpr; } declare class WritePropExpr extends Expression { receiver: Expression; name: string; value: Expression; constructor(receiver: Expression, name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): WritePropExpr; } declare class InvokeFunctionExpr extends Expression { fn: Expression; args: Expression[]; pure: boolean; constructor(fn: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, pure?: boolean); get receiver(): Expression; isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): InvokeFunctionExpr; } declare class TaggedTemplateLiteralExpr extends Expression { tag: Expression; template: TemplateLiteralExpr; constructor(tag: Expression, template: TemplateLiteralExpr, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): TaggedTemplateLiteralExpr; } declare class InstantiateExpr extends Expression { classExpr: Expression; args: Expression[]; constructor(classExpr: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): InstantiateExpr; } declare class LiteralExpr extends Expression { value: number | string | boolean | null | undefined; constructor(value: number | string | boolean | null | undefined, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): LiteralExpr; } declare class TemplateLiteralExpr extends Expression { elements: TemplateLiteralElementExpr[]; expressions: Expression[]; constructor(elements: TemplateLiteralElementExpr[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): TemplateLiteralExpr; } declare class TemplateLiteralElementExpr extends Expression { text: string; rawText: string; constructor(text: string, sourceSpan?: ParseSourceSpan | null, rawText?: string); visitExpression(visitor: ExpressionVisitor, context: any): any; isEquivalent(e: Expression): boolean; isConstant(): boolean; clone(): TemplateLiteralElementExpr; } declare class LiteralPiece { text: string; sourceSpan: ParseSourceSpan; constructor(text: string, sourceSpan: ParseSourceSpan); } declare class PlaceholderPiece { text: string; sourceSpan: ParseSourceSpan; associatedMessage?: Message | undefined; /** * Create a new instance of a `PlaceholderPiece`. * * @param text the name of this placeholder (e.g. `PH_1`). * @param sourceSpan the location of this placeholder in its localized message the source code. * @param associatedMessage reference to another message that this placeholder is associated with. * The `associatedMessage` is mainly used to provide a relationship to an ICU message that has * been extracted out from the message containing the placeholder. */ constructor(text: string, sourceSpan: ParseSourceSpan, associatedMessage?: Message | undefined); } type MessagePiece = LiteralPiece | PlaceholderPiece; declare class LocalizedString extends Expression { readonly metaBlock: I18nMeta; readonly messageParts: LiteralPiece[]; readonly placeHolderNames: PlaceholderPiece[]; readonly expressions: Expression[]; constructor(metaBlock: I18nMeta, messageParts: LiteralPiece[], placeHolderNames: PlaceholderPiece[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): LocalizedString; /** * Serialize the given `meta` and `messagePart` into "cooked" and "raw" strings that can be used * in a `$localize` tagged string. The format of the metadata is the same as that parsed by * `parseI18nMeta()`. * * @param meta The metadata to serialize * @param messagePart The first part of the tagged string */ serializeI18nHead(): CookedRawString; getMessagePartSourceSpan(i: number): ParseSourceSpan | null; getPlaceholderSourceSpan(i: number): ParseSourceSpan; /** * Serialize the given `placeholderName` and `messagePart` into "cooked" and "raw" strings that * can be used in a `$localize` tagged string. * * The format is `:[@@]:`. * * The `associated-id` is the message id of the (usually an ICU) message to which this placeholder * refers. * * @param partIndex The index of the message part to serialize. */ serializeI18nTemplatePart(partIndex: number): CookedRawString; } /** * A structure to hold the cooked and raw strings of a template literal element, along with its * source-span range. */ interface CookedRawString { cooked: string; raw: string; range: ParseSourceSpan | null; } declare class ExternalExpr extends Expression { value: ExternalReference; typeParams: Type[] | null; constructor(value: ExternalReference, type?: Type | null, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): ExternalExpr; } declare class ExternalReference { moduleName: string | null; name: string | null; constructor(moduleName: string | null, name: string | null); } declare class ConditionalExpr extends Expression { condition: Expression; falseCase: Expression | null; trueCase: Expression; constructor(condition: Expression, trueCase: Expression, falseCase?: Expression | null, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): ConditionalExpr; } declare class DynamicImportExpr extends Expression { url: string | Expression; urlComment?: string | undefined; constructor(url: string | Expression, sourceSpan?: ParseSourceSpan | null, urlComment?: string | undefined); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): DynamicImportExpr; } declare class NotExpr extends Expression { condition: Expression; constructor(condition: Expression, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): NotExpr; } declare class FnParam { name: string; type: Type | null; constructor(name: string, type?: Type | null); isEquivalent(param: FnParam): boolean; clone(): FnParam; } declare class FunctionExpr extends Expression { params: FnParam[]; statements: Statement[]; name?: string | null | undefined; constructor(params: FnParam[], statements: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null | undefined); isEquivalent(e: Expression | Statement): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; toDeclStmt(name: string, modifiers?: StmtModifier): DeclareFunctionStmt; clone(): FunctionExpr; } declare class ArrowFunctionExpr extends Expression { params: FnParam[]; body: Expression | Statement[]; constructor(params: FnParam[], body: Expression | Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): Expression; toDeclStmt(name: string, modifiers?: StmtModifier): DeclareVarStmt; } declare class UnaryOperatorExpr extends Expression { operator: UnaryOperator; expr: Expression; parens: boolean; constructor(operator: UnaryOperator, expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): UnaryOperatorExpr; } declare class BinaryOperatorExpr extends Expression { operator: BinaryOperator; rhs: Expression; parens: boolean; lhs: Expression; constructor(operator: BinaryOperator, lhs: Expression, rhs: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): BinaryOperatorExpr; } declare class ReadPropExpr extends Expression { receiver: Expression; name: string; constructor(receiver: Expression, name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null); get index(): string; isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; set(value: Expression): WritePropExpr; clone(): ReadPropExpr; } declare class ReadKeyExpr extends Expression { receiver: Expression; index: Expression; constructor(receiver: Expression, index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; set(value: Expression): WriteKeyExpr; clone(): ReadKeyExpr; } declare class LiteralArrayExpr extends Expression { entries: Expression[]; constructor(entries: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null); isConstant(): boolean; isEquivalent(e: Expression): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): LiteralArrayExpr; } declare class LiteralMapEntry { key: string; value: Expression; quoted: boolean; constructor(key: string, value: Expression, quoted: boolean); isEquivalent(e: LiteralMapEntry): boolean; clone(): LiteralMapEntry; } declare class LiteralMapExpr extends Expression { entries: LiteralMapEntry[]; valueType: Type | null; constructor(entries: LiteralMapEntry[], type?: MapType | null, sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): LiteralMapExpr; } declare class CommaExpr extends Expression { parts: Expression[]; constructor(parts: Expression[], sourceSpan?: ParseSourceSpan | null); isEquivalent(e: Expression): boolean; isConstant(): boolean; visitExpression(visitor: ExpressionVisitor, context: any): any; clone(): CommaExpr; } interface ExpressionVisitor { visitReadVarExpr(ast: ReadVarExpr, context: any): any; visitWriteVarExpr(expr: WriteVarExpr, context: any): any; visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any; visitWritePropExpr(expr: WritePropExpr, context: any): any; visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any; visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any; visitTemplateLiteralExpr(ast: TemplateLiteralExpr, context: any): any; visitTemplateLiteralElementExpr(ast: TemplateLiteralElementExpr, context: any): any; visitInstantiateExpr(ast: InstantiateExpr, context: any): any; visitLiteralExpr(ast: LiteralExpr, context: any): any; visitLocalizedString(ast: LocalizedString, context: any): any; visitExternalExpr(ast: ExternalExpr, context: any): any; visitConditionalExpr(ast: ConditionalExpr, context: any): any; visitDynamicImportExpr(ast: DynamicImportExpr, context: any): any; visitNotExpr(ast: NotExpr, context: any): any; visitFunctionExpr(ast: FunctionExpr, context: any): any; visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any; visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any; visitReadPropExpr(ast: ReadPropExpr, context: any): any; visitReadKeyExpr(ast: ReadKeyExpr, context: any): any; visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any; visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any; visitCommaExpr(ast: CommaExpr, context: any): any; visitWrappedNodeExpr(ast: WrappedNodeExpr, context: any): any; visitTypeofExpr(ast: TypeofExpr, context: any): any; visitArrowFunctionExpr(ast: ArrowFunctionExpr, context: any): any; } declare const NULL_EXPR: LiteralExpr; declare const TYPED_NULL_EXPR: LiteralExpr; declare enum StmtModifier { None = 0, Final = 1, Private = 2, Exported = 4, Static = 8 } declare class LeadingComment { text: string; multiline: boolean; trailingNewline: boolean; constructor(text: string, multiline: boolean, trailingNewline: boolean); toString(): string; } declare class JSDocComment extends LeadingComment { tags: JSDocTag[]; constructor(tags: JSDocTag[]); toString(): string; } declare abstract class Statement { modifiers: StmtModifier; sourceSpan: ParseSourceSpan | null; leadingComments?: LeadingComment[] | undefined; constructor(modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[] | undefined); /** * Calculates whether this statement produces the same value as the given statement. * Note: We don't check Types nor ParseSourceSpans nor function arguments. */ abstract isEquivalent(stmt: Statement): boolean; abstract visitStatement(visitor: StatementVisitor, context: any): any; hasModifier(modifier: StmtModifier): boolean; addLeadingComment(leadingComment: LeadingComment): void; } declare class DeclareVarStmt extends Statement { name: string; value?: Expression | undefined; type: Type | null; constructor(name: string, value?: Expression | undefined, type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]); isEquivalent(stmt: Statement): boolean; visitStatement(visitor: StatementVisitor, context: any): any; } declare class DeclareFunctionStmt extends Statement { name: string; params: FnParam[]; statements: Statement[]; type: Type | null; constructor(name: string, params: FnParam[], statements: Statement[], type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]); isEquivalent(stmt: Statement): boolean; visitStatement(visitor: StatementVisitor, context: any): any; } declare class ExpressionStatement extends Statement { expr: Expression; constructor(expr: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]); isEquivalent(stmt: Statement): boolean; visitStatement(visitor: StatementVisitor, context: any): any; } declare class ReturnStatement extends Statement { value: Expression; constructor(value: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]); isEquivalent(stmt: Statement): boolean; visitStatement(visitor: StatementVisitor, context: any): any; } declare class IfStmt extends Statement { condition: Expression; trueCase: Statement[]; falseCase: Statement[]; constructor(condition: Expression, trueCase: Statement[], falseCase?: Statement[], sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]); isEquivalent(stmt: Statement): boolean; visitStatement(visitor: StatementVisitor, context: any): any; } interface StatementVisitor { visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any; visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any; visitExpressionStmt(stmt: ExpressionStatement, context: any): any; visitReturnStmt(stmt: ReturnStatement, context: any): any; visitIfStmt(stmt: IfStmt, context: any): any; } declare class RecursiveAstVisitor$1 implements StatementVisitor, ExpressionVisitor { visitType(ast: Type, context: any): any; visitExpression(ast: Expression, context: any): any; visitBuiltinType(type: BuiltinType, context: any): any; visitExpressionType(type: ExpressionType, context: any): any; visitArrayType(type: ArrayType, context: any): any; visitMapType(type: MapType, context: any): any; visitTransplantedType(type: TransplantedType, context: any): any; visitWrappedNodeExpr(ast: WrappedNodeExpr, context: any): any; visitTypeofExpr(ast: TypeofExpr, context: any): any; visitReadVarExpr(ast: ReadVarExpr, context: any): any; visitWriteVarExpr(ast: WriteVarExpr, context: any): any; visitWriteKeyExpr(ast: WriteKeyExpr, context: any): any; visitWritePropExpr(ast: WritePropExpr, context: any): any; visitDynamicImportExpr(ast: DynamicImportExpr, context: any): any; visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any; visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any; visitInstantiateExpr(ast: InstantiateExpr, context: any): any; visitLiteralExpr(ast: LiteralExpr, context: any): any; visitLocalizedString(ast: LocalizedString, context: any): any; visitExternalExpr(ast: ExternalExpr, context: any): any; visitConditionalExpr(ast: ConditionalExpr, context: any): any; visitNotExpr(ast: NotExpr, context: any): any; visitFunctionExpr(ast: FunctionExpr, context: any): any; visitArrowFunctionExpr(ast: ArrowFunctionExpr, context: any): any; visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any; visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any; visitReadPropExpr(ast: ReadPropExpr, context: any): any; visitReadKeyExpr(ast: ReadKeyExpr, context: any): any; visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any; visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any; visitCommaExpr(ast: CommaExpr, context: any): any; visitTemplateLiteralExpr(ast: TemplateLiteralExpr, context: any): any; visitTemplateLiteralElementExpr(ast: TemplateLiteralElementExpr, context: any): any; visitAllExpressions(exprs: Expression[], context: any): void; visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any; visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any; visitExpressionStmt(stmt: ExpressionStatement, context: any): any; visitReturnStmt(stmt: ReturnStatement, context: any): any; visitIfStmt(stmt: IfStmt, context: any): any; visitAllStatements(stmts: Statement[], context: any): void; } declare function leadingComment(text: string, multiline?: boolean, trailingNewline?: boolean): LeadingComment; declare function jsDocComment(tags?: JSDocTag[]): JSDocComment; declare function variable(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadVarExpr; declare function importExpr(id: ExternalReference, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null): ExternalExpr; declare function importType(id: ExternalReference, typeParams?: Type[] | null, typeModifiers?: TypeModifier): ExpressionType | null; declare function expressionType(expr: Expression, typeModifiers?: TypeModifier, typeParams?: Type[] | null): ExpressionType; declare function transplantedType(type: T, typeModifiers?: TypeModifier): TransplantedType; declare function typeofExpr(expr: Expression): TypeofExpr; declare function literalArr(values: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralArrayExpr; declare function literalMap(values: { key: string; quoted: boolean; value: Expression; }[], type?: MapType | null): LiteralMapExpr; declare function unary(operator: UnaryOperator, expr: Expression, type?: Type, sourceSpan?: ParseSourceSpan | null): UnaryOperatorExpr; declare function not(expr: Expression, sourceSpan?: ParseSourceSpan | null): NotExpr; declare function fn(params: FnParam[], body: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null): FunctionExpr; declare function arrowFn(params: FnParam[], body: Expression | Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): ArrowFunctionExpr; declare function ifStmt(condition: Expression, thenClause: Statement[], elseClause?: Statement[], sourceSpan?: ParseSourceSpan, leadingComments?: LeadingComment[]): IfStmt; declare function taggedTemplate(tag: Expression, template: TemplateLiteralExpr, type?: Type | null, sourceSpan?: ParseSourceSpan | null): TaggedTemplateLiteralExpr; declare function literal(value: any, type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralExpr; declare function localizedString(metaBlock: I18nMeta, messageParts: LiteralPiece[], placeholderNames: PlaceholderPiece[], expressions: Expression[], sourceSpan?: ParseSourceSpan | null): LocalizedString; declare function isNull(exp: Expression): boolean; declare const enum JSDocTagName { Desc = "desc", Id = "id", Meaning = "meaning", Suppress = "suppress" } type JSDocTag = { tagName: JSDocTagName | string; text?: string; } | { tagName?: undefined; text: string; }; type output_ast_d_ArrayType = ArrayType; declare const output_ast_d_ArrayType: typeof ArrayType; type output_ast_d_ArrowFunctionExpr = ArrowFunctionExpr; declare const output_ast_d_ArrowFunctionExpr: typeof ArrowFunctionExpr; declare const output_ast_d_BOOL_TYPE: typeof BOOL_TYPE; type output_ast_d_BinaryOperator = BinaryOperator; declare const output_ast_d_BinaryOperator: typeof BinaryOperator; type output_ast_d_BinaryOperatorExpr = BinaryOperatorExpr; declare const output_ast_d_BinaryOperatorExpr: typeof BinaryOperatorExpr; type output_ast_d_BuiltinType = BuiltinType; declare const output_ast_d_BuiltinType: typeof BuiltinType; type output_ast_d_BuiltinTypeName = BuiltinTypeName; declare const output_ast_d_BuiltinTypeName: typeof BuiltinTypeName; type output_ast_d_CommaExpr = CommaExpr; declare const output_ast_d_CommaExpr: typeof CommaExpr; type output_ast_d_ConditionalExpr = ConditionalExpr; declare const output_ast_d_ConditionalExpr: typeof ConditionalExpr; type output_ast_d_CookedRawString = CookedRawString; declare const output_ast_d_DYNAMIC_TYPE: typeof DYNAMIC_TYPE; type output_ast_d_DeclareFunctionStmt = DeclareFunctionStmt; declare const output_ast_d_DeclareFunctionStmt: typeof DeclareFunctionStmt; type output_ast_d_DeclareVarStmt = DeclareVarStmt; declare const output_ast_d_DeclareVarStmt: typeof DeclareVarStmt; type output_ast_d_DynamicImportExpr = DynamicImportExpr; declare const output_ast_d_DynamicImportExpr: typeof DynamicImportExpr; type output_ast_d_Expression = Expression; declare const output_ast_d_Expression: typeof Expression; type output_ast_d_ExpressionStatement = ExpressionStatement; declare const output_ast_d_ExpressionStatement: typeof ExpressionStatement; type output_ast_d_ExpressionType = ExpressionType; declare const output_ast_d_ExpressionType: typeof ExpressionType; type output_ast_d_ExpressionVisitor = ExpressionVisitor; type output_ast_d_ExternalExpr = ExternalExpr; declare const output_ast_d_ExternalExpr: typeof ExternalExpr; type output_ast_d_ExternalReference = ExternalReference; declare const output_ast_d_ExternalReference: typeof ExternalReference; declare const output_ast_d_FUNCTION_TYPE: typeof FUNCTION_TYPE; type output_ast_d_FnParam = FnParam; declare const output_ast_d_FnParam: typeof FnParam; type output_ast_d_FunctionExpr = FunctionExpr; declare const output_ast_d_FunctionExpr: typeof FunctionExpr; declare const output_ast_d_INFERRED_TYPE: typeof INFERRED_TYPE; declare const output_ast_d_INT_TYPE: typeof INT_TYPE; type output_ast_d_IfStmt = IfStmt; declare const output_ast_d_IfStmt: typeof IfStmt; type output_ast_d_InstantiateExpr = InstantiateExpr; declare const output_ast_d_InstantiateExpr: typeof InstantiateExpr; type output_ast_d_InvokeFunctionExpr = InvokeFunctionExpr; declare const output_ast_d_InvokeFunctionExpr: typeof InvokeFunctionExpr; type output_ast_d_JSDocComment = JSDocComment; declare const output_ast_d_JSDocComment: typeof JSDocComment; type output_ast_d_JSDocTag = JSDocTag; type output_ast_d_JSDocTagName = JSDocTagName; declare const output_ast_d_JSDocTagName: typeof JSDocTagName; type output_ast_d_LeadingComment = LeadingComment; declare const output_ast_d_LeadingComment: typeof LeadingComment; type output_ast_d_LiteralArrayExpr = LiteralArrayExpr; declare const output_ast_d_LiteralArrayExpr: typeof LiteralArrayExpr; type output_ast_d_LiteralExpr = LiteralExpr; declare const output_ast_d_LiteralExpr: typeof LiteralExpr; type output_ast_d_LiteralMapEntry = LiteralMapEntry; declare const output_ast_d_LiteralMapEntry: typeof LiteralMapEntry; type output_ast_d_LiteralMapExpr = LiteralMapExpr; declare const output_ast_d_LiteralMapExpr: typeof LiteralMapExpr; type output_ast_d_LiteralPiece = LiteralPiece; declare const output_ast_d_LiteralPiece: typeof LiteralPiece; type output_ast_d_LocalizedString = LocalizedString; declare const output_ast_d_LocalizedString: typeof LocalizedString; type output_ast_d_MapType = MapType; declare const output_ast_d_MapType: typeof MapType; type output_ast_d_MessagePiece = MessagePiece; declare const output_ast_d_NONE_TYPE: typeof NONE_TYPE; declare const output_ast_d_NULL_EXPR: typeof NULL_EXPR; declare const output_ast_d_NUMBER_TYPE: typeof NUMBER_TYPE; type output_ast_d_NotExpr = NotExpr; declare const output_ast_d_NotExpr: typeof NotExpr; type output_ast_d_PlaceholderPiece = PlaceholderPiece; declare const output_ast_d_PlaceholderPiece: typeof PlaceholderPiece; type output_ast_d_ReadKeyExpr = ReadKeyExpr; declare const output_ast_d_ReadKeyExpr: typeof ReadKeyExpr; type output_ast_d_ReadPropExpr = ReadPropExpr; declare const output_ast_d_ReadPropExpr: typeof ReadPropExpr; type output_ast_d_ReadVarExpr = ReadVarExpr; declare const output_ast_d_ReadVarExpr: typeof ReadVarExpr; type output_ast_d_ReturnStatement = ReturnStatement; declare const output_ast_d_ReturnStatement: typeof ReturnStatement; declare const output_ast_d_STRING_TYPE: typeof STRING_TYPE; type output_ast_d_Statement = Statement; declare const output_ast_d_Statement: typeof Statement; type output_ast_d_StatementVisitor = StatementVisitor; type output_ast_d_StmtModifier = StmtModifier; declare const output_ast_d_StmtModifier: typeof StmtModifier; declare const output_ast_d_TYPED_NULL_EXPR: typeof TYPED_NULL_EXPR; type output_ast_d_TaggedTemplateLiteralExpr = TaggedTemplateLiteralExpr; declare const output_ast_d_TaggedTemplateLiteralExpr: typeof TaggedTemplateLiteralExpr; type output_ast_d_TemplateLiteralElementExpr = TemplateLiteralElementExpr; declare const output_ast_d_TemplateLiteralElementExpr: typeof TemplateLiteralElementExpr; type output_ast_d_TemplateLiteralExpr = TemplateLiteralExpr; declare const output_ast_d_TemplateLiteralExpr: typeof TemplateLiteralExpr; type output_ast_d_TransplantedType = TransplantedType; declare const output_ast_d_TransplantedType: typeof TransplantedType; type output_ast_d_Type = Type; declare const output_ast_d_Type: typeof Type; type output_ast_d_TypeModifier = TypeModifier; declare const output_ast_d_TypeModifier: typeof TypeModifier; type output_ast_d_TypeVisitor = TypeVisitor; type output_ast_d_TypeofExpr = TypeofExpr; declare const output_ast_d_TypeofExpr: typeof TypeofExpr; type output_ast_d_UnaryOperator = UnaryOperator; declare const output_ast_d_UnaryOperator: typeof UnaryOperator; type output_ast_d_UnaryOperatorExpr = UnaryOperatorExpr; declare const output_ast_d_UnaryOperatorExpr: typeof UnaryOperatorExpr; type output_ast_d_WrappedNodeExpr = WrappedNodeExpr; declare const output_ast_d_WrappedNodeExpr: typeof WrappedNodeExpr; type output_ast_d_WriteKeyExpr = WriteKeyExpr; declare const output_ast_d_WriteKeyExpr: typeof WriteKeyExpr; type output_ast_d_WritePropExpr = WritePropExpr; declare const output_ast_d_WritePropExpr: typeof WritePropExpr; type output_ast_d_WriteVarExpr = WriteVarExpr; declare const output_ast_d_WriteVarExpr: typeof WriteVarExpr; declare const output_ast_d_areAllEquivalent: typeof areAllEquivalent; declare const output_ast_d_arrowFn: typeof arrowFn; declare const output_ast_d_expressionType: typeof expressionType; declare const output_ast_d_fn: typeof fn; declare const output_ast_d_ifStmt: typeof ifStmt; declare const output_ast_d_importExpr: typeof importExpr; declare const output_ast_d_importType: typeof importType; declare const output_ast_d_isNull: typeof isNull; declare const output_ast_d_jsDocComment: typeof jsDocComment; declare const output_ast_d_leadingComment: typeof leadingComment; declare const output_ast_d_literal: typeof literal; declare const output_ast_d_literalArr: typeof literalArr; declare const output_ast_d_literalMap: typeof literalMap; declare const output_ast_d_localizedString: typeof localizedString; declare const output_ast_d_not: typeof not; declare const output_ast_d_nullSafeIsEquivalent: typeof nullSafeIsEquivalent; declare const output_ast_d_taggedTemplate: typeof taggedTemplate; declare const output_ast_d_transplantedType: typeof transplantedType; declare const output_ast_d_typeofExpr: typeof typeofExpr; declare const output_ast_d_unary: typeof unary; declare const output_ast_d_variable: typeof variable; declare namespace output_ast_d { export { output_ast_d_ArrayType as ArrayType, output_ast_d_ArrowFunctionExpr as ArrowFunctionExpr, output_ast_d_BOOL_TYPE as BOOL_TYPE, output_ast_d_BinaryOperator as BinaryOperator, output_ast_d_BinaryOperatorExpr as BinaryOperatorExpr, output_ast_d_BuiltinType as BuiltinType, output_ast_d_BuiltinTypeName as BuiltinTypeName, output_ast_d_CommaExpr as CommaExpr, output_ast_d_ConditionalExpr as ConditionalExpr, type output_ast_d_CookedRawString as CookedRawString, output_ast_d_DYNAMIC_TYPE as DYNAMIC_TYPE, output_ast_d_DeclareFunctionStmt as DeclareFunctionStmt, output_ast_d_DeclareVarStmt as DeclareVarStmt, output_ast_d_DynamicImportExpr as DynamicImportExpr, output_ast_d_Expression as Expression, output_ast_d_ExpressionStatement as ExpressionStatement, output_ast_d_ExpressionType as ExpressionType, type output_ast_d_ExpressionVisitor as ExpressionVisitor, output_ast_d_ExternalExpr as ExternalExpr, output_ast_d_ExternalReference as ExternalReference, output_ast_d_FUNCTION_TYPE as FUNCTION_TYPE, output_ast_d_FnParam as FnParam, output_ast_d_FunctionExpr as FunctionExpr, output_ast_d_INFERRED_TYPE as INFERRED_TYPE, output_ast_d_INT_TYPE as INT_TYPE, output_ast_d_IfStmt as IfStmt, output_ast_d_InstantiateExpr as InstantiateExpr, output_ast_d_InvokeFunctionExpr as InvokeFunctionExpr, output_ast_d_JSDocComment as JSDocComment, type output_ast_d_JSDocTag as JSDocTag, output_ast_d_JSDocTagName as JSDocTagName, output_ast_d_LeadingComment as LeadingComment, output_ast_d_LiteralArrayExpr as LiteralArrayExpr, output_ast_d_LiteralExpr as LiteralExpr, output_ast_d_LiteralMapEntry as LiteralMapEntry, output_ast_d_LiteralMapExpr as LiteralMapExpr, output_ast_d_LiteralPiece as LiteralPiece, output_ast_d_LocalizedString as LocalizedString, output_ast_d_MapType as MapType, type output_ast_d_MessagePiece as MessagePiece, output_ast_d_NONE_TYPE as NONE_TYPE, output_ast_d_NULL_EXPR as NULL_EXPR, output_ast_d_NUMBER_TYPE as NUMBER_TYPE, output_ast_d_NotExpr as NotExpr, output_ast_d_PlaceholderPiece as PlaceholderPiece, output_ast_d_ReadKeyExpr as ReadKeyExpr, output_ast_d_ReadPropExpr as ReadPropExpr, output_ast_d_ReadVarExpr as ReadVarExpr, RecursiveAstVisitor$1 as RecursiveAstVisitor, output_ast_d_ReturnStatement as ReturnStatement, output_ast_d_STRING_TYPE as STRING_TYPE, output_ast_d_Statement as Statement, type output_ast_d_StatementVisitor as StatementVisitor, output_ast_d_StmtModifier as StmtModifier, output_ast_d_TYPED_NULL_EXPR as TYPED_NULL_EXPR, output_ast_d_TaggedTemplateLiteralExpr as TaggedTemplateLiteralExpr, output_ast_d_TemplateLiteralElementExpr as TemplateLiteralElementExpr, output_ast_d_TemplateLiteralExpr as TemplateLiteralExpr, output_ast_d_TransplantedType as TransplantedType, output_ast_d_Type as Type, output_ast_d_TypeModifier as TypeModifier, type output_ast_d_TypeVisitor as TypeVisitor, output_ast_d_TypeofExpr as TypeofExpr, output_ast_d_UnaryOperator as UnaryOperator, output_ast_d_UnaryOperatorExpr as UnaryOperatorExpr, output_ast_d_WrappedNodeExpr as WrappedNodeExpr, output_ast_d_WriteKeyExpr as WriteKeyExpr, output_ast_d_WritePropExpr as WritePropExpr, output_ast_d_WriteVarExpr as WriteVarExpr, output_ast_d_areAllEquivalent as areAllEquivalent, output_ast_d_arrowFn as arrowFn, output_ast_d_expressionType as expressionType, output_ast_d_fn as fn, output_ast_d_ifStmt as ifStmt, output_ast_d_importExpr as importExpr, output_ast_d_importType as importType, output_ast_d_isNull as isNull, output_ast_d_jsDocComment as jsDocComment, output_ast_d_leadingComment as leadingComment, output_ast_d_literal as literal, output_ast_d_literalArr as literalArr, output_ast_d_literalMap as literalMap, output_ast_d_localizedString as localizedString, output_ast_d_not as not, output_ast_d_nullSafeIsEquivalent as nullSafeIsEquivalent, output_ast_d_taggedTemplate as taggedTemplate, output_ast_d_transplantedType as transplantedType, output_ast_d_typeofExpr as typeofExpr, output_ast_d_unary as unary, output_ast_d_variable as variable }; } /** * A constant pool allows a code emitter to share constant in an output context. * * The constant pool also supports sharing access to ivy definitions references. */ declare class ConstantPool { private readonly isClosureCompilerEnabled; statements: Statement[]; private literals; private literalFactories; private sharedConstants; /** * Constant pool also tracks claimed names from {@link uniqueName}. * This is useful to avoid collisions if variables are intended to be * named a certain way- but may conflict. We wouldn't want to always suffix * them with unique numbers. */ private _claimedNames; private nextNameIndex; constructor(isClosureCompilerEnabled?: boolean); getConstLiteral(literal: Expression, forceShared?: boolean): Expression; getSharedConstant(def: SharedConstantDefinition, expr: Expression): Expression; getLiteralFactory(literal: LiteralArrayExpr | LiteralMapExpr): { literalFactory: Expression; literalFactoryArguments: Expression[]; }; getSharedFunctionReference(fn: Expression, prefix: string, useUniqueName?: boolean): Expression; private _getLiteralFactory; /** * Produce a unique name in the context of this pool. * * The name might be unique among different prefixes if any of the prefixes end in * a digit so the prefix should be a constant string (not based on user input) and * must not end in a digit. */ uniqueName(name: string, alwaysIncludeSuffix?: boolean): string; private freshName; } interface ExpressionKeyFn { keyOf(expr: Expression): string; } interface SharedConstantDefinition extends ExpressionKeyFn { toSharedConstantDeclaration(declName: string, keyExpr: Expression): Statement; } declare abstract class ElementSchemaRegistry { abstract hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean; abstract hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean; abstract securityContext(elementName: string, propName: string, isAttribute: boolean): SecurityContext; abstract allKnownElementNames(): string[]; abstract getMappedPropName(propName: string): string; abstract getDefaultComponentElementName(): string; abstract validateProperty(name: string): { error: boolean; msg?: string; }; abstract validateAttribute(name: string): { error: boolean; msg?: string; }; abstract normalizeAnimationStyleProperty(propName: string): string; abstract normalizeAnimationStyleValue(camelCaseProp: string, userProvidedProp: string, val: string | number): { error: string; value: string; }; } declare function computeMsgId(msg: string, meaning?: string): string; declare class HtmlParser extends Parser$1 { constructor(); parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult; } declare class I18NHtmlParser implements HtmlParser { private _htmlParser; getTagDefinition: any; private _translationBundle; constructor(_htmlParser: HtmlParser, translations?: string, translationsFormat?: string, missingTranslation?: MissingTranslationStrategy, console?: Console); parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult; } declare abstract class Serializer { abstract write(messages: Message[], locale: string | null): string; abstract load(content: string, url: string): { locale: string | null; i18nNodesByMsgId: { [msgId: string]: Node$2[]; }; }; abstract digest(message: Message): string; createNameMapper(message: Message): PlaceholderMapper | null; } /** * A `PlaceholderMapper` converts placeholder names from internal to serialized representation and * back. * * It should be used for serialization format that put constraints on the placeholder names. */ interface PlaceholderMapper { toPublicName(internalName: string): string | null; toInternalName(publicName: string): string | null; } /** * A container for message extracted from the templates. */ declare class MessageBundle { private _htmlParser; private _implicitTags; private _implicitAttrs; private _locale; private readonly _preserveWhitespace; private _messages; constructor(_htmlParser: HtmlParser, _implicitTags: string[], _implicitAttrs: { [k: string]: string[]; }, _locale?: string | null, _preserveWhitespace?: boolean); updateFromTemplate(source: string, url: string, interpolationConfig: InterpolationConfig): ParseError[]; getMessages(): Message[]; write(serializer: Serializer, filterSources?: (path: string) => string): string; } declare class Xliff extends Serializer { write(messages: Message[], locale: string | null): string; load(content: string, url: string): { locale: string; i18nNodesByMsgId: { [msgId: string]: Node$2[]; }; }; digest(message: Message): string; } declare class Xliff2 extends Serializer { write(messages: Message[], locale: string | null): string; load(content: string, url: string): { locale: string; i18nNodesByMsgId: { [msgId: string]: Node$2[]; }; }; digest(message: Message): string; } declare class Xmb extends Serializer { write(messages: Message[], locale: string | null): string; load(content: string, url: string): { locale: string; i18nNodesByMsgId: { [msgId: string]: Node$2[]; }; }; digest(message: Message): string; createNameMapper(message: Message): PlaceholderMapper; } declare class Xtb extends Serializer { write(messages: Message[], locale: string | null): string; load(content: string, url: string): { locale: string; i18nNodesByMsgId: { [msgId: string]: Node$2[]; }; }; digest(message: Message): string; createNameMapper(message: Message): PlaceholderMapper; } declare class ParserError { input: string; errLocation: string; ctxLocation?: any | undefined; message: string; constructor(message: string, input: string, errLocation: string, ctxLocation?: any | undefined); } declare class ParseSpan { start: number; end: number; constructor(start: number, end: number); toAbsolute(absoluteOffset: number): AbsoluteSourceSpan; } declare abstract class AST { span: ParseSpan; /** * Absolute location of the expression AST in a source code file. */ sourceSpan: AbsoluteSourceSpan; constructor(span: ParseSpan, /** * Absolute location of the expression AST in a source code file. */ sourceSpan: AbsoluteSourceSpan); abstract visit(visitor: AstVisitor, context?: any): any; toString(): string; } declare abstract class ASTWithName extends AST { nameSpan: AbsoluteSourceSpan; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan); } declare class EmptyExpr extends AST { visit(visitor: AstVisitor, context?: any): void; } declare class ImplicitReceiver extends AST { visit(visitor: AstVisitor, context?: any): any; } /** * Receiver when something is accessed through `this` (e.g. `this.foo`). Note that this class * inherits from `ImplicitReceiver`, because accessing something through `this` is treated the * same as accessing it implicitly inside of an Angular template (e.g. `[attr.title]="this.title"` * is the same as `[attr.title]="title"`.). Inheriting allows for the `this` accesses to be treated * the same as implicit ones, except for a couple of exceptions like `$event` and `$any`. * TODO: we should find a way for this class not to extend from `ImplicitReceiver` in the future. */ declare class ThisReceiver extends ImplicitReceiver { visit(visitor: AstVisitor, context?: any): any; } /** * Multiple expressions separated by a semicolon. */ declare class Chain extends AST { expressions: any[]; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expressions: any[]); visit(visitor: AstVisitor, context?: any): any; } declare class Conditional extends AST { condition: AST; trueExp: AST; falseExp: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, condition: AST, trueExp: AST, falseExp: AST); visit(visitor: AstVisitor, context?: any): any; } declare class PropertyRead extends ASTWithName { receiver: AST; name: string; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan, receiver: AST, name: string); visit(visitor: AstVisitor, context?: any): any; } declare class PropertyWrite extends ASTWithName { receiver: AST; name: string; value: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan, receiver: AST, name: string, value: AST); visit(visitor: AstVisitor, context?: any): any; } declare class SafePropertyRead extends ASTWithName { receiver: AST; name: string; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, nameSpan: AbsoluteSourceSpan, receiver: AST, name: string); visit(visitor: AstVisitor, context?: any): any; } declare class KeyedRead extends AST { receiver: AST; key: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, key: AST); visit(visitor: AstVisitor, context?: any): any; } declare class SafeKeyedRead extends AST { receiver: AST; key: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, key: AST); visit(visitor: AstVisitor, context?: any): any; } declare class KeyedWrite extends AST { receiver: AST; key: AST; value: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, key: AST, value: AST); visit(visitor: AstVisitor, context?: any): any; } declare class BindingPipe extends ASTWithName { exp: AST; name: string; args: any[]; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, exp: AST, name: string, args: any[], nameSpan: AbsoluteSourceSpan); visit(visitor: AstVisitor, context?: any): any; } declare class LiteralPrimitive extends AST { value: any; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, value: any); visit(visitor: AstVisitor, context?: any): any; } declare class LiteralArray extends AST { expressions: any[]; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expressions: any[]); visit(visitor: AstVisitor, context?: any): any; } type LiteralMapKey = { key: string; quoted: boolean; isShorthandInitialized?: boolean; }; declare class LiteralMap extends AST { keys: LiteralMapKey[]; values: any[]; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, keys: LiteralMapKey[], values: any[]); visit(visitor: AstVisitor, context?: any): any; } declare class Interpolation extends AST { strings: string[]; expressions: AST[]; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, strings: string[], expressions: AST[]); visit(visitor: AstVisitor, context?: any): any; } declare class Binary extends AST { operation: string; left: AST; right: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, operation: string, left: AST, right: AST); visit(visitor: AstVisitor, context?: any): any; } /** * For backwards compatibility reasons, `Unary` inherits from `Binary` and mimics the binary AST * node that was originally used. This inheritance relation can be deleted in some future major, * after consumers have been given a chance to fully support Unary. */ declare class Unary extends Binary { operator: string; expr: AST; left: never; right: never; operation: never; /** * Creates a unary minus expression "-x", represented as `Binary` using "0 - x". */ static createMinus(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expr: AST): Unary; /** * Creates a unary plus expression "+x", represented as `Binary` using "x - 0". */ static createPlus(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expr: AST): Unary; /** * During the deprecation period this constructor is private, to avoid consumers from creating * a `Unary` with the fallback properties for `Binary`. */ private constructor(); visit(visitor: AstVisitor, context?: any): any; } declare class PrefixNot extends AST { expression: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expression: AST); visit(visitor: AstVisitor, context?: any): any; } declare class TypeofExpression extends AST { expression: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expression: AST); visit(visitor: AstVisitor, context?: any): any; } declare class NonNullAssert extends AST { expression: AST; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, expression: AST); visit(visitor: AstVisitor, context?: any): any; } declare class Call extends AST { receiver: AST; args: AST[]; argumentSpan: AbsoluteSourceSpan; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, args: AST[], argumentSpan: AbsoluteSourceSpan); visit(visitor: AstVisitor, context?: any): any; } declare class SafeCall extends AST { receiver: AST; args: AST[]; argumentSpan: AbsoluteSourceSpan; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, receiver: AST, args: AST[], argumentSpan: AbsoluteSourceSpan); visit(visitor: AstVisitor, context?: any): any; } declare class TemplateLiteral extends AST { elements: TemplateLiteralElement[]; expressions: AST[]; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, elements: TemplateLiteralElement[], expressions: AST[]); visit(visitor: AstVisitor, context?: any): any; } declare class TemplateLiteralElement extends AST { text: string; constructor(span: ParseSpan, sourceSpan: AbsoluteSourceSpan, text: string); visit(visitor: AstVisitor, context?: any): any; } /** * Records the absolute position of a text span in a source file, where `start` and `end` are the * starting and ending byte offsets, respectively, of the text span in a source file. */ declare class AbsoluteSourceSpan { readonly start: number; readonly end: number; constructor(start: number, end: number); } declare class ASTWithSource extends AST { ast: T; source: string | null; location: string; errors: ParserError[]; constructor(ast: T, source: string | null, location: string, absoluteOffset: number, errors: ParserError[]); visit(visitor: AstVisitor, context?: any): any; toString(): string; } /** * TemplateBinding refers to a particular key-value pair in a microsyntax * expression. A few examples are: * * |---------------------|--------------|---------|--------------| * | expression | key | value | binding type | * |---------------------|--------------|---------|--------------| * | 1. let item | item | null | variable | * | 2. of items | ngForOf | items | expression | * | 3. let x = y | x | y | variable | * | 4. index as i | i | index | variable | * | 5. trackBy: func | ngForTrackBy | func | expression | * | 6. *ngIf="cond" | ngIf | cond | expression | * |---------------------|--------------|---------|--------------| * * (6) is a notable exception because it is a binding from the template key in * the LHS of a HTML attribute to the expression in the RHS. All other bindings * in the example above are derived solely from the RHS. */ type TemplateBinding = VariableBinding | ExpressionBinding; declare class VariableBinding { readonly sourceSpan: AbsoluteSourceSpan; readonly key: TemplateBindingIdentifier; readonly value: TemplateBindingIdentifier | null; /** * @param sourceSpan entire span of the binding. * @param key name of the LHS along with its span. * @param value optional value for the RHS along with its span. */ constructor(sourceSpan: AbsoluteSourceSpan, key: TemplateBindingIdentifier, value: TemplateBindingIdentifier | null); } declare class ExpressionBinding { readonly sourceSpan: AbsoluteSourceSpan; readonly key: TemplateBindingIdentifier; readonly value: ASTWithSource | null; /** * @param sourceSpan entire span of the binding. * @param key binding name, like ngForOf, ngForTrackBy, ngIf, along with its * span. Note that the length of the span may not be the same as * `key.source.length`. For example, * 1. key.source = ngFor, key.span is for "ngFor" * 2. key.source = ngForOf, key.span is for "of" * 3. key.source = ngForTrackBy, key.span is for "trackBy" * @param value optional expression for the RHS. */ constructor(sourceSpan: AbsoluteSourceSpan, key: TemplateBindingIdentifier, value: ASTWithSource | null); } interface TemplateBindingIdentifier { source: string; span: AbsoluteSourceSpan; } interface AstVisitor { /** * The `visitUnary` method is declared as optional for backwards compatibility. In an upcoming * major release, this method will be made required. */ visitUnary?(ast: Unary, context: any): any; visitBinary(ast: Binary, context: any): any; visitChain(ast: Chain, context: any): any; visitConditional(ast: Conditional, context: any): any; /** * The `visitThisReceiver` method is declared as optional for backwards compatibility. * In an upcoming major release, this method will be made required. */ visitThisReceiver?(ast: ThisReceiver, context: any): any; visitImplicitReceiver(ast: ImplicitReceiver, context: any): any; visitInterpolation(ast: Interpolation, context: any): any; visitKeyedRead(ast: KeyedRead, context: any): any; visitKeyedWrite(ast: KeyedWrite, context: any): any; visitLiteralArray(ast: LiteralArray, context: any): any; visitLiteralMap(ast: LiteralMap, context: any): any; visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any; visitPipe(ast: BindingPipe, context: any): any; visitPrefixNot(ast: PrefixNot, context: any): any; visitTypeofExpression(ast: TypeofExpression, context: any): any; visitNonNullAssert(ast: NonNullAssert, context: any): any; visitPropertyRead(ast: PropertyRead, context: any): any; visitPropertyWrite(ast: PropertyWrite, context: any): any; visitSafePropertyRead(ast: SafePropertyRead, context: any): any; visitSafeKeyedRead(ast: SafeKeyedRead, context: any): any; visitCall(ast: Call, context: any): any; visitSafeCall(ast: SafeCall, context: any): any; visitTemplateLiteral(ast: TemplateLiteral, context: any): any; visitTemplateLiteralElement(ast: TemplateLiteralElement, context: any): any; visitASTWithSource?(ast: ASTWithSource, context: any): any; /** * This function is optionally defined to allow classes that implement this * interface to selectively decide if the specified `ast` should be visited. * @param ast node to visit * @param context context that gets passed to the node and all its children */ visit?(ast: AST, context?: any): any; } declare class RecursiveAstVisitor implements AstVisitor { visit(ast: AST, context?: any): any; visitUnary(ast: Unary, context: any): any; visitBinary(ast: Binary, context: any): any; visitChain(ast: Chain, context: any): any; visitConditional(ast: Conditional, context: any): any; visitPipe(ast: BindingPipe, context: any): any; visitImplicitReceiver(ast: ThisReceiver, context: any): any; visitThisReceiver(ast: ThisReceiver, context: any): any; visitInterpolation(ast: Interpolation, context: any): any; visitKeyedRead(ast: KeyedRead, context: any): any; visitKeyedWrite(ast: KeyedWrite, context: any): any; visitLiteralArray(ast: LiteralArray, context: any): any; visitLiteralMap(ast: LiteralMap, context: any): any; visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any; visitPrefixNot(ast: PrefixNot, context: any): any; visitTypeofExpression(ast: TypeofExpression, context: any): void; visitNonNullAssert(ast: NonNullAssert, context: any): any; visitPropertyRead(ast: PropertyRead, context: any): any; visitPropertyWrite(ast: PropertyWrite, context: any): any; visitSafePropertyRead(ast: SafePropertyRead, context: any): any; visitSafeKeyedRead(ast: SafeKeyedRead, context: any): any; visitCall(ast: Call, context: any): any; visitSafeCall(ast: SafeCall, context: any): any; visitTemplateLiteral(ast: TemplateLiteral, context: any): void; visitTemplateLiteralElement(ast: TemplateLiteralElement, context: any): void; visitAll(asts: AST[], context: any): any; } declare class ParsedProperty { name: string; expression: ASTWithSource; type: ParsedPropertyType; sourceSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan; valueSpan: ParseSourceSpan | undefined; readonly isLiteral: boolean; readonly isAnimation: boolean; constructor(name: string, expression: ASTWithSource, type: ParsedPropertyType, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined); } declare enum ParsedPropertyType { DEFAULT = 0, LITERAL_ATTR = 1, ANIMATION = 2, TWO_WAY = 3 } declare enum ParsedEventType { Regular = 0, Animation = 1, TwoWay = 2 } declare class ParsedEvent { name: string; targetOrPhase: string; type: ParsedEventType; handler: ASTWithSource; sourceSpan: ParseSourceSpan; handlerSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan; constructor(name: string, targetOrPhase: string, type: ParsedEventType.TwoWay, handler: ASTWithSource, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, keySpan: ParseSourceSpan); constructor(name: string, targetOrPhase: string, type: ParsedEventType, handler: ASTWithSource, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, keySpan: ParseSourceSpan); } /** * ParsedVariable represents a variable declaration in a microsyntax expression. */ declare class ParsedVariable { readonly name: string; readonly value: string; readonly sourceSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan; readonly valueSpan?: ParseSourceSpan | undefined; constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined); } declare enum BindingType { Property = 0, Attribute = 1, Class = 2, Style = 3, Animation = 4, TwoWay = 5 } declare class BoundElementProperty { name: string; type: BindingType; securityContext: SecurityContext; value: ASTWithSource; unit: string | null; sourceSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan | undefined; valueSpan: ParseSourceSpan | undefined; constructor(name: string, type: BindingType, securityContext: SecurityContext, value: ASTWithSource, unit: string | null, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan: ParseSourceSpan | undefined); } declare enum TokenType { Character = 0, Identifier = 1, PrivateIdentifier = 2, Keyword = 3, String = 4, Operator = 5, Number = 6, Error = 7 } declare enum StringTokenKind { Plain = 0, TemplateLiteralPart = 1, TemplateLiteralEnd = 2 } declare class Lexer { tokenize(text: string): Token[]; } declare class Token { index: number; end: number; type: TokenType; numValue: number; strValue: string; constructor(index: number, end: number, type: TokenType, numValue: number, strValue: string); isCharacter(code: number): boolean; isNumber(): boolean; isString(): this is StringToken; isOperator(operator: string): boolean; isIdentifier(): boolean; isPrivateIdentifier(): boolean; isKeyword(): boolean; isKeywordLet(): boolean; isKeywordAs(): boolean; isKeywordNull(): boolean; isKeywordUndefined(): boolean; isKeywordTrue(): boolean; isKeywordFalse(): boolean; isKeywordThis(): boolean; isKeywordTypeof(): boolean; isError(): boolean; toNumber(): number; isTemplateLiteralPart(): this is StringToken; isTemplateLiteralEnd(): this is StringToken; isTemplateLiteralInterpolationStart(): boolean; isTemplateLiteralInterpolationEnd(): boolean; toString(): string | null; } declare class StringToken extends Token { readonly kind: StringTokenKind; constructor(index: number, end: number, strValue: string, kind: StringTokenKind); } declare const EOF: Token; interface InterpolationPiece { text: string; start: number; end: number; } declare class SplitInterpolation { strings: InterpolationPiece[]; expressions: InterpolationPiece[]; offsets: number[]; constructor(strings: InterpolationPiece[], expressions: InterpolationPiece[], offsets: number[]); } declare class TemplateBindingParseResult { templateBindings: TemplateBinding[]; warnings: string[]; errors: ParserError[]; constructor(templateBindings: TemplateBinding[], warnings: string[], errors: ParserError[]); } /** * Represents the possible parse modes to be used as a bitmask. */ declare const enum ParseFlags { None = 0, /** * Whether an output binding is being parsed. */ Action = 1 } declare class Parser { private _lexer; private errors; constructor(_lexer: Lexer); parseAction(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource; parseBinding(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource; private checkSimpleExpression; parseSimpleBinding(input: string, location: string, absoluteOffset: number, interpolationConfig?: InterpolationConfig): ASTWithSource; private _reportError; private _parseBindingAst; /** * Parse microsyntax template expression and return a list of bindings or * parsing errors in case the given expression is invalid. * * For example, * ```html *
* ^ ^ absoluteValueOffset for `templateValue` * absoluteKeyOffset for `templateKey` * ``` * contains three bindings: * 1. ngFor -> null * 2. item -> NgForOfContext.$implicit * 3. ngForOf -> items * * This is apparent from the de-sugared template: * ```html * * ``` * * @param templateKey name of directive, without the * prefix. For example: ngIf, ngFor * @param templateValue RHS of the microsyntax attribute * @param templateUrl template filename if it's external, component filename if it's inline * @param absoluteKeyOffset start of the `templateKey` * @param absoluteValueOffset start of the `templateValue` */ parseTemplateBindings(templateKey: string, templateValue: string, templateUrl: string, absoluteKeyOffset: number, absoluteValueOffset: number): TemplateBindingParseResult; parseInterpolation(input: string, location: string, absoluteOffset: number, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): ASTWithSource | null; /** * Similar to `parseInterpolation`, but treats the provided string as a single expression * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`). * This is used for parsing the switch expression in ICUs. */ parseInterpolationExpression(expression: string, location: string, absoluteOffset: number): ASTWithSource; private createInterpolationAst; /** * Splits a string of text into "raw" text segments and expressions present in interpolations in * the string. * Returns `null` if there are no interpolations, otherwise a * `SplitInterpolation` with splits that look like * ... */ splitInterpolation(input: string, location: string, interpolatedTokens: InterpolatedAttributeToken[] | InterpolatedTextToken[] | null, interpolationConfig?: InterpolationConfig): SplitInterpolation; wrapLiteralPrimitive(input: string | null, location: string, absoluteOffset: number): ASTWithSource; private _stripComments; private _commentStart; private _checkNoInterpolation; /** * Finds the index of the end of an interpolation expression * while ignoring comments and quoted content. */ private _getInterpolationEndIndex; /** * Generator used to iterate over the character indexes of a string that are outside of quotes. * @param input String to loop through. * @param start Index within the string at which to start. */ private _forEachUnquotedChar; } declare class HtmlTagDefinition implements TagDefinition { private closedByChildren; private contentType; closedByParent: boolean; implicitNamespacePrefix: string | null; isVoid: boolean; ignoreFirstLf: boolean; canSelfClose: boolean; preventNamespaceInheritance: boolean; constructor({ closedByChildren, implicitNamespacePrefix, contentType, closedByParent, isVoid, ignoreFirstLf, preventNamespaceInheritance, canSelfClose, }?: { closedByChildren?: string[]; closedByParent?: boolean; implicitNamespacePrefix?: string; contentType?: TagContentType | { default: TagContentType; [namespace: string]: TagContentType; }; isVoid?: boolean; ignoreFirstLf?: boolean; preventNamespaceInheritance?: boolean; canSelfClose?: boolean; }); isClosedByChild(name: string): boolean; getContentType(prefix?: string): TagContentType; } declare function getHtmlTagDefinition(tagName: string): HtmlTagDefinition; declare class XmlParser extends Parser$1 { constructor(); parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult; } type SourceMap = { version: number; file?: string; sourceRoot: string; sources: string[]; sourcesContent: (string | null)[]; mappings: string; }; declare class SourceMapGenerator { private file; private sourcesContent; private lines; private lastCol0; private hasMappings; constructor(file?: string | null); addSource(url: string, content?: string | null): this; addLine(): this; addMapping(col0: number, sourceUrl?: string, sourceLine0?: number, sourceCol0?: number): this; toJSON(): SourceMap | null; toJsComment(): string; } declare class EmitterVisitorContext { private _indent; static createRoot(): EmitterVisitorContext; private _lines; constructor(_indent: number); println(from?: { sourceSpan: ParseSourceSpan | null; } | null, lastPart?: string): void; lineIsEmpty(): boolean; lineLength(): number; print(from: { sourceSpan: ParseSourceSpan | null; } | null, part: string, newLine?: boolean): void; removeEmptyLastLine(): void; incIndent(): void; decIndent(): void; toSource(): string; toSourceMapGenerator(genFilePath: string, startsAtLine?: number): SourceMapGenerator; spanOf(line: number, column: number): ParseSourceSpan | null; } interface ExternalReferenceResolver { resolveExternalReference(ref: ExternalReference): unknown; } /** * A helper class to manage the evaluation of JIT generated code. */ declare class JitEvaluator { /** * * @param sourceUrl The URL of the generated code. * @param statements An array of Angular statement AST nodes to be evaluated. * @param refResolver Resolves `o.ExternalReference`s into values. * @param createSourceMaps If true then create a source-map for the generated code and include it * inline as a source-map comment. * @returns A map of all the variables in the generated code. */ evaluateStatements(sourceUrl: string, statements: Statement[], refResolver: ExternalReferenceResolver, createSourceMaps: boolean): { [key: string]: any; }; /** * Evaluate a piece of JIT generated code. * @param sourceUrl The URL of this generated code. * @param ctx A context object that contains an AST of the code to be evaluated. * @param vars A map containing the names and values of variables that the evaluated code might * reference. * @param createSourceMap If true then create a source-map for the generated code and include it * inline as a source-map comment. * @returns The result of evaluating the code. */ evaluateCode(sourceUrl: string, ctx: EmitterVisitorContext, vars: { [key: string]: any; }, createSourceMap: boolean): any; /** * Execute a JIT generated function by calling it. * * This method can be overridden in tests to capture the functions that are generated * by this `JitEvaluator` class. * * @param fn A function to execute. * @param args The arguments to pass to the function being executed. * @returns The return value of the executed function. */ executeFunction(fn: Function, args: any[]): any; } declare class DomElementSchemaRegistry extends ElementSchemaRegistry { private _schema; private _eventSchema; constructor(); hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean; hasElement(tagName: string, schemaMetas: SchemaMetadata[]): boolean; /** * securityContext returns the security context for the given property on the given DOM tag. * * Tag and property name are statically known and cannot change at runtime, i.e. it is not * possible to bind a value into a changing attribute or tag name. * * The filtering is based on a list of allowed tags|attributes. All attributes in the schema * above are assumed to have the 'NONE' security context, i.e. that they are safe inert * string values. Only specific well known attack vectors are assigned their appropriate context. */ securityContext(tagName: string, propName: string, isAttribute: boolean): SecurityContext; getMappedPropName(propName: string): string; getDefaultComponentElementName(): string; validateProperty(name: string): { error: boolean; msg?: string; }; validateAttribute(name: string): { error: boolean; msg?: string; }; allKnownElementNames(): string[]; allKnownAttributesOfElement(tagName: string): string[]; allKnownEventsOfElement(tagName: string): string[]; normalizeAnimationStyleProperty(propName: string): string; normalizeAnimationStyleValue(camelCaseProp: string, userProvidedProp: string, val: string | number): { error: string; value: string; }; } /** * A css selector contains an element name, * css classes and attribute/value pairs with the purpose * of selecting subsets out of them. */ declare class CssSelector { element: string | null; classNames: string[]; /** * The selectors are encoded in pairs where: * - even locations are attribute names * - odd locations are attribute values. * * Example: * Selector: `[key1=value1][key2]` would parse to: * ``` * ['key1', 'value1', 'key2', ''] * ``` */ attrs: string[]; notSelectors: CssSelector[]; static parse(selector: string): CssSelector[]; /** * Unescape `\$` sequences from the CSS attribute selector. * * This is needed because `$` can have a special meaning in CSS selectors, * but we might want to match an attribute that contains `$`. * [MDN web link for more * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors). * @param attr the attribute to unescape. * @returns the unescaped string. */ unescapeAttribute(attr: string): string; /** * Escape `$` sequences from the CSS attribute selector. * * This is needed because `$` can have a special meaning in CSS selectors, * with this method we are escaping `$` with `\$'. * [MDN web link for more * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors). * @param attr the attribute to escape. * @returns the escaped string. */ escapeAttribute(attr: string): string; isElementSelector(): boolean; hasElementSelector(): boolean; setElement(element?: string | null): void; getAttrs(): string[]; addAttribute(name: string, value?: string): void; addClassName(name: string): void; toString(): string; } /** * Reads a list of CssSelectors and allows to calculate which ones * are contained in a given CssSelector. */ declare class SelectorMatcher { static createNotMatcher(notSelectors: CssSelector[]): SelectorMatcher; private _elementMap; private _elementPartialMap; private _classMap; private _classPartialMap; private _attrValueMap; private _attrValuePartialMap; private _listContexts; addSelectables(cssSelectors: CssSelector[], callbackCtxt?: T): void; /** * Add an object that can be found later on by calling `match`. * @param cssSelector A css selector * @param callbackCtxt An opaque object that will be given to the callback of the `match` function */ private _addSelectable; private _addTerminal; private _addPartial; /** * Find the objects that have been added via `addSelectable` * whose css selector is contained in the given css selector. * @param cssSelector A css selector * @param matchedCallback This callback will be called with the object handed into `addSelectable` * @return boolean true if a match was found */ match(cssSelector: CssSelector, matchedCallback: ((c: CssSelector, a: T) => void) | null): boolean; } declare class SelectorListContext { selectors: CssSelector[]; alreadyMatched: boolean; constructor(selectors: CssSelector[]); } declare class SelectorContext { selector: CssSelector; cbContext: T; listContext: SelectorListContext; notSelectors: CssSelector[]; constructor(selector: CssSelector, cbContext: T, listContext: SelectorListContext); finalize(cssSelector: CssSelector, callback: ((c: CssSelector, a: T) => void) | null): boolean; } interface R3Reference { value: Expression; type: Expression; } /** * Result of compilation of a render3 code unit, e.g. component, directive, pipe, etc. */ interface R3CompiledExpression { expression: Expression; type: Type; statements: Statement[]; } declare function getSafePropertyAccessString(accessor: string, name: string): string; declare function devOnlyGuardedExpression(expr: Expression): Expression; /** * Describes an expression that may have been wrapped in a `forwardRef()` guard. * * This is used when describing expressions that can refer to types that may eagerly reference types * that have not yet been defined. */ interface MaybeForwardRefExpression { /** * The unwrapped expression. */ expression: T; /** * Specified whether the `expression` contains a reference to something that has not yet been * defined, and whether the expression is still wrapped in a `forwardRef()` call. * * If this value is `ForwardRefHandling.None` then the `expression` is safe to use as-is. * * Otherwise the `expression` was wrapped in a call to `forwardRef()` and must not be eagerly * evaluated. Instead it must be wrapped in a function closure that will be evaluated lazily to * allow the definition of the expression to be evaluated first. * * In full AOT compilation it can be safe to unwrap the `forwardRef()` call up front if the * expression will actually be evaluated lazily inside a function call after the value of * `expression` has been defined. * * But in other cases, such as partial AOT compilation or JIT compilation the expression will be * evaluated eagerly in top level code so will need to continue to be wrapped in a `forwardRef()` * call. * */ forwardRef: ForwardRefHandling; } declare function createMayBeForwardRefExpression(expression: T, forwardRef: ForwardRefHandling): MaybeForwardRefExpression; /** * Specifies how a forward ref has been handled in a MaybeForwardRefExpression */ declare const enum ForwardRefHandling { /** The expression was not wrapped in a `forwardRef()` call in the first place. */ None = 0, /** The expression is still wrapped in a `forwardRef()` call. */ Wrapped = 1, /** The expression was wrapped in a `forwardRef()` call but has since been unwrapped. */ Unwrapped = 2 } /** * Metadata required by the factory generator to generate a `factory` function for a type. */ interface R3ConstructorFactoryMetadata { /** * String name of the type being generated (used to name the factory function). */ name: string; /** * An expression representing the interface type being constructed. */ type: R3Reference; /** Number of arguments for the `type`. */ typeArgumentCount: number; /** * Regardless of whether `fnOrClass` is a constructor function or a user-defined factory, it * may have 0 or more parameters, which will be injected according to the `R3DependencyMetadata` * for those parameters. If this is `null`, then the type's constructor is nonexistent and will * be inherited from `fnOrClass` which is interpreted as the current type. If this is `'invalid'`, * then one or more of the parameters wasn't resolvable and any attempt to use these deps will * result in a runtime error. */ deps: R3DependencyMetadata[] | 'invalid' | null; /** * Type of the target being created by the factory. */ target: FactoryTarget$1; } declare enum R3FactoryDelegateType { Class = 0, Function = 1 } interface R3DelegatedFnOrClassMetadata extends R3ConstructorFactoryMetadata { delegate: Expression; delegateType: R3FactoryDelegateType; delegateDeps: R3DependencyMetadata[]; } interface R3ExpressionFactoryMetadata extends R3ConstructorFactoryMetadata { expression: Expression; } type R3FactoryMetadata = R3ConstructorFactoryMetadata | R3DelegatedFnOrClassMetadata | R3ExpressionFactoryMetadata; declare enum FactoryTarget$1 { Directive = 0, Component = 1, Injectable = 2, Pipe = 3, NgModule = 4 } interface R3DependencyMetadata { /** * An expression representing the token or value to be injected. * Or `null` if the dependency could not be resolved - making it invalid. */ token: Expression | null; /** * If an @Attribute decorator is present, this is the literal type of the attribute name, or * the unknown type if no literal type is available (e.g. the attribute name is an expression). * Otherwise it is null; */ attributeNameType: Expression | null; /** * Whether the dependency has an @Host qualifier. */ host: boolean; /** * Whether the dependency has an @Optional qualifier. */ optional: boolean; /** * Whether the dependency has an @Self qualifier. */ self: boolean; /** * Whether the dependency has an @SkipSelf qualifier. */ skipSelf: boolean; } /** * Construct a factory function expression for the given `R3FactoryMetadata`. */ declare function compileFactoryFunction(meta: R3FactoryMetadata): R3CompiledExpression; interface R3InjectableMetadata { name: string; type: R3Reference; typeArgumentCount: number; providedIn: MaybeForwardRefExpression; useClass?: MaybeForwardRefExpression; useFactory?: Expression; useExisting?: MaybeForwardRefExpression; useValue?: MaybeForwardRefExpression; deps?: R3DependencyMetadata[]; } declare function compileInjectable(meta: R3InjectableMetadata, resolveForwardRefs: boolean): R3CompiledExpression; declare function createInjectableType(meta: R3InjectableMetadata): ExpressionType; interface R3PartialDeclaration { /** * The minimum version of the compiler that can process this partial declaration. */ minVersion: string; /** * Version number of the Angular compiler that was used to compile this declaration. The linker * will be able to detect which version a library is using and interpret its metadata accordingly. */ version: string; /** * A reference to the `@angular/core` ES module, which allows access * to all Angular exports, including Ivy instructions. */ ngImport: Expression; /** * Reference to the decorated class, which is subject to this partial declaration. */ type: Expression; } type LegacyInputPartialMapping = string | [bindingPropertyName: string, classPropertyName: string, transformFunction?: Expression]; /** * Describes the shape of the object that the `ɵɵngDeclareDirective()` function accepts. */ interface R3DeclareDirectiveMetadata extends R3PartialDeclaration { /** * Unparsed selector of the directive. */ selector?: string; /** * A mapping of inputs from class property names to binding property names, or to a tuple of * binding property name and class property name if the names are different. */ inputs?: { [fieldName: string]: { classPropertyName: string; publicName: string; isSignal: boolean; isRequired: boolean; transformFunction: Expression | null; } | LegacyInputPartialMapping; }; /** * A mapping of outputs from class property names to binding property names. */ outputs?: { [classPropertyName: string]: string; }; /** * Information about host bindings present on the component. */ host?: { /** * A mapping of attribute names to their value expression. */ attributes?: { [key: string]: Expression; }; /** * A mapping of event names to their unparsed event handler expression. */ listeners: { [key: string]: string; }; /** * A mapping of bound properties to their unparsed binding expression. */ properties?: { [key: string]: string; }; /** * The value of the class attribute, if present. This is stored outside of `attributes` as its * string value must be known statically. */ classAttribute?: string; /** * The value of the style attribute, if present. This is stored outside of `attributes` as its * string value must be known statically. */ styleAttribute?: string; }; /** * Information about the content queries made by the directive. */ queries?: R3DeclareQueryMetadata[]; /** * Information about the view queries made by the directive. */ viewQueries?: R3DeclareQueryMetadata[]; /** * The list of providers provided by the directive. */ providers?: Expression; /** * The names by which the directive is exported. */ exportAs?: string[]; /** * Whether the directive has an inheritance clause. Defaults to false. */ usesInheritance?: boolean; /** * Whether the directive implements the `ngOnChanges` hook. Defaults to false. */ usesOnChanges?: boolean; /** * Whether the directive is standalone. Defaults to false. */ isStandalone?: boolean; /** * Whether the directive is a signal-based directive. Defaults to false. */ isSignal?: boolean; /** * Additional directives applied to the directive host. */ hostDirectives?: R3DeclareHostDirectiveMetadata[]; } /** * Describes the shape of the object that the `ɵɵngDeclareComponent()` function accepts. */ interface R3DeclareComponentMetadata extends R3DeclareDirectiveMetadata { /** * The component's unparsed template string as opaque expression. The template is represented * using either a string literal or template literal without substitutions, but its value is * not read directly. Instead, the template parser is given the full source file's text and * the range of this expression to parse directly from source. */ template: Expression; /** * Whether the template was inline (using `template`) or external (using `templateUrl`). * Defaults to false. */ isInline?: boolean; /** * CSS from inline styles and included styleUrls. */ styles?: string[]; /** * List of components which matched in the template, including sufficient * metadata for each directive to attribute bindings and references within * the template to each directive specifically, if the runtime instructions * support this. */ components?: R3DeclareDirectiveDependencyMetadata[]; /** * List of directives which matched in the template, including sufficient * metadata for each directive to attribute bindings and references within * the template to each directive specifically, if the runtime instructions * support this. */ directives?: R3DeclareDirectiveDependencyMetadata[]; /** * List of dependencies which matched in the template, including sufficient * metadata for each directive/pipe to attribute bindings and references within * the template to each directive specifically, if the runtime instructions * support this. */ dependencies?: R3DeclareTemplateDependencyMetadata[]; /** * List of defer block dependency functions, ordered by the appearance * of the corresponding deferred block in the template. */ deferBlockDependencies?: Expression[]; /** * A map of pipe names to an expression referencing the pipe type (possibly a forward reference * wrapped in a `forwardRef` invocation) which are used in the template. */ pipes?: { [pipeName: string]: Expression | (() => Expression); }; /** * The list of view providers defined in the component. */ viewProviders?: Expression; /** * A collection of animation triggers that will be used in the component template. */ animations?: Expression; /** * Strategy used for detecting changes in the component. * Defaults to `ChangeDetectionStrategy.Default`. */ changeDetection?: ChangeDetectionStrategy; /** * An encapsulation policy for the component's styling. * Defaults to `ViewEncapsulation.Emulated`. */ encapsulation?: ViewEncapsulation; /** * Overrides the default interpolation start and end delimiters. Defaults to {{ and }}. */ interpolation?: [string, string]; /** * Whether whitespace in the template should be preserved. Defaults to false. */ preserveWhitespaces?: boolean; } type R3DeclareTemplateDependencyMetadata = R3DeclareDirectiveDependencyMetadata | R3DeclarePipeDependencyMetadata | R3DeclareNgModuleDependencyMetadata; interface R3DeclareDirectiveDependencyMetadata { kind: 'directive' | 'component'; /** * Selector of the directive. */ selector: string; /** * Reference to the directive class (possibly a forward reference wrapped in a `forwardRef` * invocation). */ type: Expression | (() => Expression); /** * Property names of the directive's inputs. */ inputs?: string[]; /** * Event names of the directive's outputs. */ outputs?: string[]; /** * Names by which this directive exports itself for references. */ exportAs?: string[]; } interface R3DeclarePipeDependencyMetadata { kind: 'pipe'; name: string; /** * Reference to the pipe class (possibly a forward reference wrapped in a `forwardRef` * invocation). */ type: Expression | (() => Expression); } interface R3DeclareNgModuleDependencyMetadata { kind: 'ngmodule'; type: Expression | (() => Expression); } interface R3DeclareQueryMetadata { /** * Name of the property on the class to update with query results. */ propertyName: string; /** * Whether to read only the first matching result, or an array of results. Defaults to false. */ first?: boolean; /** * Either an expression representing a type (possibly wrapped in a `forwardRef()`) or * `InjectionToken` for the query predicate, or a set of string selectors. */ predicate: Expression | string[]; /** * Whether to include only direct children or all descendants. Defaults to false. */ descendants?: boolean; /** * True to only fire changes if there are underlying changes to the query. */ emitDistinctChangesOnly?: boolean; /** * An expression representing a type to read from each matched node, or null if the default value * for a given node is to be returned. */ read?: Expression; /** * Whether or not this query should collect only static results. Defaults to false. * * If static is true, the query's results will be set on the component after nodes are created, * but before change detection runs. This means that any results that relied upon change detection * to run (e.g. results inside *ngIf or *ngFor views) will not be collected. Query results are * available in the ngOnInit hook. * * If static is false, the query's results will be set on the component after change detection * runs. This means that the query results can contain nodes inside *ngIf or *ngFor views, but * the results will not be available in the ngOnInit hook (only in the ngAfterContentInit for * content hooks and ngAfterViewInit for view hooks). */ static?: boolean; /** Whether the query is signal-based. */ isSignal: boolean; } /** * Describes the shape of the objects that the `ɵɵngDeclareNgModule()` accepts. */ interface R3DeclareNgModuleMetadata extends R3PartialDeclaration { /** * An array of expressions representing the bootstrap components specified by the module. */ bootstrap?: Expression[]; /** * An array of expressions representing the directives and pipes declared by the module. */ declarations?: Expression[]; /** * An array of expressions representing the imports of the module. */ imports?: Expression[]; /** * An array of expressions representing the exports of the module. */ exports?: Expression[]; /** * The set of schemas that declare elements to be allowed in the NgModule. */ schemas?: Expression[]; /** Unique ID or expression representing the unique ID of an NgModule. */ id?: Expression; } /** * Describes the shape of the objects that the `ɵɵngDeclareInjector()` accepts. */ interface R3DeclareInjectorMetadata extends R3PartialDeclaration { /** * The list of providers provided by the injector. */ providers?: Expression; /** * The list of imports into the injector. */ imports?: Expression[]; } /** * Describes the shape of the object that the `ɵɵngDeclarePipe()` function accepts. * * This interface serves primarily as documentation, as conformance to this interface is not * enforced during linking. */ interface R3DeclarePipeMetadata extends R3PartialDeclaration { /** * The name to use in templates to refer to this pipe. */ name: string; /** * Whether this pipe is "pure". * * A pure pipe's `transform()` method is only invoked when its input arguments change. * * Default: true. */ pure?: boolean; /** * Whether the pipe is standalone. * * Default: false. */ isStandalone?: boolean; } /** * Describes the shape of the object that the `ɵɵngDeclareFactory()` function accepts. * * This interface serves primarily as documentation, as conformance to this interface is not * enforced during linking. */ interface R3DeclareFactoryMetadata extends R3PartialDeclaration { /** * A collection of dependencies that this factory relies upon. * * If this is `null`, then the type's constructor is nonexistent and will be inherited from an * ancestor of the type. * * If this is `'invalid'`, then one or more of the parameters wasn't resolvable and any attempt to * use these deps will result in a runtime error. */ deps: R3DeclareDependencyMetadata[] | 'invalid' | null; /** * Type of the target being created by the factory. */ target: FactoryTarget; } declare enum FactoryTarget { Directive = 0, Component = 1, Injectable = 2, Pipe = 3, NgModule = 4 } /** * Describes the shape of the object that the `ɵɵngDeclareInjectable()` function accepts. * * This interface serves primarily as documentation, as conformance to this interface is not * enforced during linking. */ interface R3DeclareInjectableMetadata extends R3PartialDeclaration { /** * If provided, specifies that the declared injectable belongs to a particular injector: * - `InjectorType` such as `NgModule`, * - `'root'` the root injector * - `'any'` all injectors. * If not provided, then it does not belong to any injector. Must be explicitly listed in the * providers of an injector. */ providedIn?: Expression; /** * If provided, an expression that evaluates to a class to use when creating an instance of this * injectable. */ useClass?: Expression; /** * If provided, an expression that evaluates to a function to use when creating an instance of * this injectable. */ useFactory?: Expression; /** * If provided, an expression that evaluates to a token of another injectable that this injectable * aliases. */ useExisting?: Expression; /** * If provided, an expression that evaluates to the value of the instance of this injectable. */ useValue?: Expression; /** * An array of dependencies to support instantiating this injectable via `useClass` or * `useFactory`. */ deps?: R3DeclareDependencyMetadata[]; } /** * Metadata indicating how a dependency should be injected into a factory. */ interface R3DeclareDependencyMetadata { /** * An expression representing the token or value to be injected, or `null` if the dependency is * not valid. * * If this dependency is due to the `@Attribute()` decorator, then this is an expression * evaluating to the name of the attribute. */ token: Expression | null; /** * Whether the dependency is injecting an attribute value. * Default: false. */ attribute?: boolean; /** * Whether the dependency has an @Host qualifier. * Default: false, */ host?: boolean; /** * Whether the dependency has an @Optional qualifier. * Default: false, */ optional?: boolean; /** * Whether the dependency has an @Self qualifier. * Default: false, */ self?: boolean; /** * Whether the dependency has an @SkipSelf qualifier. * Default: false, */ skipSelf?: boolean; } /** * Describes the shape of the object that the `ɵɵngDeclareClassMetadata()` function accepts. * * This interface serves primarily as documentation, as conformance to this interface is not * enforced during linking. */ interface R3DeclareClassMetadata extends R3PartialDeclaration { /** * The Angular decorators of the class. */ decorators: Expression; /** * Optionally specifies the constructor parameters, their types and the Angular decorators of each * parameter. This property is omitted if the class does not have a constructor. */ ctorParameters?: Expression; /** * Optionally specifies the Angular decorators applied to the class properties. This property is * omitted if no properties have any decorators. */ propDecorators?: Expression; } /** * Describes the shape of the object that the `ɵɵngDeclareClassMetadataAsync()` function accepts. * * This interface serves primarily as documentation, as conformance to this interface is not * enforced during linking. */ interface R3DeclareClassMetadataAsync extends R3PartialDeclaration { /** Function that loads the deferred dependencies associated with the component. */ resolveDeferredDeps: Expression; /** * Function that, when invoked with the resolved deferred * dependencies, will return the class metadata. */ resolveMetadata: Expression; } /** * Describes the shape of the object literal that can be * passed in as a part of the `hostDirectives` array. */ interface R3DeclareHostDirectiveMetadata { directive: Expression; inputs?: string[]; outputs?: string[]; } interface Node { sourceSpan: ParseSourceSpan; visit(visitor: Visitor): Result; } /** * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently * require the implementation of a visitor for Comments as they are only collected at * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']` * is true. */ declare class Comment implements Node { value: string; sourceSpan: ParseSourceSpan; constructor(value: string, sourceSpan: ParseSourceSpan); visit(_visitor: Visitor): Result; } declare class Text implements Node { value: string; sourceSpan: ParseSourceSpan; constructor(value: string, sourceSpan: ParseSourceSpan); visit(visitor: Visitor): Result; } declare class BoundText implements Node { value: AST; sourceSpan: ParseSourceSpan; i18n?: I18nMeta$1 | undefined; constructor(value: AST, sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } /** * Represents a text attribute in the template. * * `valueSpan` may not be present in cases where there is no value `
`. * `keySpan` may also not be present for synthetic attributes from ICU expansions. */ declare class TextAttribute implements Node { name: string; value: string; sourceSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan | undefined; valueSpan?: ParseSourceSpan | undefined; i18n?: I18nMeta$1 | undefined; constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan | undefined, valueSpan?: ParseSourceSpan | undefined, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class BoundAttribute implements Node { name: string; type: BindingType; securityContext: SecurityContext; value: AST; unit: string | null; sourceSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan; valueSpan: ParseSourceSpan | undefined; i18n: I18nMeta$1 | undefined; constructor(name: string, type: BindingType, securityContext: SecurityContext, value: AST, unit: string | null, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan: ParseSourceSpan | undefined, i18n: I18nMeta$1 | undefined); static fromBoundElementProperty(prop: BoundElementProperty, i18n?: I18nMeta$1): BoundAttribute; visit(visitor: Visitor): Result; } declare class BoundEvent implements Node { name: string; type: ParsedEventType; handler: AST; target: string | null; phase: string | null; sourceSpan: ParseSourceSpan; handlerSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan; constructor(name: string, type: ParsedEventType, handler: AST, target: string | null, phase: string | null, sourceSpan: ParseSourceSpan, handlerSpan: ParseSourceSpan, keySpan: ParseSourceSpan); static fromParsedEvent(event: ParsedEvent): BoundEvent; visit(visitor: Visitor): Result; } declare class Element implements Node { name: string; attributes: TextAttribute[]; inputs: BoundAttribute[]; outputs: BoundEvent[]; children: Node[]; references: Reference[]; sourceSpan: ParseSourceSpan; startSourceSpan: ParseSourceSpan; endSourceSpan: ParseSourceSpan | null; i18n?: I18nMeta$1 | undefined; constructor(name: string, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], children: Node[], references: Reference[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare abstract class DeferredTrigger implements Node { nameSpan: ParseSourceSpan | null; sourceSpan: ParseSourceSpan; prefetchSpan: ParseSourceSpan | null; whenOrOnSourceSpan: ParseSourceSpan | null; hydrateSpan: ParseSourceSpan | null; constructor(nameSpan: ParseSourceSpan | null, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, whenOrOnSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null); visit(visitor: Visitor): Result; } declare class BoundDeferredTrigger extends DeferredTrigger { value: AST; constructor(value: AST, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, whenSourceSpan: ParseSourceSpan, hydrateSpan: ParseSourceSpan | null); } declare class NeverDeferredTrigger extends DeferredTrigger { } declare class IdleDeferredTrigger extends DeferredTrigger { } declare class ImmediateDeferredTrigger extends DeferredTrigger { } declare class HoverDeferredTrigger extends DeferredTrigger { reference: string | null; constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null); } declare class TimerDeferredTrigger extends DeferredTrigger { delay: number; constructor(delay: number, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null); } declare class InteractionDeferredTrigger extends DeferredTrigger { reference: string | null; constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null); } declare class ViewportDeferredTrigger extends DeferredTrigger { reference: string | null; constructor(reference: string | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, prefetchSpan: ParseSourceSpan | null, onSourceSpan: ParseSourceSpan | null, hydrateSpan: ParseSourceSpan | null); } declare class BlockNode { nameSpan: ParseSourceSpan; sourceSpan: ParseSourceSpan; startSourceSpan: ParseSourceSpan; endSourceSpan: ParseSourceSpan | null; constructor(nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null); } declare class DeferredBlockPlaceholder extends BlockNode implements Node { children: Node[]; minimumTime: number | null; i18n?: I18nMeta$1 | undefined; constructor(children: Node[], minimumTime: number | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class DeferredBlockLoading extends BlockNode implements Node { children: Node[]; afterTime: number | null; minimumTime: number | null; i18n?: I18nMeta$1 | undefined; constructor(children: Node[], afterTime: number | null, minimumTime: number | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class DeferredBlockError extends BlockNode implements Node { children: Node[]; i18n?: I18nMeta$1 | undefined; constructor(children: Node[], nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } interface DeferredBlockTriggers { when?: BoundDeferredTrigger; idle?: IdleDeferredTrigger; immediate?: ImmediateDeferredTrigger; hover?: HoverDeferredTrigger; timer?: TimerDeferredTrigger; interaction?: InteractionDeferredTrigger; viewport?: ViewportDeferredTrigger; never?: NeverDeferredTrigger; } declare class DeferredBlock extends BlockNode implements Node { children: Node[]; placeholder: DeferredBlockPlaceholder | null; loading: DeferredBlockLoading | null; error: DeferredBlockError | null; mainBlockSpan: ParseSourceSpan; i18n?: I18nMeta$1 | undefined; readonly triggers: Readonly; readonly prefetchTriggers: Readonly; readonly hydrateTriggers: Readonly; private readonly definedTriggers; private readonly definedPrefetchTriggers; private readonly definedHydrateTriggers; constructor(children: Node[], triggers: DeferredBlockTriggers, prefetchTriggers: DeferredBlockTriggers, hydrateTriggers: DeferredBlockTriggers, placeholder: DeferredBlockPlaceholder | null, loading: DeferredBlockLoading | null, error: DeferredBlockError | null, nameSpan: ParseSourceSpan, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; visitAll(visitor: Visitor): void; private visitTriggers; } declare class SwitchBlock extends BlockNode implements Node { expression: AST; cases: SwitchBlockCase[]; /** * These blocks are only captured to allow for autocompletion in the language service. They * aren't meant to be processed in any other way. */ unknownBlocks: UnknownBlock[]; constructor(expression: AST, cases: SwitchBlockCase[], /** * These blocks are only captured to allow for autocompletion in the language service. They * aren't meant to be processed in any other way. */ unknownBlocks: UnknownBlock[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan); visit(visitor: Visitor): Result; } declare class SwitchBlockCase extends BlockNode implements Node { expression: AST | null; children: Node[]; i18n?: I18nMeta$1 | undefined; constructor(expression: AST | null, children: Node[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class ForLoopBlock extends BlockNode implements Node { item: Variable; expression: ASTWithSource; trackBy: ASTWithSource; trackKeywordSpan: ParseSourceSpan; contextVariables: Variable[]; children: Node[]; empty: ForLoopBlockEmpty | null; mainBlockSpan: ParseSourceSpan; i18n?: I18nMeta$1 | undefined; constructor(item: Variable, expression: ASTWithSource, trackBy: ASTWithSource, trackKeywordSpan: ParseSourceSpan, contextVariables: Variable[], children: Node[], empty: ForLoopBlockEmpty | null, sourceSpan: ParseSourceSpan, mainBlockSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class ForLoopBlockEmpty extends BlockNode implements Node { children: Node[]; i18n?: I18nMeta$1 | undefined; constructor(children: Node[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class IfBlock extends BlockNode implements Node { branches: IfBlockBranch[]; constructor(branches: IfBlockBranch[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan); visit(visitor: Visitor): Result; } declare class IfBlockBranch extends BlockNode implements Node { expression: AST | null; children: Node[]; expressionAlias: Variable | null; i18n?: I18nMeta$1 | undefined; constructor(expression: AST | null, children: Node[], expressionAlias: Variable | null, sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, nameSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class UnknownBlock implements Node { name: string; sourceSpan: ParseSourceSpan; nameSpan: ParseSourceSpan; constructor(name: string, sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan); visit(visitor: Visitor): Result; } declare class LetDeclaration implements Node { name: string; value: AST; sourceSpan: ParseSourceSpan; nameSpan: ParseSourceSpan; valueSpan: ParseSourceSpan; constructor(name: string, value: AST, sourceSpan: ParseSourceSpan, nameSpan: ParseSourceSpan, valueSpan: ParseSourceSpan); visit(visitor: Visitor): Result; } declare class Template implements Node { tagName: string | null; attributes: TextAttribute[]; inputs: BoundAttribute[]; outputs: BoundEvent[]; templateAttrs: (BoundAttribute | TextAttribute)[]; children: Node[]; references: Reference[]; variables: Variable[]; sourceSpan: ParseSourceSpan; startSourceSpan: ParseSourceSpan; endSourceSpan: ParseSourceSpan | null; i18n?: I18nMeta$1 | undefined; constructor(tagName: string | null, attributes: TextAttribute[], inputs: BoundAttribute[], outputs: BoundEvent[], templateAttrs: (BoundAttribute | TextAttribute)[], children: Node[], references: Reference[], variables: Variable[], sourceSpan: ParseSourceSpan, startSourceSpan: ParseSourceSpan, endSourceSpan: ParseSourceSpan | null, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class Content implements Node { selector: string; attributes: TextAttribute[]; children: Node[]; sourceSpan: ParseSourceSpan; i18n?: I18nMeta$1 | undefined; readonly name = "ng-content"; constructor(selector: string, attributes: TextAttribute[], children: Node[], sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } declare class Variable implements Node { name: string; value: string; sourceSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan; valueSpan?: ParseSourceSpan | undefined; constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined); visit(visitor: Visitor): Result; } declare class Reference implements Node { name: string; value: string; sourceSpan: ParseSourceSpan; readonly keySpan: ParseSourceSpan; valueSpan?: ParseSourceSpan | undefined; constructor(name: string, value: string, sourceSpan: ParseSourceSpan, keySpan: ParseSourceSpan, valueSpan?: ParseSourceSpan | undefined); visit(visitor: Visitor): Result; } declare class Icu implements Node { vars: { [name: string]: BoundText; }; placeholders: { [name: string]: Text | BoundText; }; sourceSpan: ParseSourceSpan; i18n?: I18nMeta$1 | undefined; constructor(vars: { [name: string]: BoundText; }, placeholders: { [name: string]: Text | BoundText; }, sourceSpan: ParseSourceSpan, i18n?: I18nMeta$1 | undefined); visit(visitor: Visitor): Result; } interface Visitor { visit?(node: Node): Result; visitElement(element: Element): Result; visitTemplate(template: Template): Result; visitContent(content: Content): Result; visitVariable(variable: Variable): Result; visitReference(reference: Reference): Result; visitTextAttribute(attribute: TextAttribute): Result; visitBoundAttribute(attribute: BoundAttribute): Result; visitBoundEvent(attribute: BoundEvent): Result; visitText(text: Text): Result; visitBoundText(text: BoundText): Result; visitIcu(icu: Icu): Result; visitDeferredBlock(deferred: DeferredBlock): Result; visitDeferredBlockPlaceholder(block: DeferredBlockPlaceholder): Result; visitDeferredBlockError(block: DeferredBlockError): Result; visitDeferredBlockLoading(block: DeferredBlockLoading): Result; visitDeferredTrigger(trigger: DeferredTrigger): Result; visitSwitchBlock(block: SwitchBlock): Result; visitSwitchBlockCase(block: SwitchBlockCase): Result; visitForLoopBlock(block: ForLoopBlock): Result; visitForLoopBlockEmpty(block: ForLoopBlockEmpty): Result; visitIfBlock(block: IfBlock): Result; visitIfBlockBranch(block: IfBlockBranch): Result; visitUnknownBlock(block: UnknownBlock): Result; visitLetDeclaration(decl: LetDeclaration): Result; } declare class RecursiveVisitor implements Visitor { visitElement(element: Element): void; visitTemplate(template: Template): void; visitDeferredBlock(deferred: DeferredBlock): void; visitDeferredBlockPlaceholder(block: DeferredBlockPlaceholder): void; visitDeferredBlockError(block: DeferredBlockError): void; visitDeferredBlockLoading(block: DeferredBlockLoading): void; visitSwitchBlock(block: SwitchBlock): void; visitSwitchBlockCase(block: SwitchBlockCase): void; visitForLoopBlock(block: ForLoopBlock): void; visitForLoopBlockEmpty(block: ForLoopBlockEmpty): void; visitIfBlock(block: IfBlock): void; visitIfBlockBranch(block: IfBlockBranch): void; visitContent(content: Content): void; visitVariable(variable: Variable): void; visitReference(reference: Reference): void; visitTextAttribute(attribute: TextAttribute): void; visitBoundAttribute(attribute: BoundAttribute): void; visitBoundEvent(attribute: BoundEvent): void; visitText(text: Text): void; visitBoundText(text: BoundText): void; visitIcu(icu: Icu): void; visitDeferredTrigger(trigger: DeferredTrigger): void; visitUnknownBlock(block: UnknownBlock): void; visitLetDeclaration(decl: LetDeclaration): void; } declare function visitAll(visitor: Visitor, nodes: Node[]): Result[]; /** * Information needed to compile a directive for the render3 runtime. */ interface R3DirectiveMetadata { /** * Name of the directive type. */ name: string; /** * An expression representing a reference to the directive itself. */ type: R3Reference; /** * Number of generic type parameters of the type itself. */ typeArgumentCount: number; /** * A source span for the directive type. */ typeSourceSpan: ParseSourceSpan; /** * Dependencies of the directive's constructor. */ deps: R3DependencyMetadata[] | 'invalid' | null; /** * Unparsed selector of the directive, or `null` if there was no selector. */ selector: string | null; /** * Information about the content queries made by the directive. */ queries: R3QueryMetadata[]; /** * Information about the view queries made by the directive. */ viewQueries: R3QueryMetadata[]; /** * Mappings indicating how the directive interacts with its host element (host bindings, * listeners, etc). */ host: R3HostMetadata; /** * Information about usage of specific lifecycle events which require special treatment in the * code generator. */ lifecycle: { /** * Whether the directive uses NgOnChanges. */ usesOnChanges: boolean; }; /** * A mapping of inputs from class property names to binding property names, or to a tuple of * binding property name and class property name if the names are different. */ inputs: { [field: string]: R3InputMetadata; }; /** * A mapping of outputs from class property names to binding property names, or to a tuple of * binding property name and class property name if the names are different. */ outputs: { [field: string]: string; }; /** * Whether or not the component or directive inherits from another class */ usesInheritance: boolean; /** * Whether or not the component or directive inherits its entire decorator from its base class. */ fullInheritance: boolean; /** * Reference name under which to export the directive's type in a template, * if any. */ exportAs: string[] | null; /** * The list of providers defined in the directive. */ providers: Expression | null; /** * Whether or not the component or directive is standalone. */ isStandalone: boolean; /** * Whether or not the component or directive is signal-based. */ isSignal: boolean; /** * Additional directives applied to the directive host. */ hostDirectives: R3HostDirectiveMetadata[] | null; } /** * Defines how dynamic imports for deferred dependencies should be emitted in the * generated output: * - either in a function on per-component basis (in case of local compilation) * - or in a function on per-block basis (in full compilation mode) */ declare const enum DeferBlockDepsEmitMode { /** * Dynamic imports are grouped on per-block basis. * * This is used in full compilation mode, when compiler has more information * about particular dependencies that belong to this block. */ PerBlock = 0, /** * Dynamic imports are grouped on per-component basis. * * In local compilation, compiler doesn't have enough information to determine * which deferred dependencies belong to which block. In this case we group all * dynamic imports into a single file on per-component basis. */ PerComponent = 1 } /** * Specifies how a list of declaration type references should be emitted into the generated code. */ declare const enum DeclarationListEmitMode { /** * The list of declarations is emitted into the generated code as is. * * ```ts * directives: [MyDir], * ``` */ Direct = 0, /** * The list of declarations is emitted into the generated code wrapped inside a closure, which * is needed when at least one declaration is a forward reference. * * ```ts * directives: function () { return [MyDir, ForwardDir]; }, * ``` */ Closure = 1, /** * Similar to `Closure`, with the addition that the list of declarations can contain individual * items that are themselves forward references. This is relevant for JIT compilations, as * unwrapping the forwardRef cannot be done statically so must be deferred. This mode emits * the declaration list using a mapping transform through `resolveForwardRef` to ensure that * any forward references within the list are resolved when the outer closure is invoked. * * Consider the case where the runtime has captured two declarations in two distinct values: * ```ts * const dirA = MyDir; * const dirB = forwardRef(function() { return ForwardRef; }); * ``` * * This mode would emit the declarations captured in `dirA` and `dirB` as follows: * ```ts * directives: function () { return [dirA, dirB].map(ng.resolveForwardRef); }, * ``` */ ClosureResolved = 2, RuntimeResolved = 3 } /** * Information needed to compile a component for the render3 runtime. */ interface R3ComponentMetadata extends R3DirectiveMetadata { /** * Information about the component's template. */ template: { /** * Parsed nodes of the template. */ nodes: Node[]; /** * Any ng-content selectors extracted from the template. Contains `*` when an ng-content * element without selector is present. */ ngContentSelectors: string[]; /** * Whether the template preserves whitespaces from the user's code. */ preserveWhitespaces?: boolean; }; declarations: DeclarationT[]; /** Metadata related to the deferred blocks in the component's template. */ defer: R3ComponentDeferMetadata; /** * Specifies how the 'directives' and/or `pipes` array, if generated, need to be emitted. */ declarationListEmitMode: DeclarationListEmitMode; /** * A collection of styling data that will be applied and scoped to the component. */ styles: string[]; /** * A collection of style paths for external stylesheets that will be applied and scoped to the component. */ externalStyles?: string[]; /** * An encapsulation policy for the component's styling. * Possible values: * - `ViewEncapsulation.Emulated`: Apply modified component styles in order to emulate * a native Shadow DOM CSS encapsulation behavior. * - `ViewEncapsulation.None`: Apply component styles globally without any sort of encapsulation. * - `ViewEncapsulation.ShadowDom`: Use the browser's native Shadow DOM API to encapsulate styles. */ encapsulation: ViewEncapsulation; /** * A collection of animation triggers that will be used in the component template. */ animations: Expression | null; /** * The list of view providers defined in the component. */ viewProviders: Expression | null; /** * Path to the .ts file in which this template's generated code will be included, relative to * the compilation root. This will be used to generate identifiers that need to be globally * unique in certain contexts (such as g3). */ relativeContextFilePath: string; /** * Whether translation variable name should contain external message id * (used by Closure Compiler's output of `goog.getMsg` for transition period). */ i18nUseExternalIds: boolean; /** * Overrides the default interpolation start and end delimiters ({{ and }}). */ interpolation: InterpolationConfig; /** * Strategy used for detecting changes in the component. * * In global compilation mode the value is ChangeDetectionStrategy if available as it is * statically resolved during analysis phase. Whereas in local compilation mode the value is the * expression as appears in the decorator. */ changeDetection: ChangeDetectionStrategy | Expression | null; /** * Relative path to the component's template from the root of the project. * Used to generate debugging information. */ relativeTemplatePath: string | null; /** * The imports expression as appears on the component decorate for standalone component. This * field is currently needed only for local compilation, and so in other compilation modes it may * not be set. If component has empty array imports then this field is not set. */ rawImports?: Expression; } /** * Information about the deferred blocks in a component's template. */ type R3ComponentDeferMetadata = { mode: DeferBlockDepsEmitMode.PerBlock; blocks: Map; } | { mode: DeferBlockDepsEmitMode.PerComponent; dependenciesFn: Expression | null; }; /** * Metadata for an individual input on a directive. */ interface R3InputMetadata { classPropertyName: string; bindingPropertyName: string; required: boolean; isSignal: boolean; /** * Transform function for the input. * * Null if there is no transform, or if this is a signal input. * Signal inputs capture their transform as part of the `InputSignal`. */ transformFunction: Expression | null; } declare enum R3TemplateDependencyKind { Directive = 0, Pipe = 1, NgModule = 2 } /** * A dependency that's used within a component template. */ interface R3TemplateDependency { kind: R3TemplateDependencyKind; /** * The type of the dependency as an expression. */ type: Expression; } /** * A dependency that's used within a component template */ type R3TemplateDependencyMetadata = R3DirectiveDependencyMetadata | R3PipeDependencyMetadata | R3NgModuleDependencyMetadata; /** * Information about a directive that is used in a component template. Only the stable, public * facing information of the directive is stored here. */ interface R3DirectiveDependencyMetadata extends R3TemplateDependency { kind: R3TemplateDependencyKind.Directive; /** * The selector of the directive. */ selector: string; /** * The binding property names of the inputs of the directive. */ inputs: string[]; /** * The binding property names of the outputs of the directive. */ outputs: string[]; /** * Name under which the directive is exported, if any (exportAs in Angular). Null otherwise. */ exportAs: string[] | null; /** * If true then this directive is actually a component; otherwise it is not. */ isComponent: boolean; } interface R3PipeDependencyMetadata extends R3TemplateDependency { kind: R3TemplateDependencyKind.Pipe; name: string; } interface R3NgModuleDependencyMetadata extends R3TemplateDependency { kind: R3TemplateDependencyKind.NgModule; } /** * Information needed to compile a query (view or content). */ interface R3QueryMetadata { /** * Name of the property on the class to update with query results. */ propertyName: string; /** * Whether to read only the first matching result, or an array of results. */ first: boolean; /** * Either an expression representing a type or `InjectionToken` for the query * predicate, or a set of string selectors. * * Note: At compile time we split selectors as an optimization that avoids this * extra work at runtime creation phase. * * Notably, if the selector is not statically analyzable due to an expression, * the selectors may need to be split up at runtime. */ predicate: MaybeForwardRefExpression | string[]; /** * Whether to include only direct children or all descendants. */ descendants: boolean; /** * If the `QueryList` should fire change event only if actual change to query was computed (vs old * behavior where the change was fired whenever the query was recomputed, even if the recomputed * query resulted in the same list.) */ emitDistinctChangesOnly: boolean; /** * An expression representing a type to read from each matched node, or null if the default value * for a given node is to be returned. */ read: Expression | null; /** * Whether or not this query should collect only static results. * * If static is true, the query's results will be set on the component after nodes are created, * but before change detection runs. This means that any results that relied upon change detection * to run (e.g. results inside *ngIf or *ngFor views) will not be collected. Query results are * available in the ngOnInit hook. * * If static is false, the query's results will be set on the component after change detection * runs. This means that the query results can contain nodes inside *ngIf or *ngFor views, but * the results will not be available in the ngOnInit hook (only in the ngAfterContentInit for * content hooks and ngAfterViewInit for view hooks). * * Note: For signal-based queries, this option does not have any effect. */ static: boolean; /** Whether the query is signal-based. */ isSignal: boolean; } /** * Mappings indicating how the class interacts with its * host element (host bindings, listeners, etc). */ interface R3HostMetadata { /** * A mapping of attribute binding keys to `o.Expression`s. */ attributes: { [key: string]: Expression; }; /** * A mapping of event binding keys to unparsed expressions. */ listeners: { [key: string]: string; }; /** * A mapping of property binding keys to unparsed expressions. */ properties: { [key: string]: string; }; specialAttributes: { styleAttr?: string; classAttr?: string; }; } /** * Information needed to compile a host directive for the render3 runtime. */ interface R3HostDirectiveMetadata { /** An expression representing the host directive class itself. */ directive: R3Reference; /** Whether the expression referring to the host directive is a forward reference. */ isForwardReference: boolean; /** Inputs from the host directive that will be exposed on the host. */ inputs: { [publicName: string]: string; } | null; /** Outputs from the host directive that will be exposed on the host. */ outputs: { [publicName: string]: string; } | null; } /** * Information needed to compile the defer block resolver function. */ type R3DeferResolverFunctionMetadata = { mode: DeferBlockDepsEmitMode.PerBlock; dependencies: R3DeferPerBlockDependency[]; } | { mode: DeferBlockDepsEmitMode.PerComponent; dependencies: R3DeferPerComponentDependency[]; }; /** * Information about a single dependency of a defer block in `PerBlock` mode. */ interface R3DeferPerBlockDependency { /** * Reference to a dependency. */ typeReference: Expression; /** * Dependency class name. */ symbolName: string; /** * Whether this dependency can be defer-loaded. */ isDeferrable: boolean; /** * Import path where this dependency is located. */ importPath: string | null; /** * Whether the symbol is the default export. */ isDefaultImport: boolean; } /** * Information about a single dependency of a defer block in `PerComponent` mode. */ interface R3DeferPerComponentDependency { /** * Dependency class name. */ symbolName: string; /** * Import path where this dependency is located. */ importPath: string; /** * Whether the symbol is the default export. */ isDefaultImport: boolean; } /** Node that has a `Scope` associated with it. */ type ScopedNode = Template | SwitchBlockCase | IfBlockBranch | ForLoopBlock | ForLoopBlockEmpty | DeferredBlock | DeferredBlockError | DeferredBlockLoading | DeferredBlockPlaceholder | Content; /** Possible values that a reference can be resolved to. */ type ReferenceTarget = { directive: DirectiveT; node: Element | Template; } | Element | Template; /** Entity that is local to the template and defined within the template. */ type TemplateEntity = Reference | Variable | LetDeclaration; /** * A logical target for analysis, which could contain a template or other types of bindings. */ interface Target { template?: Node[]; } /** * A data structure which can indicate whether a given property name is present or not. * * This is used to represent the set of inputs or outputs present on a directive, and allows the * binder to query for the presence of a mapping for property names. */ interface InputOutputPropertySet { hasBindingPropertyName(propertyName: string): boolean; } /** * A data structure which captures the animation trigger names that are statically resolvable * and whether some names could not be statically evaluated. */ interface AnimationTriggerNames { includesDynamicAnimations: boolean; staticTriggerNames: string[]; } /** * Metadata regarding a directive that's needed to match it against template elements. This is * provided by a consumer of the t2 APIs. */ interface DirectiveMeta { /** * Name of the directive class (used for debugging). */ name: string; /** The selector for the directive or `null` if there isn't one. */ selector: string | null; /** * Whether the directive is a component. */ isComponent: boolean; /** * Set of inputs which this directive claims. * * Goes from property names to field names. */ inputs: InputOutputPropertySet; /** * Set of outputs which this directive claims. * * Goes from property names to field names. */ outputs: InputOutputPropertySet; /** * Name under which the directive is exported, if any (exportAs in Angular). * * Null otherwise */ exportAs: string[] | null; /** * Whether the directive is a structural directive (e.g. `
`). */ isStructural: boolean; /** * If the directive is a component, includes the selectors of its `ng-content` elements. */ ngContentSelectors: string[] | null; /** * Whether the template of the component preserves whitespaces. */ preserveWhitespaces: boolean; /** * The name of animations that the user defines in the component. * Only includes the animation names. */ animationTriggerNames: AnimationTriggerNames | null; } /** * Interface to the binding API, which processes a template and returns an object similar to the * `ts.TypeChecker`. * * The returned `BoundTarget` has an API for extracting information about the processed target. */ interface TargetBinder { bind(target: Target): BoundTarget; } /** * Result of performing the binding operation against a `Target`. * * The original `Target` is accessible, as well as a suite of methods for extracting binding * information regarding the `Target`. * * @param DirectiveT directive metadata type */ interface BoundTarget { /** * Get the original `Target` that was bound. */ readonly target: Target; /** * For a given template node (either an `Element` or a `Template`), get the set of directives * which matched the node, if any. */ getDirectivesOfNode(node: Element | Template): DirectiveT[] | null; /** * For a given `Reference`, get the reference's target - either an `Element`, a `Template`, or * a directive on a particular node. */ getReferenceTarget(ref: Reference): ReferenceTarget | null; /** * For a given binding, get the entity to which the binding is being made. * * This will either be a directive or the node itself. */ getConsumerOfBinding(binding: BoundAttribute | BoundEvent | TextAttribute): DirectiveT | Element | Template | null; /** * If the given `AST` expression refers to a `Reference` or `Variable` within the `Target`, then * return that. * * Otherwise, returns `null`. * * This is only defined for `AST` expressions that read or write to a property of an * `ImplicitReceiver`. */ getExpressionTarget(expr: AST): TemplateEntity | null; /** * Given a particular `Reference` or `Variable`, get the `ScopedNode` which created it. * * All `Variable`s are defined on node, so this will always return a value for a `Variable` * from the `Target`. Returns `null` otherwise. */ getDefinitionNodeOfSymbol(symbol: TemplateEntity): ScopedNode | null; /** * Get the nesting level of a particular `ScopedNode`. * * This starts at 1 for top-level nodes within the `Target` and increases for nodes * nested at deeper levels. */ getNestingLevel(node: ScopedNode): number; /** * Get all `Reference`s and `Variables` visible within the given `ScopedNode` (or at the top * level, if `null` is passed). */ getEntitiesInScope(node: ScopedNode | null): ReadonlySet; /** * Get a list of all the directives used by the target, * including directives from `@defer` blocks. */ getUsedDirectives(): DirectiveT[]; /** * Get a list of eagerly used directives from the target. * Note: this list *excludes* directives from `@defer` blocks. */ getEagerlyUsedDirectives(): DirectiveT[]; /** * Get a list of all the pipes used by the target, * including pipes from `@defer` blocks. */ getUsedPipes(): string[]; /** * Get a list of eagerly used pipes from the target. * Note: this list *excludes* pipes from `@defer` blocks. */ getEagerlyUsedPipes(): string[]; /** * Get a list of all `@defer` blocks used by the target. */ getDeferBlocks(): DeferredBlock[]; /** * Gets the element that a specific deferred block trigger is targeting. * @param block Block that the trigger belongs to. * @param trigger Trigger whose target is being looked up. */ getDeferredTriggerTarget(block: DeferredBlock, trigger: DeferredTrigger): Element | null; /** * Whether a given node is located in a `@defer` block. */ isDeferred(node: Element): boolean; } /** Shorthand for a map between a binding AST node and the entity it's targeting. */ type BindingsMap = Map; /** Shorthand for a map between a reference AST node and the entity it's targeting. */ type ReferenceMap = Map; /** Mapping between AST nodes and the directives that have been matched on them. */ type MatchedDirectives = Map