Files
element-web/src/@types/global.d.ts
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.8 KiB
TypeScript
Raw Normal View History

2020-03-25 13:53:28 +00:00
/*
2021-01-13 15:39:18 +00:00
Copyright 2020, 2021 New Vector Ltd
2020-03-25 13:53:28 +00:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import "matrix-react-sdk/src/@types/global"; // load matrix-react-sdk's type extensions first
2021-06-30 13:28:31 +01:00
import type { Renderer } from "react-dom";
import type { logger } from "matrix-js-sdk/src/logger";
2020-04-05 00:05:59 +01:00
2021-01-13 15:39:18 +00:00
type ElectronChannel =
| "app_onAction"
| "before-quit"
| "check_updates"
| "install_update"
| "ipcCall"
| "ipcReply"
| "loudNotification"
| "preferences"
| "seshat"
| "seshatReply"
| "setBadgeCount"
| "update-downloaded"
| "userDownloadCompleted"
| "userDownloadAction"
| "openDesktopCapturerSourcePicker";
2021-01-13 15:39:18 +00:00
declare global {
interface Window {
mxSendRageshake: (text: string, withLogs?: boolean) => void;
matrixLogger: typeof logger;
2020-04-22 13:41:29 +01:00
matrixChat: ReturnType<Renderer>;
2020-04-08 16:31:58 +01:00
// electron-only
2021-02-08 15:12:30 +00:00
electron?: Electron;
// opera-only
2021-02-08 15:12:30 +00:00
opera?: any;
// https://developer.mozilla.org/en-US/docs/Web/API/InstallTrigger
InstallTrigger: any;
}
2021-02-08 15:12:30 +00:00
interface Electron {
on(channel: ElectronChannel, listener: (event: Event, ...args: any[]) => void): void;
send(channel: ElectronChannel, ...args: any[]): void;
}
2020-03-25 13:53:28 +00:00
}
2020-05-20 19:56:54 +01:00
// add method which is missing from the node typing
declare module "url" {
interface Url {
format(): string;
}
}