UNPKG

3.25 kBTypeScriptView Raw
1import { BlockArguments, BlockValue, CapturedArguments, CapturedBlockArguments, CapturedNamedArguments, CapturedPositionalArguments, Dict, NamedArguments, Option, PositionalArguments, ScopeBlock, VMArguments } from '@glimmer/interfaces';
2import { Reference } from '@glimmer/reference';
3import { Tag } from '@glimmer/validator';
4import { EvaluationStack } from './stack';
5export declare class VMArgumentsImpl implements VMArguments {
6 private stack;
7 positional: PositionalArgumentsImpl;
8 named: NamedArgumentsImpl;
9 blocks: BlockArgumentsImpl;
10 empty(stack: EvaluationStack): this;
11 setup(stack: EvaluationStack, names: readonly string[], blockNames: readonly string[], positionalCount: number, atNames: boolean): void;
12 get base(): number;
13 get length(): number;
14 at(pos: number): Reference;
15 realloc(offset: number): void;
16 capture(): CapturedArguments;
17 clear(): void;
18}
19export declare class PositionalArgumentsImpl implements PositionalArguments {
20 base: number;
21 length: number;
22 private stack;
23 private _references;
24 empty(stack: EvaluationStack, base: number): void;
25 setup(stack: EvaluationStack, base: number, length: number): void;
26 at(position: number): Reference;
27 capture(): CapturedPositionalArguments;
28 prepend(other: Reference[]): void;
29 private get references();
30}
31export declare class NamedArgumentsImpl implements NamedArguments {
32 base: number;
33 length: number;
34 private stack;
35 private _references;
36 private _names;
37 private _atNames;
38 empty(stack: EvaluationStack, base: number): void;
39 setup(stack: EvaluationStack, base: number, length: number, names: readonly string[], atNames: boolean): void;
40 get names(): readonly string[];
41 get atNames(): readonly string[];
42 has(name: string): boolean;
43 get(name: string, atNames?: boolean): Reference;
44 capture(): CapturedNamedArguments;
45 merge(other: Record<string, Reference>): void;
46 private get references();
47 private toSyntheticName;
48 private toAtName;
49}
50export declare class BlockArgumentsImpl implements BlockArguments {
51 private stack;
52 private internalValues;
53 private _symbolNames;
54 internalTag: Option<Tag>;
55 names: readonly string[];
56 length: number;
57 base: number;
58 empty(stack: EvaluationStack, base: number): void;
59 setup(stack: EvaluationStack, base: number, length: number, names: readonly string[]): void;
60 get values(): readonly BlockValue[];
61 has(name: string): boolean;
62 get(name: string): Option<ScopeBlock>;
63 capture(): CapturedBlockArguments;
64 get symbolNames(): readonly string[];
65}
66export declare function createCapturedArgs(named: Dict<Reference>, positional: Reference[]): CapturedArguments;
67export declare function reifyNamed(named: CapturedNamedArguments): Dict<unknown>;
68export declare function reifyPositional(positional: CapturedPositionalArguments): unknown[];
69export declare function reifyArgs(args: CapturedArguments): {
70 named: Dict<unknown>;
71 positional: unknown[];
72};
73export declare const EMPTY_NAMED: CapturedNamedArguments;
74export declare const EMPTY_POSITIONAL: CapturedPositionalArguments;
75export declare const EMPTY_ARGS: CapturedArguments;
76//# sourceMappingURL=arguments.d.ts.map
\No newline at end of file