Document new behavior of postMesage on VS Code 1.57+

上级 18a986be
......@@ -7369,6 +7369,16 @@ declare module 'vscode' {
* background with `retainContextWhenHidden`).
*
* @param message Body of the message. This must be a string or other json serializable object.
*
* For older versions of vscode, if an `ArrayBuffer` is included in `message`,
* it will not be serialized properly and will not be received by the webview.
* Similarly any TypedArrays, such as a `Uint8Array`, will be very inefficiently
* serialized and will also not be recreated as a typed array inside the webview.
*
* However if your extension targets vscode 1.57+ in the `engines` field of its
* `package.json`, any `ArrayBuffer` values that appear in `message` will be more
* efficiently transferred to the webview and will also be correctly recreated inside
* of the webview.
*/
postMessage(message: any): Thenable<boolean>;
......
......@@ -3047,27 +3047,6 @@ declare module 'vscode' {
//#endregion
//#region https://github.com/microsoft/vscode/issues/115807
export interface Webview {
/**
* @param message A json serializable message to send to the webview.
*
* For older versions of vscode, if an `ArrayBuffer` is included in `message`,
* it will not be serialized properly and will not be received by the webview.
* Similarly any TypedArrays, such as a `Uint8Array`, will be very inefficiently
* serialized and will also not be recreated as a typed array inside the webview.
*
* However if your extension targets vscode 1.56+ in the `engines` field of its
* `package.json` any `ArrayBuffer` values that appear in `message` will be more
* efficiently transferred to the webview and will also be recreated inside of
* the webview.
*/
postMessage(message: any): Thenable<boolean>;
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/115616 @alexr00
export enum PortAutoForwardAction {
Notify = 1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册