-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuseProcessBlock.d.ts
More file actions
32 lines (32 loc) · 1.47 KB
/
useProcessBlock.d.ts
File metadata and controls
32 lines (32 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Message } from 'react-chatbotify';
import { Provider } from '../types/Provider';
/**
* Handles pre-processing and post-processing of blocks.
*
* @param refs object containing relevant refs
* @param actions object containing relevant actions
*/
declare const useProcessBlock: (refs: {
providerRef: React.MutableRefObject<Provider | null>;
messagesRef: React.MutableRefObject<Message[]>;
outputTypeRef: React.MutableRefObject<"character" | "chunk" | "full">;
outputSpeedRef: React.MutableRefObject<number>;
historySizeRef: React.MutableRefObject<number>;
initialMessageRef: React.MutableRefObject<string>;
errorMessageRef: React.MutableRefObject<string>;
onUserMessageRef: React.MutableRefObject<((msg: Message) => Promise<string | null>) | null>;
onKeyDownRef: React.MutableRefObject<((e: KeyboardEvent) => Promise<string | null>) | null>;
}, actions: {
speakAudio: (text: string) => void;
injectMessage: (content: string | JSX.Element, sender?: string) => Promise<Message | null>;
simulateStreamMessage: (content: string, sender?: string) => Promise<Message | null>;
streamMessage: (msg: string) => void;
endStreamMessage: () => void;
toggleTextAreaDisabled: (active?: boolean) => void;
toggleIsBotTyping: (active?: boolean) => void;
focusTextArea: () => void;
goToPath: (path: string) => void;
getIsChatBotVisible: () => boolean;
}) => void;
export { useProcessBlock };
//# sourceMappingURL=useProcessBlock.d.ts.map