123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- import type { Document } from './doc/Document.js';
- import type { Alias } from './nodes/Alias.js';
- import { Node } from './nodes/Node.js';
- import type { Pair } from './nodes/Pair.js';
- import type { Scalar } from './nodes/Scalar.js';
- import type { YAMLMap } from './nodes/YAMLMap.js';
- import type { YAMLSeq } from './nodes/YAMLSeq.js';
- export type visitorFn<T> = (key: number | 'key' | 'value' | null, node: T, path: readonly (Document | Node | Pair)[]) => void | symbol | number | Node | Pair;
- export type visitor = visitorFn<unknown> | {
- Alias?: visitorFn<Alias>;
- Collection?: visitorFn<YAMLMap | YAMLSeq>;
- Map?: visitorFn<YAMLMap>;
- Node?: visitorFn<Alias | Scalar | YAMLMap | YAMLSeq>;
- Pair?: visitorFn<Pair>;
- Scalar?: visitorFn<Scalar>;
- Seq?: visitorFn<YAMLSeq>;
- Value?: visitorFn<Scalar | YAMLMap | YAMLSeq>;
- };
- export type asyncVisitorFn<T> = (key: number | 'key' | 'value' | null, node: T, path: readonly (Document | Node | Pair)[]) => void | symbol | number | Node | Pair | Promise<void | symbol | number | Node | Pair>;
- export type asyncVisitor = asyncVisitorFn<unknown> | {
- Alias?: asyncVisitorFn<Alias>;
- Collection?: asyncVisitorFn<YAMLMap | YAMLSeq>;
- Map?: asyncVisitorFn<YAMLMap>;
- Node?: asyncVisitorFn<Alias | Scalar | YAMLMap | YAMLSeq>;
- Pair?: asyncVisitorFn<Pair>;
- Scalar?: asyncVisitorFn<Scalar>;
- Seq?: asyncVisitorFn<YAMLSeq>;
- Value?: asyncVisitorFn<Scalar | YAMLMap | YAMLSeq>;
- };
- export declare function visit(node: Node | Document | null, visitor: visitor): void;
- export declare namespace visit {
- var BREAK: symbol;
- var SKIP: symbol;
- var REMOVE: symbol;
- }
- export declare function visitAsync(node: Node | Document | null, visitor: asyncVisitor): Promise<void>;
- export declare namespace visitAsync {
- var BREAK: symbol;
- var SKIP: symbol;
- var REMOVE: symbol;
- }
|