1 | import type { Nullable } from '@glimmer/interfaces';
|
2 | import type { EndTag, StartTag } from '../parser';
|
3 | import type { NodeVisitor } from '../traversal/visitor';
|
4 | import type * as ASTv1 from '../v1/api';
|
5 | import type * as HBS from '../v1/handlebars-ast';
|
6 | import print from '../generation/print';
|
7 | import * as src from '../source/api';
|
8 | import traverse from '../traversal/traverse';
|
9 | import Walker from '../traversal/walker';
|
10 | import publicBuilder from '../v1/public-builders';
|
11 | import { HandlebarsNodeVisitors } from './handlebars-node-visitors';
|
12 | export declare class TokenizerEventHandlers extends HandlebarsNodeVisitors {
|
13 | private tagOpenLine;
|
14 | private tagOpenColumn;
|
15 | reset(): void;
|
16 | beginComment(): void;
|
17 | appendToCommentData(char: string): void;
|
18 | finishComment(): void;
|
19 | beginData(): void;
|
20 | appendToData(char: string): void;
|
21 | finishData(): void;
|
22 | tagOpen(): void;
|
23 | beginStartTag(): void;
|
24 | beginEndTag(): void;
|
25 | finishTag(): void;
|
26 | finishStartTag(): void;
|
27 | finishEndTag(isVoid: boolean): void;
|
28 | markTagAsSelfClosing(): void;
|
29 | appendToTagName(char: string): void;
|
30 | beginAttribute(): void;
|
31 | appendToAttributeName(char: string): void;
|
32 | beginAttributeValue(isQuoted: boolean): void;
|
33 | appendToAttributeValue(char: string): void;
|
34 | finishAttributeValue(): void;
|
35 | private parsePossibleBlockParams;
|
36 | reportSyntaxError(message: string): void;
|
37 | assembleConcatenatedValue(parts: (ASTv1.MustacheStatement | ASTv1.TextNode)[]): ASTv1.ConcatStatement;
|
38 | validateEndTag(tag: StartTag | EndTag, element: ASTv1.ParentNode, selfClosing: boolean): asserts element is ASTv1.ElementNode;
|
39 | assembleAttributeValue(parts: ASTv1.AttrPart[], isQuoted: boolean, isDynamic: boolean, span: src.SourceSpan): ASTv1.AttrValue;
|
40 | }
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export interface ASTPluginBuilder<TEnv extends ASTPluginEnvironment = ASTPluginEnvironment> {
|
46 | (env: TEnv): ASTPlugin;
|
47 | }
|
48 | export interface ASTPlugin {
|
49 | name: string;
|
50 | visitor: NodeVisitor;
|
51 | }
|
52 | export interface ASTPluginEnvironment {
|
53 | meta?: object | undefined;
|
54 | syntax: Syntax;
|
55 | }
|
56 | interface HandlebarsParseOptions {
|
57 | srcName?: string;
|
58 | ignoreStandalone?: boolean;
|
59 | }
|
60 | export interface TemplateIdFn {
|
61 | (src: string): Nullable<string>;
|
62 | }
|
63 | export interface PrecompileOptions extends PreprocessOptions {
|
64 | id?: TemplateIdFn;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | keywords?: readonly string[];
|
79 | |
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | customizeComponentName?: ((input: string) => string) | undefined;
|
88 | }
|
89 | export interface PrecompileOptionsWithLexicalScope extends PrecompileOptions {
|
90 | lexicalScope: (variable: string) => boolean;
|
91 | |
92 |
|
93 |
|
94 |
|
95 | emit?: {
|
96 | debugSymbols?: boolean;
|
97 | } | undefined;
|
98 | }
|
99 | export interface PreprocessOptions {
|
100 | strictMode?: boolean | undefined;
|
101 | locals?: string[] | undefined;
|
102 | meta?: {
|
103 | moduleName?: string | undefined;
|
104 | } | undefined;
|
105 | plugins?: {
|
106 | ast?: ASTPluginBuilder[] | undefined;
|
107 | } | undefined;
|
108 | parseOptions?: HandlebarsParseOptions | undefined;
|
109 | customizeComponentName?: ((input: string) => string) | undefined;
|
110 | /**
|
111 | Useful for specifying a group of options together.
|
112 |
|
113 | When `'codemod'` we disable all whitespace control in handlebars
|
114 | (to preserve as much as possible) and we also avoid any
|
115 | escaping/unescaping of HTML entity codes.
|
116 | */
|
117 | mode?: 'codemod' | 'precompile' | undefined;
|
118 | }
|
119 | export interface Syntax {
|
120 | parse: typeof preprocess;
|
121 | builders: typeof publicBuilder;
|
122 | print: typeof print;
|
123 | traverse: typeof traverse;
|
124 | Walker: typeof Walker;
|
125 | }
|
126 | export declare function preprocess(input: string | src.Source | HBS.Program, options?: PreprocessOptions): ASTv1.Template;
|
127 | export {};
|
128 |
|
\ | No newline at end of file |