forked from coder/code-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoder.d.ts
More file actions
210 lines (191 loc) · 6.17 KB
/
Copy pathcoder.d.ts
File metadata and controls
210 lines (191 loc) · 6.17 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
declare namespace coder {
export interface IDisposable {
dispose(): void;
}
export interface Disposer extends IDisposable {
onDidDispose: (cb: () => void) => void;
}
export interface Event<T> {
(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;
}
export interface IStatusbarEntry {
readonly text: string;
readonly tooltip?: string;
readonly color?: string;
readonly command?: string;
readonly arguments?: any[];
readonly showBeak?: boolean;
}
export interface IStatusbarService {
addEntry(entry: IStatusbarEntry, alignment: StatusbarAlignment, priority?: number): IDisposable;
setStatusMessage(message: string, autoDisposeAfter?: number, delayBy?: number): IDisposable;
}
export interface IAction extends IDisposable {
id: string;
label: string;
tooltip: string;
class: string | undefined;
enabled: boolean;
checked: boolean;
radio: boolean;
run(event?: any): Promise<any>;
}
export type NotificationMessage = string | Error;
export interface INotificationProperties {
sticky?: boolean;
silent?: boolean;
}
export interface INotificationActions {
primary?: IAction[];
secondary?: IAction[];
}
export interface INotificationProgress {
infinite(): void;
total(value: number): void;
worked(value: number): void;
done(): void;
}
export interface IPromptChoice {
label: string;
isSecondary?: boolean;
keepOpen?: boolean;
run: () => void;
}
export interface IPromptOptions extends INotificationProperties {
onCancel?: () => void;
}
export interface ISerializableCommandAction extends IBaseCommandAction {
// iconLocation?: { dark: UriComponents; light?: UriComponents; };
}
export interface IMenuItem {
command: ICommandAction;
alt?: ICommandAction;
// when?: ContextKeyExpr;
group?: "navigation" | string;
order?: number;
}
export interface IMenuRegistry {
appendMenuItem(menu: MenuId, item: IMenuItem): IDisposable;
}
export interface IBaseCommandAction {
id: string;
title: string;
category?: string;
}
export interface ICommandAction extends IBaseCommandAction {
// iconLocation?: { dark: URI; light?: URI; };
// precondition?: ContextKeyExpr;
// toggled?: ContextKeyExpr;
}
export interface ICommandHandler {
(accessor: any, ...args: any[]): void;
}
export interface ICommand {
id: string;
handler: ICommandHandler;
description?: ICommandHandlerDescription | null;
}
export interface ICommandHandlerDescription {
description: string;
args: { name: string; description?: string; }[];
returns?: string;
}
export interface ICommandRegistry {
registerCommand(command: ICommand): IDisposable;
}
export interface INotification extends INotificationProperties {
severity: Severity;
message: NotificationMessage;
source?: string;
actions?: INotificationActions;
}
export interface INotificationHandle {
readonly onDidClose: Event<void>;
readonly progress: INotificationProgress;
updateSeverity(severity: Severity): void;
updateMessage(message: NotificationMessage): void;
updateActions(actions?: INotificationActions): void;
close(): void;
}
export interface INotificationService {
notify(notification: INotification): INotificationHandle;
info(message: NotificationMessage | NotificationMessage[]): void;
warn(message: NotificationMessage | NotificationMessage[]): void;
error(message: NotificationMessage | NotificationMessage[]): void;
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle;
}
export namespace client {}
export namespace workbench {
// TODO: these types won't actually be included in the package if we try to
// import them. We'll need to recreate them.
export const action: any; // import { Action } from "vs/base/common/actions";
export const syncActionDescriptor: any; // import { SyncActionDescriptor } from "vs/platform/actions/common/actions";
export const statusbarService: IStatusbarService;
export const actionsRegistry: any; // import { IWorkbenchActionRegistry } from "vs/workbench/common/actions";
export const notificationService: INotificationService;
export const menuRegistry: IMenuRegistry;
export const commandRegistry: ICommandRegistry;
export const terminalService: any; // import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
export const registerView: (viewId: string, viewName: string, containerId: string, containerName: string, icon: string) => void;
export const onFileCreate: (cb: (path: string) => void) => void;
export const onFileMove: (cb: (path: string, target: string) => void) => void;
export const onFileDelete: (cb: (path: string) => void) => void;
export const onFileSaved: (cb: (path: string) => void) => void;
export const onFileCopy: (cb: (path: string, target: string) => void) => void;
export const onModelAdded: (cb: (path: string, languageId: string) => void) => void;
export const onModelRemoved: (cb: (path: string, languageId: string) => void) => void;
export const onModelLanguageChange: (cb: (path: string, languageId: string, oldLanguageId: string) => void) => void;
export const onTerminalAdded: (cb: () => void) => void;
export const onTerminalRemoved: (cb: () => void) => void;
}
export enum Severity {
Ignore = 0,
Info = 1,
Warning = 2,
Error = 3,
}
export enum StatusbarAlignment {
LEFT, RIGHT,
}
export enum MenuId {
CommandPalette,
DebugBreakpointsContext,
DebugCallStackContext,
DebugConsoleContext,
DebugVariablesContext,
DebugWatchContext,
DebugToolBar,
EditorContext,
EditorTitle,
EditorTitleContext,
EmptyEditorGroupContext,
ExplorerContext,
MenubarAppearanceMenu,
MenubarDebugMenu,
MenubarEditMenu,
MenubarFileMenu,
MenubarGoMenu,
MenubarHelpMenu,
MenubarLayoutMenu,
MenubarNewBreakpointMenu,
MenubarPreferencesMenu,
MenubarRecentMenu,
MenubarSelectionMenu,
MenubarSwitchEditorMenu,
MenubarSwitchGroupMenu,
MenubarTerminalMenu,
MenubarViewMenu,
OpenEditorsContext,
ProblemsPanelContext,
SCMChangeContext,
SCMResourceContext,
SCMResourceGroupContext,
SCMSourceControl,
SCMTitle,
SearchContext,
StatusBarWindowIndicatorMenu,
TouchBarContext,
ViewItemContext,
ViewTitle,
}
}