import { Editor } from '../../../core/Editor.js'; /** * Part-sync consumer: Yjs `parts` map changes → local mutation core. * * Observes the Yjs `parts` map for remote changes and applies them locally * via `mutateParts`. Each part is validated individually — a single bad part * does not block the rest. */ import * as Y from 'yjs'; export interface PartConsumer { /** Tear down the Yjs observer. */ destroy(): void; } export type ConverterWithCustomXmlTombstones = { convertedXml?: Record; removedCustomXmlPaths?: Set; bibliographyPart?: { partPath?: string | null; } | null; }; export declare function isApplyingRemotePartChanges(): boolean; export declare function createPartConsumer(editor: Editor, ydoc: Y.Doc): PartConsumer; /** * Full-replace a part's data with remote data. * Clears all existing keys, then copies from source. */ export declare function replacePartData(target: unknown, source: unknown): void; export declare function getCustomXmlTombstoneConverter(editor: Editor): ConverterWithCustomXmlTombstones | undefined; export declare function isCustomXmlPartPath(path: string): boolean; export declare function isCustomXmlTombstonePath(editor: Editor, path: string): boolean; /** * Record a custom-XML tombstone on the converter and invalidate any converter * cache keyed on the removed part. Shared by the live-delete observer and the * late-joiner hydration prune so both paths tombstone identically and both * clear `converter.bibliographyPart` when the deleted part is the bibliography * storage part (otherwise `syncBibliographyPartToPackage` would resurrect it * from the stale cache on the next export). */ export declare function recordCustomXmlTombstone(converter: ConverterWithCustomXmlTombstones, path: string): void; //# sourceMappingURL=consumer.d.ts.map