Alias.d.ts 1.0 KB

12345678910111213141516171819202122232425262728
  1. import type { Document } from '../doc/Document.js';
  2. import type { FlowScalar } from '../parse/cst.js';
  3. import type { StringifyContext } from '../stringify/stringify.js';
  4. import { NodeBase, Range } from './Node.js';
  5. import type { Scalar } from './Scalar';
  6. import { ToJSContext } from './toJS.js';
  7. import type { YAMLMap } from './YAMLMap.js';
  8. import type { YAMLSeq } from './YAMLSeq.js';
  9. export declare namespace Alias {
  10. interface Parsed extends Alias {
  11. range: Range;
  12. srcToken?: FlowScalar & {
  13. type: 'alias';
  14. };
  15. }
  16. }
  17. export 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. }