import { Editor } from './editor.js'; import { DocNode, Range } from './doc/types.js'; import { ExtractAttrValue, 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; /** * 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; type ToggleableKey = T extends any ? { [K in keyof T]-?: T[K] extends boolean | undefined ? K : never; }[keyof T] : never; /** * Format content in the selection or specified range. */ export declare function Format, K extends Exclude : never, "text">>(editor: Editor, key: K, value: ExtractAttrValue, range?: Range): void; /** * Toggle formatting in the selection or specified range. */ export declare function ToggleFormat(editor: Editor, key: Extract>, string>, range?: Range): void; /** * Set attr to block nodes in the selection or specified range. */ export declare function SetBlockAttr, K extends string>(editor: Editor, key: K, value: ExtractAttrValue, range?: Range): void; /** * Toggle attr of block nodes in the selection or specified range. */ export declare function ToggleBlockAttr, K extends string>(editor: Editor, key: K, onValue: ExtractAttrValue, offValue: ExtractAttrValue, range?: Range): 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 {};