/** * Sub-tree deduplication for serialized continuation blobs. * * Identifies structurally identical sub-trees across multiple root objects, * stores each unique sub-tree once in a shared pool, and replaces duplicates * with compact references (`{ __poolRef: id }`). * * Works bottom-up: children are deduplicated before parents, so a parent * node that contains pool references can itself be pooled if it appears * multiple times with the same pool references. */ interface PoolRef { __poolRef: number; } export declare function isPoolRef(value: unknown): value is PoolRef; /** * Deduplicate identical sub-trees across multiple root values. * * @param roots - Array of root values to scan for duplicates * @param threshold - Minimum estimated byte size for a sub-tree to be pooled (default 200) * @returns Object with rewritten roots and the shared pool */ export declare function dedupSubTrees(roots: unknown[], threshold?: number): { roots: unknown[]; pool: Record; }; /** * Recursively expand all `{ __poolRef: id }` markers in a value tree, * replacing them with the corresponding pool values. * * Pool values themselves may contain pool refs (nested pooling), * which are expanded recursively. * * @throws Error if a pool ref references an unknown ID */ export declare function expandPoolRefs(value: unknown, pool: Record): unknown; export {};