forked from onlook-dev/onlook
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathcontext.ts
More file actions
53 lines (45 loc) · 1.16 KB
/
context.ts
File metadata and controls
53 lines (45 loc) · 1.16 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
export enum MessageContextType {
FILE = 'file',
HIGHLIGHT = 'highlight',
IMAGE = 'image',
ERROR = 'error',
PROJECT = 'project',
LINK = 'link',
}
type BaseMessageContext = {
type: MessageContextType;
content: string;
displayName: string;
};
export type FileMessageContext = BaseMessageContext & {
type: MessageContextType.FILE;
path: string;
};
export type HighlightMessageContext = BaseMessageContext & {
type: MessageContextType.HIGHLIGHT;
path: string;
start: number;
end: number;
};
export type ImageMessageContext = BaseMessageContext & {
type: MessageContextType.IMAGE;
mimeType: string;
};
export type ErrorMessageContext = BaseMessageContext & {
type: MessageContextType.ERROR;
};
export type ProjectMessageContext = BaseMessageContext & {
type: MessageContextType.PROJECT;
path: string;
};
export type LinkMessageContext = BaseMessageContext & {
type: MessageContextType.LINK;
url: string;
};
export type ChatMessageContext =
| FileMessageContext
| HighlightMessageContext
| ImageMessageContext
| ErrorMessageContext
| ProjectMessageContext
| LinkMessageContext;