-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathchat.ts
62 lines (61 loc) · 2.54 KB
/
chat.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
import {
NotificationHandler,
RequestHandler,
ChatParams,
ChatResult,
EndChatParams,
EndChatResult,
FeedbackParams,
FollowUpClickParams,
InfoLinkClickParams,
InsertToCursorPositionParams,
LinkClickParams,
QuickActionParams,
QuickActionResult,
SourceLinkClickParams,
TabChangeParams,
TabAddParams,
TabRemoveParams,
OpenTabParams,
OpenTabResult,
ChatUpdateParams,
FileClickParams,
InlineChatParams,
InlineChatResult,
ContextCommandParams,
CreatePromptParams,
ListConversationsParams,
ListConversationsResult,
ConversationClickParams,
ConversationClickResult,
} from '../protocol'
/**
* The Chat feature interface. Provides access to chat features
*/
export type Chat = {
// Requests
onChatPrompt: (handler: RequestHandler<ChatParams, ChatResult | undefined | null, ChatResult>) => void
onInlineChatPrompt: (
handler: RequestHandler<InlineChatParams, InlineChatResult | undefined | null, InlineChatResult>
) => void
onEndChat: (handler: RequestHandler<EndChatParams, EndChatResult, void>) => void
onQuickAction: (handler: RequestHandler<QuickActionParams, QuickActionResult, void>) => void
openTab: (params: OpenTabParams) => Promise<OpenTabResult>
onListConversations: (handler: RequestHandler<ListConversationsParams, ListConversationsResult, void>) => void
onConversationClick: (handler: RequestHandler<ConversationClickParams, ConversationClickResult, void>) => void
// Notifications
onSendFeedback: (handler: NotificationHandler<FeedbackParams>) => void
onReady: (handler: NotificationHandler<void>) => void
onTabAdd: (handler: NotificationHandler<TabAddParams>) => void
onTabChange: (handler: NotificationHandler<TabChangeParams>) => void
onTabRemove: (handler: NotificationHandler<TabRemoveParams>) => void
onCodeInsertToCursorPosition: (handler: NotificationHandler<InsertToCursorPositionParams>) => void
onLinkClick: (handler: NotificationHandler<LinkClickParams>) => void
onInfoLinkClick: (handler: NotificationHandler<InfoLinkClickParams>) => void
onSourceLinkClick: (handler: NotificationHandler<SourceLinkClickParams>) => void
onFollowUpClicked: (handler: NotificationHandler<FollowUpClickParams>) => void
sendChatUpdate: (params: ChatUpdateParams) => void
onFileClicked: (handler: NotificationHandler<FileClickParams>) => void
sendContextCommands: (params: ContextCommandParams) => void
onCreatePrompt: (handler: NotificationHandler<CreatePromptParams>) => void
}