UNPKG

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