/** * Module-internal plumbing between `useEditor` (which creates a handle) and * `EditorContent` / the state hooks (which drive it). NOT exported from * `index.ts` — the mount/unmount lifecycle and the version-numbered * subscription store are deliberately invisible to consumers so the public * {@link EditorHandle} surface stays four members wide (the v2 WeakMap * pattern). */ import type { Editor } from '@rtif-sdk/web'; import type { EditorHandle } from './use-editor.js'; /** The private controls behind an {@link EditorHandle}. */ export interface EditorInternals { /** Create the web editor into `element` (called from EditorContent's effect). */ mount(element: HTMLElement): void; /** Destroy the editor and reset so a later `mount` works (StrictMode remount). */ unmount(): void; /** Subscribe to state-version changes; returns the unsubscribe function. */ subscribe(listener: () => void): () => void; /** Monotonically increasing state version — the `useSyncExternalStore` cache key. */ getVersion(): number; /** The live editor, or null while unmounted. */ getEditor(): Editor | null; } /** Register the internals for a freshly created handle (useEditor only). */ export declare function registerInternals(handle: EditorHandle, internals: EditorInternals): void; /** * Look up the internals for a handle. * * @throws {RtifReactError} UNREGISTERED_HANDLE when the handle was not created by `useEditor`. */ export declare function getInternals(handle: EditorHandle): EditorInternals; //# sourceMappingURL=internals.d.ts.map