From b3780445d317a89427133d61cc9fe9c369e12bc1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 8 Apr 2020 16:31:58 +0100 Subject: [PATCH] fix typescript types Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/@types/global.d.ts | 7 +++++-- src/vector/{init.ts => init.tsx} | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) rename src/vector/{init.ts => init.tsx} (99%) diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index a19e20b5c..6a5adec6d 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {ReactNode} from "react"; import "modernizr"; +import {Renderer} from "react-dom"; declare global { interface Window { @@ -25,7 +25,10 @@ declare global { }; mxSendRageshake: (text: string, withLogs?: boolean) => void; - matrixChat: ReactNode; + matrixChat: ReturnType; + + // electron-only + ipcRenderer: any; } // workaround for https://github.com/microsoft/TypeScript/issues/30933 diff --git a/src/vector/init.ts b/src/vector/init.tsx similarity index 99% rename from src/vector/init.ts rename to src/vector/init.tsx index 85f751812..d325dbae8 100644 --- a/src/vector/init.ts +++ b/src/vector/init.tsx @@ -36,7 +36,7 @@ import { initRageshake } from "./rageshakesetup"; export const rageshakePromise = initRageshake(); export function preparePlatform() { - if ((window).ipcRenderer) { + if (window.ipcRenderer) { console.log("Using Electron platform"); const plaf = new ElectronPlatform(); PlatformPeg.set(plaf);