import { Editor } from './editor.js'; import { DocNode, Range } from './doc/types.js'; import { ExtractAttrValue, InferInlineNode, InferLeafBlockNode, InferTextNode, InferVoidNode } from './doc/types-infer.js'; /** * Delete content in the selection or specified range. */ export declare function Delete(editor: Editor, range?: Range): void; /** * Insert text at the caret or specified position. */ export declare function InsertText(editor: Editor, text: string, at?: number): void; /** * Insert node at the caret or specified position. */ export declare function InsertNode(editor: Editor, node: InferVoidNode, at?: number): void; /** * Insert multiple inline nodes as a single line fragment in one transaction. * * Fork-only command. Useful when a single insert needs to interleave text and * void nodes (e.g. mention chips) without splitting blocks. */ export declare function InsertNodes(editor: Editor, nodes: InferInlineNode[], position?: number): void; /** * Replace text in the selection or specified range. */ export declare function ReplaceText(editor: Editor, text: string, range?: Range): void; /** * Replace document in the editor. */ export declare function ReplaceDoc(editor: Editor, fragment: T["children"]): void; /** * Replace the whole document content with a plain text string. * * Fork-only convenience command — splits on `\n` into one block per line * (matching how plain editors render). Equivalent to: * * ```ts * editor.exec(ReplaceDoc, text.split("\n").map((t) => ({ children: [{ text: t }] }))); * ``` */ export declare function ReplaceAll(editor: 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>(editor: Editor, key: K, value: N[K], range?: Range): void; /** * Toggle formatting in the selection or specified range. */ export declare function ToggleFormat(editor: 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 string>(editor: Editor, key: K, value: ExtractAttrValue, offset?: number): void; /** * Toggle attr of block node at the caret or specified position. */ export declare function ToggleBlockAttr, K extends string>(editor: Editor, key: K, onValue: ExtractAttrValue, offValue: ExtractAttrValue, offset?: number): void; /** * Set attr to a void node at the caret or specified position. */ export declare function SetVoidAttr, K extends string>(editor: Editor, key: K, value: ExtractAttrValue, offset?: number): void; export {};