rich-text-editor
Version:
Rich text editor
17 lines (16 loc) • 637 B
TypeScript
import * as MathQuill from '@digabi/mathquill';
type Opts = {
latex: string;
onChange?: (oldLatex: string | undefined, newLatex: string) => void;
onEnter: (latex: string) => void;
};
export default function useMathQuill(opts: Opts): {
/** A `ref` that must be attached to the `div` tag that should be controlled by MathQuill */
ref: (node: HTMLDivElement | null) => void;
/** A MathQuill `MathField` that's attached to the `ref` */
mq: MathQuill.MathField | null;
/** Boolean representing if the current `latex` code is parseable by MathQuill */
isError: boolean;
lastValue: string;
};
export {};