/** * Lossless JSON normalization shared by every trajectory persistence owner. * Strings and collection members are preserved completely; only unsupported * JavaScript values and cycles are normalized. */ import type { JsonValue } from "../types/primitives.js"; /** @internal Exposed only through the opaque {@link TrajectoryJsonBudget}. */ export type SanitizationState = { /** Containers on the current path; a revisit is a cycle. */ seen: WeakSet; }; export declare function sanitizeTrajectoryJsonValue(value: unknown): JsonValue | undefined; /** * Opaque handle retained for callers that normalize several values under one * shared traversal state. The internal state is not part of the public contract. */ export interface TrajectoryJsonBudget { /** @internal */ state: SanitizationState; } export declare function createTrajectoryJsonBudget(): TrajectoryJsonBudget; export declare function sanitizeTrajectoryJsonValueInBudget(value: unknown, budget: TrajectoryJsonBudget): JsonValue | undefined; export declare function sanitizeTrajectoryJsonObject(value: unknown): Record | undefined;