identity.d.ts 1.4 KB

1234567891011121314151617181920212223
  1. import type { Document } from '../doc/Document.js';
  2. import type { Alias } from './Alias.js';
  3. import type { Node } from './Node.js';
  4. import type { Pair } from './Pair.js';
  5. import type { Scalar } from './Scalar.js';
  6. import type { YAMLMap } from './YAMLMap.js';
  7. import type { YAMLSeq } from './YAMLSeq.js';
  8. export declare const ALIAS: unique symbol;
  9. export declare const DOC: unique symbol;
  10. export declare const MAP: unique symbol;
  11. export declare const PAIR: unique symbol;
  12. export declare const SCALAR: unique symbol;
  13. export declare const SEQ: unique symbol;
  14. export declare const NODE_TYPE: unique symbol;
  15. export declare const isAlias: (node: any) => node is Alias;
  16. export declare const isDocument: <T extends Node = Node>(node: any) => node is Document<T, true>;
  17. export declare const isMap: <K = unknown, V = unknown>(node: any) => node is YAMLMap<K, V>;
  18. export declare const isPair: <K = unknown, V = unknown>(node: any) => node is Pair<K, V>;
  19. export declare const isScalar: <T = unknown>(node: any) => node is Scalar<T>;
  20. export declare const isSeq: <T = unknown>(node: any) => node is YAMLSeq<T>;
  21. export declare function isCollection<K = unknown, V = unknown>(node: any): node is YAMLMap<K, V> | YAMLSeq<V>;
  22. export declare function isNode<T = unknown>(node: any): node is Node<T>;
  23. export declare const hasAnchor: <K = unknown, V = unknown>(node: unknown) => node is Scalar<V> | YAMLMap<K, V> | YAMLSeq<V>;