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