import type { Editor } from "./editor.js"; import type { DocNode, InferBlockNode, InferInlineNode, Path, Position, Range, TextNode } from "./doc/types.js"; export type EditorCommand = (this: Editor, ...args: A) => void; /** * Delete content in the selection or specified range. */ export declare function Delete(this: Editor, range?: Range): void; /** * Insert text at the caret or specified position. */ export declare function InsertText(this: Editor, text: string, position?: Position): void; /** * Insert node at the caret or specified position. */ export declare function InsertNode(this: Editor, node: Exclude, TextNode>, position?: Position): void; /** * Replace text in the selection or specified range. */ export declare function ReplaceText(this: Editor, text: string): void; /** * Replace all content in the editor. */ export declare function ReplaceAll(this: Editor, text: string): void; type ToggleableKey = { [K in keyof T]-?: T[K] extends boolean | undefined ? K : never; }[keyof T]; /** * Format content in the selection or specified range. */ export declare function Format, "text">, K extends Extract>(this: Editor, key: K, value: N[K], range?: Range): void; /** * Toggle formatting in the selection or specified range. */ export declare function ToggleFormat(this: Editor, key: Extract, "text">>, string>, range?: Range): void; /** * Set attr to a block node at the caret or specified position. */ export declare function SetBlockAttr, K extends Extract>(this: Editor, key: K, value: N[K], path?: Path): void; /** * Toggle attr of block node at the caret or specified position. */ export declare function ToggleBlockAttr, K extends Extract>(this: Editor, key: K, onValue: N[K], offValue: N[K], path?: Path): void; export {};