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 39d2ca2ba3
commit 46683d3344
2 changed files with 9 additions and 6 deletions

View file

@ -60,9 +60,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

@ -86,7 +86,6 @@ export interface WebviewMessage {
| "allowedMaxRequests"
| "allowedMaxCost"
| "alwaysAllowSubtasks"
| "alwaysAllowUpdateTodoList"
| "autoCondenseContext"
| "autoCondenseContextPercent"
| "condensingApiConfigId"
@ -189,7 +188,6 @@ export interface WebviewMessage {
| "indexCleared"
| "focusPanelRequest"
| "profileThresholds"
| "setHistoryPreviewCollapsed"
| "openExternal"
| "filterMarketplaceItems"
| "marketplaceButtonClicked"
@ -200,7 +198,6 @@ export interface WebviewMessage {
| "marketplaceInstallResult"
| "fetchMarketplaceData"
| "switchTab"
| "profileThresholds"
| "shareTaskSuccess"
| "exportMode"
| "exportModeResult"
@ -358,3 +355,6 @@ export type WebViewMessagePayload =
| InstallMarketplaceItemWithParametersPayload
| UpdateTodoListPayload
| EditQueuedMessagePayload
// Alias for consistent naming (prefer 'Webview' spelling in new code)
export type WebviewMessagePayload = WebViewMessagePayload