1 | import { WireFormat, Option, Expressions, ExpressionContext } from '@glimmer/interfaces';
|
2 | import { BuilderStatement, BuilderComment, Path, Variable, Builder, NormalizedExpression, NormalizedParams, NormalizedHash, NormalizedAttrs, NormalizedStatement, NormalizedAngleInvocation, NormalizedBlocks } from './builder-interface';
|
3 | import { AttrNamespace } from '@simple-dom/interface';
|
4 | interface Symbols {
|
5 | top: ProgramSymbols;
|
6 | freeVar(name: string): number;
|
7 | arg(name: string): number;
|
8 | block(name: string): number;
|
9 | local(name: string): number;
|
10 | this(): number;
|
11 | hasLocal(name: string): boolean;
|
12 | child(params: string[]): LocalSymbols;
|
13 | }
|
14 | export declare class ProgramSymbols implements Symbols {
|
15 | _freeVariables: string[];
|
16 | _symbols: string[];
|
17 | top: this;
|
18 | toSymbols(): string[];
|
19 | toUpvars(): string[];
|
20 | freeVar(name: string): number;
|
21 | block(name: string): number;
|
22 | arg(name: string): number;
|
23 | local(name: string): never;
|
24 | this(): number;
|
25 | hasLocal(_name: string): false;
|
26 | symbol(name: string): number;
|
27 | child(locals: string[]): LocalSymbols;
|
28 | }
|
29 | declare class LocalSymbols implements Symbols {
|
30 | private parent;
|
31 | private locals;
|
32 | constructor(parent: Symbols, locals: string[]);
|
33 | get paramSymbols(): number[];
|
34 | get top(): ProgramSymbols;
|
35 | freeVar(name: string): number;
|
36 | arg(name: string): number;
|
37 | block(name: string): number;
|
38 | local(name: string): number;
|
39 | this(): number;
|
40 | hasLocal(name: string): boolean;
|
41 | child(locals: string[]): LocalSymbols;
|
42 | }
|
43 | export interface BuilderGetFree {
|
44 | type: 'GetFree';
|
45 | head: string;
|
46 | tail: string[];
|
47 | }
|
48 | export declare function buildStatements(statements: BuilderStatement[], symbols: Symbols): WireFormat.Statement[];
|
49 | export declare function buildNormalizedStatements(statements: NormalizedStatement[], symbols: Symbols): WireFormat.Statement[];
|
50 | export declare function buildStatement(normalized: NormalizedStatement, symbols?: Symbols): WireFormat.Statement[];
|
51 | export declare function s(arr: TemplateStringsArray, ...interpolated: unknown[]): [Builder.Literal, string];
|
52 | export declare function c(arr: TemplateStringsArray, ...interpolated: unknown[]): BuilderComment;
|
53 | export declare function unicode(charCode: string): string;
|
54 | export declare const NEWLINE = "\n";
|
55 | export declare function buildAngleInvocation({ attrs, block, head }: NormalizedAngleInvocation, symbols: Symbols): WireFormat.Statements.Component;
|
56 | export declare function buildAttrs(attrs: NormalizedAttrs, symbols: Symbols): {
|
57 | attributes: WireFormat.Attribute[];
|
58 | args: WireFormat.Core.Hash;
|
59 | };
|
60 | export declare function extractNamespace(name: string): Option<AttrNamespace>;
|
61 | export declare function buildAttributeValue(name: string, value: NormalizedExpression, namespace: Option<AttrNamespace>, symbols: Symbols): WireFormat.Attribute[];
|
62 | export declare function buildExpression(expr: NormalizedExpression, context: ExpressionContext, symbols: Symbols): WireFormat.Expression;
|
63 | export declare function buildPath(path: Path, context: ExpressionContext, symbols: Symbols): Expressions.GetPath;
|
64 | export declare function buildVar(head: Variable, context: ExpressionContext, symbols: Symbols, path: string[]): Expressions.GetPath;
|
65 | export declare function buildVar(head: Variable, context: ExpressionContext, symbols: Symbols): Expressions.Get;
|
66 | export declare function expressionContextOp(context: ExpressionContext): WireFormat.SexpOpcodes.GetFreeInAppendSingleId | WireFormat.SexpOpcodes.GetFreeInExpression | WireFormat.SexpOpcodes.GetFreeInCallHead | WireFormat.SexpOpcodes.GetFreeInBlockHead | WireFormat.SexpOpcodes.GetFreeInModifierHead | WireFormat.SexpOpcodes.GetFreeInComponentHead;
|
67 | export declare function buildParams(exprs: Option<NormalizedParams>, symbols: Symbols): Option<WireFormat.Core.Params>;
|
68 | export declare function buildConcat(exprs: [NormalizedExpression, ...NormalizedExpression[]], symbols: Symbols): WireFormat.Core.ConcatParams;
|
69 | export declare function buildHash(exprs: Option<NormalizedHash>, symbols: Symbols): WireFormat.Core.Hash;
|
70 | export declare function buildBlocks(blocks: NormalizedBlocks, blockParams: Option<string[]>, parent: Symbols): WireFormat.Core.Blocks;
|
71 | export {};
|
72 |
|
\ | No newline at end of file |