From 993c2e50b518842cf87f8c7c42a39048117ee34c Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 8 Feb 2021 15:12:30 +0000 Subject: [PATCH] Fix Electron type merging This changes to an interface for Electron types so that other layers can merge in further APIs as needed, such as the JS SDK. --- src/@types/global.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index f498103d60..68b85d6a84 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -39,18 +39,20 @@ declare global { matrixChat: ReturnType; // electron-only - electron: { - on(channel: ElectronChannel, listener: (event: Event, ...args: any[]) => void): void; - send(channel: ElectronChannel, ...args: any[]): void; - } + electron?: Electron; // opera-only - opera: any; + opera?: any; // https://developer.mozilla.org/en-US/docs/Web/API/InstallTrigger InstallTrigger: any; } + interface Electron { + on(channel: ElectronChannel, listener: (event: Event, ...args: any[]) => void): void; + send(channel: ElectronChannel, ...args: any[]): void; + } + interface Navigator { // PWA badging extensions https://w3c.github.io/badging/ setAppBadge?(count: number): Promise;