import "./Editors.css";
import type { EditorContentChange, SourceFormat } from "../types/editor";
import type { DocumentSection } from "../types/sections";
export interface editorProps {
    /** The source content string (PreTeXt XML or LaTeX). */
    source: string;
    /**
     * The format of `source`.  Defaults to `"pretext"` when omitted.
     * When set to `"latex"`, the editor displays a LaTeX code editor and
     * derives a read-only PreTeXt preview via conversion.
     */
    sourceFormat?: SourceFormat;
    /**
     * Pre-computed PreTeXt XML corresponding to `source`.
     * Providing this avoids running the conversion on first render when the
     * host already has a cached result.  Only meaningful when
     * `sourceFormat` is not `"pretext"`.
     */
    pretextSource?: string;
    /**
     * The docinfo element for a pretext document, which can contain macros and similar
     * document wide information.
     */
    docinfo?: string;
    /**
     * Called whenever the source content changes (user edits in the code
     * editor or WYSIWYG editor).
     *
     * @param value - The new source string (`undefined` is passed by Monaco on
     *   certain edge cases; treat it as an empty string).
     * @param meta - The full derived {@link EditorContentChange} state at the
     *   time of the change, including the converted PreTeXt and any error.
     */
    onContentChange: (value: string | undefined, meta?: EditorContentChange) => void;
    /** Document title shown in the menu bar title field. */
    title?: string;
    /** Called when the user edits the title field. */
    onTitleChange?: (value: string) => void;
    /** If provided, a Save button is rendered in the menu bar. */
    onSaveButton?: () => void;
    /** Label for the Save button.  Defaults to `"Save"`. */
    saveButtonLabel?: string;
    /** If provided, a Cancel button is rendered in the menu bar. */
    onCancelButton?: () => void;
    /** Label for the Cancel button.  Defaults to `"Cancel"`. */
    cancelButtonLabel?: string;
    /**
     * If provided, `onSave` is called on Ctrl+S in addition to `onSaveButton`.
     * Useful when the host wants a keyboard shortcut to trigger saving without
     * necessarily showing an explicit Save button.
     */
    onSave?: () => void;
    /**
     * If provided, the right-hand panel shows a full iframe-based preview
     * instead of the Tiptap visual editor, and a rebuild button / Ctrl+Enter
     * shortcut become active.
     *
     * @param source - The current PreTeXt XML to render.
     * @param title - The current document title.
     * @param postToIframe - Helper to post a message into the preview iframe.
     */
    onPreviewRebuild?: (source: string, title: string, postToIframe: (url: string, data: any) => void) => void;
    /**
     * Controls the editing mode from the outside.  When provided, the
     * component operates in controlled mode; omit to use internal state
     * (uncontrolled).
     */
    editMode?: "document" | "sectioned";
    /**
     * Initial editing mode for uncontrolled usage.  Defaults to `"document"`.
     */
    defaultEditMode?: "document" | "sectioned";
    /**
     * Called when the user switches between `"document"` and `"sectioned"` mode.
     */
    onEditModeChange?: (mode: "document" | "sectioned") => void;
    /**
     * Called when the section list changes structurally (add, remove, reorder,
     * or rename).  Only fired in `"sectioned"` mode.
     */
    onSectionsChange?: (sections: DocumentSection[]) => void;
    /**
     * Called when the content of a single section is edited.  Only fired in
     * `"sectioned"` mode.
     */
    onSectionChange?: (section: DocumentSection) => void;
}
/**
 * Top-level editor component that wires together the Monaco code editor and
 * the right-hand preview panel (either Tiptap visual editor or full iframe
 * preview).  Also owns the menu bar and responsive layout logic.
 *
 * Content state is derived from props on every render via `useMemo` so the
 * parent always controls the source of truth; the component itself holds no
 * long-lived content state.
 */
declare const Editors: (props: editorProps) => import("react/jsx-runtime").JSX.Element;
export default Editors;
