-
Notifications
You must be signed in to change notification settings - Fork 0
/
typing.d.ts
63 lines (56 loc) · 1.52 KB
/
typing.d.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { Edge, Node } from "@xyflow/react";
import { ChatRequestOptions, Message } from "ai";
import { Timestamp } from "firebase/firestore";
import React from "react";
export interface User {
uid: string;
name: string;
photoURL?: string;
email: string;
}
export interface Board {
id: string;
name: string;
nodes: Node[];
edges: Edge[];
notes: string;
createdAt: Timestamp;
userId: string;
}
export interface Chat {
id: string;
title: string | null;
createdAt: Date;
}
export interface UserDetails {
email: string;
name: string;
}
export interface Model {
id: "google-generative-ai" | "mistral";
name: "Mistral AI" | "Google Generative AI";
}
export interface ChatStore {
boardId: string;
nodeId: string;
chats: Chat[];
setChats: React.Dispatch<React.SetStateAction<Chat[]>>;
setMessages: (messages: Message[]) => void;
currentChat: Chat | null;
setCurrentChat: React.Dispatch<React.SetStateAction<Chat | null>>;
setInput: React.Dispatch<React.SetStateAction<string>>;
setHasFetchedMessages: React.Dispatch<React.SetStateAction<boolean>>;
isAIThinking: boolean;
hasFetchedMessages: boolean;
messages: Message[];
model: Model;
setModel: React.Dispatch<React.SetStateAction<Model>>;
handleInputChange: (e: React.ChangeEvent<React.HTMLTextAreaElement>) => void;
input: string;
handleSubmit: (
event: { preventDefault: () => void },
chatRequestOptions: ChatRequestOptions
) => void;
isLoading: boolean;
setIsAIThinking: React.Dispatch<React.SetStateAction<boolean>>;
}