UNPKG

874 BTypeScriptView Raw
1import type { Document } from '../doc/Document.js';
2import type { Alias } from '../nodes/Alias.js';
3import type { ToStringOptions } from '../options.js';
4export type StringifyContext = {
5 actualString?: boolean;
6 allNullValues?: boolean;
7 anchors: Set<string>;
8 doc: Document;
9 forceBlockIndent?: boolean;
10 implicitKey?: boolean;
11 indent: string;
12 indentStep: string;
13 indentAtStart?: number;
14 inFlow: boolean | null;
15 inStringifyKey?: boolean;
16 flowCollectionPadding: string;
17 options: Readonly<Required<Omit<ToStringOptions, 'collectionStyle' | 'indent'>>>;
18 resolvedAliases?: Set<Alias>;
19};
20export declare function createStringifyContext(doc: Document, options: ToStringOptions): StringifyContext;
21export declare function stringify(item: unknown, ctx: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;