import type { EditorState } from '@rtif-sdk/web'; import type { EditorHandle } from './use-editor.js'; /** * Subscribe to a derived slice of the editor state via * `useSyncExternalStore`. Returns `null` while the editor is unmounted (and * always on the server — the server snapshot is `null`, which keeps SSR markup * deterministic). * * The selector result is cached per state version: the component re-renders * only when `isEqual` (default `Object.is`) reports a changed result, so * object-returning selectors should be paired with a structural `isEqual`. * * @param editor - The handle from {@link useEditor}. * @param selector - Pure derivation from {@link EditorState}; may be an inline arrow. * @param isEqual - Equality for selector results (default `Object.is`). * @returns The selected value, or null pre-mount / on the server. * * @example * ```tsx * const blockCount = useEditorState(editor, (s) => s.doc.blocks.length); * ``` */ export declare function useEditorState(editor: EditorHandle, selector: (state: EditorState) => T, isEqual?: (a: T, b: T) => boolean): T | null; //# sourceMappingURL=use-editor-state.d.ts.map