1 | import { Option } from '@glimmer/interfaces';
|
2 | import print from '../generation/print';
|
3 | import { Tag } from '../parser';
|
4 | import { Source } from '../source/source';
|
5 | import { SourceSpan } from '../source/span';
|
6 | import traverse from '../traversal/traverse';
|
7 | import { NodeVisitor } from '../traversal/visitor';
|
8 | import Walker from '../traversal/walker';
|
9 | import * as ASTv1 from '../v1/api';
|
10 | import * as HBS from '../v1/handlebars-ast';
|
11 | import publicBuilder from '../v1/public-builders';
|
12 | import { HandlebarsNodeVisitors } from './handlebars-node-visitors';
|
13 | export declare class TokenizerEventHandlers extends HandlebarsNodeVisitors {
|
14 | private tagOpenLine;
|
15 | private tagOpenColumn;
|
16 | reset(): void;
|
17 | beginComment(): void;
|
18 | appendToCommentData(char: string): void;
|
19 | finishComment(): void;
|
20 | beginData(): void;
|
21 | appendToData(char: string): void;
|
22 | finishData(): void;
|
23 | tagOpen(): void;
|
24 | beginStartTag(): void;
|
25 | beginEndTag(): void;
|
26 | finishTag(): void;
|
27 | finishStartTag(): void;
|
28 | finishEndTag(isVoid: boolean): void;
|
29 | markTagAsSelfClosing(): void;
|
30 | appendToTagName(char: string): void;
|
31 | beginAttribute(): void;
|
32 | appendToAttributeName(char: string): void;
|
33 | beginAttributeValue(isQuoted: boolean): void;
|
34 | appendToAttributeValue(char: string): void;
|
35 | finishAttributeValue(): void;
|
36 | reportSyntaxError(message: string): void;
|
37 | assembleConcatenatedValue(parts: (ASTv1.MustacheStatement | ASTv1.TextNode)[]): ASTv1.ConcatStatement;
|
38 | validateEndTag(tag: Tag<'StartTag' | 'EndTag'>, element: ASTv1.ElementNode, selfClosing: boolean): void;
|
39 | assembleAttributeValue(parts: (ASTv1.MustacheStatement | ASTv1.TextNode)[], isQuoted: boolean, isDynamic: boolean, span: SourceSpan): ASTv1.ConcatStatement | ASTv1.MustacheStatement | ASTv1.TextNode;
|
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;
|
54 | syntax: Syntax;
|
55 | }
|
56 | interface HandlebarsParseOptions {
|
57 | srcName?: string;
|
58 | ignoreStandalone?: boolean;
|
59 | }
|
60 | export interface TemplateIdFn {
|
61 | (src: string): Option<string>;
|
62 | }
|
63 | export interface PrecompileOptions extends PreprocessOptions {
|
64 | id?: TemplateIdFn;
|
65 | customizeComponentName?(input: string): string;
|
66 | }
|
67 | export interface PreprocessOptions {
|
68 | strictMode?: boolean;
|
69 | locals?: string[];
|
70 | meta?: {
|
71 | moduleName?: string;
|
72 | };
|
73 | plugins?: {
|
74 | ast?: ASTPluginBuilder[];
|
75 | };
|
76 | parseOptions?: HandlebarsParseOptions;
|
77 | customizeComponentName?(input: string): string;
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | mode?: 'codemod' | 'precompile';
|
86 | }
|
87 | export interface Syntax {
|
88 | parse: typeof preprocess;
|
89 | builders: typeof publicBuilder;
|
90 | print: typeof print;
|
91 | traverse: typeof traverse;
|
92 | Walker: typeof Walker;
|
93 | }
|
94 | export declare function preprocess(input: string | Source | HBS.Program, options?: PreprocessOptions): ASTv1.Template;
|
95 | export {};
|
96 |
|
\ | No newline at end of file |