-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.ts
40 lines (31 loc) · 1.2 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { app } from 'electron';
import Application from './src/Application';
import { waitConfigInit } from './src/config';
import { OverlayManager } from './src/overlay';
const overlayManager = new OverlayManager();
// overlayManager.init();
const application = new Application(overlayManager);
(async () => {
await app.whenReady();
await waitConfigInit();
application.initPluginLoader();
application.initOverlay();
application.initAutoUpdater();
application.initTray();
application.initSourceProvider();
application.initHook();
application.initMainWindow();
application.initTrayWindow();
overlayManager.injectOverlay();
console.log('[Alspotron] App is ready');
})();
// Auto type inference for IPC
type IpcParameters<T extends (...args: never) => unknown> = Parameters<T> extends [unknown, ...args: infer P] ? P : [];
declare global {
export type IpcHandleMap = {
[Event in keyof typeof application.handleMap]: [IpcParameters<typeof application.handleMap[Event]>,ReturnType<typeof application.handleMap[Event]>];
}
export type IpcOnMap = {
[Event in keyof typeof application.onMap]: [IpcParameters<typeof application.onMap[Event]>,ReturnType<typeof application.onMap[Event]>];
}
}