UNPKG

674 BTypeScriptView Raw
1import type { Node } from '../nodes/Node.js';
2import type { Schema } from '../schema/Schema.js';
3import type { CollectionTag, ScalarTag } from '../schema/types.js';
4import type { Replacer } from './Document.js';
5export interface CreateNodeContext {
6 aliasDuplicateObjects: boolean;
7 keepUndefined: boolean;
8 onAnchor: (source: unknown) => string;
9 onTagObj?: (tagObj: ScalarTag | CollectionTag) => void;
10 sourceObjects: Map<unknown, {
11 anchor: string | null;
12 node: Node | null;
13 }>;
14 replacer?: Replacer;
15 schema: Schema;
16}
17export declare function createNode(value: unknown, tagName: string | undefined, ctx: CreateNodeContext): Node;