import type { EditorHandle } from './use-editor.js'; /** Live view of one editor command — the building block for toolbars. */ export interface UseCommandResult { /** * Run the command. * * @throws {Error} `[NOT_MOUNTED]` before `` has mounted the editor. */ exec(params?: unknown): void; /** Whether the command can run for the current state (false pre-mount). */ readonly canExec: boolean; /** Whether the command is active at the selection, pending marks included (false pre-mount). */ readonly isActive: boolean; } /** * Bind one named command (`'bold.toggle'`, `'history.undo'`, …) to live * `canExec`/`isActive` flags plus an `exec` trigger. The flags re-evaluate on * every editor state change; the returned object is memoized (new identity * only when a member changes), so it is safe in dependency arrays. * * Pre-mount and during SSR both flags are `false` and `exec` throws. * * @param editor - The handle from {@link useEditor}. * @param command - A registered `${feature}.${command}` name. * @returns The live command binding. * * @example * ```tsx * const bold = useCommand(editor, 'bold.toggle'); * * ``` */ export declare function useCommand(editor: EditorHandle, command: string): UseCommandResult; //# sourceMappingURL=use-command.d.ts.map