import type { MaybeRefOrGetter } from 'vue'; import type { YjsAdapter } from '../composables/yjs/types'; import type { ContentTypeStrategy } from './composables/strategies'; /** * Bridges the `web-pkg/editor` strategy contract to the * {@link YjsAdapter} contract that `useYjsSession` * expects. * * Each strategy already knows how to convert between its native string format * (markdown / HTML / plain text / tiptap-json) and a ProseMirror document. The * adapter handles the conversion between that document and the Y.Doc state * that `Collaboration` writes to. * * `serialize` converts the Y.XmlFragment directly into a ProseMirror node and * hands that to the strategy. No editor is involved, which matters because the * session serializes on every pause in typing on every peer. * * `hydrate` still needs an editor, because parsing native content back into * the shared types goes through `setContent`. It runs once per session, so its * cost does not matter. It spawns a headless editor for this. * * `strategy` is a `MaybeRefOrGetter` because the adapter is built before the * file is loaded, so the content type isn't known yet. Strategies must be * built in a setup context; resolving the getter later is safe. */ export declare function makeTiptapYjsAdapter(strategy: MaybeRefOrGetter, fragment?: string): YjsAdapter;