import type { ComputedRef, Ref } from 'vue'; import type { ShortcutManager } from '../../manager/business/shortcut-manager'; import type { IShortcut } from '../../manager/business/types'; import type { IChatHelper } from '../../types'; import type { ChatBotProps } from '../types'; import type { ChatBotEmitFn } from './use-chatbot-init'; import type { ISupportUpload, IUserMessage } from '@blueking/chat-helper'; import type { Shortcut } from '@blueking/chat-x'; export type DoSendMessageFn = (message: IUserMessage['content'], options?: { property?: Record; }) => Promise; export interface UseShortcutsParams { chatHelper: Ref; doSendMessage: DoSendMessageFn; emit: ChatBotEmitFn; props: ChatBotProps; selectedShortcut: Ref; shortcutManager: Ref; } export interface UseShortcutsReturn { effectiveShortcuts: ComputedRef; buildShortcutProperty: (shortcut: Shortcut, formModel: Record) => Record; getShortcutFromMessage: (message: any) => IShortcut | null; handleCloseShortcut: () => void; handleSelectShortcut: (shortcut: Shortcut, text?: string) => void; handleShortcutSubmit: (formModel: Record) => Promise; selectShortcutWithText: (shortcut: IShortcut | Shortcut, text?: string) => void; /** * 直接发送快捷指令(跳过表单,等价于旧版 handleShortcutClick(_, true)) * 从 shortcut.components 的 default 值构建 formModel,直接发送消息 * @param shortcut 快捷指令对象 * @param selectedText 选中的文本(可选,用于填充到 fillBack 字段) */ sendShortcutDirectly: (shortcut: IShortcut | Shortcut, selectedText?: string) => Promise; } export declare function useShortcuts(params: UseShortcutsParams): UseShortcutsReturn; //# sourceMappingURL=use-shortcuts.d.ts.map