@@ -11,7 +11,7 @@ import * as path from 'path';
1111
1212import { DisposableObject } from './pure/disposable-object' ;
1313import { tmpDir } from './helpers' ;
14- import { getHtmlForWebview , WebviewView } from './interface-utils' ;
14+ import { getHtmlForWebview , WebviewMessage , WebviewView } from './interface-utils' ;
1515
1616export type InterfacePanelConfig = {
1717 viewId : string ;
@@ -22,7 +22,7 @@ export type InterfacePanelConfig = {
2222 additionalOptions ?: WebviewPanelOptions & WebviewOptions ;
2323}
2424
25- export abstract class AbstractInterfaceManager < ToMessage extends { t : string } , FromMessage extends { t : string } > extends DisposableObject {
25+ export abstract class AbstractInterfaceManager < ToMessage extends WebviewMessage , FromMessage extends WebviewMessage > extends DisposableObject {
2626 protected panel : WebviewPanel | undefined ;
2727 protected panelLoaded = false ;
2828 protected panelLoadedCallBacks : ( ( ) => void ) [ ] = [ ] ;
@@ -43,7 +43,7 @@ export abstract class AbstractInterfaceManager<ToMessage extends { t: string },
4343
4444 const config = this . getPanelConfig ( ) ;
4545
46- const panel = ( this . panel = Window . createWebviewPanel (
46+ this . panel = Window . createWebviewPanel (
4747 config . viewId ,
4848 config . title ,
4949 { viewColumn : ViewColumn . Active , preserveFocus : true } ,
@@ -59,7 +59,7 @@ export abstract class AbstractInterfaceManager<ToMessage extends { t: string },
5959 Uri . file ( path . join ( ctx . extensionPath , 'node_modules/@vscode/codicons/dist' ) ) ,
6060 ] ,
6161 }
62- ) ) ;
62+ ) ;
6363 this . push (
6464 this . panel . onDidDispose (
6565 ( ) => {
@@ -72,16 +72,16 @@ export abstract class AbstractInterfaceManager<ToMessage extends { t: string },
7272 )
7373 ) ;
7474
75- panel . webview . html = getHtmlForWebview (
75+ this . panel . webview . html = getHtmlForWebview (
7676 ctx ,
77- panel . webview ,
77+ this . panel . webview ,
7878 config . view ,
7979 {
8080 allowInlineStyles : true ,
8181 }
8282 ) ;
8383 this . push (
84- panel . webview . onDidReceiveMessage (
84+ this . panel . webview . onDidReceiveMessage (
8585 async ( e ) => this . onMessage ( e ) ,
8686 undefined ,
8787 ctx . subscriptions
0 commit comments