/** * Draft-level composer actions and their registration on * {@link composerActionPort}, so status chrome and keystrokes share one path. */ import { type RefObject } from "react"; import type { TextareaRenderable } from "@opentui/core"; import type { AppServices } from "../../ui-core/bootstrap/composition-root.js"; export interface DraftActionsInput { readonly editorRef: RefObject; readonly services: AppServices; /** Expands paste placeholders into the real text. */ readonly expandPastes: (text: string) => string; /** Drop paste + prompt-history state tied to the current draft. */ readonly resetRegistries: () => void; /** Collapse the completion menu and any accepted-slash marker. */ readonly resetMenuState: () => void; readonly setContentRows: (rows: number) => void; readonly clearPasteChips: () => void; readonly focusComposer: () => boolean; readonly refreshMenu: () => void; readonly syncContentRows: () => void; readonly notify: (message: string, durationMs: number) => void; } export interface DraftActions { /** Wipe the draft and everything derived from it. */ readonly clear: (editor: TextareaRenderable) => void; /** Ctrl+X — copy the draft to the clipboard, then clear it. */ readonly cut: () => Promise; /** Show every slash command, as typing "/" in the composer does. */ readonly showCommands: () => void; readonly insert: (text: string) => void; } export declare function useDraftActions(input: DraftActionsInput): DraftActions;