reactive-vscode 0.4.0 → 1.0.0-beta.1
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.
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +595 -411
- package/dist/index.js +754 -713
- package/dist/index.js.map +1 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,161 +1,97 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChatParticipant } from 'vscode';
|
|
2
2
|
import { ChatRequestHandler } from 'vscode';
|
|
3
|
-
import { ChatResultFeedback } from 'vscode';
|
|
4
3
|
import { ColorTheme } from 'vscode';
|
|
5
|
-
import {
|
|
4
|
+
import { commands } from 'vscode';
|
|
6
5
|
import { ComputedRef } from '@reactive-vscode/reactivity';
|
|
7
6
|
import { ConfigurationScope } from 'vscode';
|
|
8
|
-
import { ConfigurationTarget } from 'vscode';
|
|
9
7
|
import { DebugSession } from 'vscode';
|
|
10
8
|
import { DecorationOptions } from 'vscode';
|
|
11
9
|
import { DecorationRenderOptions } from 'vscode';
|
|
12
10
|
import { Disposable as Disposable_2 } from 'vscode';
|
|
13
|
-
import { DocumentSelector } from 'vscode';
|
|
14
11
|
import { EffectScope } from '@reactive-vscode/reactivity';
|
|
15
12
|
import { Event as Event_2 } from 'vscode';
|
|
16
13
|
import { EventEmitter } from 'vscode';
|
|
17
14
|
import { Extension } from 'vscode';
|
|
18
15
|
import { ExtensionContext } from 'vscode';
|
|
19
16
|
import { ExtensionTerminalOptions } from 'vscode';
|
|
20
|
-
import { FileSystemWatcher } from 'vscode';
|
|
21
|
-
import { FoldingRangeProvider } from 'vscode';
|
|
22
17
|
import { GlobPattern } from 'vscode';
|
|
23
|
-
import {
|
|
18
|
+
import { InputBoxValidationMessage } from 'vscode';
|
|
24
19
|
import { LanguageModelToolInformation } from 'vscode';
|
|
25
20
|
import { LogLevel } from 'vscode';
|
|
26
21
|
import { LogOutputChannel } from 'vscode';
|
|
27
22
|
import { MaybeRef } from '@reactive-vscode/reactivity';
|
|
28
23
|
import { MaybeRefOrGetter } from '@reactive-vscode/reactivity';
|
|
24
|
+
import { Memento } from 'vscode';
|
|
29
25
|
import { NotebookEditor } from 'vscode';
|
|
30
26
|
import { NotebookRange } from 'vscode';
|
|
31
|
-
import { OutputChannel } from 'vscode';
|
|
32
27
|
import { QuickInputButton } from 'vscode';
|
|
33
28
|
import { QuickPickItem } from 'vscode';
|
|
34
29
|
import { QuickPickItemButtonEvent } from 'vscode';
|
|
35
30
|
import { Range } from 'vscode';
|
|
36
31
|
import { Ref } from '@reactive-vscode/reactivity';
|
|
37
32
|
import { Selection } from 'vscode';
|
|
38
|
-
import { ShallowReactive } from '@reactive-vscode/reactivity';
|
|
39
33
|
import { ShallowRef } from '@reactive-vscode/reactivity';
|
|
40
34
|
import { StatusBarAlignment } from 'vscode';
|
|
41
35
|
import { StatusBarItem } from 'vscode';
|
|
42
|
-
import { Task } from 'vscode';
|
|
43
36
|
import { TaskExecution } from 'vscode';
|
|
44
|
-
import { TaskFilter } from 'vscode';
|
|
45
37
|
import { Terminal } from 'vscode';
|
|
46
38
|
import { TerminalOptions } from 'vscode';
|
|
39
|
+
import { TerminalShellIntegration } from 'vscode';
|
|
47
40
|
import { TerminalState } from 'vscode';
|
|
48
41
|
import { TextDocument } from 'vscode';
|
|
49
42
|
import { TextEditor } from 'vscode';
|
|
50
43
|
import { TextEditorDecorationType } from 'vscode';
|
|
51
|
-
import { TextEditorEdit } from 'vscode';
|
|
52
44
|
import { TextEditorSelectionChangeKind } from 'vscode';
|
|
53
45
|
import { TreeDataProvider } from 'vscode';
|
|
54
46
|
import { TreeItem } from 'vscode';
|
|
55
47
|
import { TreeView } from 'vscode';
|
|
56
48
|
import { TreeViewOptions } from 'vscode';
|
|
57
|
-
import { UnwrapNestedRefs } from '@reactive-vscode/reactivity';
|
|
58
49
|
import { Uri } from 'vscode';
|
|
59
|
-
import { ViewBadge } from 'vscode';
|
|
60
50
|
import { ViewColumn } from 'vscode';
|
|
51
|
+
import { Webview } from 'vscode';
|
|
61
52
|
import { WebviewOptions } from 'vscode';
|
|
62
53
|
import { WebviewPanel } from 'vscode';
|
|
54
|
+
import { WebviewPanelOptions } from 'vscode';
|
|
63
55
|
import { WebviewView } from 'vscode';
|
|
64
56
|
import { WebviewViewResolveContext } from 'vscode';
|
|
65
57
|
import { window } from 'vscode';
|
|
58
|
+
import { WorkspaceConfiguration } from 'vscode';
|
|
66
59
|
import { WorkspaceFolder } from 'vscode';
|
|
67
60
|
import { WritableComputedRef } from '@reactive-vscode/reactivity';
|
|
68
61
|
|
|
69
62
|
/* Excluded from this release type: activateCbs */
|
|
70
63
|
|
|
71
|
-
export declare type AnyWatchSource = any;
|
|
72
|
-
|
|
73
64
|
export declare type Awaitable<T> = T | Promise<T>;
|
|
74
65
|
|
|
75
66
|
export declare interface ChatParticipantOptions {
|
|
76
|
-
iconPath?: MaybeRefOrGetter<IconPath>;
|
|
77
|
-
followupProvider?: MaybeRef<ChatFollowupProvider>;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export declare interface Commands extends Record<string, (...args: any[]) => any> {
|
|
81
|
-
'vscode.open': (uri: Uri) => void;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export declare type ConfigObject<C extends object> = UnwrapNestedRefs<C> & {
|
|
85
|
-
/**
|
|
86
|
-
* Write the configuration value to the workspace.
|
|
87
|
-
*
|
|
88
|
-
* @see https://code.visualstudio.com/api/references/vscode-api#WorkspaceConfiguration.update
|
|
89
|
-
*/
|
|
90
|
-
$update: (key: keyof C, value: C[keyof C], configurationTarget?: ConfigurationTarget | boolean | null, overrideInLanguage?: boolean) => Promise<void>;
|
|
91
67
|
/**
|
|
92
|
-
*
|
|
68
|
+
* @see {@linkcode ChatParticipant.iconPath}
|
|
93
69
|
*/
|
|
94
|
-
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export declare interface ConfigRef<T> extends WritableComputedRef<T> {
|
|
70
|
+
iconPath?: MaybeRefOrGetter<ChatParticipant['iconPath']>;
|
|
98
71
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* @see https://code.visualstudio.com/api/references/vscode-api#WorkspaceConfiguration.update
|
|
72
|
+
* @see {@linkcode ChatParticipant.followupProvider}
|
|
102
73
|
*/
|
|
103
|
-
|
|
74
|
+
followupProvider?: MaybeRefOrGetter<ChatParticipant['followupProvider']>;
|
|
104
75
|
/**
|
|
105
|
-
*
|
|
76
|
+
* @see {@linkcode ChatParticipant.onDidReceiveFeedback}
|
|
106
77
|
*/
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export declare interface ConfigType<T> extends ObjectConstructor {
|
|
111
|
-
[ConfigTypeSymbol]: T;
|
|
78
|
+
onDidReceiveFeedback?: EventListener_2<ChatParticipant['onDidReceiveFeedback']>;
|
|
112
79
|
}
|
|
113
80
|
|
|
114
|
-
export declare type ConfigTypeOptions = Record<string, ConfigTypeRaw<any>>;
|
|
115
|
-
|
|
116
|
-
declare type ConfigTypeRaw<T> = ConfigTypeSingle<T> | ConfigTypeSingle<T>[];
|
|
117
|
-
|
|
118
|
-
declare type ConfigTypeSingle<T> = typeof String | typeof Number | typeof Boolean | typeof Array | typeof Object | null | ConfigType<T>;
|
|
119
|
-
|
|
120
|
-
declare const ConfigTypeSymbol: unique symbol;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Creates a composable that caches the result of a function based on a key.
|
|
124
|
-
*
|
|
125
|
-
* @category utilities
|
|
126
|
-
*/
|
|
127
|
-
export declare function createKeyedComposable<P extends unknown[], R, K>(fn: (...args: P) => R, key: NoInfer<(...args: P) => K>): (...args: P) => R;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Creates a composable that should only be called once.
|
|
131
|
-
*
|
|
132
|
-
* @category lifecycle
|
|
133
|
-
*/
|
|
134
|
-
export declare function createSingletonComposable<T>(fn: () => T): () => T;
|
|
135
|
-
|
|
136
81
|
/* Excluded from this release type: deactivateCbs */
|
|
137
82
|
|
|
138
83
|
/**
|
|
139
|
-
* Define configurations of an extension.
|
|
140
|
-
*
|
|
141
|
-
* You can use this function with [vscode-ext-gen](https://github.com/antfu/vscode-ext-gen).
|
|
142
|
-
*
|
|
143
|
-
* @category lifecycle
|
|
144
|
-
*/
|
|
145
|
-
export declare function defineConfigObject<const C extends ConfigTypeOptions>(section: Nullable<string>, configs: C, scope?: Nullable<ConfigurationScope>): ConfigObject<ParseConfigTypeOptions<C>>;
|
|
146
|
-
|
|
147
|
-
export declare function defineConfigObject<C extends object>(section: Nullable<string>, configs: Record<string, any>, scope?: Nullable<ConfigurationScope>): ConfigObject<C>;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Define configurations of an extension. See `vscode::workspace.getConfiguration`.
|
|
151
|
-
*
|
|
152
|
-
* You can use this function with [vscode-ext-gen](https://github.com/antfu/vscode-ext-gen).
|
|
84
|
+
* Define configurations of an extension.
|
|
153
85
|
*
|
|
86
|
+
* @see {@linkcode workspace.getConfiguration}
|
|
154
87
|
* @category lifecycle
|
|
155
88
|
*/
|
|
156
|
-
export declare function
|
|
157
|
-
|
|
158
|
-
|
|
89
|
+
export declare function defineConfig<C extends object>(section: Nullable<string>, scope?: Nullable<ConfigurationScope>): C & {
|
|
90
|
+
get: WorkspaceConfiguration['get'];
|
|
91
|
+
has: WorkspaceConfiguration['has'];
|
|
92
|
+
inspect: WorkspaceConfiguration['inspect'];
|
|
93
|
+
update: WorkspaceConfiguration['update'];
|
|
94
|
+
};
|
|
159
95
|
|
|
160
96
|
/**
|
|
161
97
|
* Define a new extension.
|
|
@@ -164,56 +100,31 @@ export declare function defineConfigs<C extends object>(section: Nullable<string
|
|
|
164
100
|
*/
|
|
165
101
|
export declare function defineExtension<T>(setup: (context: ExtensionContext) => T): {
|
|
166
102
|
activate: (context: ExtensionContext) => T | undefined;
|
|
167
|
-
deactivate: () => void
|
|
103
|
+
deactivate: () => Promise<void>;
|
|
168
104
|
};
|
|
169
105
|
|
|
170
106
|
/**
|
|
171
107
|
* Define a logger which is usable before activation.
|
|
172
108
|
*
|
|
109
|
+
* @see {@linkcode window.createOutputChannel}
|
|
173
110
|
* @category view
|
|
174
111
|
*/
|
|
175
|
-
export declare function defineLogger(name: string
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
error: (...message: any[]) => void;
|
|
112
|
+
export declare function defineLogger(name: string): {
|
|
113
|
+
trace: (message: string, ...args: any[]) => void;
|
|
114
|
+
debug: (message: string, ...args: any[]) => void;
|
|
115
|
+
info: (message: string, ...args: any[]) => void;
|
|
116
|
+
warn: (message: string, ...args: any[]) => void;
|
|
117
|
+
error: (error: string | Error, ...args: any[]) => void;
|
|
182
118
|
append: (value: string) => void;
|
|
183
119
|
appendLine: (value: string) => void;
|
|
184
120
|
replace: (value: string) => void;
|
|
185
121
|
clear: () => void;
|
|
186
122
|
show: {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
};
|
|
190
|
-
hide: () => void;
|
|
191
|
-
} | null, {
|
|
192
|
-
outputChannel: OutputChannel;
|
|
193
|
-
createLoggerFunc: (type: "info" | "warn" | "error") => (...message: any[]) => void;
|
|
194
|
-
info: (...message: any[]) => void;
|
|
195
|
-
warn: (...message: any[]) => void;
|
|
196
|
-
error: (...message: any[]) => void;
|
|
197
|
-
append: (value: string) => void;
|
|
198
|
-
appendLine: (value: string) => void;
|
|
199
|
-
replace: (value: string) => void;
|
|
200
|
-
clear: () => void;
|
|
201
|
-
show: {
|
|
202
|
-
(preserveFocus?: boolean): void;
|
|
203
|
-
(column?: ViewColumn, preserveFocus?: boolean): void;
|
|
123
|
+
(preserveFocus?: boolean): void;
|
|
124
|
+
(column?: ViewColumn, preserveFocus?: boolean): void;
|
|
204
125
|
};
|
|
205
126
|
hide: () => void;
|
|
206
|
-
|
|
207
|
-
outputChannel: ComputedRef<OutputChannel | undefined>;
|
|
208
|
-
info: (...args: any[]) => void | null;
|
|
209
|
-
warn: (...args: any[]) => void | null;
|
|
210
|
-
error: (...args: any[]) => void | null;
|
|
211
|
-
append: (value: string) => void | null;
|
|
212
|
-
appendLine: (value: string) => void | null;
|
|
213
|
-
replace: (value: string) => void | null;
|
|
214
|
-
clear: () => void | null;
|
|
215
|
-
show: (column?: ViewColumn | undefined, preserveFocus?: boolean | undefined) => void | null;
|
|
216
|
-
hide: () => void | null;
|
|
127
|
+
logger: ComputedRef<LogOutputChannel | null>;
|
|
217
128
|
};
|
|
218
129
|
|
|
219
130
|
/**
|
|
@@ -221,24 +132,96 @@ export declare function defineLogger(name: string, options?: UseLoggerOptions):
|
|
|
221
132
|
*
|
|
222
133
|
* @category lifecycle
|
|
223
134
|
*/
|
|
224
|
-
export declare
|
|
135
|
+
export declare function defineService<T>(fn: () => T): () => T;
|
|
225
136
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
* @category commands
|
|
230
|
-
*/
|
|
231
|
-
export declare function executeCommand<K extends Extract<keyof Commands, string>>(command: K, ...args: Parameters<Commands[K]>): Thenable<unknown>;
|
|
137
|
+
declare type EventListener_2<T extends Event_2<any>> = T extends Event_2<infer U> ? (e: U) => any : never;
|
|
138
|
+
export { EventListener_2 as EventListener }
|
|
232
139
|
|
|
233
140
|
export declare const extensionContext: ShallowRef<ExtensionContext | null, ExtensionContext | null>;
|
|
234
141
|
|
|
235
142
|
/* Excluded from this release type: extensionScope */
|
|
236
143
|
|
|
237
|
-
export declare
|
|
144
|
+
export declare type ExtensionSecretRef = WritableComputedRef<string | null | undefined, string | undefined> & {
|
|
145
|
+
/**
|
|
146
|
+
* Set the secret value. Compared to directly setting the `value`, this method
|
|
147
|
+
* returns a promise that resolves when the secret has been stored.
|
|
148
|
+
*/
|
|
149
|
+
set: (newValue: string) => Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Remove the secret value. Compared to directly setting the `value` to `undefined`,
|
|
152
|
+
* this method returns a promise that resolves when the secret has been deleted.
|
|
153
|
+
*/
|
|
154
|
+
remove: () => Promise<void>;
|
|
155
|
+
};
|
|
238
156
|
|
|
239
|
-
declare
|
|
157
|
+
export declare interface InputBoxProps extends QuickInputOptions {
|
|
158
|
+
/**
|
|
159
|
+
* The current input value.
|
|
160
|
+
*
|
|
161
|
+
* If provided as a ref, the value will be kept in sync with the input box's value, just like `v-model`.
|
|
162
|
+
*/
|
|
163
|
+
value?: MaybeRef<string>;
|
|
164
|
+
/**
|
|
165
|
+
* Selection range in the input value.
|
|
166
|
+
*
|
|
167
|
+
* Defined as tuple of two numbers where the first is the inclusive start index and the second the
|
|
168
|
+
* exclusive end index. When `undefined` the whole pre-filled value will be selected, when empty
|
|
169
|
+
* (start equals end) only the cursor will be set, otherwise the defined range will be selected.
|
|
170
|
+
*
|
|
171
|
+
* This property does not get updated when the user types or makes a selection, but it can be updated
|
|
172
|
+
* by the extension.
|
|
173
|
+
*/
|
|
174
|
+
valueSelection?: MaybeRefOrGetter<readonly [number, number] | undefined>;
|
|
175
|
+
/**
|
|
176
|
+
* Optional placeholder text shown when no value has been input.
|
|
177
|
+
*/
|
|
178
|
+
placeholder?: MaybeRefOrGetter<string | undefined>;
|
|
179
|
+
/**
|
|
180
|
+
* Determines if the input value should be hidden. Defaults to `false`.
|
|
181
|
+
*/
|
|
182
|
+
password?: MaybeRefOrGetter<boolean>;
|
|
183
|
+
/**
|
|
184
|
+
* An event signaling when the value has changed.
|
|
185
|
+
*/
|
|
186
|
+
onDidChangeValue?: (value: string) => void;
|
|
187
|
+
/**
|
|
188
|
+
* An event signaling when the user indicated acceptance of the input value.
|
|
189
|
+
*/
|
|
190
|
+
onDidAccept?: () => void;
|
|
191
|
+
/**
|
|
192
|
+
* Buttons for actions in the UI.
|
|
193
|
+
*/
|
|
194
|
+
buttons?: MaybeRefOrGetter<readonly QuickInputButton[]>;
|
|
195
|
+
/**
|
|
196
|
+
* An event signaling when a button was triggered.
|
|
197
|
+
*/
|
|
198
|
+
onDidTriggerButton?: (button: QuickInputButton) => void;
|
|
199
|
+
/**
|
|
200
|
+
* An optional prompt text providing some ask or explanation to the user.
|
|
201
|
+
*/
|
|
202
|
+
prompt?: MaybeRefOrGetter<string | undefined>;
|
|
203
|
+
/**
|
|
204
|
+
* An optional validation message indicating a problem with the current input value.
|
|
205
|
+
*
|
|
206
|
+
* By setting a string, the InputBox will use a default {@link InputBoxValidationSeverity} of Error.
|
|
207
|
+
* Returning `undefined` clears the validation message.
|
|
208
|
+
*/
|
|
209
|
+
validationMessage?: MaybeRefOrGetter<string | InputBoxValidationMessage | undefined>;
|
|
210
|
+
}
|
|
240
211
|
|
|
241
|
-
export declare type MaybeNullableRefOrGetter<T> = T | Ref<Nullable<T>> | (() => Nullable<T>);
|
|
212
|
+
export declare type MaybeNullableRefOrGetter<T> = T | Ref<Nullable<T>> | ShallowRef<Nullable<T>> | WritableComputedRef<Nullable<T>> | ComputedRef<Nullable<T>> | (() => Nullable<T>);
|
|
213
|
+
|
|
214
|
+
export declare type MementoItemRef<T> = WritableComputedRef<T, T | undefined> & {
|
|
215
|
+
/**
|
|
216
|
+
* Update the memento value. Compared to directly setting the `value`, this method
|
|
217
|
+
* returns a promise that resolves when the value has been stored.
|
|
218
|
+
*
|
|
219
|
+
* If `undefined` is passed, the key will be deleted from the memento.
|
|
220
|
+
*
|
|
221
|
+
* @see {@linkcode Memento.update}
|
|
222
|
+
*/
|
|
223
|
+
update: (newValue: T | undefined) => Promise<void>;
|
|
224
|
+
};
|
|
242
225
|
|
|
243
226
|
export declare type Nullable<T> = T | null | undefined;
|
|
244
227
|
|
|
@@ -258,23 +241,9 @@ declare type OnActivateCb = (context: ExtensionContext) => void;
|
|
|
258
241
|
*/
|
|
259
242
|
export declare function onDeactivate(fn: OnDeactivateCb): void;
|
|
260
243
|
|
|
261
|
-
declare type OnDeactivateCb = () => void
|
|
262
|
-
|
|
263
|
-
declare type ParseConfigType<C extends ConfigTypeRaw<any>> = C extends (infer C1)[] ? (C1 extends ConfigTypeSingle<any> ? ParseConfigType<C1> : never) : C extends ConfigType<infer T> ? T : (C extends typeof String ? string : C extends typeof Number ? number : C extends typeof Boolean ? boolean : C extends typeof Array ? any[] : C extends typeof Object ? Record<string | number, any> : C extends null ? null : never);
|
|
264
|
-
|
|
265
|
-
export declare type ParseConfigTypeOptions<C extends ConfigTypeOptions> = {
|
|
266
|
-
-readonly [K in keyof C]: ParseConfigType<C[K]>;
|
|
267
|
-
};
|
|
244
|
+
declare type OnDeactivateCb = () => Awaitable<void>;
|
|
268
245
|
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Items to pick from. This can be read and updated by the extension.
|
|
272
|
-
*/
|
|
273
|
-
items?: MaybeRefOrGetter<readonly T[]>;
|
|
274
|
-
/**
|
|
275
|
-
* Buttons for actions in the UI.
|
|
276
|
-
*/
|
|
277
|
-
buttons?: MaybeRefOrGetter<readonly QuickInputButton[]>;
|
|
246
|
+
declare interface QuickInputOptions {
|
|
278
247
|
/**
|
|
279
248
|
* An optional title.
|
|
280
249
|
*/
|
|
@@ -302,14 +271,61 @@ export declare interface QuickPickOptions<T extends QuickPickItem> {
|
|
|
302
271
|
*/
|
|
303
272
|
busy?: MaybeRefOrGetter<boolean>;
|
|
304
273
|
/**
|
|
305
|
-
* If the UI should stay open even when
|
|
274
|
+
* If the UI should stay open even when losing UI focus. Defaults to false.
|
|
306
275
|
* This setting is ignored on iPad and is always false.
|
|
307
276
|
*/
|
|
308
277
|
ignoreFocusOut?: MaybeRefOrGetter<boolean>;
|
|
278
|
+
visible?: MaybeRefOrGetter<boolean>;
|
|
279
|
+
/**
|
|
280
|
+
* An event signaling when this input UI is hidden.
|
|
281
|
+
*
|
|
282
|
+
* There are several reasons why this UI might have to be hidden and the extension will be notified
|
|
283
|
+
* through {@link QuickInput.onDidHide onDidHide}. Examples include: an explicit call to
|
|
284
|
+
* {@link QuickInput.hide hide}, the user pressing Esc, some other input UI opening, etc.
|
|
285
|
+
*/
|
|
286
|
+
onDidHide?: () => void;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export declare interface QuickPickProps<T extends QuickPickItem> extends QuickInputOptions {
|
|
290
|
+
/**
|
|
291
|
+
* The current value of the filter text.
|
|
292
|
+
*
|
|
293
|
+
* If provided as a ref, the value will be kept in sync with the quick pick's value, just like `v-model`.
|
|
294
|
+
*/
|
|
295
|
+
value?: MaybeRef<string>;
|
|
309
296
|
/**
|
|
310
297
|
* Optional placeholder shown in the filter textbox when no filter has been entered.
|
|
311
298
|
*/
|
|
312
299
|
placeholder?: MaybeRefOrGetter<string | undefined>;
|
|
300
|
+
/**
|
|
301
|
+
* An event signaling when the value of the filter text has changed.
|
|
302
|
+
*/
|
|
303
|
+
onDidChangeValue?: (value: string) => void;
|
|
304
|
+
/**
|
|
305
|
+
* An event signaling when the user indicated acceptance of the selected item(s).
|
|
306
|
+
*/
|
|
307
|
+
onDidAccept?: () => void;
|
|
308
|
+
/**
|
|
309
|
+
* Buttons for actions in the UI.
|
|
310
|
+
*/
|
|
311
|
+
buttons?: MaybeRefOrGetter<readonly QuickInputButton[]>;
|
|
312
|
+
/**
|
|
313
|
+
* An event signaling when a button was triggered.
|
|
314
|
+
*
|
|
315
|
+
* This event fires for buttons stored in the {@link QuickPick.buttons buttons} array. This event does
|
|
316
|
+
* not fire for buttons on a {@link QuickPickItem}.
|
|
317
|
+
*/
|
|
318
|
+
onDidTriggerButton?: (button: QuickInputButton) => void;
|
|
319
|
+
/**
|
|
320
|
+
* An event signaling when a button in a particular {@link QuickPickItem} was triggered.
|
|
321
|
+
*
|
|
322
|
+
* This event does not fire for buttons in the title bar which are part of {@link QuickPick.buttons buttons}.
|
|
323
|
+
*/
|
|
324
|
+
onDidTriggerItemButton?: (event: QuickPickItemButtonEvent<T>) => void;
|
|
325
|
+
/**
|
|
326
|
+
* Items to pick from. This can be read and updated by the extension.
|
|
327
|
+
*/
|
|
328
|
+
items?: MaybeRefOrGetter<readonly T[]>;
|
|
313
329
|
/**
|
|
314
330
|
* If multiple items can be selected at the same time. Defaults to false.
|
|
315
331
|
*/
|
|
@@ -327,159 +343,152 @@ export declare interface QuickPickOptions<T extends QuickPickItem> {
|
|
|
327
343
|
*/
|
|
328
344
|
keepScrollPosition?: MaybeRefOrGetter<boolean>;
|
|
329
345
|
/**
|
|
330
|
-
*
|
|
346
|
+
* Items to pick from. This can be read and updated by the extension.
|
|
331
347
|
*/
|
|
332
|
-
|
|
348
|
+
activeItems?: MaybeRef<readonly T[]>;
|
|
333
349
|
/**
|
|
334
|
-
*
|
|
350
|
+
* An event signaling when the active items have changed.
|
|
351
|
+
*
|
|
352
|
+
* If provided as a ref, the value will be kept in sync with the quick pick's value, just like `v-model`.
|
|
335
353
|
*/
|
|
336
|
-
|
|
354
|
+
onDidChangeActive?: (items: readonly T[]) => void;
|
|
337
355
|
/**
|
|
338
356
|
* Initial selected items. This can be read and updated by the extension.
|
|
339
357
|
*/
|
|
340
|
-
selectedItems?: readonly T[]
|
|
358
|
+
selectedItems?: MaybeRef<readonly T[]>;
|
|
359
|
+
/**
|
|
360
|
+
* An event signaling when the selected items have changed.
|
|
361
|
+
*
|
|
362
|
+
* If provided as a ref, the value will be kept in sync with the quick pick's value, just like `v-model`.
|
|
363
|
+
*/
|
|
364
|
+
onDidChangeSelection?: (items: readonly T[]) => void;
|
|
341
365
|
}
|
|
342
366
|
|
|
343
|
-
export declare type TextEditorCommandCallback =
|
|
344
|
-
|
|
345
|
-
declare type ToConfigRefs<C extends object> = {
|
|
346
|
-
[K in keyof C]: ConfigRef<C[K]>;
|
|
347
|
-
};
|
|
367
|
+
export declare type TextEditorCommandCallback = Parameters<typeof commands.registerTextEditorCommand>[1];
|
|
348
368
|
|
|
349
369
|
export declare interface TreeViewNode {
|
|
350
370
|
readonly children?: Awaitable<this[]>;
|
|
351
371
|
readonly treeItem: TreeItem | Thenable<TreeItem>;
|
|
352
372
|
}
|
|
353
373
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
374
|
+
export declare type TreeViewProps<T> = Omit<TreeViewOptions<T>, 'treeDataProvider'> & Pick<TreeDataProvider<T>, 'resolveTreeItem'> & {
|
|
375
|
+
/**
|
|
376
|
+
* @see {@linkcode TreeView.onDidExpandElement}
|
|
377
|
+
*/
|
|
378
|
+
onDidExpandElement?: EventListener_2<TreeView<T>['onDidExpandElement']>;
|
|
379
|
+
/**
|
|
380
|
+
* @see {@linkcode TreeView.onDidCollapseElement}
|
|
381
|
+
*/
|
|
382
|
+
onDidCollapseElement?: EventListener_2<TreeView<T>['onDidCollapseElement']>;
|
|
383
|
+
/**
|
|
384
|
+
* @see {@linkcode TreeView.onDidChangeSelection}
|
|
385
|
+
*/
|
|
386
|
+
onDidChangeSelection?: EventListener_2<TreeView<T>['onDidChangeSelection']>;
|
|
387
|
+
/**
|
|
388
|
+
* @see {@linkcode TreeView.onDidChangeVisibility}
|
|
389
|
+
*/
|
|
390
|
+
onDidChangeVisibility?: EventListener_2<TreeView<T>['onDidChangeVisibility']>;
|
|
391
|
+
/**
|
|
392
|
+
* @see {@linkcode TreeView.onDidChangeCheckboxState}
|
|
393
|
+
*/
|
|
394
|
+
onDidChangeCheckboxState?: EventListener_2<TreeView<T>['onDidChangeCheckboxState']>;
|
|
395
|
+
/**
|
|
396
|
+
* @see {@linkcode TreeView.message}
|
|
397
|
+
*/
|
|
398
|
+
message?: MaybeRefOrGetter<TreeView<T>['message']>;
|
|
399
|
+
/**
|
|
400
|
+
* @see {@linkcode TreeView.title}
|
|
401
|
+
*/
|
|
402
|
+
title?: MaybeRefOrGetter<TreeView<T>['title']>;
|
|
403
|
+
/**
|
|
404
|
+
* @see {@linkcode TreeView.description}
|
|
405
|
+
*/
|
|
406
|
+
description?: MaybeRefOrGetter<TreeView<T>['description']>;
|
|
407
|
+
/**
|
|
408
|
+
* @see {@linkcode TreeView.badge}
|
|
409
|
+
*/
|
|
410
|
+
badge?: MaybeRefOrGetter<TreeView<T>['badge']>;
|
|
411
|
+
};
|
|
360
412
|
|
|
361
413
|
/**
|
|
414
|
+
* @reactive {@linkcode ExtensionContext.asAbsolutePath}
|
|
362
415
|
* @category utilities
|
|
363
|
-
* @reactive `ExtensionContext.asAbsolutePath`
|
|
364
416
|
*/
|
|
365
|
-
export declare function
|
|
366
|
-
|
|
367
|
-
export declare function useAbsolutePath(relativePath: MaybeRefOrGetter<string>, silent?: false): ComputedRef<string>;
|
|
417
|
+
export declare function useAbsoluteUri(relativePath: MaybeRefOrGetter<string>): ComputedRef<Uri>;
|
|
368
418
|
|
|
369
419
|
/**
|
|
370
|
-
* @reactive
|
|
420
|
+
* @reactive {@linkcode window.activeColorTheme}
|
|
371
421
|
*/
|
|
372
422
|
export declare const useActiveColorTheme: () => ShallowRef<ColorTheme, ColorTheme>;
|
|
373
423
|
|
|
374
424
|
/**
|
|
375
|
-
* @reactive
|
|
425
|
+
* @reactive {@linkcode debug.activeDebugSession}
|
|
376
426
|
*/
|
|
377
427
|
export declare const useActiveDebugSession: () => ComputedRef<DebugSession | undefined>;
|
|
378
428
|
|
|
379
429
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* @category editor
|
|
383
|
-
*/
|
|
384
|
-
export declare function useActiveEditorDecorations(decorationTypeOrOptions: MaybeRefOrGetter<TextEditorDecorationType | DecorationRenderOptions>, decorations: MaybeRef<readonly Range[] | readonly DecorationOptions[]> | ((editor: TextEditor) => Awaitable<readonly Range[] | readonly DecorationOptions[]>), options?: UseEditorDecorationsOptions): {
|
|
385
|
-
update: () => Promise<void>;
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* @reactive `window.activeNotebookEditor`
|
|
430
|
+
* @reactive {@linkcode window.activeNotebookEditor}
|
|
390
431
|
* @category editor
|
|
391
432
|
*/
|
|
392
433
|
export declare const useActiveNotebookEditor: () => ShallowRef<NotebookEditor | undefined, NotebookEditor | undefined>;
|
|
393
434
|
|
|
394
435
|
/**
|
|
395
|
-
* @reactive
|
|
436
|
+
* @reactive {@linkcode window.activeTerminal}
|
|
396
437
|
* @category terminal
|
|
397
438
|
*/
|
|
398
439
|
export declare const useActiveTerminal: () => ShallowRef<Terminal | undefined, Terminal | undefined>;
|
|
399
440
|
|
|
400
441
|
/**
|
|
401
|
-
* @reactive
|
|
442
|
+
* @reactive {@linkcode window.activeTextEditor}
|
|
402
443
|
* @category editor
|
|
403
444
|
*/
|
|
404
|
-
export declare const useActiveTextEditor: () =>
|
|
445
|
+
export declare const useActiveTextEditor: () => ComputedRef<TextEditor | undefined>;
|
|
405
446
|
|
|
406
447
|
/**
|
|
407
|
-
* @reactive
|
|
448
|
+
* @reactive {@linkcode extensions.all}
|
|
408
449
|
* @category extension
|
|
409
450
|
*/
|
|
410
451
|
export declare const useAllExtensions: () => ComputedRef<readonly Extension<any>[]>;
|
|
411
452
|
|
|
412
453
|
/**
|
|
413
|
-
* @reactive
|
|
454
|
+
* @reactive {@linkcode chat.createChatParticipant}
|
|
414
455
|
* @category chat
|
|
415
456
|
*/
|
|
416
|
-
export declare
|
|
417
|
-
onDidReceiveFeedback: (listener: (e: ChatResultFeedback) => any, thisArgs?: any, disposables?: Disposable_2[]) => void;
|
|
418
|
-
};
|
|
457
|
+
export declare function useChatParticipant(id: string, handler: MaybeRef<ChatRequestHandler>, options?: ChatParticipantOptions): ChatParticipant;
|
|
419
458
|
|
|
420
459
|
/**
|
|
421
|
-
*
|
|
422
|
-
*
|
|
460
|
+
* @reactive {@linkcode commands.registerCommand}
|
|
423
461
|
* @category commands
|
|
424
462
|
*/
|
|
425
|
-
export declare function useCommand
|
|
463
|
+
export declare function useCommand(command: string, callback: MaybeRef<Nullable<(...args: any[]) => any>>): void;
|
|
426
464
|
|
|
427
465
|
/**
|
|
428
|
-
*
|
|
429
|
-
*
|
|
466
|
+
* @reactive {@linkcode commands.registerCommand}
|
|
430
467
|
* @category commands
|
|
431
468
|
*/
|
|
432
|
-
export declare function useCommands(commands:
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* @reactive `comments.createCommentController`
|
|
436
|
-
*/
|
|
437
|
-
export declare function useCommentController(id: string, label: string): CommentController;
|
|
469
|
+
export declare function useCommands(commands: Record<string, MaybeRef<Nullable<(...args: any[]) => any>>>): void;
|
|
438
470
|
|
|
439
471
|
/**
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
* @category terminal
|
|
443
|
-
*/
|
|
444
|
-
export declare function useControlledTerminal(name?: string, shellPath?: string, shellArgs?: readonly string[] | string): UseControlledTerminalReturn;
|
|
445
|
-
|
|
446
|
-
export declare function useControlledTerminal(options: TerminalOptions): UseControlledTerminalReturn;
|
|
447
|
-
|
|
448
|
-
export declare function useControlledTerminal(options: ExtensionTerminalOptions): UseControlledTerminalReturn;
|
|
449
|
-
|
|
450
|
-
declare interface UseControlledTerminalReturn {
|
|
451
|
-
terminal: Ref<Terminal | null>;
|
|
452
|
-
getIsActive: () => boolean;
|
|
453
|
-
show: () => void;
|
|
454
|
-
sendText: (text: string) => void;
|
|
455
|
-
close: () => void;
|
|
456
|
-
state: ComputedRef<TerminalState | undefined>;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
/**
|
|
460
|
-
* @reactive `env.shell`
|
|
461
|
-
*/
|
|
462
|
-
export declare const useDefaultShell: () => ComputedRef<string>;
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Dispose the disposable when the current scope is disposed. See `vscode::Disposable`.
|
|
472
|
+
* Dispose the disposable when the current scope is disposed.
|
|
466
473
|
*
|
|
474
|
+
* @see {@linkcode Disposable}
|
|
467
475
|
* @category lifecycle
|
|
468
476
|
*/
|
|
469
477
|
export declare function useDisposable<T extends Disposable_2>(disposable: T): T;
|
|
470
478
|
|
|
471
479
|
/**
|
|
472
|
-
* @reactive
|
|
480
|
+
* @reactive {@linkcode TextDocument.getText}
|
|
473
481
|
* @category document
|
|
474
482
|
*/
|
|
475
|
-
export declare function useDocumentText(doc:
|
|
483
|
+
export declare function useDocumentText(doc: MaybeNullableRefOrGetter<TextDocument>): ShallowRef<string | undefined, string | undefined>;
|
|
476
484
|
|
|
477
485
|
/**
|
|
478
|
-
* Reactively set decorations on the given editor.
|
|
486
|
+
* Reactively set decorations on the given editor.
|
|
479
487
|
*
|
|
488
|
+
* @see {@linkcode TextEditor.setDecorations}
|
|
480
489
|
* @category editor
|
|
481
490
|
*/
|
|
482
|
-
export declare function useEditorDecorations(editor:
|
|
491
|
+
export declare function useEditorDecorations(editor: MaybeNullableRefOrGetter<TextEditor>, decorationTypeOrOptions: MaybeRefOrGetter<TextEditorDecorationType | DecorationRenderOptions>, decorations: MaybeRef<readonly Range[] | readonly DecorationOptions[]> | ((editor: TextEditor) => Awaitable<readonly Range[] | readonly DecorationOptions[]>), options?: UseEditorDecorationsOptions): {
|
|
483
492
|
/**
|
|
484
493
|
* Manually trigger the decoration update.
|
|
485
494
|
*/
|
|
@@ -490,190 +499,231 @@ export declare interface UseEditorDecorationsOptions {
|
|
|
490
499
|
/**
|
|
491
500
|
* The triggers to update the decorations.
|
|
492
501
|
*
|
|
493
|
-
* @default
|
|
502
|
+
* @default true
|
|
503
|
+
*/
|
|
504
|
+
watchDocumentChange?: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* Immediately trigger an update.
|
|
507
|
+
*
|
|
508
|
+
* @default true
|
|
494
509
|
*/
|
|
495
|
-
|
|
510
|
+
immediate?: boolean;
|
|
496
511
|
}
|
|
497
512
|
|
|
513
|
+
/**
|
|
514
|
+
* @reactive {@linkcode env.shell}
|
|
515
|
+
*/
|
|
516
|
+
export declare const useEnvShell: () => ComputedRef<string>;
|
|
517
|
+
|
|
498
518
|
/**
|
|
499
519
|
* @category utilities
|
|
500
|
-
* @reactive
|
|
520
|
+
* @reactive {@linkcode Event}
|
|
501
521
|
*/
|
|
502
|
-
export declare function useEvent<T>(event: Event_2<T>, listeners?: ((e: T) => any)[]):
|
|
522
|
+
export declare function useEvent<T>(event: Event_2<T>, listeners?: ((e: T) => any)[]): Event_2<T>;
|
|
503
523
|
|
|
504
524
|
/**
|
|
505
525
|
* @category utilities
|
|
506
|
-
* @reactive
|
|
526
|
+
* @reactive {@linkcode EventEmitter}
|
|
507
527
|
*/
|
|
508
528
|
export declare function useEventEmitter<T>(eventEmitter?: EventEmitter<T>, listeners?: ((e: T) => any)[]): UseEventEmitterReturn<T>;
|
|
509
529
|
|
|
510
|
-
export declare function useEventEmitter<T>(listeners
|
|
530
|
+
export declare function useEventEmitter<T>(listeners: ((e: T) => any)[]): UseEventEmitterReturn<T>;
|
|
511
531
|
|
|
512
532
|
declare interface UseEventEmitterReturn<T> {
|
|
533
|
+
emitter: EventEmitter<T>;
|
|
513
534
|
event: Event_2<T>;
|
|
514
|
-
fire:
|
|
515
|
-
addListener: (listener: (e: T) => any) => void;
|
|
535
|
+
fire: EventEmitter<T>['fire'];
|
|
516
536
|
}
|
|
517
537
|
|
|
518
538
|
/**
|
|
519
539
|
* Get a reactive secret value from the extension's secrets.
|
|
520
540
|
*
|
|
521
|
-
*
|
|
541
|
+
* - `null` indicates that the value has not been loaded yet.
|
|
542
|
+
* - `undefined` indicates that there is no value stored for the given key.
|
|
543
|
+
*
|
|
544
|
+
* @reactive {@linkcode ExtensionContext.secrets}
|
|
522
545
|
* @category extension
|
|
523
546
|
*/
|
|
524
|
-
export declare function useExtensionSecret(key: string):
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
547
|
+
export declare function useExtensionSecret(key: string): ExtensionSecretRef;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* @reactive {@linkcode workspace.createFileSystemWatcher}
|
|
551
|
+
*/
|
|
552
|
+
export declare function useFileSystemWatcher(globPatterns: MaybeRefOrGetter<GlobPattern | readonly GlobPattern[] | ReadonlySet<GlobPattern>>, handlers?: {
|
|
553
|
+
onDidCreate?: false | ((ev: Uri) => void);
|
|
554
|
+
onDidChange?: false | ((ev: Uri) => void);
|
|
555
|
+
onDidDelete?: false | ((ev: Uri) => void);
|
|
556
|
+
}): {
|
|
557
|
+
watchers: ReadonlyMap<string | {
|
|
558
|
+
readonly baseUri: {
|
|
559
|
+
readonly scheme: string;
|
|
560
|
+
readonly authority: string;
|
|
561
|
+
readonly path: string;
|
|
562
|
+
readonly query: string;
|
|
563
|
+
readonly fragment: string;
|
|
564
|
+
readonly fsPath: string;
|
|
565
|
+
readonly with: (change: {
|
|
566
|
+
scheme?: string;
|
|
567
|
+
authority?: string;
|
|
568
|
+
path?: string;
|
|
569
|
+
query?: string;
|
|
570
|
+
fragment?: string;
|
|
571
|
+
}) => Uri;
|
|
572
|
+
readonly toString: (skipEncoding?: boolean) => string;
|
|
573
|
+
readonly toJSON: () => any;
|
|
574
|
+
};
|
|
575
|
+
readonly base: string;
|
|
576
|
+
readonly pattern: string;
|
|
577
|
+
}, {
|
|
578
|
+
readonly ignoreCreateEvents: boolean;
|
|
579
|
+
readonly ignoreChangeEvents: boolean;
|
|
580
|
+
readonly ignoreDeleteEvents: boolean;
|
|
581
|
+
readonly onDidCreate: Event_2<Uri>;
|
|
582
|
+
readonly onDidChange: Event_2<Uri>;
|
|
583
|
+
readonly onDidDelete: Event_2<Uri>;
|
|
584
|
+
readonly dispose: () => any;
|
|
585
|
+
}>;
|
|
586
|
+
/**
|
|
587
|
+
* @see {@link FileSystemWatcher.onDidCreate}
|
|
588
|
+
*/
|
|
589
|
+
onDidCreate: Event_2<Uri>;
|
|
590
|
+
/**
|
|
591
|
+
* @see {@link FileSystemWatcher.onDidChange}
|
|
592
|
+
*/
|
|
593
|
+
onDidChange: Event_2<Uri>;
|
|
594
|
+
/**
|
|
595
|
+
* @see {@link FileSystemWatcher.onDidDelete}
|
|
596
|
+
*/
|
|
597
|
+
onDidDelete: Event_2<Uri>;
|
|
598
|
+
};
|
|
539
599
|
|
|
540
600
|
/**
|
|
541
|
-
* @reactive
|
|
601
|
+
* @reactive {@linkcode ExtensionContext.globalState}
|
|
602
|
+
* @category extension
|
|
542
603
|
*/
|
|
543
|
-
export declare function
|
|
604
|
+
export declare function useGlobalState<T>(key: string): MementoItemRef<T>;
|
|
544
605
|
|
|
545
|
-
export declare
|
|
546
|
-
readonly watchers: ShallowReactive<Map<GlobPattern, FileSystemWatcher>>;
|
|
547
|
-
readonly onDidCreate: Event_2<Uri>;
|
|
548
|
-
readonly onDidChange: Event_2<Uri>;
|
|
549
|
-
readonly onDidDelete: Event_2<Uri>;
|
|
550
|
-
}
|
|
606
|
+
export declare function useGlobalState<T>(key: string, defaultValue: T): Ref<T>;
|
|
551
607
|
|
|
552
608
|
/**
|
|
553
|
-
* @reactive
|
|
609
|
+
* @reactive {@linkcode window.createInputBox}
|
|
554
610
|
*/
|
|
555
|
-
export declare function
|
|
611
|
+
export declare function useInputBox(options?: InputBoxProps): {
|
|
612
|
+
/**
|
|
613
|
+
* @see {@linkcode InputBox.value}
|
|
614
|
+
*/
|
|
615
|
+
value: Ref<string, string> | ShallowRef<string, string> | WritableComputedRef<string, string>;
|
|
616
|
+
valueSelection: readonly [number, number] | undefined;
|
|
617
|
+
placeholder: string | undefined;
|
|
618
|
+
password: boolean;
|
|
619
|
+
onDidChangeValue: Event_2<string>;
|
|
620
|
+
onDidAccept: Event_2<void>;
|
|
621
|
+
buttons: readonly QuickInputButton[];
|
|
622
|
+
onDidTriggerButton: Event_2<QuickInputButton>;
|
|
623
|
+
prompt: string | undefined;
|
|
624
|
+
validationMessage: string | InputBoxValidationMessage | undefined;
|
|
625
|
+
title: string | undefined;
|
|
626
|
+
step: number | undefined;
|
|
627
|
+
totalSteps: number | undefined;
|
|
628
|
+
enabled: boolean;
|
|
629
|
+
busy: boolean;
|
|
630
|
+
ignoreFocusOut: boolean;
|
|
631
|
+
show(): void;
|
|
632
|
+
hide(): void;
|
|
633
|
+
onDidHide: Event_2<void>;
|
|
634
|
+
dispose(): void;
|
|
635
|
+
};
|
|
556
636
|
|
|
557
637
|
/**
|
|
558
|
-
* Determines if the current color theme is dark.
|
|
638
|
+
* Determines if the current color theme is dark.
|
|
559
639
|
*
|
|
640
|
+
* @see {@linkcode ColorTheme.kind}
|
|
560
641
|
* @category window
|
|
561
642
|
*/
|
|
562
643
|
export declare const useIsDarkTheme: () => ComputedRef<boolean>;
|
|
563
644
|
|
|
564
645
|
/**
|
|
565
|
-
* @reactive
|
|
646
|
+
* @reactive {@linkcode env.isTelemetryEnabled}
|
|
566
647
|
*/
|
|
567
648
|
export declare const useIsTelemetryEnabled: () => ComputedRef<boolean>;
|
|
568
649
|
|
|
569
650
|
/**
|
|
570
|
-
* @reactive
|
|
651
|
+
* @reactive {@linkcode l10n.t}
|
|
571
652
|
*/
|
|
572
|
-
export declare function useL10nText(message: MaybeRefOrGetter<string>, ...args:
|
|
653
|
+
export declare function useL10nText(message: MaybeRefOrGetter<string>, ...args: MaybeRefOrGetter<string | number | boolean>[]): ComputedRef<string>;
|
|
573
654
|
|
|
574
|
-
export declare function useL10nText(message: MaybeRefOrGetter<string>, args: Record<string, any
|
|
655
|
+
export declare function useL10nText(message: MaybeRefOrGetter<string>, args: MaybeRefOrGetter<Record<string, any>>): ComputedRef<string>;
|
|
575
656
|
|
|
576
657
|
/**
|
|
577
|
-
*
|
|
578
|
-
*
|
|
579
|
-
* @reactive `lm.tools`
|
|
658
|
+
* @reactive {@linkcode lm.tools}
|
|
580
659
|
* @category lm
|
|
581
660
|
*/
|
|
582
661
|
export declare const useLmTools: () => ComputedRef<readonly LanguageModelToolInformation[]>;
|
|
583
662
|
|
|
584
663
|
/**
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
* @category view
|
|
664
|
+
* @reactive {@linkcode env.logLevel}
|
|
588
665
|
*/
|
|
589
|
-
export declare
|
|
590
|
-
outputChannel: OutputChannel;
|
|
591
|
-
createLoggerFunc: (type: LoggingType) => (...message: any[]) => void;
|
|
592
|
-
info: (...message: any[]) => void;
|
|
593
|
-
warn: (...message: any[]) => void;
|
|
594
|
-
error: (...message: any[]) => void;
|
|
595
|
-
append: (value: string) => void;
|
|
596
|
-
appendLine: (value: string) => void;
|
|
597
|
-
replace: (value: string) => void;
|
|
598
|
-
clear: () => void;
|
|
599
|
-
show: {
|
|
600
|
-
(preserveFocus?: boolean): void;
|
|
601
|
-
(column?: ViewColumn, preserveFocus?: boolean): void;
|
|
602
|
-
};
|
|
603
|
-
hide: () => void;
|
|
604
|
-
};
|
|
666
|
+
export declare const useLogLevel: () => ComputedRef<LogLevel>;
|
|
605
667
|
|
|
606
|
-
|
|
607
|
-
outputChannel?: OutputChannel;
|
|
608
|
-
getPrefix?: ((type: LoggingType) => string) | null;
|
|
609
|
-
/**
|
|
610
|
-
* @default ['error', 'warn']
|
|
611
|
-
*/
|
|
612
|
-
toConsole?: LoggingType[];
|
|
613
|
-
}
|
|
668
|
+
/* Excluded declaration from this release type: useMementoItem */
|
|
614
669
|
|
|
615
|
-
|
|
616
|
-
* @reactive `env.logLevel`
|
|
617
|
-
*/
|
|
618
|
-
export declare const useLogLevel: () => ComputedRef<LogLevel>;
|
|
670
|
+
export declare function useMementoItem<T>(memento: Memento, key: string, defaultValue: T): MementoItemRef<T>;
|
|
619
671
|
|
|
620
672
|
/**
|
|
621
|
-
* @reactive
|
|
673
|
+
* @reactive {@linkcode NotebookEditor.selection}
|
|
622
674
|
* @category editor
|
|
623
675
|
*/
|
|
624
|
-
export declare function useNotebookEditorSelection(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<NotebookRange, NotebookRange>;
|
|
676
|
+
export declare function useNotebookEditorSelection(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<NotebookRange | undefined, NotebookRange | undefined>;
|
|
625
677
|
|
|
626
678
|
/**
|
|
627
|
-
* @reactive
|
|
679
|
+
* @reactive {@linkcode NotebookEditor.selections}
|
|
628
680
|
* @category editor
|
|
629
681
|
*/
|
|
630
682
|
export declare function useNotebookEditorSelections(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<readonly NotebookRange[], readonly NotebookRange[]>;
|
|
631
683
|
|
|
632
684
|
/**
|
|
633
|
-
* @reactive
|
|
685
|
+
* @reactive {@linkcode NotebookEditor.visibleRanges}
|
|
634
686
|
* @category editor
|
|
635
687
|
*/
|
|
636
688
|
export declare function useNotebookEditorVisibleRanges(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): ComputedRef<readonly NotebookRange[]>;
|
|
637
689
|
|
|
638
690
|
/**
|
|
639
|
-
* @reactive
|
|
691
|
+
* @reactive {@linkcode window.terminals}
|
|
640
692
|
* @category terminal
|
|
641
693
|
*/
|
|
642
694
|
export declare const useOpenedTerminals: () => ShallowRef<readonly Terminal[], readonly Terminal[]>;
|
|
643
695
|
|
|
644
|
-
/**
|
|
645
|
-
* @reactive `window.createOutputChannel`
|
|
646
|
-
* @category view
|
|
647
|
-
*/
|
|
648
|
-
export declare function useOutputChannel(name: string, options: {
|
|
649
|
-
log: true;
|
|
650
|
-
}): LogOutputChannel;
|
|
651
|
-
|
|
652
|
-
export declare function useOutputChannel(name: string, languageId?: string): OutputChannel;
|
|
653
|
-
|
|
654
696
|
/**
|
|
655
697
|
* Creates a customizable quick pick UI.
|
|
656
698
|
*
|
|
657
|
-
* @reactive
|
|
658
|
-
*/
|
|
659
|
-
export declare function useQuickPick<T extends QuickPickItem>(options?:
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
activeItems: ShallowRef<readonly T[], readonly T[]>;
|
|
668
|
-
|
|
699
|
+
* @reactive {@linkcode window.createQuickPick}
|
|
700
|
+
*/
|
|
701
|
+
export declare function useQuickPick<T extends QuickPickItem>(options?: QuickPickProps<T>): {
|
|
702
|
+
/**
|
|
703
|
+
* @see {@linkcode QuickPick.value}
|
|
704
|
+
*/
|
|
705
|
+
value: Ref<string, string> | ShallowRef<string, string> | WritableComputedRef<string, string>;
|
|
706
|
+
/**
|
|
707
|
+
* @see {@linkcode QuickPick.activeItems}
|
|
708
|
+
*/
|
|
709
|
+
activeItems: Ref<readonly T[], readonly T[]> | ShallowRef<readonly T[], readonly T[]> | WritableComputedRef<readonly T[], readonly T[]>;
|
|
710
|
+
/**
|
|
711
|
+
* @see {@linkcode QuickPick.selectedItems}
|
|
712
|
+
*/
|
|
713
|
+
selectedItems: Ref<readonly T[], readonly T[]> | ShallowRef<readonly T[], readonly T[]> | WritableComputedRef<readonly T[], readonly T[]>;
|
|
669
714
|
placeholder: string | undefined;
|
|
715
|
+
onDidChangeValue: Event_2<string>;
|
|
716
|
+
onDidAccept: Event_2<void>;
|
|
670
717
|
buttons: readonly QuickInputButton[];
|
|
718
|
+
onDidTriggerButton: Event_2<QuickInputButton>;
|
|
671
719
|
onDidTriggerItemButton: Event_2<QuickPickItemButtonEvent<T>>;
|
|
672
720
|
items: readonly T[];
|
|
673
721
|
canSelectMany: boolean;
|
|
674
722
|
matchOnDescription: boolean;
|
|
675
723
|
matchOnDetail: boolean;
|
|
676
724
|
keepScrollPosition?: boolean;
|
|
725
|
+
onDidChangeActive: Event_2<readonly T[]>;
|
|
726
|
+
onDidChangeSelection: Event_2<readonly T[]>;
|
|
677
727
|
title: string | undefined;
|
|
678
728
|
step: number | undefined;
|
|
679
729
|
totalSteps: number | undefined;
|
|
@@ -682,19 +732,14 @@ export declare function useQuickPick<T extends QuickPickItem>(options?: QuickPic
|
|
|
682
732
|
ignoreFocusOut: boolean;
|
|
683
733
|
show(): void;
|
|
684
734
|
hide(): void;
|
|
735
|
+
onDidHide: Event_2<void>;
|
|
685
736
|
dispose(): void;
|
|
686
737
|
};
|
|
687
738
|
|
|
688
|
-
|
|
689
|
-
* Set multiple reactive options on a target object.
|
|
690
|
-
* @category utilities
|
|
691
|
-
*/
|
|
692
|
-
export declare function useReactiveOptions<T extends object>(target: T, options: {
|
|
693
|
-
[K in keyof T]?: MaybeRefOrGetter<T[K]>;
|
|
694
|
-
}, keys: (keyof T)[]): void;
|
|
739
|
+
/* Excluded from this release type: useReactiveOptions */
|
|
695
740
|
|
|
696
741
|
/**
|
|
697
|
-
* @reactive
|
|
742
|
+
* @reactive {@linkcode window.createStatusBarItem}
|
|
698
743
|
*/
|
|
699
744
|
export declare function useStatusBarItem(options: UseStatusBarItemOptions): StatusBarItem;
|
|
700
745
|
|
|
@@ -702,24 +747,48 @@ export declare interface UseStatusBarItemOptions {
|
|
|
702
747
|
id?: string;
|
|
703
748
|
alignment?: StatusBarAlignment;
|
|
704
749
|
priority?: number;
|
|
750
|
+
/**
|
|
751
|
+
* @see {@linkcode StatusBarItem.name}
|
|
752
|
+
*/
|
|
705
753
|
name?: MaybeRefOrGetter<StatusBarItem['name']>;
|
|
754
|
+
/**
|
|
755
|
+
* @see {@linkcode StatusBarItem.text}
|
|
756
|
+
*/
|
|
706
757
|
text?: MaybeRefOrGetter<StatusBarItem['text']>;
|
|
758
|
+
/**
|
|
759
|
+
* @see {@linkcode StatusBarItem.tooltip}
|
|
760
|
+
*/
|
|
707
761
|
tooltip?: MaybeRefOrGetter<StatusBarItem['tooltip']>;
|
|
762
|
+
/**
|
|
763
|
+
* @see {@linkcode StatusBarItem.color}
|
|
764
|
+
*/
|
|
708
765
|
color?: MaybeRefOrGetter<StatusBarItem['color']>;
|
|
766
|
+
/**
|
|
767
|
+
* @see {@linkcode StatusBarItem.backgroundColor}
|
|
768
|
+
*/
|
|
709
769
|
backgroundColor?: MaybeRefOrGetter<StatusBarItem['backgroundColor']>;
|
|
770
|
+
/**
|
|
771
|
+
* @see {@linkcode StatusBarItem.command}
|
|
772
|
+
*/
|
|
710
773
|
command?: MaybeRefOrGetter<StatusBarItem['command']>;
|
|
774
|
+
/**
|
|
775
|
+
* @see {@linkcode StatusBarItem.accessibilityInformation}
|
|
776
|
+
*/
|
|
711
777
|
accessibilityInformation?: MaybeRefOrGetter<StatusBarItem['accessibilityInformation']>;
|
|
778
|
+
/**
|
|
779
|
+
* Whether the status bar item is visible
|
|
780
|
+
*/
|
|
712
781
|
visible?: MaybeRefOrGetter<boolean>;
|
|
713
782
|
}
|
|
714
783
|
|
|
715
784
|
/**
|
|
716
|
-
* @reactive
|
|
785
|
+
* @reactive {@linkcode tasks.taskExecutions}
|
|
717
786
|
*/
|
|
718
787
|
export declare const useTaskExecutions: () => ComputedRef<readonly TaskExecution[]>;
|
|
719
788
|
|
|
720
789
|
/**
|
|
721
790
|
* @category terminal
|
|
722
|
-
* @reactive
|
|
791
|
+
* @reactive {@linkcode window.createTerminal}
|
|
723
792
|
*/
|
|
724
793
|
export declare function useTerminal(name?: string, shellPath?: string, shellArgs?: readonly string[] | string): UseTerminalReturn;
|
|
725
794
|
|
|
@@ -727,138 +796,208 @@ export declare function useTerminal(options: TerminalOptions): UseTerminalReturn
|
|
|
727
796
|
|
|
728
797
|
export declare function useTerminal(options: ExtensionTerminalOptions): UseTerminalReturn;
|
|
729
798
|
|
|
730
|
-
declare interface UseTerminalReturn extends
|
|
799
|
+
declare interface UseTerminalReturn extends Pick<Terminal, 'sendText' | 'show' | 'hide' | 'dispose'> {
|
|
731
800
|
terminal: Terminal;
|
|
801
|
+
/**
|
|
802
|
+
* @see {@linkcode Terminal.state}
|
|
803
|
+
*/
|
|
732
804
|
state: ComputedRef<TerminalState>;
|
|
805
|
+
/**
|
|
806
|
+
* @see {@linkcode Terminal.shellIntegration}
|
|
807
|
+
*/
|
|
808
|
+
shellIntegration: ComputedRef<TerminalShellIntegration>;
|
|
733
809
|
}
|
|
734
810
|
|
|
735
811
|
/**
|
|
736
|
-
* @reactive
|
|
812
|
+
* @reactive {@linkcode Terminal.shellIntegration}
|
|
737
813
|
* @category terminal
|
|
738
814
|
*/
|
|
815
|
+
export declare function useTerminalShellIntegration(terminal: MaybeRefOrGetter<Terminal>): ComputedRef<TerminalShellIntegration>;
|
|
816
|
+
|
|
817
|
+
export declare function useTerminalShellIntegration(terminal: MaybeNullableRefOrGetter<Terminal>): ComputedRef<TerminalShellIntegration | undefined>;
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* @reactive {@linkcode Terminal.state}
|
|
821
|
+
* @category terminal
|
|
822
|
+
*/
|
|
823
|
+
export declare function useTerminalState(terminal: MaybeRefOrGetter<Terminal>): ComputedRef<TerminalState>;
|
|
824
|
+
|
|
739
825
|
export declare function useTerminalState(terminal: MaybeNullableRefOrGetter<Terminal>): ComputedRef<TerminalState | undefined>;
|
|
740
826
|
|
|
741
827
|
/**
|
|
742
|
-
*
|
|
743
|
-
*
|
|
828
|
+
* @reactive {@linkcode commands.registerTextEditorCommand}
|
|
744
829
|
* @category commands
|
|
745
830
|
*/
|
|
746
|
-
export declare function useTextEditorCommand(command: string, callback: TextEditorCommandCallback): void;
|
|
831
|
+
export declare function useTextEditorCommand(command: string, callback: MaybeRef<Nullable<TextEditorCommandCallback>>): void;
|
|
747
832
|
|
|
748
833
|
/**
|
|
749
|
-
*
|
|
750
|
-
*
|
|
834
|
+
* @reactive {@linkcode commands.registerTextEditorCommand}
|
|
751
835
|
* @category commands
|
|
752
836
|
*/
|
|
753
|
-
export declare function useTextEditorCommands(commands: Record<string, TextEditorCommandCallback
|
|
837
|
+
export declare function useTextEditorCommands(commands: Record<string, MaybeRef<Nullable<TextEditorCommandCallback>>>): void;
|
|
754
838
|
|
|
755
839
|
/**
|
|
756
|
-
* @reactive
|
|
840
|
+
* @reactive {@linkcode TextEditor.selection}
|
|
757
841
|
* @category editor
|
|
758
842
|
*/
|
|
759
|
-
export declare function useTextEditorSelection(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<Selection, Selection>;
|
|
843
|
+
export declare function useTextEditorSelection(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<Selection | undefined, Selection | undefined>;
|
|
760
844
|
|
|
761
845
|
/**
|
|
762
|
-
* @reactive
|
|
846
|
+
* @reactive {@linkcode TextEditor.selections}
|
|
763
847
|
* @category editor
|
|
764
848
|
*/
|
|
765
849
|
export declare function useTextEditorSelections(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<readonly Selection[], readonly Selection[]>;
|
|
766
850
|
|
|
767
851
|
/**
|
|
768
|
-
* @reactive
|
|
852
|
+
* @reactive {@linkcode TextEditor.viewColumn}
|
|
769
853
|
* @category editor
|
|
770
854
|
*/
|
|
771
855
|
export declare function useTextEditorViewColumn(textEditor: MaybeNullableRefOrGetter<TextEditor>): ComputedRef<ViewColumn | undefined>;
|
|
772
856
|
|
|
773
857
|
/**
|
|
774
|
-
* @reactive
|
|
858
|
+
* @reactive {@linkcode TextEditor.visibleRanges}
|
|
775
859
|
* @category editor
|
|
776
860
|
*/
|
|
777
861
|
export declare function useTextEditorVisibleRanges(textEditor: MaybeNullableRefOrGetter<TextEditor>): ComputedRef<readonly Range[]>;
|
|
778
862
|
|
|
779
863
|
/**
|
|
780
|
-
*
|
|
781
|
-
*
|
|
864
|
+
* @reactive {@linkcode window.createTreeView}
|
|
782
865
|
* @category view
|
|
783
866
|
*/
|
|
784
|
-
export declare
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
867
|
+
export declare function useTreeView<T extends TreeViewNode>(viewId: string, treeData: MaybeRefOrGetter<Awaitable<T[]>>, options?: TreeViewProps<T>): {
|
|
868
|
+
view: TreeView<T>;
|
|
869
|
+
/**
|
|
870
|
+
* @see {@linkcode TreeView.selection}
|
|
871
|
+
*/
|
|
872
|
+
selection: ShallowRef<readonly T[], readonly T[]>;
|
|
873
|
+
/**
|
|
874
|
+
* @see {@linkcode TreeView.visible}
|
|
875
|
+
*/
|
|
876
|
+
visible: ComputedRef<boolean>;
|
|
789
877
|
/**
|
|
790
|
-
*
|
|
878
|
+
* @see {@linkcode TreeView.reveal}
|
|
791
879
|
*/
|
|
792
|
-
|
|
880
|
+
reveal: (element: T, options?: {
|
|
881
|
+
readonly select?: boolean;
|
|
882
|
+
readonly focus?: boolean;
|
|
883
|
+
readonly expand?: boolean | number;
|
|
884
|
+
}) => Thenable<void>;
|
|
793
885
|
};
|
|
794
886
|
|
|
795
887
|
/**
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
* @category view
|
|
799
|
-
*/
|
|
800
|
-
export declare function useViewBadge(view: MaybeRefOrGetter<Nullable<ViewWithBadge>>, badge: MaybeRefOrGetter<ViewBadge | undefined>): void;
|
|
801
|
-
|
|
802
|
-
/**
|
|
803
|
-
* Reactively set the title of a view (`vscode::TreeView` or `vscode::WebviewView`).
|
|
804
|
-
*
|
|
805
|
-
* @category view
|
|
806
|
-
*/
|
|
807
|
-
export declare function useViewTitle(view: MaybeRefOrGetter<Nullable<ViewWithTitle>>, title: MaybeRefOrGetter<string | undefined>): void;
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* Reactively get the visibility of a view (`vscode::TreeView` or `vscode::WebviewView`).
|
|
811
|
-
*
|
|
888
|
+
* @reactive {@linkcode TreeView.visible}, {@linkcode WebviewView.visible}
|
|
812
889
|
* @category view
|
|
813
890
|
*/
|
|
814
891
|
export declare function useViewVisibility(view: MaybeNullableRefOrGetter<ViewWithVisibility>): ComputedRef<boolean>;
|
|
815
892
|
|
|
816
893
|
/**
|
|
817
|
-
* @reactive
|
|
894
|
+
* @reactive {@linkcode window.visibleNotebookEditors}
|
|
818
895
|
* @category editor
|
|
819
896
|
*/
|
|
820
|
-
export declare const useVisibleNotebookEditors: () =>
|
|
897
|
+
export declare const useVisibleNotebookEditors: () => ComputedRef<readonly NotebookEditor[]>;
|
|
821
898
|
|
|
822
899
|
/**
|
|
823
|
-
* @reactive
|
|
900
|
+
* @reactive {@linkcode window.visibleTextEditors}
|
|
824
901
|
* @category editor
|
|
825
902
|
*/
|
|
826
|
-
export declare const useVisibleTextEditors: () =>
|
|
903
|
+
export declare const useVisibleTextEditors: () => ComputedRef<readonly TextEditor[]>;
|
|
827
904
|
|
|
828
|
-
|
|
905
|
+
/**
|
|
906
|
+
* Reactively set a VS Code context. See [custom when clause context](https://code.visualstudio.com/api/references/when-clause-contexts#add-a-custom-when-clause-context).
|
|
907
|
+
*
|
|
908
|
+
* @category lifecycle
|
|
909
|
+
*/
|
|
910
|
+
export declare function useVscodeContext<T>(name: string, value: WritableComputedRef<T>): WritableComputedRef<T>;
|
|
829
911
|
|
|
830
|
-
export declare function useVscodeContext<T>(name: string, value: ComputedRef<T> | (() => T)
|
|
912
|
+
export declare function useVscodeContext<T>(name: string, value: ComputedRef<T> | (() => T)): ComputedRef<T>;
|
|
831
913
|
|
|
832
|
-
export declare function useVscodeContext<T>(name: string, value: MaybeRef<T
|
|
914
|
+
export declare function useVscodeContext<T>(name: string, value: MaybeRef<T>): Ref<T>;
|
|
833
915
|
|
|
834
916
|
/**
|
|
835
|
-
*
|
|
836
|
-
*
|
|
917
|
+
* @reactive {@linkcode window.createWebviewPanel}
|
|
837
918
|
* @category view
|
|
838
919
|
*/
|
|
839
|
-
export declare function useWebviewPanel(viewType: string, title: MaybeRefOrGetter<string>, html: MaybeRefOrGetter<string>, showOptions: Parameters<typeof window.createWebviewPanel>[2], options?:
|
|
920
|
+
export declare function useWebviewPanel(viewType: string, title: MaybeRefOrGetter<string>, html: MaybeRefOrGetter<string>, showOptions: Parameters<typeof window.createWebviewPanel>[2], options?: WebviewPanelProps): {
|
|
840
921
|
panel: WebviewPanel;
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
922
|
+
webview: Webview;
|
|
923
|
+
/**
|
|
924
|
+
* @see {@linkcode WebviewPanel.viewColumn}
|
|
925
|
+
*/
|
|
926
|
+
viewColumn: ComputedRef<ViewColumn | undefined>;
|
|
927
|
+
/**
|
|
928
|
+
* @see {@linkcode WebviewPanel.active}
|
|
929
|
+
*/
|
|
930
|
+
active: ComputedRef<boolean>;
|
|
931
|
+
/**
|
|
932
|
+
* @see {@linkcode WebviewPanel.visible}
|
|
933
|
+
*/
|
|
934
|
+
visible: ComputedRef<boolean>;
|
|
935
|
+
/**
|
|
936
|
+
* @see {@linkcode WebviewPanel.reveal}
|
|
937
|
+
*/
|
|
938
|
+
reveal: (viewColumn?: ViewColumn, preserveFocus?: boolean) => void;
|
|
939
|
+
/**
|
|
940
|
+
* @see {@linkcode Webview.postMessage}
|
|
941
|
+
*/
|
|
844
942
|
postMessage: (message: any) => Thenable<boolean>;
|
|
845
|
-
|
|
943
|
+
/**
|
|
944
|
+
* @see {@linkcode Webview.asWebviewUri}
|
|
945
|
+
*/
|
|
946
|
+
asWebviewUri: (localResource: Uri) => Uri;
|
|
947
|
+
/**
|
|
948
|
+
* Force reload the webview content.
|
|
949
|
+
*/
|
|
950
|
+
forceReload: () => void;
|
|
846
951
|
};
|
|
847
952
|
|
|
848
953
|
/**
|
|
849
|
-
*
|
|
850
|
-
*
|
|
954
|
+
* @reactive {@linkcode window.registerWebviewViewProvider}
|
|
851
955
|
* @category view
|
|
852
956
|
*/
|
|
853
|
-
export declare
|
|
854
|
-
view:
|
|
855
|
-
|
|
957
|
+
export declare function useWebviewView(viewId: string, html: MaybeRefOrGetter<string>, options?: WebviewViewProps): {
|
|
958
|
+
view: ComputedRef<WebviewView | undefined>;
|
|
959
|
+
/**
|
|
960
|
+
* @see {@linkcode WebviewView.webview}
|
|
961
|
+
*/
|
|
962
|
+
webview: ComputedRef<Webview | undefined>;
|
|
963
|
+
/**
|
|
964
|
+
* Additional metadata about the view being resolved.
|
|
965
|
+
*/
|
|
966
|
+
context: ComputedRef<WebviewViewResolveContext<unknown> | undefined>;
|
|
967
|
+
/**
|
|
968
|
+
* @see {@linkcode WebviewView.visible}
|
|
969
|
+
*/
|
|
970
|
+
visible: ComputedRef<boolean>;
|
|
971
|
+
/**
|
|
972
|
+
* @see {@linkcode WebviewView.show}
|
|
973
|
+
*/
|
|
974
|
+
show: (preserveFocus?: boolean) => void | undefined;
|
|
975
|
+
/**
|
|
976
|
+
* @see {@linkcode Webview.postMessage}
|
|
977
|
+
*/
|
|
856
978
|
postMessage: (message: any) => Thenable<boolean> | undefined;
|
|
857
|
-
|
|
979
|
+
/**
|
|
980
|
+
* @see {@linkcode Webview.asWebviewUri}
|
|
981
|
+
*/
|
|
982
|
+
asWebviewUri: (resource: Uri) => Uri | undefined;
|
|
983
|
+
/**
|
|
984
|
+
* Force reload the webview content.
|
|
985
|
+
*/
|
|
986
|
+
forceReload: () => void;
|
|
858
987
|
};
|
|
859
988
|
|
|
860
989
|
/**
|
|
861
|
-
* @reactive
|
|
990
|
+
* @reactive {@linkcode window.state.active}
|
|
991
|
+
*/
|
|
992
|
+
export declare const useWindowActive: () => ComputedRef<boolean>;
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* @reactive {@linkcode window.state.focused}
|
|
996
|
+
*/
|
|
997
|
+
export declare const useWindowFocused: () => ComputedRef<boolean>;
|
|
998
|
+
|
|
999
|
+
/**
|
|
1000
|
+
* @reactive {@linkcode window.state}
|
|
862
1001
|
*/
|
|
863
1002
|
export declare const useWindowState: () => {
|
|
864
1003
|
focused: ComputedRef<boolean>;
|
|
@@ -866,29 +1005,74 @@ export declare const useWindowState: () => {
|
|
|
866
1005
|
};
|
|
867
1006
|
|
|
868
1007
|
/**
|
|
869
|
-
* @reactive
|
|
1008
|
+
* @reactive {@linkcode workspace.workspaceFolders}
|
|
870
1009
|
*/
|
|
871
1010
|
export declare const useWorkspaceFolders: () => ComputedRef<readonly WorkspaceFolder[] | undefined>;
|
|
872
1011
|
|
|
873
|
-
|
|
1012
|
+
/**
|
|
1013
|
+
* @reactive {@linkcode ExtensionContext.workspaceState}
|
|
1014
|
+
* @category extension
|
|
1015
|
+
*/
|
|
1016
|
+
export declare function useWorkspaceState<T>(key: string): MementoItemRef<T>;
|
|
874
1017
|
|
|
875
|
-
declare
|
|
1018
|
+
export declare function useWorkspaceState<T>(key: string, defaultValue: T): Ref<T>;
|
|
876
1019
|
|
|
877
1020
|
declare type ViewWithVisibility = Pick<TreeView<unknown> | WebviewView, 'visible' | 'onDidChangeVisibility'>;
|
|
878
1021
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1022
|
+
declare type WebviewCreationOptions = (Parameters<typeof window.registerWebviewViewProvider>[2] & {})['webviewOptions'] & {};
|
|
1023
|
+
|
|
1024
|
+
export declare interface WebviewPanelProps extends WebviewPanelOptions, WebviewOptions {
|
|
1025
|
+
/**
|
|
1026
|
+
* @see {@linkcode WebviewPanel.title}
|
|
1027
|
+
*/
|
|
1028
|
+
title?: MaybeRefOrGetter<WebviewPanel['title']>;
|
|
1029
|
+
/**
|
|
1030
|
+
* @see {@linkcode WebviewPanel.iconPath}
|
|
1031
|
+
*/
|
|
1032
|
+
iconPath?: MaybeRefOrGetter<WebviewPanel['iconPath']>;
|
|
1033
|
+
/**
|
|
1034
|
+
* @see {@linkcode WebviewPanel.onDidChangeViewState}
|
|
1035
|
+
*/
|
|
1036
|
+
onDidChangeViewState?: EventListener_2<WebviewPanel['onDidChangeViewState']>;
|
|
1037
|
+
/**
|
|
1038
|
+
* @see {@linkcode WebviewPanel.onDidDispose}
|
|
1039
|
+
*/
|
|
1040
|
+
onDidDispose?: EventListener_2<WebviewPanel['onDidDispose']>;
|
|
1041
|
+
/**
|
|
1042
|
+
* @see {@linkcode Webview.options}
|
|
1043
|
+
*/
|
|
883
1044
|
webviewOptions?: MaybeRefOrGetter<WebviewOptions>;
|
|
1045
|
+
/**
|
|
1046
|
+
* @see {@linkcode Webview.onDidReceiveMessage}
|
|
1047
|
+
*/
|
|
1048
|
+
onDidReceiveMessage?: EventListener_2<Webview['onDidReceiveMessage']>;
|
|
884
1049
|
}
|
|
885
1050
|
|
|
886
|
-
export declare interface
|
|
887
|
-
|
|
888
|
-
|
|
1051
|
+
export declare interface WebviewViewProps extends WebviewCreationOptions {
|
|
1052
|
+
/**
|
|
1053
|
+
* @see {@linkcode WebviewView.title}
|
|
1054
|
+
*/
|
|
1055
|
+
title?: MaybeRefOrGetter<WebviewView['title']>;
|
|
1056
|
+
/**
|
|
1057
|
+
* @see {@linkcode WebviewView.description}
|
|
1058
|
+
*/
|
|
1059
|
+
description?: MaybeRefOrGetter<WebviewView['description']>;
|
|
1060
|
+
/**
|
|
1061
|
+
* @see {@linkcode WebviewView.badge}
|
|
1062
|
+
*/
|
|
1063
|
+
badge?: MaybeRefOrGetter<WebviewView['badge']>;
|
|
1064
|
+
/**
|
|
1065
|
+
* @see {@linkcode WebviewViewOptions.onDidDispose}
|
|
1066
|
+
*/
|
|
1067
|
+
onDidDispose?: EventListener_2<WebviewView['onDidDispose']>;
|
|
1068
|
+
/**
|
|
1069
|
+
* @see {@linkcode Webview.options}
|
|
1070
|
+
*/
|
|
889
1071
|
webviewOptions?: MaybeRefOrGetter<WebviewOptions>;
|
|
890
|
-
|
|
891
|
-
|
|
1072
|
+
/**
|
|
1073
|
+
* @see {@linkcode Webview.onDidReceiveMessage}
|
|
1074
|
+
*/
|
|
1075
|
+
onDidReceiveMessage?: EventListener_2<Webview['onDidReceiveMessage']>;
|
|
892
1076
|
}
|
|
893
1077
|
|
|
894
1078
|
|