forked from vercel/ai-chatbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
48 lines (41 loc) · 836 Bytes
/
types.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
import { CoreMessage } from 'ai'
export type Message = CoreMessage & {
id: string
createdAt?: number;
}
export interface Chat extends Record<string, any> {
id: string
title: string
createdAt: Date
userId: string
path: string
messages: Message[]
sharePath?: string
}
export type ServerActionResult<Result> = Promise<
| Result
| {
error: string
}
>
export interface Session {
user: {
id: string
email: string
}
}
export interface AuthResult {
type: string
message: string
}
export interface User extends Record<string, any> {
id: string
email: string
password: string
salt: string
}
export type MutableAIState<AIState> = {
get: () => AIState;
update: (newState: AIState | ((current: AIState) => AIState)) => void;
done: ((newState: AIState) => void) | (() => void);
};