1 | import { Action } from './template-visitor';
|
2 | import { Template } from './javascript-compiler';
|
3 | import { Option } from '@glimmer/util';
|
4 | import { AST } from '@glimmer/syntax';
|
5 | import { Processor, InputOps, AllocateSymbolsOps, Ops, SourceLocation } from './compiler-ops';
|
6 | export interface CompileOptions {
|
7 | meta?: unknown;
|
8 | customizeComponentName?(tag: string): string;
|
9 | }
|
10 | export default class TemplateCompiler implements Processor<InputOps> {
|
11 | private source;
|
12 | static compile(ast: AST.Template, source: string, options?: CompileOptions): Template;
|
13 | constructor(source: string);
|
14 | private templateId;
|
15 | private templateIds;
|
16 | private opcodes;
|
17 | private locations;
|
18 | private includeMeta;
|
19 | private cursorCount;
|
20 | cursor(): string;
|
21 | process(actions: Action[]): {
|
22 | opcodes: readonly Ops<AllocateSymbolsOps>[];
|
23 | locations: readonly Option<SourceLocation>[];
|
24 | };
|
25 | startProgram([program]: [AST.Template]): void;
|
26 | endProgram(): void;
|
27 | startBlock([program]: [AST.Block]): void;
|
28 | endBlock(): void;
|
29 | text([action]: [AST.TextNode]): void;
|
30 | comment([action]: [AST.CommentStatement]): void;
|
31 | openElement([action]: [AST.ElementNode]): void;
|
32 | closeElement([action]: [AST.ElementNode]): void;
|
33 | attribute([action]: [AST.AttrNode], isComponent: boolean, elementNode: AST.ElementNode): void;
|
34 | modifier([action]: [AST.ElementModifierStatement]): void;
|
35 | mustache([mustache]: [AST.MustacheStatement]): void;
|
36 | block([action]: [AST.BlockStatement]): void;
|
37 | private argPath;
|
38 | private varPath;
|
39 | private thisPath;
|
40 | private expression;
|
41 | yield(to: string, action: AST.MustacheStatement): void;
|
42 | debugger(_name: string, action: AST.MustacheStatement): void;
|
43 | hasBlock(name: string, action: AST.Call): void;
|
44 | hasBlockParams(name: string, action: AST.Call): void;
|
45 | partial(_params: AST.Expression[], action: AST.MustacheStatement): void;
|
46 | keyword(action: AST.Call): void;
|
47 | SubExpression(expr: AST.SubExpression): void;
|
48 | PathExpression(expr: AST.PathExpression): void;
|
49 | private path;
|
50 | StringLiteral(action: AST.StringLiteral): void;
|
51 | BooleanLiteral(action: AST.BooleanLiteral): void;
|
52 | NumberLiteral(action: AST.NumberLiteral): void;
|
53 | NullLiteral(action: AST.NullLiteral): void;
|
54 | UndefinedLiteral(action: AST.UndefinedLiteral): void;
|
55 | opcode<O extends Ops<AllocateSymbolsOps>>(opcode: O, action?: Option<AST.BaseNode>): void;
|
56 | helperCall(call: AST.Call, node: AST.Node): void;
|
57 | mustacheCall(call: AST.MustacheStatement): void;
|
58 | prepareHelper(expr: AST.Call, context: 'helper' | 'modifier' | 'block' | 'in-element'): void;
|
59 | prepareParams(params: AST.Expression[]): void;
|
60 | prepareHash(hash: AST.Hash, context: 'helper' | 'modifier' | 'block' | 'in-element'): void;
|
61 | prepareAttributeValue(value: AST.AttrNode['value']): value is AST.TextNode;
|
62 | prepareConcatParts(parts: AST.ConcatStatement['parts']): void;
|
63 | private mustacheAttrValue;
|
64 | meta(node: AST.BaseNode): (string | (string | number[] | null)[])[];
|
65 | location(node: AST.BaseNode): SourceLocation | null;
|
66 | }
|
67 |
|
\ | No newline at end of file |