export type { JsonPrimitive } from './internal/types.js'; export { ToonError } from './internal/errors.js'; export { enforceInputLength } from './internal/security.js'; export interface SecurityOptions { /** * Maximum nesting depth (objects + arrays). Defaults to 64. */ maxDepth?: number; /** * Maximum allowed array length. Defaults to 50_000. */ maxArrayLength?: number; /** * Maximum total nodes (object fields + array items) processed. * Defaults to 250_000 to limit resource exhaustion. */ maxTotalNodes?: number; /** * Keys that are rejected to avoid prototype pollution. * Defaults to ["__proto__", "constructor", "prototype"]. */ disallowedKeys?: string[]; /** * Maximum allowed length of a raw input string passed to a `*ToToon` / * `*ToJson` decoder. Defaults to 5_000_000 (5 MB). * Set to `Infinity` to disable. */ maxInputLength?: number; } export interface JsonToToonOptions extends SecurityOptions { /** * Number of spaces per indentation level. Defaults to 2. */ indent?: number; /** * Delimiter to use for inline arrays and tabular rows. * Defaults to comma. */ delimiter?: ',' | '|' | '\t'; /** * When true, object keys are sorted alphabetically to keep output deterministic. * Defaults to false (preserve encounter order). */ sortKeys?: boolean; /** * TOON v3 §13.4 key folding. When `'safe'`, single-key object chains are folded * into dotted paths (e.g. `{a:{b:{c:1}}}` -> `a.b.c: 1`) provided every segment * matches the IdentifierSegment grammar. Defaults to `'off'`. */ keyFolding?: 'off' | 'safe'; /** * Maximum number of segments included in a folded path (counting from the * outermost key). Has no practical effect below 2. Defaults to Infinity when * `keyFolding` is `'safe'`. */ flattenDepth?: number; } export interface ToonToJsonOptions extends SecurityOptions { /** * Enforce declared array lengths, field counts, and indentation consistency. * Defaults to true. */ strict?: boolean; /** * TOON v3 §13.4 path expansion. When `'safe'`, dotted keys are expanded into * nested objects (e.g. `a.b.c: 1` -> `{a:{b:{c:1}}}`) provided every segment * matches the IdentifierSegment grammar. Defaults to `'off'`. */ expandPaths?: 'off' | 'safe'; } export declare function jsonToToon(value: unknown, options?: JsonToToonOptions): string; export declare function toonToJson(text: string, options?: ToonToJsonOptions): unknown; //# sourceMappingURL=core.d.ts.map