2024-04-09 04:07:22 +00:00
|
|
|
import type { Electron } from "./types/ipc";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extend the global object's (`globalThis`) interface to state that it can
|
|
|
|
* potentially hold a property called `electron`. It will be injected by our
|
|
|
|
* preload.js script when we're running in the context of our desktop app.
|
|
|
|
*/
|
|
|
|
declare global {
|
|
|
|
/**
|
|
|
|
* Extra, desktop specific, APIs provided by our Node.js layer.
|
|
|
|
*
|
|
|
|
* This property will defined only when we're running inside our desktop
|
|
|
|
* (Electron) app. It will expose a bunch of functions (see
|
|
|
|
* {@link Electron}) that allow us to communicate with the Node.js layer of
|
|
|
|
* our desktop app.
|
|
|
|
*/
|
2024-04-09 04:23:28 +00:00
|
|
|
// This needs to be a var for it to be recognized as a property of
|
|
|
|
// globalThis, so we unfortunately need to hush eslint for the next line.
|
|
|
|
//
|
|
|
|
// eslint-disable-next-line no-var
|
|
|
|
var electron: Electron | undefined;
|
2024-04-09 04:07:22 +00:00
|
|
|
}
|