chore(shared): dedupe WebviewMessage.type union; add WebviewMessagePayload alias; clarify ExtensionMessage header comment

This commit is contained in:
Hannes Rudolph 2025-08-27 18:10:38 -06:00
parent 06d5674801
commit 8ac8247ca9
2 changed files with 9 additions and 6 deletions

View file

@ -57,9 +57,12 @@ export interface LanguageModelChatSelector {
id?: string
}
// Represents JSON data that is sent from extension to webview, called
// ExtensionMessage and has 'type' enum which can be 'plusButtonClicked' or
// 'settingsButtonClicked' or 'hello'. Webview will hold state.
/**
* Message sent from the VS Code extension to the webview UI.
* The 'type' union below enumerates outbound notifications and data updates
* (e.g., "state", "theme", "indexingStatusUpdate", "filesChanged") that the
* webview consumes to render and synchronize state. See the full union below.
*/
export interface ExtensionMessage {
type:
| "action"

View file

@ -83,7 +83,6 @@ export interface WebviewMessage {
| "allowedMaxRequests"
| "allowedMaxCost"
| "alwaysAllowSubtasks"
| "alwaysAllowUpdateTodoList"
| "autoCondenseContext"
| "autoCondenseContextPercent"
| "condensingApiConfigId"
@ -186,7 +185,6 @@ export interface WebviewMessage {
| "indexCleared"
| "focusPanelRequest"
| "profileThresholds"
| "setHistoryPreviewCollapsed"
| "openExternal"
| "filterMarketplaceItems"
| "marketplaceButtonClicked"
@ -197,7 +195,6 @@ export interface WebviewMessage {
| "marketplaceInstallResult"
| "fetchMarketplaceData"
| "switchTab"
| "profileThresholds"
| "shareTaskSuccess"
| "exportMode"
| "exportModeResult"
@ -346,3 +343,6 @@ export type WebViewMessagePayload =
| IndexClearedPayload
| InstallMarketplaceItemWithParametersPayload
| UpdateTodoListPayload
// Alias for consistent naming (prefer 'Webview' spelling in new code)
export type WebviewMessagePayload = WebViewMessagePayload