@opensumi/sumi 2.12.1-next-079c1930 → 2.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,300 +19,305 @@ declare module 'sumi-worker' {
19
19
  openLabel?: string;
20
20
 
21
21
  /**
22
- * Allow to select files, defaults to `true`.
23
- */
22
+ * Allow to select files, defaults to `true`.
23
+ */
24
24
  canSelectFiles?: boolean;
25
25
 
26
26
  /**
27
- * Allow to select folders, defaults to `false`.
28
- */
27
+ * Allow to select folders, defaults to `false`.
28
+ */
29
29
  canSelectFolders?: boolean;
30
30
 
31
31
  /**
32
- * Allow to select many files or folders.
33
- */
32
+ * Allow to select many files or folders.
33
+ */
34
34
  canSelectMany?: boolean;
35
35
 
36
36
  /**
37
- * A set of file filters that are used by the dialog. Each entry is a human readable label,
38
- * like "TypeScript", and an array of extensions, e.g.
39
- * ```ts
40
- * {
41
- * 'Images': ['png', 'jpg']
42
- * 'TypeScript': ['ts', 'tsx']
43
- * }
44
- * ```
45
- */
37
+ * A set of file filters that are used by the dialog. Each entry is a human readable label,
38
+ * like "TypeScript", and an array of extensions, e.g.
39
+ * ```ts
40
+ * {
41
+ * 'Images': ['png', 'jpg']
42
+ * 'TypeScript': ['ts', 'tsx']
43
+ * }
44
+ * ```
45
+ */
46
46
  filters?: { [name: string]: string[] };
47
47
  }
48
48
 
49
49
  /**
50
- * Options to configure the behaviour of a file save dialog.
51
- */
50
+ * Options to configure the behaviour of a file save dialog.
51
+ */
52
52
  export interface SaveDialogOptions {
53
53
  /**
54
- * The resource the dialog shows when opened.
55
- */
54
+ * The resource the dialog shows when opened.
55
+ */
56
56
  defaultUri?: Uri;
57
57
 
58
58
  /**
59
- * A human-readable string for the save button.
60
- */
59
+ * A human-readable string for the save button.
60
+ */
61
61
  saveLabel?: string;
62
62
 
63
63
  /**
64
- * A set of file filters that are used by the dialog. Each entry is a human readable label,
65
- * like "TypeScript", and an array of extensions, e.g.
66
- * ```ts
67
- * {
68
- * 'Images': ['png', 'jpg']
69
- * 'TypeScript': ['ts', 'tsx']
70
- * }
71
- * ```
72
- */
64
+ * A set of file filters that are used by the dialog. Each entry is a human readable label,
65
+ * like "TypeScript", and an array of extensions, e.g.
66
+ * ```ts
67
+ * {
68
+ * 'Images': ['png', 'jpg']
69
+ * 'TypeScript': ['ts', 'tsx']
70
+ * }
71
+ * ```
72
+ */
73
73
  filters?: { [name: string]: string[] };
74
74
  }
