import { PartEnvelope } from './types.js'; /** * JSON ↔ Yjs encode/decode for part CRDT storage. * * v1 semantics: full-part replace. Envelopes are stored as JSON-safe plain * objects inside the Yjs parts map instead of nested Yjs types. This avoids * duplicate-Yjs constructor mismatches when a caller provides a Y.Doc created * by a different bundled copy of Yjs. * * `decodeYjsToJson` converts the Yjs structures back to plain JSON for * local consumption by the mutation core. */ import * as Y from 'yjs'; /** * Encode a `PartEnvelope` into a JSON-safe value for the `parts` map. */ export declare function encodeEnvelopeToYjs(envelope: PartEnvelope): Record; /** * Decode a stored `parts` value back into a `PartEnvelope`. * * Returns `null` if the structure is missing required fields. */ export declare function decodeYjsToEnvelope(value: unknown): PartEnvelope | null; /** * Read the current version from a Yjs parts map entry without full decode. * Returns 0 if the entry doesn't exist or lacks a version. */ export declare function readEnvelopeVersion(partsMap: Y.Map, partId: string): number; //# sourceMappingURL=json-crdt.d.ts.map