UNPKG

1.05 kBTypeScriptView Raw
1import type { Document } from '../doc/Document.js';
2import type { FlowScalar } from '../parse/cst.js';
3import type { StringifyContext } from '../stringify/stringify.js';
4import { NodeBase, Range } from './Node.js';
5import type { Scalar } from './Scalar';
6import { ToJSContext } from './toJS.js';
7import type { YAMLMap } from './YAMLMap.js';
8import type { YAMLSeq } from './YAMLSeq.js';
9export declare namespace Alias {
10 interface Parsed extends Alias {
11 range: Range;
12 srcToken?: FlowScalar & {
13 type: 'alias';
14 };
15 }
16}
17export declare class Alias extends NodeBase {
18 source: string;
19 anchor?: never;
20 constructor(source: string);
21 /**
22 * Resolve the value of this alias within `doc`, finding the last
23 * instance of the `source` anchor before this node.
24 */
25 resolve(doc: Document): Scalar | YAMLMap | YAMLSeq | undefined;
26 toJSON(_arg?: unknown, ctx?: ToJSContext): {} | null;
27 toString(ctx?: StringifyContext, _onComment?: () => void, _onChompKeep?: () => void): string;
28}