import { Plugin } from "prosemirror-state"; import { Decoration, NodeView } from "prosemirror-view"; import { EnterRule } from "prosemirror-enter-rules"; import { InputRule } from "prosemirror-inputrules"; import { Node, NodeSpec } from "prosemirror-model"; //#region src/cursor-inside-plugin.d.ts /** * Creates a plugin that adds a `prosemirror-math-head-inside` CSS class to math * nodes when the text selection head is inside them. This is useful for styling * math nodes differently while they are being edited. * * The plugin automatically detects nodes in the `math` group. * * @public */ declare function createCursorInsidePlugin(): Plugin; //#endregion //#region src/math-block-enter-rule.d.ts /** * An {@link EnterRule} that converts a textblock node that only contains `$$` into a math * block node when Enter is pressed. * * @public */ declare const mathBlockEnterRule: EnterRule; //#endregion //#region src/math-block-spec.d.ts /** * A {@link NodeSpec} for a block-level math node. * * @public */ declare const mathBlockSpec: NodeSpec; //#endregion //#region src/math-block-view.d.ts /** * The function to render a math block. * * @param text - The text of the math block. For example, a TeX expression. * @param element - A `
` element to render the math block. */ type RenderMathBlock = (text: string, element: HTMLElement) => void; /** * Creates a {@link NodeView} for a block-level math node. The view will show a * source editor or a rendered display area based on the text cursor position. * * @param renderMathBlock - A function that renders math text (e.g. TeX) into * the display element. You can use libraries like * [Temml](https://temml.org/) or [KaTeX](https://katex.org/). * @param node - The ProseMirror node to render. * @param decorations - The decorations applied to the node. * * @public */ declare function createMathBlockView(renderMathBlock: RenderMathBlock, node: Node, decorations: readonly Decoration[]): NodeView; //#endregion //#region src/math-inline-input-rule.d.ts /** * Creates a ProseMirror {@link InputRule} that converts text wrapped in `$` or * `$$` (e.g. `$x^2$`) into an inline math node. * * @param nodeType - The name of the inline math node type in your schema. * * @public */ declare function createMathInlineInputRule(nodeType: string): InputRule; //#endregion //#region src/math-inline-spec.d.ts /** * A {@link NodeSpec} for an inline math node. * * @public */ declare const mathInlineSpec: NodeSpec; //#endregion //#region src/math-inline-view.d.ts /** * The function to render a math inline. * * @param text - The text of the math inline. For example, a TeX expression. * @param element - A `` element to render the math inline. */ type RenderMathInline = (text: string, element: HTMLElement) => void; /** * Creates a {@link NodeView} for an inline math node. The view will show a * source editor or a rendered display area based on the text cursor position. * * @param renderMathInline - A function that renders math text (e.g. TeX) into * the display element. You can use libraries like [Temml](https://temml.org/) * or [KaTeX](https://katex.org/). * @param node - The ProseMirror node to render. * @param decorations - The decorations applied to the node. * * @public */ declare function createMathInlineView(renderMathInline: RenderMathInline, node: Node, decorations: readonly Decoration[]): NodeView; //#endregion export { type RenderMathBlock, type RenderMathInline, createCursorInsidePlugin, createMathBlockView, createMathInlineInputRule, createMathInlineView, mathBlockEnterRule, mathBlockSpec, mathInlineSpec }; //# sourceMappingURL=index.d.ts.map