@tabula/ui-ai-chat
Version:
Allows to embed UI for conversation with AI assistant
33 lines (32 loc) • 801 B
TypeScript
export type Request = {
id: number;
prompt: string;
answer: string;
} | {
id?: never;
prompt: string;
answer?: never;
};
export type InternalConversationController = {
hasTextArea: boolean;
scrollToTop: (behavior?: ScrollBehavior) => void;
scrollToBottom: (behavior?: ScrollBehavior) => void;
};
export type ConversationController = Omit<InternalConversationController, 'hasTextArea'>;
export type PromptInputController = {
focus: () => void;
blur: () => void;
select: () => void;
};
export type Controller = {
conversation: ConversationController;
prompt: PromptInputController;
};
export type TableData = {
header: string[];
rows: string[][];
};
export type TableAction = {
label: string;
action: (data: TableData) => void;
};