import { CoRichText } from "jazz-tools"; import { Plugin, PluginKey } from "prosemirror-state"; /** * Configuration options for the Jazz plugin */ export interface JazzPluginConfig { /** Whether to show caret and selection decorations */ showDecorations?: boolean; } /** * Unique key for the Jazz plugin to identify it in the ProseMirror state. * This key is used to access the plugin's state and view from the editor. */ export declare const jazzPluginKey: PluginKey; /** * Creates a ProseMirror plugin that synchronizes a CoRichText instance with a ProseMirror editor. * * This plugin enables bidirectional synchronization between a CoRichText instance * and a ProseMirror editor. It handles: * - Initializing the editor with CoRichText content * - Updating the editor when CoRichText changes * - Updating CoRichText when the editor changes * - Managing the editor view lifecycle * * @param coRichText - The CoRichText instance to synchronize with the editor. * If undefined, the plugin will still work but won't sync with CoRichText. * @param config - Optional configuration for the plugin * @returns A ProseMirror plugin instance that can be added to an editor * * @example * ```typescript * const coRichText = new CoRichText({ text: "

Hello

", owner: account }); * const plugin = createJazzPlugin(coRichText, { showDecorations: true }); * const state = EditorState.create({ * schema, * plugins: [plugin], * }); * ``` */ export declare function createJazzPlugin(coRichText: CoRichText | undefined, config?: JazzPluginConfig): Plugin<{ coRichText: CoRichText | undefined; }>; //# sourceMappingURL=plugin.d.ts.map