mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
VS Code 1.38.0 Extension API (#38136)
This commit is contained in:
parent
47e9cf6d89
commit
d43feccde7
63
types/vscode/index.d.ts
vendored
63
types/vscode/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for Visual Studio Code 1.37
|
||||
// Type definitions for Visual Studio Code 1.38
|
||||
// Project: https://github.com/microsoft/vscode
|
||||
// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@ -10,7 +10,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Type Definition for Visual Studio Code 1.37 Extension API
|
||||
* Type Definition for Visual Studio Code 1.38 Extension API
|
||||
* See https://code.visualstudio.com/api for more information
|
||||
*/
|
||||
|
||||
@ -2797,7 +2797,7 @@ declare module 'vscode' {
|
||||
* *Note* that the eol-sequence will be applied to the
|
||||
* whole document.
|
||||
*/
|
||||
newEol: EndOfLine;
|
||||
newEol?: EndOfLine;
|
||||
|
||||
/**
|
||||
* Create a new TextEdit.
|
||||
@ -5219,7 +5219,7 @@ declare module 'vscode' {
|
||||
*/
|
||||
export enum TaskScope {
|
||||
/**
|
||||
* The task is a global task
|
||||
* The task is a global task. Global tasks are currrently not supported.
|
||||
*/
|
||||
Global = 1,
|
||||
|
||||
@ -5248,7 +5248,7 @@ declare module 'vscode' {
|
||||
* Creates a new task.
|
||||
*
|
||||
* @param definition The task definition as defined in the taskDefinitions extension point.
|
||||
* @param scope Specifies the task's scope. It is either a global or a workspace task or a task for a specific workspace folder.
|
||||
* @param scope Specifies the task's scope. It is either a global or a workspace task or a task for a specific workspace folder. Global tasks are currently not supported.
|
||||
* @param name The task's name. Is presented in the user interface.
|
||||
* @param source The task's source (e.g. 'gulp', 'npm', ...). Is presented in the user interface.
|
||||
* @param execution The process or shell execution.
|
||||
@ -5923,17 +5923,46 @@ declare module 'vscode' {
|
||||
|
||||
/**
|
||||
* Fired when the webview content posts a message.
|
||||
*
|
||||
* Webview content can post strings or json serilizable objects back to a VS Code extension. They cannot
|
||||
* post `Blob`, `File`, `ImageData` and other DOM specific objects since the extension that receives the
|
||||
* message does not run in a browser environment.
|
||||
*/
|
||||
readonly onDidReceiveMessage: Event<any>;
|
||||
|
||||
/**
|
||||
* Post a message to the webview content.
|
||||
*
|
||||
* Messages are only delivered if the webview is visible.
|
||||
* Messages are only delivered if the webview is live (either visible or in the
|
||||
* background with `retainContextWhenHidden`).
|
||||
*
|
||||
* @param message Body of the message.
|
||||
* @param message Body of the message. This must be a string or other json serilizable object.
|
||||
*/
|
||||
postMessage(message: any): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* Convert a uri for the local file system to one that can be used inside webviews.
|
||||
*
|
||||
* Webviews cannot directly load resources from the workspace or local file system using `file:` uris. The
|
||||
* `asWebviewUri` function takes a local `file:` uri and converts it into a uri that can be used inside of
|
||||
* a webview to load the same resource:
|
||||
*
|
||||
* ```ts
|
||||
* webview.html = `<img src="${webview.asWebviewUri(vscode.Uri.file('/Users/codey/workspace/cat.gif'))}">`
|
||||
* ```
|
||||
*/
|
||||
asWebviewUri(localResource: Uri): Uri;
|
||||
|
||||
/**
|
||||
* Content security policy source for webview resources.
|
||||
*
|
||||
* This is the origin that should be used in a content security policy rule:
|
||||
*
|
||||
* ```
|
||||
* img-src https: ${webview.cspSource} ...;
|
||||
* ```
|
||||
*/
|
||||
readonly cspSource: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -6869,6 +6898,13 @@ declare module 'vscode' {
|
||||
* Whether to show collapse all action or not.
|
||||
*/
|
||||
showCollapseAll?: boolean;
|
||||
|
||||
/**
|
||||
* Whether the tree supports multi-select. When the tree supports multi-select and a command is executed from the tree,
|
||||
* the first argument to the command is the tree item that the command was executed on and the second argument is an
|
||||
* array containing all selected tree items.
|
||||
*/
|
||||
canSelectMany?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -8070,8 +8106,7 @@ declare module 'vscode' {
|
||||
export const onDidChangeDiagnostics: Event<DiagnosticChangeEvent>;
|
||||
|
||||
/**
|
||||
* Get all diagnostics for a given resource. *Note* that this includes diagnostics from
|
||||
* all extensions but *not yet* from the task framework.
|
||||
* Get all diagnostics for a given resource.
|
||||
*
|
||||
* @param resource A resource
|
||||
* @returns An array of [diagnostics](#Diagnostic) objects or an empty array.
|
||||
@ -8079,8 +8114,7 @@ declare module 'vscode' {
|
||||
export function getDiagnostics(resource: Uri): Diagnostic[];
|
||||
|
||||
/**
|
||||
* Get all diagnostics. *Note* that this includes diagnostics from
|
||||
* all extensions but *not yet* from the task framework.
|
||||
* Get all diagnostics.
|
||||
*
|
||||
* @returns An array of uri-diagnostics tuples or an empty array.
|
||||
*/
|
||||
@ -8103,9 +8137,14 @@ declare module 'vscode' {
|
||||
* result. A failing provider (rejected promise or exception) will not fail the whole
|
||||
* operation.
|
||||
*
|
||||
* A completion item provider can be associated with a set of `triggerCharacters`. When trigger
|
||||
* characters are being typed, completions are requested but only from providers that registered
|
||||
* the typed character. Because of that trigger characters should be different than [word characters](#LanguageConfiguration.wordPattern),
|
||||
* a common trigger character is `.` to trigger member completions.
|
||||
*
|
||||
* @param selector A selector that defines the documents this provider is applicable to.
|
||||
* @param provider A completion provider.
|
||||
* @param triggerCharacters Trigger completion when the user types one of the characters, like `.` or `:`.
|
||||
* @param triggerCharacters Trigger completion when the user types one of the characters.
|
||||
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
|
||||
*/
|
||||
export function registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider, ...triggerCharacters: string[]): Disposable;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user