mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
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:
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user