reactive-vscode 0.0.1-beta.5 → 0.1.0

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.
Files changed (66) hide show
  1. package/README.md +33 -33
  2. package/dist/index.d.ts +723 -3
  3. package/dist/index.js +791 -724
  4. package/package.json +2 -2
  5. package/tsconfig.json +9 -9
  6. package/dist/composables/index.d.ts +0 -50
  7. package/dist/composables/useAbsolutePath.d.ts +0 -8
  8. package/dist/composables/useActiveColorTheme.d.ts +0 -5
  9. package/dist/composables/useActiveDebugSession.d.ts +0 -5
  10. package/dist/composables/useActiveEditorDecorations.d.ts +0 -9
  11. package/dist/composables/useActiveNotebookEditor.d.ts +0 -6
  12. package/dist/composables/useActiveTerminal.d.ts +0 -6
  13. package/dist/composables/useActiveTextEditor.d.ts +0 -6
  14. package/dist/composables/useAllExtensions.d.ts +0 -5
  15. package/dist/composables/useCommand.d.ts +0 -8
  16. package/dist/composables/useCommands.d.ts +0 -8
  17. package/dist/composables/useCommentController.d.ts +0 -5
  18. package/dist/composables/useDefaultShell.d.ts +0 -4
  19. package/dist/composables/useDisposable.d.ts +0 -8
  20. package/dist/composables/useDocumentText.d.ts +0 -8
  21. package/dist/composables/useEditorDecorations.d.ts +0 -10
  22. package/dist/composables/useEvent.d.ts +0 -7
  23. package/dist/composables/useEventEmitter.d.ts +0 -10
  24. package/dist/composables/useFetchTasks.d.ts +0 -7
  25. package/dist/composables/useFileUri.d.ts +0 -24
  26. package/dist/composables/useFoldingRangeProvider.d.ts +0 -7
  27. package/dist/composables/useIsDarkTheme.d.ts +0 -6
  28. package/dist/composables/useIsTelemetryEnabled.d.ts +0 -4
  29. package/dist/composables/useL10nText.d.ts +0 -7
  30. package/dist/composables/useLogLevel.d.ts +0 -5
  31. package/dist/composables/useLogger.d.ts +0 -24
  32. package/dist/composables/useNotebookEditorSelection.d.ts +0 -8
  33. package/dist/composables/useNotebookEditorSelections.d.ts +0 -8
  34. package/dist/composables/useNotebookEditorVisibleRanges.d.ts +0 -8
  35. package/dist/composables/useOpenedTerminals.d.ts +0 -6
  36. package/dist/composables/useOutputChannel.d.ts +0 -6
  37. package/dist/composables/useStatusBarItem.d.ts +0 -19
  38. package/dist/composables/useTaskExecutions.d.ts +0 -5
  39. package/dist/composables/useTerminalState.d.ts +0 -7
  40. package/dist/composables/useTextEditorCommand.d.ts +0 -9
  41. package/dist/composables/useTextEditorCommands.d.ts +0 -8
  42. package/dist/composables/useTextEditorSelection.d.ts +0 -9
  43. package/dist/composables/useTextEditorSelections.d.ts +0 -9
  44. package/dist/composables/useTextEditorViewColumn.d.ts +0 -8
  45. package/dist/composables/useTextEditorVisibleRanges.d.ts +0 -8
  46. package/dist/composables/useTreeView.d.ts +0 -13
  47. package/dist/composables/useUri.d.ts +0 -24
  48. package/dist/composables/useViewBadge.d.ts +0 -12
  49. package/dist/composables/useViewTitle.d.ts +0 -12
  50. package/dist/composables/useViewVisibility.d.ts +0 -12
  51. package/dist/composables/useVisibleNotebookEditors.d.ts +0 -6
  52. package/dist/composables/useVisibleTextEditors.d.ts +0 -6
  53. package/dist/composables/useVscodeContext.d.ts +0 -5
  54. package/dist/composables/useWebviewView.d.ts +0 -19
  55. package/dist/composables/useWindowState.d.ts +0 -7
  56. package/dist/composables/useWorkspaceFolders.d.ts +0 -5
  57. package/dist/utils/createKeyedComposable.d.ts +0 -6
  58. package/dist/utils/createSingletonComposable.d.ts +0 -6
  59. package/dist/utils/defineConfigs.d.ts +0 -24
  60. package/dist/utils/defineExtension.d.ts +0 -16
  61. package/dist/utils/executeCommand.d.ts +0 -11
  62. package/dist/utils/index.d.ts +0 -9
  63. package/dist/utils/onActivate.d.ts +0 -14
  64. package/dist/utils/onDeactivate.d.ts +0 -12
  65. package/dist/utils/tryOnScopeDispose.d.ts +0 -6
  66. package/dist/utils/types.d.ts +0 -4
