1 | import * as AST from './types/nodes';
|
2 | import { Option, Dict } from '@glimmer/interfaces';
|
3 | import { StringLiteral, BooleanLiteral, NumberLiteral } from './types/handlebars-ast';
|
4 | export declare type BuilderHead = string | AST.Expression;
|
5 | export declare type TagDescriptor = string | {
|
6 | name: string;
|
7 | selfClosing: boolean;
|
8 | };
|
9 | declare function buildMustache(path: BuilderHead | AST.Literal, params?: AST.Expression[], hash?: AST.Hash, raw?: boolean, loc?: AST.SourceLocation, strip?: AST.StripFlags): AST.MustacheStatement;
|
10 | declare function buildBlock(path: BuilderHead, params: Option<AST.Expression[]>, hash: Option<AST.Hash>, _defaultBlock: AST.PossiblyDeprecatedBlock, _elseBlock?: Option<AST.PossiblyDeprecatedBlock>, loc?: AST.SourceLocation, openStrip?: AST.StripFlags, inverseStrip?: AST.StripFlags, closeStrip?: AST.StripFlags): AST.BlockStatement;
|
11 | declare function buildElementModifier(path: BuilderHead, params?: AST.Expression[], hash?: AST.Hash, loc?: Option<AST.SourceLocation>): AST.ElementModifierStatement;
|
12 | declare function buildPartial(name: AST.PathExpression, params?: AST.Expression[], hash?: AST.Hash, indent?: string, loc?: AST.SourceLocation): AST.PartialStatement;
|
13 | declare function buildComment(value: string, loc?: AST.SourceLocation): AST.CommentStatement;
|
14 | declare function buildMustacheComment(value: string, loc?: AST.SourceLocation): AST.MustacheCommentStatement;
|
15 | declare function buildConcat(parts: (AST.TextNode | AST.MustacheStatement)[], loc?: AST.SourceLocation): AST.ConcatStatement;
|
16 | export declare type ElementArgs = ['attrs', ...AttrSexp[]] | ['modifiers', ...ModifierSexp[]] | ['body', ...AST.Statement[]] | ['comments', ...ElementComment[]] | ['as', ...string[]] | ['loc', AST.SourceLocation];
|
17 | export declare type PathSexp = string | ['path', string, LocSexp?];
|
18 | export declare type ModifierSexp = string | [PathSexp, LocSexp?] | [PathSexp, AST.Expression[], LocSexp?] | [PathSexp, AST.Expression[], Dict<AST.Expression>, LocSexp?];
|
19 | export declare type AttrSexp = [string, AST.AttrNode['value'] | string, LocSexp?];
|
20 | export declare type LocSexp = ['loc', AST.SourceLocation];
|
21 | export declare type ElementComment = AST.MustacheCommentStatement | AST.SourceLocation | string;
|
22 | export declare type SexpValue = string | AST.Expression[] | Dict<AST.Expression> | LocSexp | PathSexp | undefined;
|
23 | export declare function isLocSexp(value: SexpValue): value is LocSexp;
|
24 | export declare function isParamsSexp(value: SexpValue): value is AST.Expression[];
|
25 | export declare function isHashSexp(value: SexpValue): value is Dict<AST.Expression>;
|
26 | export declare function normalizeModifier(sexp: ModifierSexp): AST.ElementModifierStatement;
|
27 | export declare function normalizeAttr(sexp: AttrSexp): AST.AttrNode;
|
28 | export declare function normalizeHash(hash: Dict<AST.Expression>, loc?: AST.SourceLocation): AST.Hash;
|
29 | export declare function normalizeHead(path: PathSexp): AST.Expression;
|
30 | export declare function normalizeElementOptions(...args: ElementArgs[]): BuildElementOptions;
|
31 | export interface BuildElementOptions {
|
32 | attrs?: AST.AttrNode[];
|
33 | modifiers?: AST.ElementModifierStatement[];
|
34 | children?: AST.Statement[];
|
35 | comments?: ElementComment[];
|
36 | blockParams?: string[];
|
37 | loc?: AST.SourceLocation;
|
38 | }
|
39 | declare function buildElement(tag: TagDescriptor, options?: BuildElementOptions): AST.ElementNode;
|
40 | declare function buildElement(tag: TagDescriptor, ...options: ElementArgs[]): AST.ElementNode;
|
41 | declare function buildAttr(name: string, value: AST.AttrNode['value'], loc?: AST.SourceLocation): AST.AttrNode;
|
42 | declare function buildText(chars?: string, loc?: AST.SourceLocation): AST.TextNode;
|
43 | declare function buildSexpr(path: BuilderHead, params?: AST.Expression[], hash?: AST.Hash, loc?: AST.SourceLocation): AST.SubExpression;
|
44 | declare function buildHead(original: BuilderHead, loc?: AST.SourceLocation): AST.Expression;
|
45 | declare function buildLiteral<T extends AST.Literal>(type: T['type'], value: T['value'], loc?: AST.SourceLocation): T;
|
46 | declare function buildHash(pairs?: AST.HashPair[], loc?: AST.SourceLocation): AST.Hash;
|
47 | declare function buildPair(key: string, value: AST.Expression, loc?: AST.SourceLocation): AST.HashPair;
|
48 | declare function buildProgram(body?: AST.Statement[], blockParams?: string[], loc?: AST.SourceLocation): AST.Template;
|
49 | declare function buildBlockItself(body?: AST.Statement[], blockParams?: string[], chained?: boolean, loc?: AST.SourceLocation): AST.Block;
|
50 | declare function buildTemplate(body?: AST.Statement[], blockParams?: string[], loc?: AST.SourceLocation): AST.Template;
|
51 | declare function buildPosition(line: number, column: number): {
|
52 | line: number;
|
53 | column: number;
|
54 | };
|
55 | export declare const SYNTHETIC: AST.SourceLocation;
|
56 | declare function buildLoc(loc: Option<AST.SourceLocation>): AST.SourceLocation;
|
57 | declare function buildLoc(startLine: number, startColumn: number, endLine?: number, endColumn?: number, source?: string): AST.SourceLocation;
|
58 | declare const _default: {
|
59 | mustache: typeof buildMustache;
|
60 | block: typeof buildBlock;
|
61 | partial: typeof buildPartial;
|
62 | comment: typeof buildComment;
|
63 | mustacheComment: typeof buildMustacheComment;
|
64 | element: typeof buildElement;
|
65 | elementModifier: typeof buildElementModifier;
|
66 | attr: typeof buildAttr;
|
67 | text: typeof buildText;
|
68 | sexpr: typeof buildSexpr;
|
69 | path: typeof buildHead;
|
70 | concat: typeof buildConcat;
|
71 | hash: typeof buildHash;
|
72 | pair: typeof buildPair;
|
73 | literal: typeof buildLiteral;
|
74 | program: typeof buildProgram;
|
75 | blockItself: typeof buildBlockItself;
|
76 | template: typeof buildTemplate;
|
77 | loc: typeof buildLoc;
|
78 | pos: typeof buildPosition;
|
79 | string: (value: string) => StringLiteral;
|
80 | boolean: (value: boolean) => BooleanLiteral;
|
81 | number: (value: number) => NumberLiteral;
|
82 | undefined(): AST.Literal;
|
83 | null(): AST.Literal;
|
84 | };
|
85 | export default _default;
|
86 |
|
\ | No newline at end of file |