import { CoRichText } from "jazz-tools"; import { Transaction } from "prosemirror-state"; import { EditorView } from "prosemirror-view"; /** * Metadata key used to identify changes originating from Jazz. * This is used to prevent infinite update loops between CoRichText and ProseMirror. */ export declare const META_KEY = "fromJazz"; /** * Creates handlers for bidirectional synchronization between CoRichText and ProseMirror. * * This function returns a set of handlers that manage the synchronization between * a CoRichText instance and a ProseMirror editor. It handles: * - Updating the ProseMirror editor when CoRichText changes * - Updating CoRichText when the ProseMirror editor changes * - Preventing infinite update loops * * @param coRichText - The CoRichText instance to synchronize with * @returns An object containing the synchronization handlers: * - setView: Function to set the current ProseMirror view * - handleCoRichTextChange: Handler for CoRichText changes * - handleProseMirrorChange: Handler for ProseMirror changes * * @example * ```typescript * const handlers = createSyncHandlers(coRichText); * handlers.setView(editorView); * ``` */ export declare function createSyncHandlers(coRichText: CoRichText | undefined): { setView: (newView?: EditorView) => void; handleCoRichTextChange: (newText: CoRichText) => void; handleProseMirrorChange: (tr: Transaction) => void; }; //# sourceMappingURL=sync.d.ts.map