package/dist/index.d.ts CHANGED
@@ -1,3 +1,723 @@
1
- export * from '@reactive-vscode/reactivity';
2
- export * from './composables';
3
- export * from './utils';
1
+ /// <reference types="vscode" />
2
+
3
+ import { Awaited as Awaited_2 } from '@vue/shared';
4
+ import { ColorTheme } from 'vscode';
5
+ import { CommentController } from 'vscode';
6
+ import { ComputedRef } from '@vue/reactivity';
7
+ import { ConfigurationScope } from 'vscode';
8
+ import { ConfigurationTarget } from 'vscode';
9
+ import { DebuggerOptions } from '@vue/reactivity';
10
+ import { DebugSession } from 'vscode';
11
+ import { DecorationOptions } from 'vscode';
12
+ import { DecorationRenderOptions } from 'vscode';
13
+ import { Disposable as Disposable_2 } from 'vscode';
14
+ import { DocumentSelector } from 'vscode';
15
+ import { EffectScope } from '@vue/reactivity';
16
+ import { Event as Event_2 } from 'vscode';
17
+ import { Extension } from 'vscode';
18
+ import { ExtensionContext } from 'vscode';
19
+ import { ExtensionTerminalOptions } from 'vscode';
20
+ import { FoldingRangeProvider } from 'vscode';
21
+ import { GlobPattern } from 'vscode';
22
+ import { LogLevel } from 'vscode';
23
+ import { MaybeRef } from '@vue/reactivity';
24
+ import { MaybeRefOrGetter } from '@vue/reactivity';
25
+ import { NotebookEditor } from 'vscode';
26
+ import { NotebookRange } from 'vscode';
27
+ import { OutputChannel } from 'vscode';
28
+ import { Range } from 'vscode';
29
+ import { Ref } from '@vue/reactivity';
30
+ import { Selection } from 'vscode';
31
+ import { ShallowReactive } from '@vue/reactivity';
32
+ import { ShallowRef } from '@vue/reactivity';
33
+ import { StatusBarAlignment } from 'vscode';
34
+ import { StatusBarItem } from 'vscode';
35
+ import { Task } from 'vscode';
36
+ import { TaskExecution } from 'vscode';
37
+ import { TaskFilter } from 'vscode';
38
+ import { Terminal } from 'vscode';
39
+ import { TerminalOptions } from 'vscode';
40
+ import { TerminalState } from 'vscode';
41
+ import { TextDocument } from 'vscode';
42
+ import { TextEditor } from 'vscode';
43
+ import { TextEditorDecorationType } from 'vscode';
44
+ import { TextEditorEdit } from 'vscode';
45
+ import { TextEditorSelectionChangeKind } from 'vscode';
46
+ import { TreeDataProvider } from 'vscode';
47
+ import { TreeView } from 'vscode';
48
+ import { TreeViewOptions } from 'vscode';
49
+ import { Uri } from 'vscode';
50
+ import { ViewBadge } from 'vscode';
51
+ import { ViewColumn } from 'vscode';
52
+ import { WebviewOptions } from 'vscode';
53
+ import { WebviewView } from 'vscode';
54
+ import { WorkspaceFolder } from 'vscode';
55
+ import { WritableComputedRef } from '@vue/reactivity';
56
+
57
+ /* Excluded from this release type: activateCbs */
58
+
59
+ export declare interface Commands extends Record<string, (...args: any[]) => any> {
60
+ 'vscode.open': (uri: Uri) => void;
61
+ }
62
+
63
+ export declare interface ConfigRef<T> extends ShallowRef<T> {
64
+ update: (value: T, configurationTarget?: ConfigurationTarget | boolean | null, overrideInLanguage?: boolean) => Promise<void>;
65
+ }
66
+
67
+ export declare interface ConfigType<T> extends ObjectConstructor {
68
+ [ConfigTypeSymbol]: T;
69
+ }
70
+
71
+ declare type ConfigTypeOptions = Record<string, ConfigTypeRaw<any>>;
72
+
73
+ declare type ConfigTypeRaw<T> = ConfigTypeSingle<T> | ConfigTypeSingle<T>[];
74
+
75
+ declare type ConfigTypeSingle<T> = string | typeof String | typeof Number | typeof Boolean | typeof Array | typeof Object | null | ConfigType<T>;
76
+
77
+ declare const ConfigTypeSymbol: unique symbol;
78
+
79
+ /**
80
+ * Creates a composable that caches the result of a function based on a key.
81
+ *
82
+ * @category utilities
83
+ */
84
+ export declare function createKeyedComposable<P extends unknown[], R, K>(fn: (...args: P) => R, key: NoInfer<(...args: P) => K>): (...args: P) => R;
85
+
86
+ /**
87
+ * Creates a composable that should only be called once.
88
+ *
89
+ * @category utilities
90
+ */
91
+ export declare function createSingletonComposable<T>(fn: () => T): () => T;
92
+
93
+ /* Excluded from this release type: deactivateCbs */
94
+
95
+ declare function defaultGetPrefix(type: string): string;
96
+
97
+ /**
98
+ * Define configurations of an extension. See `vscode::workspace.getConfiguration`.
99
+ *
100
+ * @category lifecycle
101
+ */
102
+ export declare function defineConfigs<const C extends ConfigTypeOptions>(section: string, configs: C, scope?: ConfigurationScope | null | undefined): ParseConfigTypeOptions<C>;
103
+
104
+ /**
105
+ * Define a new extension.
106
+ *
107
+ * @category lifecycle
108
+ */
109
+ export declare function defineExtension(setup: () => void): {
110
+ activate: (extCtx: ExtensionContext) => void;
111
+ deactivate: () => void;
112
+ };
113
+
114
+ /**
115
+ * Execute a command, with type checking. See `vscode::commands.executeCommand`.
116
+ *
117
+ * @category commands
118
+ */
119
+ export declare function executeCommand<K extends Extract<keyof Commands, string>>(command: K, ...args: Parameters<Commands[K]>): Thenable<unknown>;
120
+
121
+ export declare const extensionContext: ShallowRef<ExtensionContext | null>;
122
+
123
+ /* Excluded from this release type: extensionScope */
124
+
125
+ declare type MapSources<T, Immediate> = {
126
+ [K in keyof T]: T[K] extends WatchSource<infer V>
127
+ ? Immediate extends true
128
+ ? V | undefined
129
+ : V
130
+ : T[K] extends object
131
+ ? Immediate extends true
132
+ ? T[K] | undefined
133
+ : T[K]
134
+ : never
135
+ }
136
+
137
+ export declare type MaybeNullableRefOrGetter<T> = T | Ref<Nullable<T>> | (() => Nullable<T>);
138
+
139
+ declare type MultiWatchSources = (WatchSource<unknown> | object)[]
140
+
141
+ export declare function nextTick<T = void, R = void>(
142
+ this: T,
143
+ fn?: (this: T) => R,
144
+ ): Promise<Awaited_2<R>> {
145
+ const p = currentFlushPromise || resolvedPromise
146
+ return fn ? p.then(this ? fn.bind(this) : fn) : p
147
+ }
148
+
149
+ export declare type Nullable<T> = T | null | undefined;
150
+
151
+ /**
152
+ * Registers a callback to be called after the extension has been activated.
153
+ *
154
+ * @category lifecycle
155
+ */
156
+ export declare function onActivate(fn: OnActivateCb): void;
157
+
158
+ declare type OnActivateCb = (context: ExtensionContext) => void;
159
+
160
+ declare type OnCleanup = (cleanupFn: () => void) => void
161
+
162
+ /**
163
+ * Registers a callback to be called when the extension is deactivated.
164
+ *
165
+ * @category lifecycle
166
+ */
167
+ export declare function onDeactivate(fn: OnDeactivateCb): void;
168
+
169
+ declare type OnDeactivateCb = () => void;
170
+
171
+ declare type ParseConfigType<C extends ConfigTypeRaw<any>> = C extends string ? (C extends 'string' ? string : C extends 'number' ? number : C extends 'boolean' ? boolean : C extends 'null' ? null : C extends 'integer' ? number : C extends 'array' ? any[] : C extends 'object' ? Record<string | number, any> : never) : 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);
172
+
173
+ declare type ParseConfigTypeOptions<C extends ConfigTypeOptions> = {
174
+ [K in keyof C]: ConfigRef<ParseConfigType<C[K]>>;
175
+ };
176
+
177
+ export declare type TextEditorCommandCallback = (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void;
178
+
179
+ export declare interface TreeViewNode {
180
+ readonly children?: this[];
181
+ }
182
+
183
+ /**
184
+ * The safe version of `vue::onScopeDispose(https://vuejs.org/api/reactivity-advanced.html#onscopedispose)`.
185
+ *
186
+ * @category lifecycle
187
+ */
188
+ export declare function tryOnScopeDispose(fn: () => void): boolean;
189
+
190
+ /**
191
+ * @category utilities
192
+ * @reactive `ExtensionContext.asAbsolutePath`
193
+ */
194
+ export declare function useAbsolutePath(relativePath: MaybeRefOrGetter<string>, slient: true): ComputedRef<string | undefined>;
195
+
196
+ export declare function useAbsolutePath(relativePath: MaybeRefOrGetter<string>, slient?: false): ComputedRef<string>;
197
+
198
+ /**
199
+ * @reactive `window.activeColorTheme`
200
+ */
201
+ export declare const useActiveColorTheme: () => ShallowRef<ColorTheme>;
202
+
203
+ /**
204
+ * @reactive `debug.activeDebugSession`
205
+ */
206
+ export declare const useActiveDebugSession: () => ComputedRef<DebugSession | undefined>;
207
+
208
+ /**
209
+ * Reactively set decorations on the active editor. See `vscode::window.activeTextEditor`.
210
+ *
211
+ * @category editor
212
+ */
213
+ export declare function useActiveEditorDecorations(decorationTypeOrOptions: TextEditorDecorationType | DecorationRenderOptions, rangesOrOptions: MaybeRefOrGetter<readonly Range[] | readonly DecorationOptions[]>): void;
214
+
215
+ /**
216
+ * @reactive `window.activeNotebookEditor`
217
+ * @category editor
218
+ */
219
+ export declare const useActiveNotebookEditor: () => ShallowRef<NotebookEditor | undefined>;
220
+
221
+ /**
222
+ * @reactive `window.activeTerminal`
223
+ * @category terminal
224
+ */
225
+ export declare const useActiveTerminal: () => ShallowRef<Terminal | undefined>;
226
+
227
+ /**
228
+ * @reactive `window.activeTextEditor`
229
+ * @category editor
230
+ */
231
+ export declare const useActiveTextEditor: () => ShallowRef<TextEditor | undefined>;
232
+
233
+ /**
234
+ * @reactive `extensions.all`
235
+ */
236
+ export declare const useAllExtensions: () => ComputedRef<readonly Extension<any>[]>;
237
+
238
+ /**
239
+ * Register a command. See `vscode::commands.registerCommand`.
240
+ *
241
+ * @category commands
242
+ */
243
+ export declare function useCommand<K extends Extract<keyof Commands, string>>(command: K, callback: Commands[K]): void;
244
+
245
+ /**
246
+ * Register multiple commands. See `vscode::commands.registerCommand`.
247
+ *
248
+ * @category commands
249
+ */
250
+ export declare function useCommands(commands: Partial<Commands>): void;
251
+
252
+ /**
253
+ * @reactive `comments.createCommentController`
254
+ */
255
+ export declare function useCommentController(id: string, label: string): CommentController;
256
+
257
+ /**
258
+ * Create terminal, and allows you to control the terminal lifecycle.
259
+ *
260
+ * @category terminal
261
+ */
262
+ export declare function useControlledTerminal(name?: string, shellPath?: string, shellArgs?: readonly string[] | string): UseControlledTerminalReturn;
263
+
264
+ export declare function useControlledTerminal(options: TerminalOptions): UseControlledTerminalReturn;
265
+
266
+ export declare function useControlledTerminal(options: ExtensionTerminalOptions): UseControlledTerminalReturn;
267
+
268
+ declare interface UseControlledTerminalReturn {
269
+ terminal: Ref<Terminal | null>;
270
+ getIsActive: () => boolean;
271
+ show: () => void;
272
+ sendText: (text: string) => void;
273
+ close: () => void;
274
+ state: ComputedRef<TerminalState | undefined>;
275
+ }
276
+
277
+ /**
278
+ * @reactive `env.shell`
279
+ */
280
+ export declare const useDefaultShell: () => ComputedRef<string>;
281
+
282
+ /**
283
+ * Dispose the disposable when the current scope is disposed. See `vscode::Disposable`.
284
+ *
285
+ * @category lifecycle
286
+ */
287
+ export declare function useDisposable<T extends Disposable_2>(disposable: T): T;
288
+
289
+ /**
290
+ * @reactive `TextDocument.getText`
291
+ * @category document
292
+ */
293
+ export declare function useDocumentText(doc: MaybeRefOrGetter<TextDocument | undefined>): ShallowRef<string | undefined>;
294
+
295
+ /**
296
+ * Reactively set decorations on the given editor. See `vscode::TextEditor.setDecorations`.
297
+ *
298
+ * @category editor
299
+ */
300
+ export declare function useEditorDecorations(editor: MaybeRefOrGetter<Nullable<TextEditor>>, decorationTypeOrOptions: TextEditorDecorationType | DecorationRenderOptions, rangesOrOptions: MaybeRefOrGetter<readonly Range[] | readonly DecorationOptions[]>): void;
301
+
302
+ /**
303
+ * @category utilities
304
+ * @reactive `Event`
305
+ */
306
+ export declare function useEvent<T>(event: Event_2<T>, listeners?: ((e: T) => any)[]): Event_2<T>;
307
+
308
+ /**
309
+ * @category utilities
310
+ * @reactive `EventEmitter`
311
+ */
312
+ export declare function useEventEmitter<T>(listeners?: ((e: T) => any)[]): {
313
+ event: Event_2<T>;
314
+ fire: (data: T) => void;
315
+ addListener: Event_2<T>;
316
+ };
317
+
318
+ /**
319
+ * @reactive `tasks.fetchTasks`
320
+ */
321
+ export declare function useFetchTasks(filter?: MaybeRefOrGetter<TaskFilter | undefined>): ComputedRef<Thenable<Task[]>>;
322
+
323
+ /**
324
+ * @reactive `Uri.file`
325
+ * @category utilities
326
+ */
327
+ export declare function useFileUri(path: MaybeRefOrGetter<string>): ShallowReactive< {
328
+ readonly scheme: string;
329
+ readonly authority: string;
330
+ readonly path: string;
331
+ readonly query: string;
332
+ readonly fragment: string;
333
+ readonly fsPath: string;
334
+ with(change: {
335
+ scheme?: string | undefined;
336
+ authority?: string | undefined;
337
+ path?: string | undefined;
338
+ query?: string | undefined;
339
+ fragment?: string | undefined;
340
+ }): Uri;
341
+ toString(): string;
342
+ toJSON(): any;
343
+ }>;
344
+
345
+ /**
346
+ * @reactive `languages.registerFoldingRangeProvider`
347
+ */
348
+ export declare function useFoldingRangeProvider(selector: DocumentSelector, provideFoldingRanges: MaybeRefOrGetter<FoldingRangeProvider['provideFoldingRanges']>): void;
349
+
350
+ /**
351
+ * @reactive `workspace.createFileSystemWatcher`
352
+ */
353
+ export declare function useFsWatcher(globPattern: GlobPattern, ignoreCreateEvents?: boolean | undefined, ignoreChangeEvents?: boolean | undefined, ignoreDeleteEvents?: boolean | undefined): {
354
+ onDidCreate: Event_2<Uri>;
355
+ onDidChange: Event_2<Uri>;
356
+ onDidDelete: Event_2<Uri>;
357
+ ignoreCreateEvents: boolean;
358
+ ignoreChangeEvents: boolean;
359
+ ignoreDeleteEvents: boolean;
360
+ };
361
+
362
+ /**
363
+ * Determines if the current color theme is dark. See `vscode::ColorTheme.kind`.
364
+ *
365
+ * @category window
366
+ */
367
+ export declare const useIsDarkTheme: () => ComputedRef<boolean>;
368
+
369
+ /**
370
+ * @reactive `env.isTelemetryEnabled`
371
+ */
372
+ export declare const useIsTelemetryEnabled: () => ComputedRef<boolean>;
373
+
374
+ /**
375
+ * @reactive `l10n.t`
376
+ */
377
+ export declare function useL10nText(message: MaybeRefOrGetter<string>, ...args: Array<MaybeRefOrGetter<string | number | boolean>>): ComputedRef<string>;
378
+
379
+ export declare function useL10nText(message: MaybeRefOrGetter<string>, args: Record<string, any>): ComputedRef<string>;
380
+
381
+ /**
382
+ * Creates a logger that writes to the output channel.
383
+ *
384
+ * @category view
385
+ */
386
+ export declare function useLogger(name: string, getPrefix?: typeof defaultGetPrefix): {
387
+ outputChannel: OutputChannel;
388
+ createLoggerFunc: (type: string) => (...message: any[]) => void;
389
+ info: (...message: any[]) => void;
390
+ warn: (...message: any[]) => void;
391
+ error: (...message: any[]) => void;
392
+ append: (value: string) => void;
393
+ appendLine: (value: string) => void;
394
+ replace: (value: string) => void;
395
+ clear: () => void;
396
+ show: {
397
+ (preserveFocus?: boolean | undefined): void;
398
+ (column?: ViewColumn | undefined, preserveFocus?: boolean | undefined): void;
399
+ };
400
+ hide: () => void;
401
+ };
402
+
403
+ /**
404
+ * @reactive `env.logLevel`
405
+ */
406
+ export declare const useLogLevel: () => ComputedRef<LogLevel>;
407
+
408
+ /**
409
+ * @reactive `NotebookEditor.selection`
410
+ * @category editor
411
+ */
412
+ export declare function useNotebookEditorSelection(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<NotebookRange>;
413
+
414
+ /**
415
+ * @reactive `NotebookEditor.selections`
416
+ * @category editor
417
+ */
418
+ export declare function useNotebookEditorSelections(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): WritableComputedRef<readonly NotebookRange[]>;
419
+
420
+ /**
421
+ * @reactive `NotebookEditor.visibleRanges`
422
+ * @category editor
423
+ */
424
+ export declare function useNotebookEditorVisibleRanges(notebookEditor: MaybeNullableRefOrGetter<NotebookEditor>): ComputedRef<readonly NotebookRange[]>;
425
+
426
+ /**
427
+ * @reactive `window.terminals`
428
+ * @category terminal
429
+ */
430
+ export declare const useOpenedTerminals: () => ShallowRef<readonly Terminal[]>;
431
+
432
+ /**
433
+ * @reactive `window.createOutputChannel`
434
+ * @category view
435
+ */
436
+ export declare function useOutputChannel(name: string, languageId?: string): OutputChannel;
437
+
438
+ /**
439
+ * @reactive `window.createStatusBarItem`
440
+ */
441
+ export declare function useStatusBarItem(options: UseStatusBarItemOptions): StatusBarItem;
442
+
443
+ export declare interface UseStatusBarItemOptions {
444
+ id?: string;
445
+ alignment?: StatusBarAlignment;
446
+ priority?: number;
447
+ name?: MaybeRefOrGetter<StatusBarItem['name']>;
448
+ text?: MaybeRefOrGetter<StatusBarItem['text']>;
449
+ tooltip?: MaybeRefOrGetter<StatusBarItem['tooltip']>;
450
+ color?: MaybeRefOrGetter<StatusBarItem['color']>;
451
+ backgroundColor?: MaybeRefOrGetter<StatusBarItem['backgroundColor']>;
452
+ command?: MaybeRefOrGetter<StatusBarItem['command']>;
453
+ accessibilityInformation?: MaybeRefOrGetter<StatusBarItem['accessibilityInformation']>;
454
+ }
455
+
456
+ /**
457
+ * @reactive `tasks.taskExecutions`
458
+ */
459
+ export declare const useTaskExecutions: () => ComputedRef<readonly TaskExecution[]>;
460
+
461
+ /**
462
+ * @category terminal
463
+ * @reactive `window.createTerminal()`
464
+ */
465
+ export declare function useTerminal(name?: string, shellPath?: string, shellArgs?: readonly string[] | string): UseTerminalReturn;
466
+
467
+ export declare function useTerminal(options: TerminalOptions): UseTerminalReturn;
468
+
469
+ export declare function useTerminal(options: ExtensionTerminalOptions): UseTerminalReturn;
470
+
471
+ declare interface UseTerminalReturn extends Omit<Terminal, 'state' | 'dispose'> {
472
+ terminal: Terminal;
473
+ state: ComputedRef<TerminalState>;
474
+ }
475
+
476
+ /**
477
+ * @reactive `Terminal.state`
478
+ * @category terminal
479
+ */
480
+ export declare function useTerminalState(terminal: MaybeNullableRefOrGetter<Terminal>): ComputedRef<TerminalState | undefined>;
481
+
482
+ /**
483
+ * Register a text editor command. See `vscode::commands.registerTextEditorCommand`.
484
+ *
485
+ * @category commands
486
+ */
487
+ export declare function useTextEditorCommand(command: string, callback: TextEditorCommandCallback): void;
488
+
489
+ /**
490
+ * Register multiple text editor commands. See `vscode::commands.registerTextEditorCommand`.
491
+ *
492
+ * @category commands
493
+ */
494
+ export declare function useTextEditorCommands(commands: Record<string, TextEditorCommandCallback>): void;
495
+
496
+ /**
497
+ * @reactive `TextEditor.selection`
498
+ * @category editor
499
+ */
500
+ export declare function useTextEditorSelection(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<Selection>;
501
+
502
+ /**
503
+ * @reactive `TextEditor.selections`
504
+ * @category editor
505
+ */
506
+ export declare function useTextEditorSelections(textEditor: MaybeNullableRefOrGetter<TextEditor>, acceptKind?: MaybeRefOrGetter<(TextEditorSelectionChangeKind | undefined)[]>): WritableComputedRef<readonly Selection[]>;
507
+
508
+ /**
509
+ * @reactive `TextEditor.viewColumn`
510
+ * @category editor
511
+ */
512
+ export declare function useTextEditorViewColumn(textEditor: MaybeNullableRefOrGetter<TextEditor>): ComputedRef<ViewColumn | undefined>;
513
+
514
+ /**
515
+ * @reactive `TextEditor.visibleRanges`
516
+ * @category editor
517
+ */
518
+ export declare function useTextEditorVisibleRanges(textEditor: MaybeNullableRefOrGetter<TextEditor>): ComputedRef<readonly Range[]>;
519
+
520
+ /**
521
+ * Register a tree view. See `vscode::window.createTreeView`.
522
+ *
523
+ * @category view
524
+ */
525
+ export declare const useTreeView: <T extends TreeViewNode>(viewId: string, treeData: MaybeRefOrGetter<T[]>, options: UseTreeViewOptions<T>) => TreeView<T>;
526
+
527
+ export declare type UseTreeViewOptions<T> = (Omit<TreeViewOptions<T>, 'treeDataProvider'> & Pick<TreeDataProvider<T>, 'getTreeItem' | 'resolveTreeItem'> & {
528
+ title?: MaybeRefOrGetter<string | undefined>;
529
+ badge?: MaybeRefOrGetter<ViewBadge | undefined>;
530
+ }) | TreeDataProvider<T>['getTreeItem'];
531
+
532
+ /**
533
+ * @reactive `Uri`
534
+ * @category utilities
535
+ */
536
+ export declare function useUri(uri: MaybeRefOrGetter<Uri>): ShallowReactive< {
537
+ readonly scheme: string;
538
+ readonly authority: string;
539
+ readonly path: string;
540
+ readonly query: string;
541
+ readonly fragment: string;
542
+ readonly fsPath: string;
543
+ with(change: {
544
+ scheme?: string | undefined;
545
+ authority?: string | undefined;
546
+ path?: string | undefined;
547
+ query?: string | undefined;
548
+ fragment?: string | undefined;
549
+ }): Uri;
550
+ toString(): string;
551
+ toJSON(): any;
552
+ }>;
553
+
554
+ /**
555
+ * Reactively set the badge of a view (`vscode::TreeView` or `vscode::WebviewView`).
556
+ *
557
+ * @category view
558
+ */
559
+ export declare function useViewBadge(view: MaybeRefOrGetter<Nullable<ViewWithBadge>>, badge: MaybeRefOrGetter<ViewBadge | undefined>): void;
560
+
561
+ /**
562
+ * Reactively set the title of a view (`vscode::TreeView` or `vscode::WebviewView`).
563
+ *
564
+ * @category view
565
+ */
566
+ export declare function useViewTitle(view: MaybeRefOrGetter<Nullable<ViewWithTitle>>, title: MaybeRefOrGetter<string | undefined>): void;
567
+
568
+ /**
569
+ * Reactively get the visibility of a view (`vscode::TreeView` or `vscode::WebviewView`).
570
+ *
571
+ * @category view
572
+ */
573
+ export declare function useViewVisibility(view: MaybeNullableRefOrGetter<ViewWithVisibility>): ComputedRef<boolean>;
574
+
575
+ /**
576
+ * @reactive `window.visibleNotebookEditors`
577
+ * @category editor
578
+ */
579
+ export declare const useVisibleNotebookEditors: () => ShallowRef<readonly NotebookEditor[]>;
580
+
581
+ /**
582
+ * @reactive `window.visibleTextEditors`
583
+ * @category editor
584
+ */
585
+ export declare const useVisibleTextEditors: () => ShallowRef<readonly TextEditor[]>;
586
+
587
+ export declare function useVscodeContext<T>(name: string, value: ComputedRef<T> | (() => T), shouldUpdate?: MaybeRefOrGetter<boolean>): ComputedRef<T>;
588
+
589
+ export declare function useVscodeContext<T>(name: string, value: WritableComputedRef<T>, shouldUpdate?: MaybeRefOrGetter<boolean>): WritableComputedRef<T>;
590
+
591
+ export declare function useVscodeContext<T>(name: string, value: MaybeRef<T>, shouldUpdate?: MaybeRefOrGetter<boolean>): Ref<T>;
592
+
593
+ /**
594
+ * Register a webview view. See `vscode::window.registerWebviewViewProvider`.
595
+ *
596
+ * @category view
597
+ */
598
+ export declare const useWebviewView: (viewId: string, html: MaybeRefOrGetter<string>, options?: ({
599
+ readonly webviewOptions?: {
600
+ readonly retainContextWhenHidden?: boolean | undefined;
601
+ } | undefined;
602
+ } & {
603
+ onDidReceiveMessage?: ((message: any) => void) | undefined;
604
+ webviewOptions?: MaybeRefOrGetter<WebviewOptions> | undefined;
605
+ title?: MaybeRefOrGetter<string | undefined>;
606
+ badge?: MaybeRefOrGetter<ViewBadge | undefined>;
607
+ }) | undefined) => {
608
+ view: ShallowRef<WebviewView | undefined>;
609
+ context: ShallowRef<unknown>;
610
+ postMessage: (message: any) => Thenable<boolean> | undefined;
611
+ };
612
+
613
+ /**
614
+ * @reactive `window.state`
615
+ */
616
+ export declare const useWindowState: () => {
617
+ focused: ComputedRef<boolean>;
618
+ active: ComputedRef<boolean>;
619
+ };
620
+
621
+ /**
622
+ * @reactive `workspace.workspaceFolders`
623
+ */
624
+ export declare const useWorkspaceFolders: () => ComputedRef<readonly WorkspaceFolder[] | undefined>;
625
+
626
+ declare type ViewWithBadge = Pick<TreeView<unknown> | WebviewView, 'badge'>;
627
+
628
+ declare type ViewWithTitle = Pick<TreeView<unknown> | WebviewView, 'title'>;
629
+
630
+ declare type ViewWithVisibility = Pick<TreeView<unknown> | WebviewView, 'visible' | 'onDidChangeVisibility'>;
631
+
632
+ export declare function watch<T, Immediate extends Readonly<boolean> = false>(
633
+ source: WatchSource<T>,
634
+ cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,
635
+ options?: WatchOptions<Immediate>,
636
+ ): WatchStopHandle
637
+
638
+ export declare function watch<
639
+ T extends MultiWatchSources,
640
+ Immediate extends Readonly<boolean> = false,
641
+ >(
642
+ sources: [...T],
643
+ cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>,
644
+ options?: WatchOptions<Immediate>,
645
+ ): WatchStopHandle
646
+
647
+ export declare function watch<
648
+ T extends Readonly<MultiWatchSources>,
649
+ Immediate extends Readonly<boolean> = false,
650
+ >(
651
+ source: T,
652
+ cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>,
653
+ options?: WatchOptions<Immediate>,
654
+ ): WatchStopHandle
655
+
656
+ export declare function watch<
657
+ T extends object,
658
+ Immediate extends Readonly<boolean> = false,
659
+ >(
660
+ source: T,
661
+ cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,
662
+ options?: WatchOptions<Immediate>,
663
+ ): WatchStopHandle
664
+
665
+ export declare function watch<T = any, Immediate extends Readonly<boolean> = false>(
666
+ source: T | WatchSource<T>,
667
+ cb: any,
668
+ options?: WatchOptions<Immediate>,
669
+ ): WatchStopHandle {
670
+ if (__DEV__ && !isFunction(cb)) {
671
+ warn(
672
+ `\`watch(fn, options?)\` signature has been moved to a separate API. ` +
673
+ `Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
674
+ `supports \`watch(source, cb, options?) signature.`,
675
+ )
676
+ }
677
+ return doWatch(source as any, cb, options)
678
+ }
679
+
680
+ export declare type WatchCallback<V = any, OV = any> = (
681
+ value: V,
682
+ oldValue: OV,
683
+ onCleanup: OnCleanup,
684
+ ) => any
685
+
686
+ export declare type WatchEffect = (onCleanup: OnCleanup) => void
687
+
688
+ export declare function watchEffect(
689
+ effect: WatchEffect,
690
+ options?: WatchOptionsBase,
691
+ ): WatchStopHandle {
692
+ return doWatch(effect, null, options)
693
+ }
694
+
695
+ export declare interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
696
+ immediate?: Immediate
697
+ deep?: boolean
698
+ once?: boolean
699
+ }
700
+
701
+ export declare interface WatchOptionsBase extends DebuggerOptions {
702
+ flush?: 'pre' | 'post' | 'sync'
703
+ }
704
+
705
+ export declare type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T)
706
+
707
+ export declare type WatchStopHandle = () => void
708
+
709
+ export declare function watchSyncEffect(
710
+ effect: WatchEffect,
711
+ options?: DebuggerOptions,
712
+ ) {
713
+ return doWatch(
714
+ effect,
715
+ null,
716
+ __DEV__ ? extend({}, options as any, { flush: 'sync' }) : { flush: 'sync' },
717
+ )
718
+ }
719
+
720
+
721
+ export * from "@vue/reactivity";
722
+
723
+ export { }