@overlayed/app 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,32 +1,35 @@
1
1
  /// <reference types="electron" />
2
2
  /// <reference types="node" />
3
3
 
4
- import { BrowserWindow } from 'electron';
5
- import { electron } from 'electron';
6
- import { Module } from 'arktype';
7
- import { ObjectType } from 'arktype/internal/methods/object.ts';
8
- import { Out } from 'arktype/internal/attributes.ts';
9
- import { Process } from '@overlayed-gg/native-interface';
4
+ import { BrowserWindow } from "electron";
5
+ import { electron } from "electron";
6
+ import { Module } from "arktype";
7
+ import { ObjectType } from "arktype/internal/methods/object.ts";
8
+ import { Out } from "arktype/internal/attributes.ts";
9
+ import { Process } from "@overlayed-gg/native-interface";
10
10
 
11
11
  export const enum AccessLevel {
12
- Default = 0,
13
- Global = 1,
14
- Admin = 2,
15
- }
12
+ Default = 0,
13
+ Global = 1,
14
+ Admin = 2,
15
+ }
16
16
 
17
17
  export declare type ActiveGameInfo = {
18
- isConnected: boolean;
19
- resolution: {
20
- width: number;
21
- height: number;
22
- };
18
+ isConnected: boolean;
19
+ resolution: {
20
+ width: number;
21
+ height: number;
22
+ };
23
23
  };
24
24
 
25
- declare const BaseEvent: ObjectType< {
26
- game: string;
27
- type: string;
28
- creation_time: number;
29
- }, {}>;
25
+ declare const BaseEvent: ObjectType<
26
+ {
27
+ game: string;
28
+ type: string;
29
+ creation_time: number;
30
+ },
31
+ {}
32
+ >;
30
33
 
31
34
  declare type BaseEvent = typeof BaseEvent.infer;
32
35
 
