Skip to content

Commit c174571

Browse files
chore: update WebviewPortMapping and proposed type (#4295)
* feat: update WebviewPortMapping type * chore: update DocumentFilter、WorkspaceTrustRequestOptions、requestWorkspaceTrust type positioin * chore: add proposed vscode statement * chore: update proposed quote
1 parent d5f68e0 commit c174571

6 files changed

+60
-57
lines changed

packages/types/vscode.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
/// <reference path='./vscode/typings/vscode.tests.d.ts' />
2424
/// <reference path='./vscode/typings/vscode.l10n.d.ts' />
2525

26-
/// <reference path='./vscode/typings-pending/vscode.d.ts' />
27-
/// <reference path='./vscode/typings-pending/vscode.proposed.d.ts' />
26+
/// <reference path='./vscode/typings/vscode.proposed.documentFiltersExclusive.d.ts' />
27+
/// <reference path='./vscode/typings/vscode.proposed.workspaceTrust.d.ts' />
2828

2929
/// <reference path='./vscode/typings/vscode.proposed.authSession.d.ts' />
3030
/// <reference path='./vscode/typings/vscode.proposed.diffCommand.d.ts' />

packages/types/vscode/typings-pending/vscode.d.ts

-25
This file was deleted.

packages/types/vscode/typings-pending/vscode.proposed.d.ts

-30
This file was deleted.

packages/types/vscode/typings/vscode.d.ts

+15
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,21 @@ declare module 'vscode' {
954954
FocusOut = 3,
955955
}
956956

957+
/**
958+
* Defines a port mapping used for localhost inside the webview.
959+
*/
960+
export interface WebviewPortMapping {
961+
/**
962+
* Localhost port to remap inside the webview.
963+
*/
964+
readonly webviewPort: number;
965+
966+
/**
967+
* Destination port. The `webviewPort` is resolved to this port.
968+
*/
969+
readonly extensionHostPort: number;
970+
}
971+
957972
/**
958973
* Content settings for a webview.
959974
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
declare module 'vscode' {
7+
8+
// todo@jrieken add issue reference
9+
10+
export interface DocumentFilter {
11+
readonly exclusive?: boolean;
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
declare module 'vscode' {
7+
8+
// https://github.com/microsoft/vscode/issues/120173
9+
10+
/**
11+
* The object describing the properties of the workspace trust request
12+
*/
13+
export interface WorkspaceTrustRequestOptions {
14+
/**
15+
* Custom message describing the user action that requires workspace
16+
* trust. If omitted, a generic message will be displayed in the workspace
17+
* trust request dialog.
18+
*/
19+
readonly message?: string;
20+
}
21+
22+
export namespace workspace {
23+
/**
24+
* Prompt the user to chose whether to trust the current workspace
25+
* @param options Optional object describing the properties of the
26+
* workspace trust request.
27+
*/
28+
export function requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Thenable<boolean | undefined>;
29+
}
30+
}

0 commit comments

Comments
 (0)