Skip to content

Commit 5dd7bec

Browse files
authored
Update VS Code Types to 1.109 (DefinitelyTyped#74478)
1 parent c703122 commit 5dd7bec

2 files changed

Lines changed: 80 additions & 38 deletions

File tree

types/vscode/index.d.ts

Lines changed: 79 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10068,7 +10068,7 @@ declare module 'vscode' {
1006810068
}
1006910069

1007010070
/**
10071-
* A panel that contains a webview.
10071+
* A panel that contains a {@linkcode Webview}.
1007210072
*/
1007310073
export interface WebviewPanel {
1007410074
/**
@@ -10120,7 +10120,7 @@ declare module 'vscode' {
1012010120
/**
1012110121
* Fired when the panel is disposed.
1012210122
*
10123-
* This may be because the user closed the panel or because `.dispose()` was
10123+
* This may be because the user closed the panel or because {@linkcode WebviewPanel.dispose dispose} was
1012410124
* called on it.
1012510125
*
1012610126
* Trying to use the panel after it has been disposed throws an exception.
@@ -10133,7 +10133,7 @@ declare module 'vscode' {
1013310133
* A webview panel may only show in a single column at a time. If it is already showing, this
1013410134
* method moves it to a new column.
1013510135
*
10136-
* @param viewColumn View column to show the panel in. Shows in the current `viewColumn` if undefined.
10136+
* @param viewColumn View column to show the panel in. Shows in the current {@linkcode WebviewPanel.viewColumn} if undefined.
1013710137
* @param preserveFocus When `true`, the webview will not take focus.
1013810138
*/
1013910139
reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;
@@ -10143,17 +10143,17 @@ declare module 'vscode' {
1014310143
*
1014410144
* This closes the panel if it showing and disposes of the resources owned by the webview.
1014510145
* Webview panels are also disposed when the user closes the webview panel. Both cases
10146-
* fire the `onDidDispose` event.
10146+
* fire the {@linkcode onDidDispose} event.
1014710147
*/
1014810148
dispose(): any;
1014910149
}
1015010150

1015110151
/**
10152-
* Event fired when a webview panel's view state changes.
10152+
* Event fired when a {@linkcode WebviewPanel webview panel's} view state changes.
1015310153
*/
1015410154
export interface WebviewPanelOnDidChangeViewStateEvent {
1015510155
/**
10156-
* Webview panel whose view state changed.
10156+
* {@linkcode WebviewPanel} whose view state changed.
1015710157
*/
1015810158
readonly webviewPanel: WebviewPanel;
1015910159
}
@@ -10288,12 +10288,12 @@ declare module 'vscode' {
1028810288
*
1028910289
* To save resources, the editor normally deallocates webview documents (the iframe content) that are not visible.
1029010290
* For example, when the user collapse a view or switches to another top level activity in the sidebar, the
10291-
* `WebviewView` itself is kept alive but the webview's underlying document is deallocated. It is recreated when
10291+
* {@linkcode WebviewView} itself is kept alive but the webview's underlying document is deallocated. It is recreated when
1029210292
* the view becomes visible again.
1029310293
*
10294-
* You can prevent this behavior by setting `retainContextWhenHidden` in the `WebviewOptions`. However this
10295-
* increases resource usage and should be avoided wherever possible. Instead, you can use persisted state to
10296-
* save off a webview's state so that it can be quickly recreated as needed.
10294+
* You can prevent this behavior by setting {@linkcode WebviewOptions.retainContextWhenHidden retainContextWhenHidden} in the {@linkcode WebviewOptions}.
10295+
* However this increases resource usage and should be avoided wherever possible. Instead, you can use
10296+
* persisted state to save off a webview's state so that it can be quickly recreated as needed.
1029710297
*
1029810298
* To save off a persisted state, inside the webview call `acquireVsCodeApi().setState()` with
1029910299
* any json serializable object. To restore the state again, call `getState()`. For example:
@@ -10316,7 +10316,7 @@ declare module 'vscode' {
1031610316
}
1031710317

1031810318
/**
10319-
* Provider for creating `WebviewView` elements.
10319+
* Provider for creating {@linkcode WebviewView} elements.
1032010320
*/
1032110321
export interface WebviewViewProvider {
1032210322
/**
@@ -10340,7 +10340,7 @@ declare module 'vscode' {
1034010340
*
1034110341
* Text based custom editors use a {@linkcode TextDocument} as their data model. This considerably simplifies
1034210342
* implementing a custom editor as it allows the editor to handle many common operations such as
10343-
* undo and backup. The provider is responsible for synchronizing text changes between the webview and the `TextDocument`.
10343+
* undo and backup. The provider is responsible for synchronizing text changes between the webview and the {@linkcode TextDocument}.
1034410344
*/
1034510345
export interface CustomTextEditorProvider {
1034610346

@@ -10350,13 +10350,12 @@ declare module 'vscode' {
1035010350
* This is called when a user first opens a resource for a `CustomTextEditorProvider`, or if they reopen an
1035110351
* existing editor using this `CustomTextEditorProvider`.
1035210352
*
10353-
*
1035410353
* @param document Document for the resource to resolve.
1035510354
*
1035610355
* @param webviewPanel The webview panel used to display the editor UI for this resource.
1035710356
*
1035810357
* During resolve, the provider must fill in the initial html for the content webview panel and hook up all
10359-
* the event listeners on it that it is interested in. The provider can also hold onto the `WebviewPanel` to
10358+
* the event listeners on it that it is interested in. The provider can also hold onto the {@linkcode WebviewPanel} to
1036010359
* use later for example in a command. See {@linkcode WebviewPanel} for additional details.
1036110360
*
1036210361
* @param token A cancellation token that indicates the result is no longer needed.
@@ -10404,7 +10403,7 @@ declare module 'vscode' {
1040410403
*
1040510404
* This is invoked by the editor when the user undoes this edit. To implement `undo`, your
1040610405
* extension should restore the document and editor to the state they were in just before this
10407-
* edit was added to the editor's internal edit stack by `onDidChangeCustomDocument`.
10406+
* edit was added to the editor's internal edit stack by {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.
1040810407
*/
1040910408
undo(): Thenable<void> | void;
1041010409

@@ -10413,7 +10412,7 @@ declare module 'vscode' {
1041310412
*
1041410413
* This is invoked by the editor when the user redoes this edit. To implement `redo`, your
1041510414
* extension should restore the document and editor to the state they were in just after this
10416-
* edit was added to the editor's internal edit stack by `onDidChangeCustomDocument`.
10415+
* edit was added to the editor's internal edit stack by {@linkcode CustomEditorProvider.onDidChangeCustomDocument}.
1041710416
*/
1041810417
redo(): Thenable<void> | void;
1041910418

@@ -10445,7 +10444,7 @@ declare module 'vscode' {
1044510444
/**
1044610445
* Unique identifier for the backup.
1044710446
*
10448-
* This id is passed back to your extension in `openCustomDocument` when opening a custom editor from a backup.
10447+
* This id is passed back to your extension in {@linkcode CustomReadonlyEditorProvider.openCustomDocument openCustomDocument} when opening a custom editor from a backup.
1044910448
*/
1045010449
readonly id: string;
1045110450

@@ -10510,10 +10509,10 @@ declare module 'vscode' {
1051010509
* Create a new document for a given resource.
1051110510
*
1051210511
* `openCustomDocument` is called when the first time an editor for a given resource is opened. The opened
10513-
* document is then passed to `resolveCustomEditor` so that the editor can be shown to the user.
10512+
* document is then passed to {@link resolveCustomEditor} so that the editor can be shown to the user.
1051410513
*
10515-
* Already opened `CustomDocument` are re-used if the user opened additional editors. When all editors for a
10516-
* given resource are closed, the `CustomDocument` is disposed of. Opening an editor at this point will
10514+
* Already opened {@linkcode CustomDocument CustomDocuments} are re-used if the user opened additional editors. When all editors for a
10515+
* given resource are closed, the {@linkcode CustomDocument CustomDocuments} is disposed of. Opening an editor at this point will
1051710516
* trigger another call to `openCustomDocument`.
1051810517
*
1051910518
* @param uri Uri of the document to open.
@@ -10563,18 +10562,18 @@ declare module 'vscode' {
1056310562
* anything from changing some text, to cropping an image, to reordering a list. Your extension is free to
1056410563
* define what an edit is and what data is stored on each edit.
1056510564
*
10566-
* Firing `onDidChange` causes the editors to be marked as being dirty. This is cleared when the user either
10567-
* saves or reverts the file.
10565+
* Firing {@linkcode CustomEditorProvider.onDidChangeCustomDocument onDidChangeCustomDocument} causes the
10566+
* editors to be marked as being dirty. This is cleared when the user either saves or reverts the file.
1056810567
*
10569-
* Editors that support undo/redo must fire a `CustomDocumentEditEvent` whenever an edit happens. This allows
10568+
* Editors that support undo/redo must fire a {@linkcode CustomDocumentEditEvent} whenever an edit happens. This allows
1057010569
* users to undo and redo the edit using the editor's standard keyboard shortcuts. The editor will also mark
1057110570
* the editor as no longer being dirty if the user undoes all edits to the last saved state.
1057210571
*
10573-
* Editors that support editing but cannot use the editor's standard undo/redo mechanism must fire a `CustomDocumentContentChangeEvent`.
10572+
* Editors that support editing but cannot use the editor's standard undo/redo mechanism must fire a {@linkcode CustomDocumentContentChangeEvent}.
1057410573
* The only way for a user to clear the dirty state of an editor that does not support undo/redo is to either
1057510574
* `save` or `revert` the file.
1057610575
*
10577-
* An editor should only ever fire `CustomDocumentEditEvent` events, or only ever fire `CustomDocumentContentChangeEvent` events.
10576+
* An editor should only ever fire {@linkcode CustomDocumentEditEvent} events, or only ever fire {@linkcode CustomDocumentContentChangeEvent} events.
1057810577
*/
1057910578
readonly onDidChangeCustomDocument: Event<CustomDocumentEditEvent<T>> | Event<CustomDocumentContentChangeEvent<T>>;
1058010579

@@ -10584,30 +10583,30 @@ declare module 'vscode' {
1058410583
* This method is invoked by the editor when the user saves a custom editor. This can happen when the user
1058510584
* triggers save while the custom editor is active, by commands such as `save all`, or by auto save if enabled.
1058610585
*
10587-
* To implement `save`, the implementer must persist the custom editor. This usually means writing the
10588-
* file data for the custom document to disk. After `save` completes, any associated editor instances will
10589-
* no longer be marked as dirty.
10586+
* The implementer must persist the custom editor. This usually means writing the
10587+
* file data for the custom document to disk. After {@linkcode saveCustomDocument} completes, any associated
10588+
* editor instances will no longer be marked as dirty.
1059010589
*
1059110590
* @param document Document to save.
1059210591
* @param cancellation Token that signals the save is no longer required (for example, if another save was triggered).
1059310592
*
10594-
* @returns Thenable signaling that saving has completed.
10593+
* @returns A {@linkcode Thenable} that saving has completed.
1059510594
*/
1059610595
saveCustomDocument(document: T, cancellation: CancellationToken): Thenable<void>;
1059710596

1059810597
/**
1059910598
* Save a custom document to a different location.
1060010599
*
1060110600
* This method is invoked by the editor when the user triggers 'save as' on a custom editor. The implementer must
10602-
* persist the custom editor to `destination`.
10601+
* persist the custom editor to {@linkcode destination}.
1060310602
*
1060410603
* When the user accepts save as, the current editor is be replaced by an non-dirty editor for the newly saved file.
1060510604
*
1060610605
* @param document Document to save.
1060710606
* @param destination Location to save to.
1060810607
* @param cancellation Token that signals the save is no longer required.
1060910608
*
10610-
* @returns Thenable signaling that saving has completed.
10609+
* @returns A {@linkcode Thenable} signaling that saving has completed.
1061110610
*/
1061210611
saveCustomDocumentAs(document: T, destination: Uri, cancellation: CancellationToken): Thenable<void>;
1061310612

@@ -10617,37 +10616,39 @@ declare module 'vscode' {
1061710616
* This method is invoked by the editor when the user triggers `File: Revert File` in a custom editor. (Note that
1061810617
* this is only used using the editor's `File: Revert File` command and not on a `git revert` of the file).
1061910618
*
10620-
* To implement `revert`, the implementer must make sure all editor instances (webviews) for `document`
10619+
* The implementer must make sure all editor instances (webviews) for {@linkcode document}
1062110620
* are displaying the document in the same state is saved in. This usually means reloading the file from the
1062210621
* workspace.
1062310622
*
1062410623
* @param document Document to revert.
1062510624
* @param cancellation Token that signals the revert is no longer required.
1062610625
*
10627-
* @returns Thenable signaling that the change has completed.
10626+
* @returns A {@linkcode Thenable} signaling that the revert has completed.
1062810627
*/
1062910628
revertCustomDocument(document: T, cancellation: CancellationToken): Thenable<void>;
1063010629

1063110630
/**
1063210631
* Back up a dirty custom document.
1063310632
*
10634-
* Backups are used for hot exit and to prevent data loss. Your `backup` method should persist the resource in
10633+
* Backups are used for hot exit and to prevent data loss. Your {@linkcode backupCustomDocument} method should persist the resource in
1063510634
* its current state, i.e. with the edits applied. Most commonly this means saving the resource to disk in
1063610635
* the `ExtensionContext.storagePath`. When the editor reloads and your custom editor is opened for a resource,
1063710636
* your extension should first check to see if any backups exist for the resource. If there is a backup, your
1063810637
* extension should load the file contents from there instead of from the resource in the workspace.
1063910638
*
10640-
* `backup` is triggered approximately one second after the user stops editing the document. If the user
10641-
* rapidly edits the document, `backup` will not be invoked until the editing stops.
10639+
* {@linkcode backupCustomDocument} is triggered approximately one second after the user stops editing the document. If the user
10640+
* rapidly edits the document, {@linkcode backupCustomDocument} will not be invoked until the editing stops.
1064210641
*
10643-
* `backup` is not invoked when `auto save` is enabled (since auto save already persists the resource).
10642+
* {@linkcode backupCustomDocument} is not invoked when `auto save` is enabled (since auto save already persists the resource).
1064410643
*
1064510644
* @param document Document to backup.
1064610645
* @param context Information that can be used to backup the document.
1064710646
* @param cancellation Token that signals the current backup since a new backup is coming in. It is up to your
1064810647
* extension to decided how to respond to cancellation. If for example your extension is backing up a large file
1064910648
* in an operation that takes time to complete, your extension may decide to finish the ongoing backup rather
1065010649
* than cancelling it to ensure that the editor has some valid backup.
10650+
*
10651+
* @returns A {@linkcode Thenable} signaling that the backup has completed.
1065110652
*/
1065210653
backupCustomDocument(document: T, context: CustomDocumentBackupContext, cancellation: CancellationToken): Thenable<CustomDocumentBackup>;
1065310654
}
@@ -13303,6 +13304,26 @@ declare module 'vscode' {
1330313304
validationMessage: string | InputBoxValidationMessage | undefined;
1330413305
}
1330513306

13307+
/**
13308+
* Specifies the location where a {@link QuickInputButton} should be rendered.
13309+
*/
13310+
export enum QuickInputButtonLocation {
13311+
/**
13312+
* The button is rendered in the title bar.
13313+
*/
13314+
Title = 1,
13315+
13316+
/**
13317+
* The button is rendered inline to the right of the input box.
13318+
*/
13319+
Inline = 2,
13320+
13321+
/**
13322+
* The button is rendered at the far end inside the input box.
13323+
*/
13324+
Input = 3
13325+
}
13326+
1330613327
/**
1330713328
* A button for an action in a {@link QuickPick} or {@link InputBox}.
1330813329
*/
@@ -13316,6 +13337,26 @@ declare module 'vscode' {
1331613337
* An optional tooltip displayed when hovering over the button.
1331713338
*/
1331813339
readonly tooltip?: string | undefined;
13340+
13341+
/**
13342+
* The location where the button should be rendered.
13343+
*
13344+
* Defaults to {@link QuickInputButtonLocation.Title}.
13345+
*
13346+
* **Note:** This property is ignored if the button was added to a {@link QuickPickItem}.
13347+
*/
13348+
location?: QuickInputButtonLocation;
13349+
13350+
/**
13351+
* When present, indicates that the button is a toggle button that can be checked or unchecked.
13352+
*/
13353+
readonly toggle?: {
13354+
/**
13355+
* Indicates whether the toggle button is currently checked.
13356+
* This property will be updated when the button is toggled.
13357+
*/
13358+
checked: boolean;
13359+
};
1331913360
}
1332013361

1332113362
/**
@@ -21170,3 +21211,4 @@ declare module 'vscode' {
2117021211
* we recommend the use of native promises which are available in this editor.
2117121212
*/
2117221213
interface Thenable<T> extends PromiseLike<T> { }
21214+

types/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/vscode",
4-
"version": "1.108.9999",
4+
"version": "1.109.9999",
55
"nonNpm": "conflict",
66
"nonNpmDescription": "TypeScript definitions for the Visual Studio Code Extension API",
77
"projects": [

0 commit comments

Comments
 (0)