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