import { t as TexEditorProps } from "./index-WjMpTx9m.js"; //#region src/components/equation-editor/renderEquationEditor.d.ts interface EquationEditorConfig { /** * A function to load custom theme for the editor. It should return a * Promise that resolves to a CodeMirror extension created with * `EditorView.theme()`. This allows the editor to dynamically import * `@codemirror/view`. */ loadTexEditorTheme?: TexEditorProps['loadTheme']; } interface EquationEditorProps { /** Whether the equation node is a block equation. */ isBlock: boolean; /** Initial TeX content. */ initialTex: string; /** When the content changes. */ onChange: (tex: string) => void; /** Get DOMRect of the equation node being edited. */ getNodeRect: () => DOMRect; /** Discard TeX modification and close editor. */ cancelEdit: () => void; /** * Commit TeX modification and close editor. * * @param dir Indicate the side of the equation node that the caret * should appear blinking at after closing the editor. -1 means left and * 1 means right. Default: 1 (right). */ confirmEdit: (dir?: -1 | 1) => void; } /** * A function to detach elements from HTML document and clean up effects. */ type CleanupEquationEditorFn = () => void; /** @experimental */ type RenderEquationEditorFn = (props: EquationEditorProps) => void | CleanupEquationEditorFn; /** * Default implementation of equation editor. * @experimental */ declare function createEquationEditorRenderer({ loadTexEditorTheme }?: EquationEditorConfig): ({ isBlock, initialTex, onChange, getNodeRect, cancelEdit, confirmEdit }: EquationEditorProps) => void | CleanupEquationEditorFn; //#endregion export { createEquationEditorRenderer as n, RenderEquationEditorFn as t }; //# sourceMappingURL=index-DsfL3aA6.d.ts.map