Add badges extension API (#139225)

* First attempt at a badges API

* Updated badge API to reflect feedback

* Update to reflect PR feedback

* Address further feedback

* Badge -> ViewBadge

Co-authored-by: Alex Ross <alros@microsoft.com>
This commit is contained in:
Matt Adam
2022-03-08 08:07:15 -08:00
committed by GitHub
parent cf86a5e310
commit 9be0d5ed05
2 changed files with 42 additions and 0 deletions
@@ -7,6 +7,7 @@
export const allApiProposals = Object.freeze({
authSession: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts',
badges: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.badges.d.ts',
commentsResolvedState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsResolvedState.d.ts',
contribLabelFormatterWorkspaceTooltip: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts',
contribMenuBarHome: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts',
+41
View File
@@ -0,0 +1,41 @@
/*---------------------------------------------------------------------------------------------
* 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/62783 @matthewjamesadam
/**
* A badge presenting a value for a view
*/
export interface ViewBadge {
/**
* A label to present in tooltips for the badge
*/
readonly tooltip: string;
/**
* The value to present in the badge
*/
readonly value: number;
}
export interface TreeView<T> {
/**
* The badge to display for this TreeView.
* To remove the badge, set to undefined.
*/
badge?: ViewBadge | undefined;
}
export interface WebviewView {
/**
* The badge to display for this webview view.
* To remove the badge, set to undefined.
*/
badge?: ViewBadge | undefined;
}
}