mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3
This commit is contained in:
35
src/vs/vscode.d.ts
vendored
35
src/vs/vscode.d.ts
vendored
@@ -4975,10 +4975,11 @@ declare module 'vscode' {
|
||||
color: string | ThemeColor | undefined;
|
||||
|
||||
/**
|
||||
* The identifier of a command to run on click. The command must be
|
||||
* [known](#commands.getCommands).
|
||||
* [`Command`](#Command) or identifier of a command to run on click.
|
||||
*
|
||||
* The command must be [known](#commands.getCommands).
|
||||
*/
|
||||
command: string | undefined;
|
||||
command: string | Command | undefined;
|
||||
|
||||
/**
|
||||
* Shows the entry in the status bar.
|
||||
@@ -6324,7 +6325,7 @@ declare module 'vscode' {
|
||||
}
|
||||
|
||||
/**
|
||||
* A webview displays html content, like an iframe.
|
||||
* Displays html content, similarly to an iframe.
|
||||
*/
|
||||
export interface Webview {
|
||||
/**
|
||||
@@ -6333,9 +6334,29 @@ declare module 'vscode' {
|
||||
options: WebviewOptions;
|
||||
|
||||
/**
|
||||
* Contents of the webview.
|
||||
* HTML contents of the webview.
|
||||
*
|
||||
* Should be a complete html document.
|
||||
* This should be a complete, valid html document. Changing this property causes the webview to be reloaded.
|
||||
*
|
||||
* Webviews are sandboxed from normal extension process, so all communication with the webview must use
|
||||
* message passing. To send a message from the extension to the webview, use [`postMessage`](#Webview.postMessage).
|
||||
* To send message from the webview back to an extension, use the `acquireVsCodeApi` function inside the webview
|
||||
* to get a handle to VS Code's api and then call `.postMessage()`:
|
||||
*
|
||||
* ```html
|
||||
* <script>
|
||||
* const vscode = acquireVsCodeApi(); // acquireVsCodeApi can only be invoked once
|
||||
* vscode.postMessage({ message: 'hello!' });
|
||||
* </script>
|
||||
* ```
|
||||
*
|
||||
* To load a resources from the workspace inside a webview, use the `[asWebviewUri](#Webview.asWebviewUri)` method
|
||||
* and ensure the resource's directory is listed in [`WebviewOptions.localResourceRoots`](#WebviewOptions.localResourceRoots).
|
||||
*
|
||||
* Keep in mind that even though webviews are sandboxed, they still allow running scripts and loading arbitrary content,
|
||||
* so extensions must follow all standard web security best practices when working with webviews. This includes
|
||||
* properly sanitizing all untrusted input (including content from the workspace) and
|
||||
* setting a [content security policy](https://aka.ms/vscode-api-webview-csp).
|
||||
*/
|
||||
html: string;
|
||||
|
||||
@@ -6433,7 +6454,7 @@ declare module 'vscode' {
|
||||
iconPath?: Uri | { light: Uri; dark: Uri };
|
||||
|
||||
/**
|
||||
* Webview belonging to the panel.
|
||||
* [`Webview`](#Webview) belonging to the panel.
|
||||
*/
|
||||
readonly webview: Webview;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user