1 |
|
2 | import { Reference } from '@glimmer/reference';
|
3 |
|
4 | import { Tag } from '@glimmer/validator';
|
5 | import { Dict, Option } from '../core';
|
6 | import { ScopeBlock, Block } from './scope';
|
7 |
|
8 | declare const CAPTURED_ARGS: unique symbol;
|
9 |
|
10 | export interface VMArguments {
|
11 | length: number;
|
12 | positional: PositionalArguments;
|
13 | named: NamedArguments;
|
14 |
|
15 | at(pos: number): Reference;
|
16 | capture(): CapturedArguments;
|
17 | }
|
18 |
|
19 | export interface CapturedArguments {
|
20 | positional: CapturedPositionalArguments;
|
21 | named: CapturedNamedArguments;
|
22 | [CAPTURED_ARGS]: true;
|
23 | }
|
24 |
|
25 | export interface PositionalArguments {
|
26 | length: number;
|
27 | at(position: number): Reference;
|
28 | capture(): CapturedPositionalArguments;
|
29 | }
|
30 |
|
31 | export interface CapturedPositionalArguments extends Array<Reference> {
|
32 | [CAPTURED_ARGS]: true;
|
33 | }
|
34 |
|
35 | export interface NamedArguments {
|
36 | names: readonly string[];
|
37 | length: number;
|
38 | has(name: string): boolean;
|
39 | get(name: string): Reference;
|
40 | capture(): CapturedNamedArguments;
|
41 | }
|
42 |
|
43 | export interface BlockArguments {
|
44 | names: readonly string[];
|
45 | length: number;
|
46 | has(name: string): boolean;
|
47 | get(name: string): Option<ScopeBlock>;
|
48 | capture(): CapturedBlockArguments;
|
49 | }
|
50 |
|
51 | export interface CapturedBlockArguments {
|
52 | names: readonly string[];
|
53 | length: number;
|
54 | has(name: string): boolean;
|
55 | get(name: string): Option<ScopeBlock>;
|
56 | }
|
57 |
|
58 | export interface CapturedNamedArguments {
|
59 | [key: string]: Reference;
|
60 | [CAPTURED_ARGS]: true;
|
61 | }
|
62 |
|
63 | export interface Arguments {
|
64 | positional: readonly unknown[];
|
65 | named: Record<string, unknown>;
|
66 | }
|