From fb3a44890b40bb4bb988c4047a02e673765e60fc Mon Sep 17 00:00:00 2001 From: Vladimir Y <1560781+vladimiry@users.noreply.github.com> Date: Tue, 31 Aug 2021 21:18:50 +0300 Subject: [PATCH] import "WebviewTag" via namespace vs type (@electron v15+ support) * @electron stopped exporting "WebviewTag" interface/type since v15 but it's still available for referencing using the "Electron.WebviewTag" way. --- src/lib/webview-api-service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/webview-api-service.ts b/src/lib/webview-api-service.ts index fe08058..f952119 100644 --- a/src/lib/webview-api-service.ts +++ b/src/lib/webview-api-service.ts @@ -1,6 +1,6 @@ import * as Lib from "pubsub-to-rpc-api"; import UUID from "pure-uuid"; -import {IpcMessageEvent, IpcRenderer, WebviewTag} from "electron"; +import {IpcMessageEvent, IpcRenderer} from "electron"; import * as PM from "./private/model"; import {curryOwnFunctionMembers} from "./private/util"; @@ -12,7 +12,7 @@ type ACA2 = [IpcMessageEvent, ...PM.Any[]]; // used by "pubsub-to-rpc-api" like type RegisterApiIpcRenderer = Pick; const ipcRendererEventEmittersCache = new WeakMap(); -const webViewTagEventEmittersCache = new WeakMap(); +const webViewTagEventEmittersCache = new WeakMap(); const clientIpcMessageEventName = "ipc-message"; const clientIpcMessageListenerBundleProp = Symbol(`[${PM.MODULE_NAME}] clientIpcMessageListenerBundleProp symbol`); @@ -25,7 +25,7 @@ export function createWebViewApiService>( options?: Lib.Model.CreateServiceRegisterOptions & { ipcRenderer?: RegisterApiIpcRenderer; }, ) => ReturnType["register"]>; client: ( - webView: WebviewTag, + webView: Electron.WebviewTag, params?: { options?: Partial> }, ) => ReturnType["caller"]>; } {