提交 facc5e44 编写于 作者: M Matt Bierner

Documentation

上级 c952a887
......@@ -1292,11 +1292,25 @@ declare module 'vscode' {
export interface Webview {
/**
* Convert a uri for the local file system to one that can be used inside webviews.
*
* Webviews cannot directly load resoruces from the workspace or local file system using `file:` uris. The
* `toWebviewResource` 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.toWebviewResource(vscode.Uri.file('/Users/codey/workspace/cat.gif'))}">`
* ```
*/
toWebviewResource(localResource: Uri): Uri;
/**
* Content security policy rule for webview resources.
* Content security policy source for webview resources.
*
* This is origin used in a content security policy rule:
*
* ```
* img-src https: ${webview.cspSource} ...;
* ````
*/
readonly cspSource: string;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册