75
75
  export namespace window {
76
-
77
76
  /**
78
- * The currently opened terminals or an empty array.
79
- */
77
+ * The currently opened terminals or an empty array.
78
+ */
80
79
  export const terminals: ReadonlyArray<Terminal>;
81
80
 
82
81
  /**
83
- * The currently active terminal or `undefined`. The active terminal is the one that
84
- * currently has focus or most recently had focus.
85
- */
82
+ * The currently active terminal or `undefined`. The active terminal is the one that
83
+ * currently has focus or most recently had focus.
84
+ */
86
85
  export const activeTerminal: Terminal | undefined;
87
86
 
88
87
  /**
89
- * An [event](#Event) which fires when the [active terminal](#window.activeTerminal)
90
- * has changed. *Note* that the event also fires when the active terminal changes
91
- * to `undefined`.
92
- */
88
+ * An [event](#Event) which fires when the [active terminal](#window.activeTerminal)
89
+ * has changed. *Note* that the event also fires when the active terminal changes
90
+ * to `undefined`.
91
+ */
93
92
  export const onDidChangeActiveTerminal: Event<Terminal | undefined>;
94
93
 
95
94
  /**
96
- * An [event](#Event) which fires when a terminal has been created, either through the
97
- * [createTerminal](#window.createTerminal) API or commands.
98
- */
95
+ * An [event](#Event) which fires when a terminal has been created, either through the
96
+ * [createTerminal](#window.createTerminal) API or commands.
97
+ */
99
98
  export const onDidOpenTerminal: Event<Terminal>;
100
99
 
101
100
  /**
102
- * An [event](#Event) which fires when a terminal is disposed.
103
- */
101
+ * An [event](#Event) which fires when a terminal is disposed.
102
+ */
104
103
  export const onDidCloseTerminal: Event<Terminal>;
105
104
 
106
105
  /**
107
- * Represents the current window's state.
108
- */
106
+ * Represents the current window's state.
107
+ */
109
108
  export const state: WindowState;
110
109
 
111
110
  /**
112
- * An [event](#Event) which fires when the focus state of the current window
113
- * changes. The value of the event represents whether the window is focused.
114
- */
111
+ * An [event](#Event) which fires when the focus state of the current window
112
+ * changes. The value of the event represents whether the window is focused.
113
+ */
115
114
  export const onDidChangeWindowState: Event<WindowState>;
116
115
 
117
116
  /**
118
- * Creates a [Terminal](#Terminal). The cwd of the terminal will be the workspace directory
119
- * if it exists, regardless of whether an explicit customStartPath setting exists.
120
- *
121
- * @param name Optional human-readable string which will be used to represent the terminal in the UI.
122
- * @param shellPath Optional path to a custom shell executable to be used in the terminal.
123
- * @param shellArgs Optional args for the custom shell executable. A string can be used on Windows only which
124
- * allows specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
125
- * @return A new Terminal.
126
- */
117
+ * Creates a [Terminal](#Terminal). The cwd of the terminal will be the workspace directory
118
+ * if it exists, regardless of whether an explicit customStartPath setting exists.
119
+ *
120
+ * @param name Optional human-readable string which will be used to represent the terminal in the UI.
121
+ * @param shellPath Optional path to a custom shell executable to be used in the terminal.
122
+ * @param shellArgs Optional args for the custom shell executable. A string can be used on Windows only which
123
+ * allows specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
124
+ * @return A new Terminal.
125
+ */
127
126
  export function createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): Terminal;
128
127
 
129
128
  /**
130
- * Create and show a new webview panel.
131
- *
132
- * @param viewType Identifies the type of the webview panel.
133
- * @param title Title of the panel.
134
- * @param showOptions Where to show the webview in the editor. If preserveFocus is set, the new webview will not take focus.
135
- * @param options Settings for the new panel.
136
- *
137
- * @return New webview panel.
138
- */
139
- export function createWebviewPanel(viewType: string, title: string, showOptions: ViewColumn | { viewColumn: ViewColumn, preserveFocus?: boolean }, options?: WebviewPanelOptions & WebviewOptions): WebviewPanel;
140
-
141
- /**
142
- * ~~Show progress in the Source Control viewlet while running the given callback and while
143
- * its returned promise isn't resolve or rejected.~~
144
- *
145
- * @deprecated Use `withProgress` instead.
146
- *
147
- * @param task A callback returning a promise. Progress increments can be reported with
148
- * the provided [progress](#Progress)-object.
149
- * @return The thenable the task did return.
150
- */
129
+ * Create and show a new webview panel.
130
+ *
131
+ * @param viewType Identifies the type of the webview panel.
132
+ * @param title Title of the panel.
133
+ * @param showOptions Where to show the webview in the editor. If preserveFocus is set, the new webview will not take focus.
134
+ * @param options Settings for the new panel.
135
+ *
136
+ * @return New webview panel.
137
+ */
138
+ export function createWebviewPanel(
139
+ viewType: string,
140
+ title: string,
141
+ showOptions: ViewColumn | { viewColumn: ViewColumn; preserveFocus?: boolean },
142
+ options?: WebviewPanelOptions & WebviewOptions,
143
+ ): WebviewPanel;
144
+
145
+ /**
146
+ * ~~Show progress in the Source Control viewlet while running the given callback and while
147
+ * its returned promise isn't resolve or rejected.~~
148
+ *
149
+ * @deprecated Use `withProgress` instead.
150
+ *
151
+ * @param task A callback returning a promise. Progress increments can be reported with
152
+ * the provided [progress](#Progress)-object.
153
+ * @return The thenable the task did return.
154
+ */
151
155
  export function withScmProgress<R>(task: (progress: Progress<number>) => Thenable<R>): Thenable<R>;
152
156
 
153
157
  /**
154
- * Show progress in the editor. Progress is shown while running the given callback
155
- * and while the promise it returned isn't resolved nor rejected. The location at which
156
- * progress should show (and other details) is defined via the passed [`ProgressOptions`](#ProgressOptions).
157
- *
158
- * @param task A callback returning a promise. Progress state can be reported with
159
- * the provided [progress](#Progress)-object.
160
- *
161
- * To report discrete progress, use `increment` to indicate how much work has been completed. Each call with
162
- * a `increment` value will be summed up and reflected as overall progress until 100% is reached (a value of
163
- * e.g. `10` accounts for `10%` of work done).
164
- * Note that currently only `ProgressLocation.Notification` is capable of showing discrete progress.
165
- *
166
- * To monitor if the operation has been cancelled by the user, use the provided [`CancellationToken`](#CancellationToken).
167
- * Note that currently only `ProgressLocation.Notification` is supporting to show a cancel button to cancel the
168
- * long running operation.
169
- *
170
- * @return The thenable the task-callback returned.
171
- */
172
- export function withProgress<R>(options: ProgressOptions, task: (progress: Progress<{ message?: string; increment?: number }>, token: CancellationToken) => Thenable<R>): Thenable<R>;
173
-
174
- /**
175
- * Register a [TreeDataProvider](#TreeDataProvider) for the view contributed using the extension point `views`.
176
- * This will allow you to contribute data to the [TreeView](#TreeView) and update if the data changes.
177
- *
178
- * **Note:** To get access to the [TreeView](#TreeView) and perform operations on it, use [createTreeView](#window.createTreeView).
179
- *
180
- * @param viewId Id of the view contributed using the extension point `views`.
181
- * @param treeDataProvider A [TreeDataProvider](#TreeDataProvider) that provides tree data for the view
182
- */
158
+ * Show progress in the editor. Progress is shown while running the given callback
159
+ * and while the promise it returned isn't resolved nor rejected. The location at which
160
+ * progress should show (and other details) is defined via the passed [`ProgressOptions`](#ProgressOptions).
161
+ *
162
+ * @param task A callback returning a promise. Progress state can be reported with
163
+ * the provided [progress](#Progress)-object.
164
+ *
165
+ * To report discrete progress, use `increment` to indicate how much work has been completed. Each call with
166
+ * a `increment` value will be summed up and reflected as overall progress until 100% is reached (a value of
167
+ * e.g. `10` accounts for `10%` of work done).
168
+ * Note that currently only `ProgressLocation.Notification` is capable of showing discrete progress.
169
+ *
170
+ * To monitor if the operation has been cancelled by the user, use the provided [`CancellationToken`](#CancellationToken).
171
+ * Note that currently only `ProgressLocation.Notification` is supporting to show a cancel button to cancel the
172
+ * long running operation.
173
+ *
174
+ * @return The thenable the task-callback returned.
175
+ */
176
+ export function withProgress<R>(
177
+ options: ProgressOptions,
178
+ task: (progress: Progress<{ message?: string; increment?: number }>, token: CancellationToken) => Thenable<R>,
179
+ ): Thenable<R>;
180
+
181
+ /**
182
+ * Register a [TreeDataProvider](#TreeDataProvider) for the view contributed using the extension point `views`.
183
+ * This will allow you to contribute data to the [TreeView](#TreeView) and update if the data changes.
184
+ *
185
+ * **Note:** To get access to the [TreeView](#TreeView) and perform operations on it, use [createTreeView](#window.createTreeView).
186
+ *
187
+ * @param viewId Id of the view contributed using the extension point `views`.
188
+ * @param treeDataProvider A [TreeDataProvider](#TreeDataProvider) that provides tree data for the view
189
+ */
183
190
  export function registerTreeDataProvider<T>(viewId: string, treeDataProvider: TreeDataProvider<T>): Disposable;
184
191
 
185
192
  /**
186
- * Create a [TreeView](#TreeView) for the view contributed using the extension point `views`.
187
- * @param viewId Id of the view contributed using the extension point `views`.
188
- * @param options Options for creating the [TreeView](#TreeView)
189
- * @returns a [TreeView](#TreeView).
190
- */
193
+ * Create a [TreeView](#TreeView) for the view contributed using the extension point `views`.
194
+ * @param viewId Id of the view contributed using the extension point `views`.
195
+ * @param options Options for creating the [TreeView](#TreeView)
196
+ * @returns a [TreeView](#TreeView).
197
+ */
191
198
  export function createTreeView<T>(viewId: string, options: TreeViewOptions<T>): TreeView<T>;
192
199
 
193
200
  /**
194
- * Options for creating a [TreeView](#TreeView)
195
- */
201
+ * Options for creating a [TreeView](#TreeView)
202
+ */
196
203
  export interface TreeViewOptions<T> {
197
-
198
204
  /**
199
- * A data provider that provides tree data.
200
- */
205
+ * A data provider that provides tree data.
206
+ */
201
207
  treeDataProvider: TreeDataProvider<T>;
202
208
 
203
209
  /**
204
- * Whether to show collapse all action or not.
205
- */
210
+ * Whether to show collapse all action or not.
211
+ */
206
212
  showCollapseAll?: boolean;
207
213
  }
208
214
  /**
209
- * Shows a file open dialog to the user which allows to select a file
210
- * for opening-purposes.
211
- *
212
- * @param options Options that control the dialog.
213
- * @returns A promise that resolves to the selected resources or `undefined`.
214
- */
215
+ * Shows a file open dialog to the user which allows to select a file
216
+ * for opening-purposes.
217
+ *
218
+ * @param options Options that control the dialog.
219
+ * @returns A promise that resolves to the selected resources or `undefined`.
220
+ */
215
221
  export function showOpenDialog(options: OpenDialogOptions): Thenable<Uri[] | undefined>;
216
222
 
217
223
  /**
218
- * Shows a file save dialog to the user which allows to select a file
219
- * for saving-purposes.
220
- *
221
- * @param options Options that control the dialog.
222
- * @returns A promise that resolves to the selected resource or `undefined`.
223
- */
224
+ * Shows a file save dialog to the user which allows to select a file
225
+ * for saving-purposes.
226
+ *
227
+ * @param options Options that control the dialog.
228
+ * @returns A promise that resolves to the selected resource or `undefined`.
229
+ */
224
230
  export function showSaveDialog(options: SaveDialogOptions): Thenable<Uri | undefined>;
225
231
  }
226
232
 
227
233
  /**
228
- * A panel that contains a webview.
229
- */
234
+ * A panel that contains a webview.
235
+ */
230
236
  interface WebviewPanel {
231
237
  /**
232
- * Identifies the type of the webview panel, such as `'markdown.preview'`.
233
- */
238
+ * Identifies the type of the webview panel, such as `'markdown.preview'`.
239
+ */
234
240
  readonly viewType: string;
235
241
 
236
242
  /**
237
- * Title of the panel shown in UI.
238
- */
243
+ * Title of the panel shown in UI.
244
+ */
239
245
  title: string;
240
246
 
241
247
  /**
242
- * Icon for the panel shown in UI.
243
- */
248
+ * Icon for the panel shown in UI.
249
+ */
244
250
  iconPath?: Uri | { light: Uri; dark: Uri };
245
251
 
246
252
  /**
247
- * Webview belonging to the panel.
248
- */
253
+ * Webview belonging to the panel.
254
+ */
249
255
  readonly webview: Webview;
250
256
 
251
257
  /**
252
- * Content settings for the webview panel.
253
- */
258
+ * Content settings for the webview panel.
259
+ */
254
260
  readonly options: WebviewPanelOptions;
255
261
 
256
262
  /**
257
- * Editor position of the panel. This property is only set if the webview is in
258
- * one of the editor view columns.
259
- */
263
+ * Editor position of the panel. This property is only set if the webview is in
264
+ * one of the editor view columns.
265
+ */
260
266
  readonly viewColumn?: ViewColumn;
261
267
 
262
268
  /**
263
- * Whether the panel is active (focused by the user).
264
- */
269
+ * Whether the panel is active (focused by the user).
270
+ */
265
271
  readonly active: boolean;
266
272
 
267
273
  /**
268
- * Whether the panel is visible.
269
- */
274
+ * Whether the panel is visible.
275
+ */
270
276
  readonly visible: boolean;
271
277
 
272
278
  /**
273
- * Fired when the panel's view state changes.
274
- */
279
+ * Fired when the panel's view state changes.
280
+ */
275
281
  readonly onDidChangeViewState: Event<WebviewPanelOnDidChangeViewStateEvent>;
276
282
 
277
283
  /**
278
- * Fired when the panel is disposed.
279
- *
280
- * This may be because the user closed the panel or because `.dispose()` was
281
- * called on it.
282
- *
283
- * Trying to use the panel after it has been disposed throws an exception.
284
- */
284
+ * Fired when the panel is disposed.
285
+ *
286
+ * This may be because the user closed the panel or because `.dispose()` was
287
+ * called on it.
288
+ *
289
+ * Trying to use the panel after it has been disposed throws an exception.
290
+ */
285
291
  readonly onDidDispose: Event<void>;
286
292
 
287
293
  /**
288
- * Show the webview panel in a given column.
289
- *
290
- * A webview panel may only show in a single column at a time. If it is already showing, this
291
- * method moves it to a new column.
292
- *
293
- * @param viewColumn View column to show the panel in. Shows in the current `viewColumn` if undefined.
294
- * @param preserveFocus When `true`, the webview will not take focus.
295
- */
294
+ * Show the webview panel in a given column.
295
+ *
296
+ * A webview panel may only show in a single column at a time. If it is already showing, this
297
+ * method moves it to a new column.
298
+ *
299
+ * @param viewColumn View column to show the panel in. Shows in the current `viewColumn` if undefined.
300
+ * @param preserveFocus When `true`, the webview will not take focus.
301
+ */
296
302
  reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;
297
303
 
298
304
  /**
299
- * Dispose of the webview panel.
300
- *
301
- * This closes the panel if it showing and disposes of the resources owned by the webview.
302
- * Webview panels are also disposed when the user closes the webview panel. Both cases
303
- * fire the `onDispose` event.
304
- */
305
+ * Dispose of the webview panel.
306
+ *
307
+ * This closes the panel if it showing and disposes of the resources owned by the webview.
308
+ * Webview panels are also disposed when the user closes the webview panel. Both cases
309
+ * fire the `onDispose` event.
310
+ */
305
311
  dispose(): any;
306
312
  }
307
313
 
308
314
  /**
309
- * Event fired when a webview panel's view state changes.
310
- */
315
+ * Event fired when a webview panel's view state changes.
316
+ */
311
317
  export interface WebviewPanelOnDidChangeViewStateEvent {
312
318
  /**
313
- * Webview panel whose view state changed.
314
- */
319
+ * Webview panel whose view state changed.
320
+ */
315
321
  readonly webviewPanel: WebviewPanel;
316
322
  }
317
-
318
323
  }