import React from 'react'; import { CaretController } from '../core/caret-controller'; import { PromptInputProps } from '../interfaces'; export interface ShortcutsState { /** The ID of the trigger the caret is currently in, or null if not in any trigger. */ caretInTrigger: string | null; setCaretInTrigger: (triggerId: string | null) => void; /** DOM elements for trigger spans, keyed by trigger ID. Used for dropdown positioning and render reuse. */ triggerElementsRef: React.MutableRefObject>; /** Trigger IDs cancelled by onTriggerDetected — prevents menu opening and re-detection. */ cancelledTriggerIds: React.MutableRefObject>; /** Set to the trigger ID that was just closed. checkMenuState skips reopening * this specific trigger on the next call, then clears the value. */ menuJustClosed: React.MutableRefObject; /** Tracks the last token array emitted by the component. Used to distinguish * user-initiated changes from external (parent) updates. */ lastEmittedTokensRef: React.MutableRefObject; markTokensAsSent: (tokens: readonly PromptInputProps.InputToken[]) => void; } export declare function useShortcutsState(): ShortcutsState; interface EffectsConfig { tokens?: readonly PromptInputProps.InputToken[]; editableElementRef: React.RefObject; state: ShortcutsState; activeTriggerToken: PromptInputProps.TriggerToken | null; caretController: React.RefObject; } /** * Manages trigger menu state by listening for selection changes within the * editable element. Determines which trigger (if any) the caret is inside * and updates `caretInTrigger` accordingly. * * Supports menu suppression (via Escape) which is cleared on the next user * interaction that changes the selection. */ export declare function useShortcutsEffects(config: EffectsConfig): void; export {};