import type { CommonEditor } from "../common/index.js"; import type { TransformFn } from "../core/markdown/ProseMirrorTransformer/index.js"; import type { ReactRenderStorage } from "../extensions/index.js"; import { type Logger2 } from "../logger.js"; import { type Receiver } from "../utils/index.js"; import type { DirectiveSyntaxContext } from "../utils/directive.js"; import type { MarkdownEditorMode as EditorMode, MarkdownEditorPreset as EditorPreset, MarkdownEditorOptions } from "./types.js"; export type ToolbarActionData = { editorMode: EditorMode; id: string; attrs?: { [key: string]: any; }; }; export interface EventMap { change: null; cancel: null; submit: null; 'toolbar-action': ToolbarActionData; 'change-editor-mode': { mode: EditorMode; }; 'change-toolbar-visibility': { visible: boolean; }; 'change-split-mode-enabled': { splitModeEnabled: boolean; }; } export interface Editor extends Receiver, CommonEditor { readonly logger: Logger2.LogReceiver; readonly currentMode: EditorMode; readonly toolbarVisible: boolean; setEditorMode(mode: EditorMode, opts?: SetEditorModeOptions): void; moveCursor(position: 'start' | 'end' | { line: number; }): void; } type SetEditorModeOptions = Pick; export type ChangeEditorModeOptions = { mode: EditorMode; reason: 'error-boundary' | 'settings' | 'manually'; emit?: boolean; }; export type EditorOptions = Pick & { logger: Logger2.ILogger; renderStorage: ReactRenderStorage; preset: EditorPreset; directiveSyntax: DirectiveSyntaxContext; pmTransformers: TransformFn[]; }; export {};