UNPKG

2.57 kBTypeScriptView Raw
1import { SourceSlice } from '../../source/slice';
2import { SourceSpan } from '../../source/span';
3import type { ExpressionNode } from './expr';
4declare const Args_base: import("./node").NodeConstructor<{
5 positional: PositionalArguments;
6 named: NamedArguments;
7} & import("./node").BaseNodeFields>;
8/**
9 * Corresponds to syntaxes with positional and named arguments:
10 *
11 * - SubExpression
12 * - Invoking Append
13 * - Invoking attributes
14 * - InvokeBlock
15 *
16 * If `Args` is empty, the `SourceOffsets` for this node should be the collapsed position
17 * immediately after the parent call node's `callee`.
18 */
19export declare class Args extends Args_base {
20 static empty(loc: SourceSpan): Args;
21 static named(named: NamedArguments): Args;
22 nth(offset: number): ExpressionNode | null;
23 get(name: string): ExpressionNode | null;
24 isEmpty(): boolean;
25}
26declare const PositionalArguments_base: import("./node").NodeConstructor<{
27 exprs: readonly ExpressionNode[];
28} & import("./node").BaseNodeFields>;
29/**
30 * Corresponds to positional arguments.
31 *
32 * If `PositionalArguments` is empty, the `SourceOffsets` for this node should be the collapsed
33 * position immediately after the parent call node's `callee`.
34 */
35export declare class PositionalArguments extends PositionalArguments_base {
36 static empty(loc: SourceSpan): PositionalArguments;
37 get size(): number;
38 nth(offset: number): ExpressionNode | null;
39 isEmpty(): boolean;
40}
41declare const NamedArguments_base: import("./node").NodeConstructor<{
42 entries: readonly NamedArgument[];
43} & import("./node").BaseNodeFields>;
44/**
45 * Corresponds to named arguments.
46 *
47 * If `PositionalArguments` and `NamedArguments` are empty, the `SourceOffsets` for this node should
48 * be the same as the `Args` node that contains this node.
49 *
50 * If `PositionalArguments` is not empty but `NamedArguments` is empty, the `SourceOffsets` for this
51 * node should be the collapsed position immediately after the last positional argument.
52 */
53export declare class NamedArguments extends NamedArguments_base {
54 static empty(loc: SourceSpan): NamedArguments;
55 get size(): number;
56 get(name: string): ExpressionNode | null;
57 isEmpty(): boolean;
58}
59/**
60 * Corresponds to a single named argument.
61 *
62 * ```hbs
63 * x=<expr>
64 * ```
65 */
66export declare class NamedArgument {
67 readonly loc: SourceSpan;
68 readonly name: SourceSlice;
69 readonly value: ExpressionNode;
70 constructor(options: {
71 name: SourceSlice;
72 value: ExpressionNode;
73 });
74}
75export {};
76//# sourceMappingURL=args.d.ts.map
\No newline at end of file