import { Command, EditorState } from 'prosemirror-state'; import { MarkType, ResolvedPos, Node as PMNode } from 'prosemirror-model'; import type { Alignment } from './schema'; export type CommandName = 'bold' | 'italic' | 'underline' | 'strike' | 'subscript' | 'superscript' | 'code' | 'paragraph' | 'heading' | 'blockquote' | 'align' | 'lineHeight' | 'bulletList' | 'orderedList' | 'taskList' | 'indent' | 'outdent' | 'setListStyle' | 'setListStart' | 'toggleImageCaption' | 'setImageAlign' | 'setImageWidth' | 'deleteImage' | 'updateImage' | 'setEmbedAlign' | 'deleteEmbed' | 'link' | 'unlink' | 'insertBookmark' | 'textColor' | 'bgColor' | 'fontFamily' | 'fontSize' | 'horizontalRule' | 'clearFormatting' | 'undo' | 'redo' | 'codeBlock' | 'setCodeBlockLanguage' | 'insertEmbed' | 'insertImage' | 'insertTable' | 'addRowBefore' | 'addRowAfter' | 'addColumnBefore' | 'addColumnAfter' | 'deleteRow' | 'deleteColumn' | 'mergeCells' | 'splitCell' | 'toggleHeaderRow' | 'toggleLayoutTable' | 'deleteTable' | 'changeCase' | 'insertMergeField' | 'insertMath'; export interface CommandAttrs { level?: number; align?: Alignment | null; href?: string; title?: string; target?: string | null; color?: string | null; family?: string | null; size?: string | null; /** insertImage / updateImage */ src?: string; alt?: string | null; /** insertImage / updateImage: figcaption text; empty/null = plain inline image */ caption?: string | null; /** insertTable */ rows?: number; cols?: number; withHeaderRow?: boolean; /** codeBlock */ language?: string | null; /** insertEmbed */ provider?: string | null; /** setListStyle: a CSS list-style-type, null = default */ style?: string | null; /** setListStart */ start?: number; /** setImageWidth: px, null = natural size */ width?: number | null; /** lineHeight: unitless multiplier ('1.5'), null = default */ lineHeight?: string | null; /** insertBookmark / insertMergeField: the anchor or field id */ id?: string; /** changeCase: which transform to apply */ textCase?: 'upper' | 'lower' | 'title' | 'sentence'; /** insertMergeField: human-readable label */ label?: string | null; /** insertMath: LaTeX source */ latex?: string; /** insertMath: inline vs block presentation */ mathDisplay?: 'inline' | 'block'; } /** Finds the extent of a mark around a resolved position (cursor in a link). */ export declare function getMarkRange($pos: ResolvedPos, markType: MarkType): { from: number; to: number; } | null; /** * The image (inline `image` or block `figure`) the selection points at: * a NodeSelection on either type, or a cursor inside a figure's caption. */ export declare function selectedImageInfo(state: EditorState): { node: PMNode; pos: number; isFigure: boolean; } | null; /** The selected embed node (a NodeSelection on an `embed`), or null. */ export declare function selectedEmbedInfo(state: EditorState): { node: PMNode; pos: number; } | null; /** * Resolves a named command against a schema. Returns null for unknown names * so callers can treat the registry as data. */ export declare function getCommand(state: EditorState, name: CommandName, attrs?: CommandAttrs): Command | null;