import type { SimpleAction } from "@next-bricks/basic/actions"; import { type TextareaAutoResizeRef } from "@next-shared/form"; import type { CommandPayload } from "../interfaces"; import type { ChatCommand } from "../../data-providers/set-chat-command"; export declare const MAX_SHOWN_COMMANDS = 10; export interface MentionPopover { style: React.CSSProperties; range: { start: number; end: number; }; actions: ActionWithSubCommands[]; } export type ActionWithSubCommands = SimpleAction & { key: string | number; subCommands?: Command[]; payload?: CommandPayload; }; export interface Command { label: string; value: string; groupKey?: string; groupLabel?: string; subCommands?: Command[]; payload?: CommandPayload; } export interface AIEmployee { employeeId: string; name: string; } export interface UseChatMentionsParams { aiEmployees?: AIEmployee[]; commands?: Command[]; root: HTMLElement; hasFiles: boolean; /** @default "bottom" */ placement?: "top" | "bottom"; } export declare function useChatCompletions({ aiEmployees, commands: propCommands, root, hasFiles, placement, }: UseChatMentionsParams): { textareaRef: React.RefObject; valueRef: React.MutableRefObject; value: string; setValue: React.Dispatch>; selectionRef: React.MutableRefObject<{ start: number; end: number; } | null>; mentioned: string | null; mentionedText: string; mentionPopover: MentionPopover | null; mentionOverlay: React.CSSProperties[] | null; mentionActiveKeys: (string | number)[] | null; setInitialMention: React.Dispatch>; handleMention: (action: SimpleAction) => void; command: CommandPayload | null; commandText: string; commandPrefix: string; commandPopover: MentionPopover | null; commandOverlay: React.CSSProperties[] | null; commandActiveKeys: (string | number)[] | null; setInitialCommand: React.Dispatch>; handleSelectCommand: (action: ActionWithSubCommands) => void; handleChange: (e: React.ChangeEvent) => void; handleKeyDown: (e: React.KeyboardEvent) => false | undefined; };