import { Node } from '@tiptap/core';
import { FormulaDoc } from '@formulaxjs/core';
import { FormulaXEditorPreloadMode, FormulaXEditorOptions } from '@formulaxjs/editor';
import { FormulaRenderer } from '@formulaxjs/renderer';

interface FormulaXPayload {
    latex: string;
}
interface FormulaXTiptapOptions {
    name?: string;
    formulaClassName?: string;
    formulaAttributeName?: string;
    cursorStyle?: string;
    initialLatex?: string;
    renderer?: FormulaRenderer;
    preload?: FormulaXEditorPreloadMode;
    modal?: {
        title?: string;
        insertText?: string;
        updateText?: string;
        cancelText?: string;
        closeOnBackdrop?: boolean;
    };
    editor?: Omit<FormulaXEditorOptions, 'initialLatex'>;
}
interface RequiredFormulaXTiptapOptions {
    name: string;
    formulaClassName: string;
    formulaAttributeName: string;
    cursorStyle: string;
    initialLatex: string;
    renderer: FormulaRenderer;
    preload: FormulaXEditorPreloadMode;
    modal: {
        title: string;
        insertText: string;
        updateText: string;
        cancelText: string;
        closeOnBackdrop: boolean;
    };
    editor: {
        height: number | string;
        autofocus: boolean;
        locale: FormulaXEditorOptions['locale'];
        assets: FormulaXEditorOptions['assets'];
        render: {
            fontsize: number;
        };
    };
}

interface OpenFormulaXTiptapModalInput {
    initialLatex: string;
    isUpdate: boolean;
    options: RequiredFormulaXTiptapOptions;
}
declare function openFormulaXTiptapModal(input: OpenFormulaXTiptapModalInput): Promise<FormulaXPayload | null>;

interface FormulaXNodeAttributes {
    latex: string;
}
declare const FORMULAX_NODE_NAME = "formulaX";
declare module '@tiptap/core' {
    interface Commands<ReturnType> {
        formulaX: {
            openFormulaX: () => ReturnType;
        };
    }
}
declare function resolveOptions(options?: FormulaXTiptapOptions): RequiredFormulaXTiptapOptions;
interface TiptapNodeFactory {
    create: typeof Node.create;
}
declare function createFormulaXNode(nodeFactory?: TiptapNodeFactory, options?: FormulaXTiptapOptions): any;
declare const FormulaXNode: any;
declare const createFormulaXPayload: (latex: string) => FormulaDoc;
declare const serializeFormulaXPayload: (doc: FormulaDoc) => string;

export { FORMULAX_NODE_NAME, FormulaXNode, type FormulaXNodeAttributes, type FormulaXPayload, type FormulaXTiptapOptions, type RequiredFormulaXTiptapOptions, type TiptapNodeFactory, createFormulaXNode, createFormulaXPayload, openFormulaXTiptapModal, resolveOptions, serializeFormulaXPayload };
