fix typescript types

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-04-08 16:31:58 +01:00
parent 7113fe7e31
commit b3780445d3
2 changed files with 6 additions and 3 deletions

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import {ReactNode} from "react";
import "modernizr"; import "modernizr";
import {Renderer} from "react-dom";
declare global { declare global {
interface Window { interface Window {
@ -25,7 +25,10 @@ declare global {
}; };
mxSendRageshake: (text: string, withLogs?: boolean) => void; mxSendRageshake: (text: string, withLogs?: boolean) => void;
matrixChat: ReactNode; matrixChat: ReturnType<Renderer>;
// electron-only
ipcRenderer: any;
} }
// workaround for https://github.com/microsoft/TypeScript/issues/30933 // workaround for https://github.com/microsoft/TypeScript/issues/30933

View File

@ -36,7 +36,7 @@ import { initRageshake } from "./rageshakesetup";
export const rageshakePromise = initRageshake(); export const rageshakePromise = initRageshake();
export function preparePlatform() { export function preparePlatform() {
if ((<any>window).ipcRenderer) { if (window.ipcRenderer) {
console.log("Using Electron platform"); console.log("Using Electron platform");
const plaf = new ElectronPlatform(); const plaf = new ElectronPlatform();
PlatformPeg.set(plaf); PlatformPeg.set(plaf);