/** Structural view of a `Y.Map` (a real `Y.Map` satisfies it). */ export interface YMapLike { get: (key: string) => unknown; set: (key: string, value: unknown) => void; delete: (key: string) => void; forEach: (cb: (value: unknown, key: string) => void) => void; } export interface AssetSpec { /** Name of the root Y.Map holding the payloads (for example `pptx:assets`). */ mapName: string; /** Field name to the ref-pointer key stored on the owner's map (`mediaData` to `_mdRef`). */ fields: Readonly>; /** Suffix of the per-field version counter; defaults to `__v`. */ versionSuffix?: string; } export interface AssetSync { readonly spec: AssetSpec; /** Fields routed through the asset map. */ isAssetField: (field: string) => boolean; /** Whether `key` is one of the ref-pointer keys this spec owns. */ isRefKey: (key: string) => boolean; /** Whether `key` is an internal version counter (never a model field). */ isVersionKey: (key: string) => boolean; assetKey: (ownerId: string, field: string) => string; getMap: (doc: { getMap: (name: string) => YMapLike; }) => YMapLike; /** * Write present asset fields of `record` into `assets`, storing only a ref on `owner`. Never reads * `owner`, so it is safe on a brand-new, not yet integrated map (Yjs throws on reading one). */ write: (ownerId: string, record: Record, owner: YMapLike, assets: YMapLike) => void; /** * Variant for an already integrated owner: skips redundant sets, bumps the version counter on an * in-place payload swap, and clears the ref and the payload when the field was removed. */ reconcile: (ownerId: string, record: Record, owner: YMapLike, assets: YMapLike) => void; /** Rehydrate the asset fields referenced by `owner` onto `target`. */ read: (owner: YMapLike, assets: YMapLike, target: Record) => void; } export declare function createAssetSync(spec: AssetSpec): AssetSync; //# sourceMappingURL=assets.d.ts.map