-
-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
Currently, using the WebviewMessageParticipant instead leads into a non-obvious pitfall:
vscode-messenger/packages/vscode-messenger-common/src/messages.ts
Lines 26 to 32 in f8746a5
| export interface WebviewMessageParticipant { | |
| type: 'webview' | |
| /** Identifier of a specific webview instance. */ | |
| webviewId?: string | |
| /** Webview panel type or webview view type. */ | |
| webviewType?: string | |
| } |
As both webviewId and webviewType are optional, I believed them both to be truly optional. However, at least one of them is needed. This fact is not reflected in the type definition. Instead, the type should probably look something like this:
export type WebviewMessageParticipant = WebviewIdMessageParticipant | WebviewTypeMessageParticipant;
export interface WebviewIdMessageParticipant {
type: 'webview'
/** Identifier of a specific webview instance. */
webviewId: string
}
export interface WebviewTypeMessageParticipant {
type: 'webview'
/** Webview panel type or webview view type. */
webviewType: string
}Metadata
Metadata
Assignees
Labels
No labels