import { ComputedRef, MaybeRefOrGetter, Ref } from 'vue'; import { PromptBarMenuKind } from './types'; export interface PromptBarToken { kind: PromptBarMenuKind; /** Text typed after the trigger character, lower-cased for matching. */ query: string; /** Index of the trigger character itself within the draft. */ start: number; } export declare function parseToken(draft: string): PromptBarToken | null; /** The shape both menus agree on; callers keep their own richer row types. */ export interface TokenMenuRow { key: string; name: string; } export interface UseTokenMenuOptions { draft: MaybeRefOrGetter; sources?: MaybeRefOrGetter; commands?: MaybeRefOrGetter; /** Forces the `at` menu open with an empty query — the composer's + button. */ forced?: MaybeRefOrGetter; } export interface UseTokenMenuReturn { token: ComputedRef; menu: ComputedRef; query: ComputedRef; rows: ComputedRef<(TSource | TCommand)[]>; activeIndex: Ref; activeRow: ComputedRef; /** Whether the highlight has been earned yet — see `engage`. */ engaged: Ref; dismissed: Ref; move: (direction: 1 | -1) => void; engage: (index: number) => void; dismiss: () => void; resume: () => void; /** The draft with the pending token replaced by `replacement`, plus a space. */ insert: (replacement: string) => string; } /** * The `@` / `/` menu state machine behind `TxPromptBar`, exported on its own so * a host can wire mentions into its own composer without adopting the whole * bar. Pure state: it owns no DOM and performs no side effects. */ export declare function useTokenMenu(options: UseTokenMenuOptions): UseTokenMenuReturn;