Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vscode-dts/vscode.proposed.chatInputNotification.d.ts
13379 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
declare module 'vscode' {
7
8
/**
9
* Severity level of a chat input notification.
10
*/
11
export enum ChatInputNotificationSeverity {
12
/**
13
* Informational notification (e.g., approaching a usage threshold).
14
*/
15
Info = 0,
16
17
/**
18
* Warning notification (e.g., close to a usage limit).
19
*/
20
Warning = 1,
21
22
/**
23
* Error notification (e.g., quota exhausted).
24
*/
25
Error = 2,
26
}
27
28
/**
29
* An action button displayed in a chat input notification.
30
*/
31
export interface ChatInputNotificationAction {
32
/**
33
* The label of the action button.
34
*/
35
label: string;
36
37
/**
38
* The command to execute when the action is clicked.
39
*/
40
commandId: string;
41
42
/**
43
* Optional arguments to pass to the command.
44
*/
45
commandArgs?: unknown[];
46
}
47
48
/**
49
* A notification banner displayed above the chat input area.
50
*
51
* Notifications have a severity level that controls their visual styling
52
* (info, warning, or error), a message, optional action buttons, and
53
* configurable dismiss behavior.
54
*/
55
export interface ChatInputNotification {
56
/**
57
* The unique identifier of this notification.
58
*/
59
readonly id: string;
60
61
/**
62
* The severity of the notification.
63
*/
64
severity: ChatInputNotificationSeverity;
65
66
/**
67
* The title to display. Plain text only. Rendered in bold.
68
*/
69
message: string;
70
71
/**
72
* Optional description text displayed below the title.
73
* Plain text only.
74
*/
75
description: string | undefined;
76
77
/**
78
* Optional action buttons to display.
79
*/
80
actions: ChatInputNotificationAction[];
81
82
/**
83
* Whether the notification can be dismissed by the user. Defaults to `true`.
84
*/
85
dismissible: boolean;
86
87
/**
88
* Whether the notification should be automatically dismissed when the user
89
* sends their next chat message. Defaults to `false`.
90
*/
91
autoDismissOnMessage: boolean;
92
93
/**
94
* Shows the notification in the chat input area.
95
*/
96
show(): void;
97
98
/**
99
* Hides the notification from the chat input area.
100
*/
101
hide(): void;
102
103
/**
104
* Dispose and free associated resources.
105
*/
106
dispose(): void;
107
}
108
109
namespace chat {
110
/**
111
* Create a new chat input notification.
112
*
113
* @param id The unique identifier of the notification.
114
* @returns A new chat input notification.
115
*/
116
export function createInputNotification(id: string): ChatInputNotification;
117
}
118
}
119
120