Skip to content

Commit

Permalink
chore: update WebviewPortMapping and proposed type (#4295)
Browse files Browse the repository at this point in the history
* feat: update WebviewPortMapping type

* chore: update DocumentFilter、WorkspaceTrustRequestOptions、requestWorkspaceTrust type positioin

* chore: add proposed vscode statement

* chore: update proposed quote
  • Loading branch information
hui2334387208 authored Jan 3, 2025
1 parent d5f68e0 commit c174571
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 57 deletions.
4 changes: 2 additions & 2 deletions packages/types/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
/// <reference path='./vscode/typings/vscode.tests.d.ts' />
/// <reference path='./vscode/typings/vscode.l10n.d.ts' />

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

/// <reference path='./vscode/typings/vscode.proposed.authSession.d.ts' />
/// <reference path='./vscode/typings/vscode.proposed.diffCommand.d.ts' />
Expand Down
25 changes: 0 additions & 25 deletions packages/types/vscode/typings-pending/vscode.d.ts

This file was deleted.

30 changes: 0 additions & 30 deletions packages/types/vscode/typings-pending/vscode.proposed.d.ts

This file was deleted.

15 changes: 15 additions & 0 deletions packages/types/vscode/typings/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,21 @@ declare module 'vscode' {
FocusOut = 3,
}

/**
* Defines a port mapping used for localhost inside the webview.
*/
export interface WebviewPortMapping {
/**
* Localhost port to remap inside the webview.
*/
readonly webviewPort: number;

/**
* Destination port. The `webviewPort` is resolved to this port.
*/
readonly extensionHostPort: number;
}

/**
* Content settings for a webview.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

declare module 'vscode' {

// todo@jrieken add issue reference

export interface DocumentFilter {
readonly exclusive?: boolean;
}
}
30 changes: 30 additions & 0 deletions packages/types/vscode/typings/vscode.proposed.workspaceTrust.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

declare module 'vscode' {

// https://github.com/microsoft/vscode/issues/120173

/**
* The object describing the properties of the workspace trust request
*/
export interface WorkspaceTrustRequestOptions {
/**
* Custom message describing the user action that requires workspace
* trust. If omitted, a generic message will be displayed in the workspace
* trust request dialog.
*/
readonly message?: string;
}

export namespace workspace {
/**
* Prompt the user to chose whether to trust the current workspace
* @param options Optional object describing the properties of the
* workspace trust request.
*/
export function requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Thenable<boolean | undefined>;
}
}

0 comments on commit c174571

Please sign in to comment.