From e5a232b0d8722e911f09fb7bea5043be5f347f88 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 22 Apr 2020 13:41:29 +0100 Subject: [PATCH] make typescript happy Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/@types/global.d.ts | 4 ++-- src/vector/app.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 0068d4018d..9716cafe22 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -15,12 +15,12 @@ limitations under the License. */ import "matrix-react-sdk/src/@types/global"; // load matrix-react-sdk's type extensions first -import type MatrixChat from "matrix-react-sdk/src/components/structures/MatrixChat"; +import type {Renderer} from "react-dom"; declare global { interface Window { mxSendRageshake: (text: string, withLogs?: boolean) => void; - matrixChat: MatrixChat; + matrixChat: ReturnType; // electron-only ipcRenderer: any; diff --git a/src/vector/app.tsx b/src/vector/app.tsx index d5484fc3e2..b665fedaf1 100644 --- a/src/vector/app.tsx +++ b/src/vector/app.tsx @@ -30,6 +30,7 @@ import {_td, newTranslatableError} from 'matrix-react-sdk/src/languageHandler'; import AutoDiscoveryUtils from 'matrix-react-sdk/src/utils/AutoDiscoveryUtils'; import {AutoDiscovery} from "matrix-js-sdk/src/autodiscovery"; import * as Lifecycle from "matrix-react-sdk/src/Lifecycle"; +import type MatrixChatType from "matrix-react-sdk/src/components/structures/MatrixChat"; import url from 'url'; @@ -59,7 +60,7 @@ function routeUrl(location: Location) { console.log("Routing URL ", location.href); const s = getScreenFromLocation(location); - window.matrixChat.showScreen(s.screen, s.params); + (window.matrixChat as MatrixChatType).showScreen(s.screen, s.params); } function onHashChange(ev: HashChangeEvent) {