diff --git a/packages/preview-process/src/parts/CreateWebViewServer/CreateWebViewServer.ts b/packages/preview-process/src/parts/CreateWebViewServer/CreateWebViewServer.ts index 7e9ce0e2..4ac8881f 100644 --- a/packages/preview-process/src/parts/CreateWebViewServer/CreateWebViewServer.ts +++ b/packages/preview-process/src/parts/CreateWebViewServer/CreateWebViewServer.ts @@ -20,6 +20,12 @@ export const createWebViewServer = (id: number): void => { // eslint-disable-next-line @typescript-eslint/no-misused-promises this.server.on('request', handleRequest) }, + on(event: string, listener: any): void { + this.server.on(event, listener) + }, + off(event: string, listener: any): void { + this.server.off(event, listener) + }, listen(port, callback): void { this.server.listen(port, callback) }, diff --git a/packages/preview-process/src/parts/WebViewServerTypes/WebViewServerTypes.ts b/packages/preview-process/src/parts/WebViewServerTypes/WebViewServerTypes.ts index c6bd45c9..ae67b166 100644 --- a/packages/preview-process/src/parts/WebViewServerTypes/WebViewServerTypes.ts +++ b/packages/preview-process/src/parts/WebViewServerTypes/WebViewServerTypes.ts @@ -9,4 +9,6 @@ export interface WebViewServer { readonly setHandler: (handler: Handler) => void readonly server: Server readonly listen: (port: string, callback: () => void) => void + readonly on: (event: string, listener: any) => void + readonly off: (event: string, listener: any) => void }