@@ -58,107 +61,100 @@ declare type BaseEvent = typeof BaseEvent.infer;
58
61
  * ```
59
62
  */
60
63
  declare type Brand<Base, Branding, ReservedName extends string = "__type__"> = Base & {
61
- [K in ReservedName]: Branding;
64
+ [K in ReservedName]: Branding;
62
65
  } & { __witness__: Base };
63
66
 
64
- declare interface CortexEvents extends Record<string, unknown> {
65
- }
67
+ declare interface CortexEvents extends Record<string, unknown> {}
66
68
 
67
- declare interface CortexLogs extends Record<string, unknown> {
68
- }
69
+ declare interface CortexLogs extends Record<string, unknown> {}
69
70
 
70
71
  declare type CustomLoggerScope = ReturnType<typeof Logger.prototype.scope>;
71
72
 
72
73
  declare type ErrorEvents = ErrorPipeServerError | ErrorInvalidConfigFile;
73
74
 
74
75
  declare interface ErrorInvalidConfigFile extends ErrorManagerEvent {
75
- code: "INVALID_CONFIG_FILE";
76
- data: {
77
- issues: string[];
78
- filePath: string;
79
- data: unknown;
80
- };
76
+ code: "INVALID_CONFIG_FILE";
77
+ data: {
78
+ issues: string[];
79
+ filePath: string;
80
+ data: unknown;
81
+ };
81
82
  }
82
83
 
83
84
  declare type ErrorManagerEvent = {
84
- code: string;
85
- message: string;
86
- data: Record<string, any>;
87
- timestamp: number;
85
+ code: string;
86
+ message: string;
87
+ data: Record<string, any>;
88
+ timestamp: number;
88
89
  };
89
90
 
90
91
  declare type ErrorManagerEvents = {
91
- fatal: FatalEvents;
92
- error: ErrorEvents;
93
- warning: WarningEvents;
92
+ fatal: FatalEvents;
93
+ error: ErrorEvents;
94
+ warning: WarningEvents;
94
95
  };
95
96
 
96
97
  declare interface ErrorPipeServerError extends ErrorManagerEvent {
97
- code: "PIPE_SERVER_ERROR";
98
- data: {
99
- error: unknown;
100
- };
98
+ code: "PIPE_SERVER_ERROR";
99
+ data: {
100
+ error: unknown;
101
+ };
101
102
  }
102
103
 
103
- declare type EventCallback<TEvent extends BaseEvent, TEventType extends EventType<TEvent>> = (event: Extract<TEvent, {
104
- type: TEventType;
105
- }>) => void;
104
+ declare type EventCallback<TEvent extends BaseEvent, TEventType extends EventType<TEvent>> = (
105
+ event: Extract<
106
+ TEvent,
107
+ {
108
+ type: TEventType;
109
+ }
110
+ >,
111
+ ) => void;
106
112
 
107
113
  declare type EventType<TEvent extends BaseEvent> = TEvent["type"];
108
114
 
109
115
  declare interface FatalElevationMismatch extends ErrorManagerEvent {
110
- code: "ELEVATION_MISMATCH";
111
- data: {
112
- appElevated: boolean;
113
- gameElevated: boolean;
114
- };
116
+ code: "ELEVATION_MISMATCH";
117
+ data: {
118
+ appElevated: boolean;
119
+ gameElevated: boolean;
120
+ };
115
121
  }
116
122
 
117
123
  declare type FatalEvents = FatalElevationMismatch;
118
124
 
119
125
  export declare type GameLaunchManagerEvents = {
120
- gameCloseInternal: (args: {
121
- ravenGame: GameModel;
122
- process: Process;
123
- }) => MaybePromise<void>;
124
- gameLaunch: (args: {
125
- game: string;
126
- reject: () => void;
127
- }) => MaybePromise<boolean>;
128
- gameClose: (args: {
129
- game: string;
130
- }) => MaybePromise<void>;
131
- gameReady: (args: {
132
- game: string;
133
- }) => MaybePromise<void>;
134
- gameReadyInternal: (args: {
135
- ravenGame: GameModel;
136
- process: Process;
137
- }) => MaybePromise<void>;
126
+ gameCloseInternal: (args: { ravenGame: GameModel; process: Process }) => MaybePromise<void>;
127
+ gameLaunch: (args: { game: string; reject: () => void }) => MaybePromise<boolean>;
128
+ gameClose: (args: { game: string }) => MaybePromise<void>;
129
+ gameReady: (args: { game: string }) => MaybePromise<void>;
130
+ gameReadyInternal: (args: { ravenGame: GameModel; process: Process }) => MaybePromise<void>;
138
131
  };
139
132
 
140
133
  declare interface GameModel {
141
- name: string;
142
- identifier: Brand<string, GameModel>;
143
- modules: string[];
144
- executables: string[];
134
+ name: string;
135
+ identifier: Brand<string, GameModel>;
136
+ modules: string[];
137
+ executables: string[];
145
138
  }
146
139
 
147
- declare interface GameModule<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>, TKey extends string = string> {
148
- key: TKey;
149
- events: Module<GameModuleEvent<TEvents>>;
140
+ declare interface GameModule<
141
+ TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>,
142
+ TKey extends string = string,
143
+ > {
144
+ key: TKey;
145
+ events: Module<GameModuleEvent<TEvents>>;
150
146
  }
151
147
 
152
148
  declare type GameModuleEvent<TEvents extends Record<string, BaseEvent>> = TEvents & {
153
- event: BaseEvent;
149
+ event: BaseEvent;
154
150
  };
155
151
 
156
152
  declare type GameModuleEventInfer<TModule extends GameModule> = TModule["events"]["event"]["infer"];
157
153
 
158
154
  declare type KeybindCallbacks = {
159
- toggle?: KeybindPressedCallback;
160
- down?: KeybindDownCallback;
161
- up?: KeybindUpCallback;
155
+ toggle?: KeybindPressedCallback;
156
+ down?: KeybindDownCallback;
157
+ up?: KeybindUpCallback;
162
158
  };
163
159
 
164
160
  export declare type KeybindConfig = (typeof KeybindSchema.infer)[string];
@@ -167,637 +163,712 @@ declare type KeybindDownCallback = () => string | void;
167
163
 
168
164
  declare type KeybindPressedCallback = () => string | void;
169
165
 
170
- declare const KeybindSchema: ObjectType< {
171
- [x: string]: {
172
- keys: string[];
173
- mode: (In: "toggle" | "hold") => Out<"toggle" | "hold">;
174
- };
175
- }, {}>;
166
+ declare const KeybindSchema: ObjectType<
167
+ {
168
+ [x: string]: {
169
+ keys: string[];
170
+ mode: (In: "toggle" | "hold") => Out<"toggle" | "hold">;
171
+ };
172
+ },
173
+ {}
174
+ >;
176
175
 
177
176
  declare type KeybindUpCallback = () => void;
178
177
 
179
178
  export interface KeyboardKeyEvent extends WindowEvent {
180
- key: VirtualKey;
181
- }
179
+ key: VirtualKey;
180
+ }
182
181
 
183
182
  declare const Logger = AsSingleton(LoggerClass);
184
183
 
185
184
  /** This should be kept in sync with EventEmitterManager */
186
185
  declare class Manager {
187
- protected logger: CustomLoggerScope;
188
- initialized: boolean;
189
- constructor(name: string);
190
- init(): void;
191
- destroy(): void;
186
+ protected logger: CustomLoggerScope;
187
+ initialized: boolean;
188
+ constructor(name: string);
189
+ init(): void;
190
+ destroy(): void;
192
191
  }
193
192
 
194
193
  declare type MaybePromise<T> = T | Promise<T>;
195
194
 
196
195
  export interface MouseButtonEvent extends WindowEvent {
197
- x: number;
198
- y: number;
199
-
200
- globalX: number;
201
- globalY: number;
202
-
203
- key: VirtualKey;
204
- }
205
-
206
- export declare function overlayed<TModule extends GameModule, TShortcut extends string>(options: OverlayedOptions<TModule, TShortcut>): OverlayedApp<TModule, TShortcut>;
207
-
208
- export declare type OverlayedApp<TModule extends GameModule, TKeybind extends string> = OverlayedAppGameModules<TModule> & OverlayedAppHandlers & {
209
- keybinds: OverlayedAppKeybindModule<TKeybind>;
210
- windows: OverlayedAppWindowsModule;
211
- input: OverlayedAppInputModule;
212
- ads: OverlayedAppAdsModule;
213
- cortex: OverlayedAppCortexModule;
214
- /**
215
- * Returns true if any monitored processes are running.
216
- *
217
- * Useful for stopping the overlay from updating when the game is running.
218
- */
219
- hasAnyActiveProcesses: () => boolean;
220
- /**
221
- * Initializes the overlayed app.
222
- *
223
- * This should only be called once, and is automatically called by default, unless `init: false` is passed:
224
- * ```ts
225
- * overlayed({
226
- * init: false,
227
- * });
228
- * ```
229
- */
230
- init: () => void;
231
- /**
232
- * Returns true if the overlayed app has been initialized.
233
- */
234
- initialized: boolean;
235
- };
196
+ x: number;
197
+ y: number;
198
+
199
+ globalX: number;
200
+ globalY: number;
201
+
202
+ key: VirtualKey;
203
+ }
204
+
205
+ export declare function overlayed<TModule extends GameModule, TShortcut extends string>(
206
+ options: OverlayedOptions<TModule, TShortcut>,
207
+ ): OverlayedApp<TModule, TShortcut>;
208
+
209
+ export declare type OverlayedApp<
210
+ TModule extends GameModule,
211
+ TKeybind extends string,
212
+ > = OverlayedAppGameModules<TModule> &
213
+ OverlayedAppHandlers & {
214
+ keybinds: OverlayedAppKeybindModule<TKeybind>;
215
+ windows: OverlayedAppWindowsModule;
216
+ input: OverlayedAppInputModule;
217
+ ads: OverlayedAppAdsModule;
218
+ cortex: OverlayedAppCortexModule;
219
+ /**
220
+ * Returns true if any monitored processes are running.
221
+ *
222
+ * Useful for stopping the overlay from updating when the game is running.
223
+ */
224
+ hasAnyActiveProcesses: () => boolean;
225
+ /**
226
+ * Initializes the overlayed app.
227
+ *
228
+ * This should only be called once, and is automatically called by default, unless `init: false` is passed:
229
+ * ```ts
230
+ * overlayed({
231
+ * init: false,
232
+ * });
233
+ * ```
234
+ */
235
+ init: () => void;
236
+ /**
237
+ * Returns true if the overlayed app has been initialized.
238
+ */
239
+ initialized: boolean;
240
+ };
236
241
 
237
242
  declare interface OverlayedAppAdsModule {
238
- registerWindow(window: BrowserWindow, options?: {
239
- linkHandler?: {
240
- allowHosts?: string[];
241
- };
242
- }): void;
243
+ registerWindow(
244
+ window: BrowserWindow,
245
+ options?: {
246
+ linkHandler?: {
247
+ allowHosts?: string[];
248
+ };
249
+ },
250
+ ): void;
243
251
  }
244
252
 
245
253
  declare interface OverlayedAppCortexModule {
246
- trackEvent: <TEventName extends keyof CortexEvents>(name: TEventName, data: CortexEvents[TEventName]) => void;
247
- trackLog: <TEventName extends keyof CortexLogs>(name: TEventName, data: CortexLogs[TEventName]) => void;
254
+ trackEvent: <TEventName extends keyof CortexEvents>(name: TEventName, data: CortexEvents[TEventName]) => void;
255
+ trackLog: <TEventName extends keyof CortexLogs>(name: TEventName, data: CortexLogs[TEventName]) => void;
248
256
  }
249
257
 
250
258
  declare type OverlayedAppGameModules<TModule extends GameModule> = {
251
- [TKey in TModule["key"]]: {
252
- onAny<TEvent extends Extract<TModule, {
253
- key: TKey;
254
- }>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
255
- on<TEvent extends Extract<TModule, {
256
- key: TKey;
257
- }>["events"]["event"]["infer"], TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
258
- offAny<TEvent extends Extract<TModule, {
259
- key: TKey;
260
- }>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
261
- off<TEvent extends GameModuleEventInfer<Extract<TModule, {
262
- key: TKey;
263
- }>>, TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
264
- };
259
+ [TKey in TModule["key"]]: {
260
+ onAny<
261
+ TEvent extends Extract<
262
+ TModule,
263
+ {
264
+ key: TKey;
265
+ }
266
+ >["events"]["event"]["infer"],
267
+ >(
268
+ cb: (data: TEvent) => void,
269
+ ): void;
270
+ on<
271
+ TEvent extends Extract<
272
+ TModule,
273
+ {
274
+ key: TKey;
275
+ }
276
+ >["events"]["event"]["infer"],
277
+ TEventType extends EventType<TEvent> = EventType<TEvent>,
278
+ >(
279
+ event: TEventType,
280
+ cb: EventCallback<TEvent, TEventType>,
281
+ ): void;
282
+ offAny<
283
+ TEvent extends Extract<
284
+ TModule,
285
+ {
286
+ key: TKey;
287
+ }
288
+ >["events"]["event"]["infer"],
289
+ >(
290
+ cb: (data: TEvent) => void,
291
+ ): void;
292
+ off<
293
+ TEvent extends GameModuleEventInfer<
294
+ Extract<
295
+ TModule,
296
+ {
297
+ key: TKey;
298
+ }
299
+ >
300
+ >,
301
+ TEventType extends EventType<TEvent> = EventType<TEvent>,
302
+ >(
303
+ event: TEventType,
304
+ cb: EventCallback<TEvent, TEventType>,
305
+ ): void;
306
+ };
265
307
  };
266
308
 
267
309
  declare type OverlayedAppHandlers = {
268
- on: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(event: TEvent, cb: OverlayedAppHandlersMapping[TEvent]) => void;
269
- off: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(event: TEvent, cb: OverlayedAppHandlersMapping[TEvent]) => void;
310
+ on: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(
311
+ event: TEvent,
312
+ cb: OverlayedAppHandlersMapping[TEvent],
313
+ ) => void;
314
+ off: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(
315
+ event: TEvent,
316
+ cb: OverlayedAppHandlersMapping[TEvent],
317
+ ) => void;
270
318
  };
271
319
 
272
320
  declare type OverlayedAppHandlersMapping = {
273
- error: (data: ErrorManagerEvents["error"]) => void;
274
- warning: (data: ErrorManagerEvents["warning"]) => void;
275
- fatal: (data: ErrorManagerEvents["fatal"]) => void;
276
- gameLaunch: GameLaunchManagerEvents["gameLaunch"];
277
- gameClose: GameLaunchManagerEvents["gameClose"];
278
- gameReady: GameLaunchManagerEvents["gameReady"];
321
+ error: (data: ErrorManagerEvents["error"]) => void;
322
+ warning: (data: ErrorManagerEvents["warning"]) => void;
323
+ fatal: (data: ErrorManagerEvents["fatal"]) => void;
324
+ gameLaunch: GameLaunchManagerEvents["gameLaunch"];
325
+ gameClose: GameLaunchManagerEvents["gameClose"];
326
+ gameReady: GameLaunchManagerEvents["gameReady"];
279
327
  };
280
328
 
281
329
  declare interface OverlayedAppInputModule {
282
- scope: (scopeName: string) => ReturnType<OverridesManager["scope"]>;
283
- raw: OverlayedAppInputModuleRaw;
330
+ scope: (scopeName: string) => ReturnType<OverridesManager["scope"]>;
331
+ raw: OverlayedAppInputModuleRaw;
284
332
  }
285
333
 
286
334
  declare type OverlayedAppInputModuleRaw = {
287
- /**
288
- * Block the game from receiving mouse input.
289
- *
290
- * @param block Whether to block mouse input.
291
- */
292
- setGlobalMouseBlock(block: boolean): void;
293
- /**
294
- * Block the game from receiving keyboard input.
295
- *
296
- * @param block Whether to block keyboard input.
297
- */
298
- setGlobalKeyboardBlock(block: boolean): void;
299
- /**
300
- * Show or hide the cursor.
301
- *
302
- * @param show Whether to show or hide the cursor.
303
- */
304
- setGlobalCursorOverride(show: boolean): void;
305
- /**
306
- * Block the game from receiving input for a specific key.
307
- *
308
- * @param key The key to block input for.
309
- * @param block Whether to block input for the key.
310
- */
311
- setKeyInputBlock(key: VirtualKey, block: boolean): void;
312
- /**
313
- * Get the current state of the global mouse block.
314
- */
315
- getGlobalMouseBlock(): boolean;
316
- /**
317
- * Get the current state of the global keyboard block.
318
- */
319
- getGlobalKeyboardBlock(): boolean;
320
- /**
321
- * Get the current state of the global cursor override.
322
- */
323
- getGlobalCursorOverride(): boolean;
324
- /**
325
- * Get the current state of the key input block for a specific key.
326
- * @param key The key to block input for.
327
- */
328
- getKeyInputBlock(key: VirtualKey): boolean;
335
+ /**
336
+ * Block the game from receiving mouse input.
337
+ *
338
+ * @param block Whether to block mouse input.
339
+ */
340
+ setGlobalMouseBlock(block: boolean): void;
341
+ /**
342
+ * Block the game from receiving keyboard input.
343
+ *
344
+ * @param block Whether to block keyboard input.
345
+ */
346
+ setGlobalKeyboardBlock(block: boolean): void;
347
+ /**
348
+ * Show or hide the cursor.
349
+ *
350
+ * @param show Whether to show or hide the cursor.
351
+ */
352
+ setGlobalCursorOverride(show: boolean): void;
353
+ /**
354
+ * Block the game from receiving input for a specific key.
355
+ *
356
+ * @param key The key to block input for.
357
+ * @param block Whether to block input for the key.
358
+ */
359
+ setKeyInputBlock(key: VirtualKey, block: boolean): void;
360
+ /**
361
+ * Get the current state of the global mouse block.
362
+ */
363
+ getGlobalMouseBlock(): boolean;
364
+ /**
365
+ * Get the current state of the global keyboard block.
366
+ */
367
+ getGlobalKeyboardBlock(): boolean;
368
+ /**
369
+ * Get the current state of the global cursor override.
370
+ */
371
+ getGlobalCursorOverride(): boolean;
372
+ /**
373
+ * Get the current state of the key input block for a specific key.
374
+ * @param key The key to block input for.
375
+ */
376
+ getKeyInputBlock(key: VirtualKey): boolean;
329
377
  };
330
378
 
331
- declare type OverlayedAppKeybindModule<TKeybind extends string> = Record<TKeybind, {
332
- on: <TEvent extends "down" | "up" | "toggle">(event: TEvent, cb: KeybindCallbacks[TEvent]) => void;
333
- }> & {
334
- /**
335
- * Get the current user keybinds.
336
- */
337
- getConfig: () => OverlayedAppKeybindsConfig<TKeybind>;
338
- /**
339
- * Pause keybind listening. Essential for pausing keybind listening when recording new keybinds.
340
- */
341
- pauseKeybindListening: () => void;
342
- /**
343
- * Resume keybind listening. Essential for resuming keybind listening after recording new keybinds.
344
- */
345
- resumeKeybindListening: () => void;
346
- /**
347
- * Update a single keybind.
348
- *
349
- * @param keybind The keybind to update.
350
- * @param keybindConfig The new keybind config.
351
- */
352
- updateKeybind: (keybind: TKeybind, keybindConfig: OverlayedAppKeybindsConfig<TKeybind>[TKeybind]) => void;
353
- /**
354
- * Bulk update keybinds.
355
- *
356
- * @param keybinds The keybinds to update. Keybind keys not provided will not be updated.
357
- */
358
- updateKeybinds: (keybinds: Partial<OverlayedAppKeybindsConfig<TKeybind>>) => void;
379
+ declare type OverlayedAppKeybindModule<TKeybind extends string> = Record<
380
+ TKeybind,
381
+ {
382
+ on: <TEvent extends "down" | "up" | "toggle">(event: TEvent, cb: KeybindCallbacks[TEvent]) => void;
383
+ }
384
+ > & {
385
+ /**
386
+ * Get the current user keybinds.
387
+ */
388
+ getConfig: () => OverlayedAppKeybindsConfig<TKeybind>;
389
+ /**
390
+ * Pause keybind listening. Essential for pausing keybind listening when recording new keybinds.
391
+ */
392
+ pauseKeybindListening: () => void;
393
+ /**
394
+ * Resume keybind listening. Essential for resuming keybind listening after recording new keybinds.
395
+ */
396
+ resumeKeybindListening: () => void;
397
+ /**
398
+ * Update a single keybind.
399
+ *
400
+ * @param keybind The keybind to update.
401
+ * @param keybindConfig The new keybind config.
402
+ */
403
+ updateKeybind: (keybind: TKeybind, keybindConfig: OverlayedAppKeybindsConfig<TKeybind>[TKeybind]) => void;
404
+ /**
405
+ * Bulk update keybinds.
406
+ *
407
+ * @param keybinds The keybinds to update. Keybind keys not provided will not be updated.
408
+ */
409
+ updateKeybinds: (keybinds: Partial<OverlayedAppKeybindsConfig<TKeybind>>) => void;
359
410
  };
360
411
 
361
- declare type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<TKeybind, {
362
- /**
363
- * - An array of [KeyboardEvent#code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code)
364
- * - Whatever you configure will be the default value
365
- * - [Here](https://www.toptal.com/developers/keycode) is a good tool to easily find the codes for a given hotkey
366
- */
367
- keys: OverlayedAppKeybindsConfigKey[];
368
- /**
369
- * - `toggle` will trigger the callback when the key is toggled on and off
370
- * - `hold` will trigger the callback when the key is held down
371
- * - This can be updated at runtime
372
- */
373
- mode: OverlayedAppKeybindsConfigMode;
374
- }>;
375
-
376
- declare type OverlayedAppKeybindsConfigKey = "ControlLeft" | "AltLeft" | "ShiftLeft" | "AltRight" | "ControlRight" | "ShiftRight" | (string & {});
412
+ declare type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<
413
+ TKeybind,
414
+ {
415
+ /**
416
+ * - An array of [KeyboardEvent#code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code)
417
+ * - Whatever you configure will be the default value
418
+ * - [Here](https://www.toptal.com/developers/keycode) is a good tool to easily find the codes for a given hotkey
419
+ */
420
+ keys: OverlayedAppKeybindsConfigKey[];
421
+ /**
422
+ * - `toggle` will trigger the callback when the key is toggled on and off
423
+ * - `hold` will trigger the callback when the key is held down
424
+ * - This can be updated at runtime
425
+ */
426
+ mode: OverlayedAppKeybindsConfigMode;
427
+ }
428
+ >;
429
+
430
+ declare type OverlayedAppKeybindsConfigKey =
431
+ | "ControlLeft"
432
+ | "AltLeft"
433
+ | "ShiftLeft"
434
+ | "AltRight"
435
+ | "ControlRight"
436
+ | "ShiftRight"
437
+ | (string & {});
377
438
 
378
439
  declare type OverlayedAppKeybindsConfigMode = "toggle" | "hold";
379
440
 
380
- declare interface OverlayedAppWindowsModule extends Pick<RenderInterface, "on" | "off" | "once" | "addListener" | "prependListener" | "prependOnceListener" | "removeListener" | "removeAllListeners"> {
381
- createWindow(options: RenderWindowConstructorOptions): RenderWindow;
382
- getActiveGameInfo: () => ActiveGameInfo;
441
+ declare interface OverlayedAppWindowsModule
442
+ extends Pick<
443
+ RenderInterface,
444
+ | "on"
445
+ | "off"
446
+ | "once"
447
+ | "addListener"
448
+ | "prependListener"
449
+ | "prependOnceListener"
450
+ | "removeListener"
451
+ | "removeAllListeners"
452
+ > {
453
+ createWindow(options: RenderWindowConstructorOptions): RenderWindow;
454
+ getActiveGameInfo: () => ActiveGameInfo;
383
455
  }
384
456
 
385
457
  declare interface OverlayedOptions<TModule extends GameModule, TKeybind extends string> {
386
- /**
387
- * The electron instance.
388
- *
389
- * Must be imported globally like:
390
- * ```ts
391
- * import { electron } from "electron";
392
- * ```
393
- * or
394
- * ```ts
395
- * const electron = require("electron");
396
- * ```
397
- */
398
- electron: electron;
399
- /**
400
- * The application id, this can be found in the [Overlayed Dashboard](https://dashboard.overlayed.gg/settings/applications).
401
- */
402
- applicationId: string;
403
- /**
404
- * App modules to load.
405
- */
406
- modules: TModule[];
407
- /**
408
- * App keybinds config.
409
- */
410
- keybinds: OverlayedAppKeybindsConfig<TKeybind>;
411
- /**
412
- * Whether to initialize the app when the module is loaded.
413
- * @default true;
414
- */
415
- init?: boolean;
416
- /**
417
- * When true, the overlay will be loaded for all supported games.
418
- * When false, only games registered under the `modules` array will be loaded.
419
- *
420
- * @default false
421
- */
422
- universal?: boolean;
423
- /**
424
- * @deprecated
425
- */
426
- channel?: string;
458
+ /**
459
+ * The electron instance.
460
+ *
461
+ * Must be imported globally like:
462
+ * ```ts
463
+ * import { electron } from "electron";
464
+ * ```
465
+ * or
466
+ * ```ts
467
+ * const electron = require("electron");
468
+ * ```
469
+ */
470
+ electron: electron;
471
+ /**
472
+ * The application id, this can be found in the [Overlayed Dashboard](https://dashboard.overlayed.gg/settings/applications).
473
+ */
474
+ applicationId: string;
475
+ /**
476
+ * App modules to load.
477
+ */
478
+ modules: TModule[];
479
+ /**
480
+ * App keybinds config.
481
+ */
482
+ keybinds: OverlayedAppKeybindsConfig<TKeybind>;
483
+ /**
484
+ * Whether to initialize the app when the module is loaded.
485
+ * @default true;
486
+ */
487
+ init?: boolean;
488
+ /**
489
+ * When true, the overlay will be loaded for all supported games.
490
+ * When false, only games registered under the `modules` array will be loaded.
491
+ *
492
+ * @default false
493
+ */
494
+ universal?: boolean;
495
+ /**
496
+ * @deprecated
497
+ */
498
+ channel?: string;
427
499
  }
428
500
 
429
501
  declare class OverridesManager extends Manager {
430
- private renderInterface;
431
- private globalCursorOverrideCount;
432
- private globalMouseBlockCount;
433
- private globalKeyboardBlockCount;
434
- private keyInputBlocks;
435
- constructor(interfaceName: RenderInterfaceName);
436
- scope(scopeName: string): OverridesManagerScope;
437
- private setGlobalCursorOverride;
438
- private setGlobalMouseBlock;
439
- private setGlobalKeyboardBlock;
440
- private setKeyInputBlock;
502
+ private renderInterface;
503
+ private globalCursorOverrideCount;
504
+ private globalMouseBlockCount;
505
+ private globalKeyboardBlockCount;
506
+ private keyInputBlocks;
507
+ constructor(interfaceName: RenderInterfaceName);
508
+ scope(scopeName: string): OverridesManagerScope;
509
+ private setGlobalCursorOverride;
510
+ private setGlobalMouseBlock;
511
+ private setGlobalKeyboardBlock;
512
+ private setKeyInputBlock;
441
513
  }
442
514
 
443
515
  export declare interface OverridesManagerScope {
444
- setGlobalCursorOverride: (override: boolean) => void;
445
- setGlobalMouseBlock: (block: boolean) => void;
446
- setGlobalKeyboardBlock: (block: boolean) => void;
447
- setKeyInputBlock: (key: number, block: boolean) => void;
516
+ setGlobalCursorOverride: (override: boolean) => void;
517
+ setGlobalMouseBlock: (block: boolean) => void;
518
+ setGlobalKeyboardBlock: (block: boolean) => void;
519
+ setKeyInputBlock: (key: number, block: boolean) => void;
448
520
  }
449
521
 
450
522
  export class RenderInterface {
451
- constructor(name: String, options?: { maxWindowCount?: number; eventQueueSize?: number; access?: AccessLevel }); // default: { maxWindowCount: 10, eventQueueSize: 200, access: AccessLevel.Default }
452
-
453
- newWindowInternal(browserWindow: Electron.BrowserWindow, options?: RenderWindowConstructorOptions): RenderWindow;
454
-
455
- getGlobalMouseBlock(): boolean;
456
- getGlobalKeyboardBlock(): boolean;
457
- getGlobalCursorOverride(): boolean;
458
- getKeyInputBlock(key: VirtualKey): boolean;
459
-
460
- setGlobalMouseBlock(block: boolean): void;
461
- setGlobalKeyboardBlock(block: boolean): void;
462
- setGlobalCursorOverride(show: boolean): void;
463
- setKeyInputBlock(key: VirtualKey, block: boolean): void;
464
-
465
- eventNames(): string[];
466
- getMaxListeners(): number;
467
- removeAllListeners(): this;
468
-
469
- listeners(eventName: "keyDown"): Function[];
470
- rawListeners(eventName: "keyDown"): Function[];
471
- listenerCount(eventName: "keyDown", listener?: (event: KeyboardKeyEvent) => void): number;
472
-
473
- on(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
474
- once(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
475
- addListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
476
- prependListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
477
- prependOnceListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
478
-
479
- off(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
480
- removeListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
481
- removeAllListeners(eventName: "keyDown"): this;
482
-
483
- listeners(eventName: "keyUp"): Function[];
484
- rawListeners(eventName: "keyUp"): Function[];
485
- listenerCount(eventName: "keyUp", listener?: (event: KeyboardKeyEvent) => void): number;
486
-
487
- on(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
488
- once(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
489
- addListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
490
- prependListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
491
- prependOnceListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
492
-
493
- off(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
494
- removeListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
495
- removeAllListeners(eventName: "keyUp"): this;
496
-
497
- listeners(eventName: "mouseDown"): Function[];
498
- rawListeners(eventName: "mouseDown"): Function[];
499
- listenerCount(eventName: "mouseDown", listener?: (event: MouseButtonEvent) => void): number;
500
-
501
- on(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
502
- once(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
503
- addListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
504
- prependListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
505
- prependOnceListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
506
-
507
- off(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
508
- removeListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
509
- removeAllListeners(eventName: "mouseDown"): this;
510
-
511
- listeners(eventName: "mouseUp"): Function[];
512
- rawListeners(eventName: "mouseUp"): Function[];
513
- listenerCount(eventName: "mouseUp", listener?: (event: MouseButtonEvent) => void): number;
514
-
515
- on(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
516
- once(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
517
- addListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
518
- prependListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
519
- prependOnceListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
520
-
521
- off(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
522
- removeListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
523
- removeAllListeners(eventName: "mouseUp"): this;
524
-
525
- listeners(eventName: "resolution"): Function[];
526
- rawListeners(eventName: "resolution"): Function[];
527
- listenerCount(eventName: "resolution", listener?: (width: number, height: number) => void): number;
528
-
529
- on(eventName: "resolution", listener: (width: number, height: number) => void): this;
530
- once(eventName: "resolution", listener: (width: number, height: number) => void): this;
531
- addListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
532
- prependListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
533
- prependOnceListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
534
-
535
- off(eventName: "resolution", listener: (width: number, height: number) => void): this;
536
- removeListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
537
- removeAllListeners(eventName: "resolution"): this;
538
-
539
- listeners(eventName: "keyboardFocus"): Function[];
540
- rawListeners(eventName: "keyboardFocus"): Function[];
541
- listenerCount(eventName: "keyboardFocus", listener?: (focus: boolean) => void): number;
542
-
543
- on(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
544
- once(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
545
- addListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
546
- prependListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
547
- prependOnceListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
548
-
549
- off(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
550
- removeListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
551
- removeAllListeners(eventName: "keyboardFocus"): this;
552
- }
523
+ constructor(name: String, options?: { maxWindowCount?: number; eventQueueSize?: number; access?: AccessLevel }); // default: { maxWindowCount: 10, eventQueueSize: 200, access: AccessLevel.Default }
524
+
525
+ newWindowInternal(browserWindow: Electron.BrowserWindow, options?: RenderWindowConstructorOptions): RenderWindow;
526
+
527
+ getGlobalMouseBlock(): boolean;
528
+ getGlobalKeyboardBlock(): boolean;
529
+ getGlobalCursorOverride(): boolean;
530
+ getKeyInputBlock(key: VirtualKey): boolean;
531
+
532
+ setGlobalMouseBlock(block: boolean): void;
533
+ setGlobalKeyboardBlock(block: boolean): void;
534
+ setGlobalCursorOverride(show: boolean): void;
535
+ setKeyInputBlock(key: VirtualKey, block: boolean): void;
536
+
537
+ eventNames(): string[];
538
+ getMaxListeners(): number;
539
+ removeAllListeners(): this;
540
+
541
+ listeners(eventName: "keyDown"): Function[];
542
+ rawListeners(eventName: "keyDown"): Function[];
543
+ listenerCount(eventName: "keyDown", listener?: (event: KeyboardKeyEvent) => void): number;
544
+
545
+ on(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
546
+ once(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
547
+ addListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
548
+ prependListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
549
+ prependOnceListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
550
+
551
+ off(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
552
+ removeListener(eventName: "keyDown", listener: (event: KeyboardKeyEvent) => void): this;
553
+ removeAllListeners(eventName: "keyDown"): this;
554
+
555
+ listeners(eventName: "keyUp"): Function[];
556
+ rawListeners(eventName: "keyUp"): Function[];
557
+ listenerCount(eventName: "keyUp", listener?: (event: KeyboardKeyEvent) => void): number;
558
+
559
+ on(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
560
+ once(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
561
+ addListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
562
+ prependListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
563
+ prependOnceListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
564
+
565
+ off(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
566
+ removeListener(eventName: "keyUp", listener: (event: KeyboardKeyEvent) => void): this;
567
+ removeAllListeners(eventName: "keyUp"): this;
568
+
569
+ listeners(eventName: "mouseDown"): Function[];
570
+ rawListeners(eventName: "mouseDown"): Function[];
571
+ listenerCount(eventName: "mouseDown", listener?: (event: MouseButtonEvent) => void): number;
572
+
573
+ on(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
574
+ once(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
575
+ addListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
576
+ prependListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
577
+ prependOnceListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
578
+
579
+ off(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
580
+ removeListener(eventName: "mouseDown", listener: (event: MouseButtonEvent) => void): this;
581
+ removeAllListeners(eventName: "mouseDown"): this;
582
+
583
+ listeners(eventName: "mouseUp"): Function[];
584
+ rawListeners(eventName: "mouseUp"): Function[];
585
+ listenerCount(eventName: "mouseUp", listener?: (event: MouseButtonEvent) => void): number;
586
+
587
+ on(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
588
+ once(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
589
+ addListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
590
+ prependListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
591
+ prependOnceListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
592
+
593
+ off(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
594
+ removeListener(eventName: "mouseUp", listener: (event: MouseButtonEvent) => void): this;
595
+ removeAllListeners(eventName: "mouseUp"): this;
596
+
597
+ listeners(eventName: "resolution"): Function[];
598
+ rawListeners(eventName: "resolution"): Function[];
599
+ listenerCount(eventName: "resolution", listener?: (width: number, height: number) => void): number;
600
+
601
+ on(eventName: "resolution", listener: (width: number, height: number) => void): this;
602
+ once(eventName: "resolution", listener: (width: number, height: number) => void): this;
603
+ addListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
604
+ prependListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
605
+ prependOnceListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
606
+
607
+ off(eventName: "resolution", listener: (width: number, height: number) => void): this;
608
+ removeListener(eventName: "resolution", listener: (width: number, height: number) => void): this;
609
+ removeAllListeners(eventName: "resolution"): this;
610
+
611
+ listeners(eventName: "keyboardFocus"): Function[];
612
+ rawListeners(eventName: "keyboardFocus"): Function[];
613
+ listenerCount(eventName: "keyboardFocus", listener?: (focus: boolean) => void): number;
614
+
615
+ on(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
616
+ once(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
617
+ addListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
618
+ prependListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
619
+ prependOnceListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
620
+
621
+ off(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
622
+ removeListener(eventName: "keyboardFocus", listener: (focus: boolean) => void): this;
623
+ removeAllListeners(eventName: "keyboardFocus"): this;
624
+ }
553
625
 
554
626
  declare type RenderInterfaceName = "OGG_SIEGE";
555
627
 
556
628
  export interface RenderWindow extends Electron.BrowserWindow {
557
- getLayer(): number;
558
- getInput(): boolean;
559
- getInputBlock(): boolean;
560
- getCursorOverride(): boolean;
561
-
562
- setLayer(layer: number): void;
563
- setInput(input: boolean): void;
564
- setInputBlock(block: boolean): void;
565
- setCursorOverride(override: boolean): void;
566
- }
629
+ getLayer(): number;
630
+ getInput(): boolean;
631
+ getInputBlock(): boolean;
632
+ getCursorOverride(): boolean;
633
+
634
+ setLayer(layer: number): void;
635
+ setInput(input: boolean): void;
636
+ setInputBlock(block: boolean): void;
637
+ setCursorOverride(override: boolean): void;
638
+ }
567
639
 
568
640
  export interface RenderWindowConstructorOptions extends Electron.BrowserWindowConstructorOptions {
569
- layer?: number; // default: 0
641
+ layer?: number; // default: 0
570
642
 
571
- createForeground?: boolean; // default: true
643
+ createForeground?: boolean; // default: true
572
644
 
573
- hasInput?: boolean; // default: true
574
- hasInputBlock?: boolean; // default: true
575
- hasCursorOverride?: boolean; // default: true
576
- }
645
+ hasInput?: boolean; // default: true
646
+ hasInputBlock?: boolean; // default: true
647
+ hasCursorOverride?: boolean; // default: true
648
+ }
577
649
 
578
650
  export declare function setFetchLatestTokenCallback(newFetchLatestToken: () => Promise<unknown> | undefined): void;
579
651
 
580
652
  export declare function setUpdaterTokenResolver(newTokenResolver: () => string | undefined): void;
581
653
 
582
654
  export const enum VirtualKey {
583
- LeftButton = 0x01,
584
- RightButton = 0x02,
585
- Cancel = 0x03,
586
- MiddleButton = 0x04,
587
- ExtraButton1 = 0x05,
588
- ExtraButton2 = 0x06,
589
- Back = 0x08,
590
- Tab = 0x09,
591
- Clear = 0x0c,
592
- Return = 0x0d,
593
- Shift = 0x10,
594
- Control = 0x11,
595
- Menu = 0x12,
596
- Pause = 0x13,
597
- CapsLock = 0x14,
598
- Kana = 0x15,
599
- Hangeul = 0x15,
600
- Hangul = 0x15,
601
- Junja = 0x17,
602
- Final = 0x18,
603
- Hanja = 0x19,
604
- Kanji = 0x19,
605
- Escape = 0x1b,
606
- Convert = 0x1c,
607
- NonConvert = 0x1d,
608
- Accept = 0x1e,
609
- ModeChange = 0x1f,
610
- Space = 0x20,
611
- Prior = 0x21,
612
- Next = 0x22,
613
- End = 0x23,
614
- Home = 0x24,
615
- Left = 0x25,
616
- Up = 0x26,
617
- Right = 0x27,
618
- Down = 0x28,
619
- Select = 0x29,
620
- Print = 0x2a,
621
- Execute = 0x2b,
622
- Snapshot = 0x2c,
623
- Insert = 0x2d,
624
- Delete = 0x2e,
625
- Help = 0x2f,
626
- N0 = 0x30,
627
- N1 = 0x31,
628
- N2 = 0x32,
629
- N3 = 0x33,
630
- N4 = 0x34,
631
- N5 = 0x35,
632
- N6 = 0x36,
633
- N7 = 0x37,
634
- N8 = 0x38,
635
- N9 = 0x39,
636
- A = 0x41,
637
- B = 0x42,
638
- C = 0x43,
639
- D = 0x44,
640
- E = 0x45,
641
- F = 0x46,
642
- G = 0x47,
643
- H = 0x48,
644
- I = 0x49,
645
- J = 0x4a,
646
- K = 0x4b,
647
- L = 0x4c,
648
- M = 0x4d,
649
- N = 0x4e,
650
- O = 0x4f,
651
- P = 0x50,
652
- Q = 0x51,
653
- R = 0x52,
654
- S = 0x53,
655
- T = 0x54,
656
- U = 0x55,
657
- V = 0x56,
658
- W = 0x57,
659
- X = 0x58,
660
- Y = 0x59,
661
- Z = 0x5a,
662
- LeftWindows = 0x5b,
663
- RightWindows = 0x5c,
664
- Application = 0x5d,
665
- Sleep = 0x5f,
666
- Numpad0 = 0x60,
667
- Numpad1 = 0x61,
668
- Numpad2 = 0x62,
669
- Numpad3 = 0x63,
670
- Numpad4 = 0x64,
671
- Numpad5 = 0x65,
672
- Numpad6 = 0x66,
673
- Numpad7 = 0x67,
674
- Numpad8 = 0x68,
675
- Numpad9 = 0x69,
676
- Multiply = 0x6a,
677
- Add = 0x6b,
678
- Separator = 0x6c,
679
- Subtract = 0x6d,
680
- Decimal = 0x6e,
681
- Divide = 0x6f,
682
- F1 = 0x70,
683
- F2 = 0x71,
684
- F3 = 0x72,
685
- F4 = 0x73,
686
- F5 = 0x74,
687
- F6 = 0x75,
688
- F7 = 0x76,
689
- F8 = 0x77,
690
- F9 = 0x78,
691
- F10 = 0x79,
692
- F11 = 0x7a,
693
- F12 = 0x7b,
694
- F13 = 0x7c,
695
- F14 = 0x7d,
696
- F15 = 0x7e,
697
- F16 = 0x7f,
698
- F17 = 0x80,
699
- F18 = 0x81,
700
- F19 = 0x82,
701
- F20 = 0x83,
702
- F21 = 0x84,
703
- F22 = 0x85,
704
- F23 = 0x86,
705
- F24 = 0x87,
706
- NumLock = 0x90,
707
- ScrollLock = 0x91,
708
- NEC_Equal = 0x92,
709
- Fujitsu_Jisho = 0x92,
710
- Fujitsu_Masshou = 0x93,
711
- Fujitsu_Touroku = 0x94,
712
- Fujitsu_Loya = 0x95,
713
- Fujitsu_Roya = 0x96,
714
- LeftShift = 0xa0,
715
- RightShift = 0xa1,
716
- LeftControl = 0xa2,
717
- RightControl = 0xa3,
718
- LeftMenu = 0xa4,
719
- RightMenu = 0xa5,
720
- BrowserBack = 0xa6,
721
- BrowserForward = 0xa7,
722
- BrowserRefresh = 0xa8,
723
- BrowserStop = 0xa9,
724
- BrowserSearch = 0xaa,
725
- BrowserFavorites = 0xab,
726
- BrowserHome = 0xac,
727
- VolumeMute = 0xad,
728
- VolumeDown = 0xae,
729
- VolumeUp = 0xaf,
730
- MediaNextTrack = 0xb0,
731
- MediaPrevTrack = 0xb1,
732
- MediaStop = 0xb2,
733
- MediaPlayPause = 0xb3,
734
- LaunchMail = 0xb4,
735
- LaunchMediaSelect = 0xb5,
736
- LaunchApplication1 = 0xb6,
737
- LaunchApplication2 = 0xb7,
738
- OEM1 = 0xba,
739
- OEMPlus = 0xbb,
740
- OEMComma = 0xbc,
741
- OEMMinus = 0xbd,
742
- OEMPeriod = 0xbe,
743
- OEM2 = 0xbf,
744
- OEM3 = 0xc0,
745
- OEM4 = 0xdb,
746
- OEM5 = 0xdc,
747
- OEM6 = 0xdd,
748
- OEM7 = 0xde,
749
- OEM8 = 0xdf,
750
- OEMAX = 0xe1,
751
- OEM102 = 0xe2,
752
- ICOHelp = 0xe3,
753
- ICO00 = 0xe4,
754
- ProcessKey = 0xe5,
755
- ICOClear = 0xe6,
756
- Packet = 0xe7,
757
- OEMReset = 0xe9,
758
- OEMJump = 0xea,
759
- OEMPA1 = 0xeb,
760
- OEMPA2 = 0xec,
761
- OEMPA3 = 0xed,
762
- OEMWSCtrl = 0xee,
763
- OEMCUSel = 0xef,
764
- OEMATTN = 0xf0,
765
- OEMFinish = 0xf1,
766
- OEMCopy = 0xf2,
767
- OEMAuto = 0xf3,
768
- OEMENLW = 0xf4,
769
- OEMBackTab = 0xf5,
770
- ATTN = 0xf6,
771
- CRSel = 0xf7,
772
- EXSel = 0xf8,
773
- EREOF = 0xf9,
774
- Play = 0xfa,
775
- Zoom = 0xfb,
776
- Noname = 0xfc,
777
- PA1 = 0xfd,
778
- OEMClear = 0xfe,
779
- }
655
+ LeftButton = 0x01,
656
+ RightButton = 0x02,
657
+ Cancel = 0x03,
658
+ MiddleButton = 0x04,
659
+ ExtraButton1 = 0x05,
660
+ ExtraButton2 = 0x06,
661
+ Back = 0x08,
662
+ Tab = 0x09,
663
+ Clear = 0x0c,
664
+ Return = 0x0d,
665
+ Shift = 0x10,
666
+ Control = 0x11,
667
+ Menu = 0x12,
668
+ Pause = 0x13,
669
+ CapsLock = 0x14,
670
+ Kana = 0x15,
671
+ Hangeul = 0x15,
672
+ Hangul = 0x15,
673
+ Junja = 0x17,
674
+ Final = 0x18,
675
+ Hanja = 0x19,
676
+ Kanji = 0x19,
677
+ Escape = 0x1b,
678
+ Convert = 0x1c,
679
+ NonConvert = 0x1d,
680
+ Accept = 0x1e,
681
+ ModeChange = 0x1f,
682
+ Space = 0x20,
683
+ Prior = 0x21,
684
+ Next = 0x22,
685
+ End = 0x23,
686
+ Home = 0x24,
687
+ Left = 0x25,
688
+ Up = 0x26,
689
+ Right = 0x27,
690
+ Down = 0x28,
691
+ Select = 0x29,
692
+ Print = 0x2a,
693
+ Execute = 0x2b,
694
+ Snapshot = 0x2c,
695
+ Insert = 0x2d,
696
+ Delete = 0x2e,
697
+ Help = 0x2f,
698
+ N0 = 0x30,
699
+ N1 = 0x31,
700
+ N2 = 0x32,
701
+ N3 = 0x33,
702
+ N4 = 0x34,
703
+ N5 = 0x35,
704
+ N6 = 0x36,
705
+ N7 = 0x37,
706
+ N8 = 0x38,
707
+ N9 = 0x39,
708
+ A = 0x41,
709
+ B = 0x42,
710
+ C = 0x43,
711
+ D = 0x44,
712
+ E = 0x45,
713
+ F = 0x46,
714
+ G = 0x47,
715
+ H = 0x48,
716
+ I = 0x49,
717
+ J = 0x4a,
718
+ K = 0x4b,
719
+ L = 0x4c,
720
+ M = 0x4d,
721
+ N = 0x4e,
722
+ O = 0x4f,
723
+ P = 0x50,
724
+ Q = 0x51,
725
+ R = 0x52,
726
+ S = 0x53,
727
+ T = 0x54,
728
+ U = 0x55,
729
+ V = 0x56,
730
+ W = 0x57,
731
+ X = 0x58,
732
+ Y = 0x59,
733
+ Z = 0x5a,
734
+ LeftWindows = 0x5b,
735
+ RightWindows = 0x5c,
736
+ Application = 0x5d,
737
+ Sleep = 0x5f,
738
+ Numpad0 = 0x60,
739
+ Numpad1 = 0x61,
740
+ Numpad2 = 0x62,
741
+ Numpad3 = 0x63,
742
+ Numpad4 = 0x64,
743
+ Numpad5 = 0x65,
744
+ Numpad6 = 0x66,
745
+ Numpad7 = 0x67,
746
+ Numpad8 = 0x68,
747
+ Numpad9 = 0x69,
748
+ Multiply = 0x6a,
749
+ Add = 0x6b,
750
+ Separator = 0x6c,
751
+ Subtract = 0x6d,
752
+ Decimal = 0x6e,
753
+ Divide = 0x6f,
754
+ F1 = 0x70,
755
+ F2 = 0x71,
756
+ F3 = 0x72,
757
+ F4 = 0x73,
758
+ F5 = 0x74,
759
+ F6 = 0x75,
760
+ F7 = 0x76,
761
+ F8 = 0x77,
762
+ F9 = 0x78,
763
+ F10 = 0x79,
764
+ F11 = 0x7a,
765
+ F12 = 0x7b,
766
+ F13 = 0x7c,
767
+ F14 = 0x7d,
768
+ F15 = 0x7e,
769
+ F16 = 0x7f,
770
+ F17 = 0x80,
771
+ F18 = 0x81,
772
+ F19 = 0x82,
773
+ F20 = 0x83,
774
+ F21 = 0x84,
775
+ F22 = 0x85,
776
+ F23 = 0x86,
777
+ F24 = 0x87,
778
+ NumLock = 0x90,
779
+ ScrollLock = 0x91,
780
+ NEC_Equal = 0x92,
781
+ Fujitsu_Jisho = 0x92,
782
+ Fujitsu_Masshou = 0x93,
783
+ Fujitsu_Touroku = 0x94,
784
+ Fujitsu_Loya = 0x95,
785
+ Fujitsu_Roya = 0x96,
786
+ LeftShift = 0xa0,
787
+ RightShift = 0xa1,
788
+ LeftControl = 0xa2,
789
+ RightControl = 0xa3,
790
+ LeftMenu = 0xa4,
791
+ RightMenu = 0xa5,
792
+ BrowserBack = 0xa6,
793
+ BrowserForward = 0xa7,
794
+ BrowserRefresh = 0xa8,
795
+ BrowserStop = 0xa9,
796
+ BrowserSearch = 0xaa,
797
+ BrowserFavorites = 0xab,
798
+ BrowserHome = 0xac,
799
+ VolumeMute = 0xad,
800
+ VolumeDown = 0xae,
801
+ VolumeUp = 0xaf,
802
+ MediaNextTrack = 0xb0,
803
+ MediaPrevTrack = 0xb1,
804
+ MediaStop = 0xb2,
805
+ MediaPlayPause = 0xb3,
806
+ LaunchMail = 0xb4,
807
+ LaunchMediaSelect = 0xb5,
808
+ LaunchApplication1 = 0xb6,
809
+ LaunchApplication2 = 0xb7,
810
+ OEM1 = 0xba,
811
+ OEMPlus = 0xbb,
812
+ OEMComma = 0xbc,
813
+ OEMMinus = 0xbd,
814
+ OEMPeriod = 0xbe,
815
+ OEM2 = 0xbf,
816
+ OEM3 = 0xc0,
817
+ OEM4 = 0xdb,
818
+ OEM5 = 0xdc,
819
+ OEM6 = 0xdd,
820
+ OEM7 = 0xde,
821
+ OEM8 = 0xdf,
822
+ OEMAX = 0xe1,
823
+ OEM102 = 0xe2,
824
+ ICOHelp = 0xe3,
825
+ ICO00 = 0xe4,
826
+ ProcessKey = 0xe5,
827
+ ICOClear = 0xe6,
828
+ Packet = 0xe7,
829
+ OEMReset = 0xe9,
830
+ OEMJump = 0xea,
831
+ OEMPA1 = 0xeb,
832
+ OEMPA2 = 0xec,
833
+ OEMPA3 = 0xed,
834
+ OEMWSCtrl = 0xee,
835
+ OEMCUSel = 0xef,
836
+ OEMATTN = 0xf0,
837
+ OEMFinish = 0xf1,
838
+ OEMCopy = 0xf2,
839
+ OEMAuto = 0xf3,
840
+ OEMENLW = 0xf4,
841
+ OEMBackTab = 0xf5,
842
+ ATTN = 0xf6,
843
+ CRSel = 0xf7,
844
+ EXSel = 0xf8,
845
+ EREOF = 0xf9,
846
+ Play = 0xfa,
847
+ Zoom = 0xfb,
848
+ Noname = 0xfc,
849
+ PA1 = 0xfd,
850
+ OEMClear = 0xfe,
851
+ }
780
852
 
781
853
  declare type WarningEvents = WarningInvalidEvent;
782
854
 
783
855
  declare interface WarningInvalidEvent extends ErrorManagerEvent {
784
- code: "INVALID_EVENT";
785
- data: {
786
- summary: string;
787
- };
856
+ code: "INVALID_EVENT";
857
+ data: {
858
+ summary: string;
859
+ };
788
860
  }
789
861
 
790
862
  export interface WindowEvent {
791
- window?: RenderWindow;
792
- }
793
-
794
- export { }
795
-
796
- declare global {
797
- namespace Electron {
798
- interface BrowserWindow {
799
- isShown(): boolean;
800
- }
801
- }
802
- }
803
-
863
+ window?: RenderWindow;
864
+ }
865
+
866
+ export {};
867
+
868
+ declare global {
869
+ namespace Electron {
870
+ interface BrowserWindow {
871
+ isShown(): boolean;
872
+ }
873
+ }
874
+ }