@overlayed/app 0.14.0 → 0.15.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,23 +1,12 @@
1
1
  import * as arktype0 from "arktype";
2
2
  import { Module, Type } from "arktype";
3
3
  import EventEmitter$1 from "events";
4
+ import "xior";
4
5
  import * as electron0 from "electron";
5
- import { BrowserWindow } from "electron";
6
+ import { BrowserWindow, BrowserWindowConstructorOptions } from "electron";
6
7
  import * as arktype_internal_methods_object_ts0 from "arktype/internal/methods/object.ts";
7
8
  import { Process } from "@overlayed-gg/native-interface";
8
- import {
9
- AccessLevel,
10
- KeyboardKeyEvent,
11
- MouseButtonEvent,
12
- RenderInterface,
13
- RenderInterface as RenderInterface$1,
14
- RenderWindow,
15
- RenderWindow as RenderWindow$1,
16
- RenderWindowConstructorOptions,
17
- RenderWindowConstructorOptions as RenderWindowConstructorOptions$1,
18
- VirtualKey,
19
- WindowEvent,
20
- } from "@overlayed-gg/render-interface";
9
+ import { AccessLevel, KeyboardKeyEvent, MouseButtonEvent, RenderInterface, RenderInterface as RenderInterface$1, RenderWindow, RenderWindow as RenderWindow$1, RenderWindowConstructorOptions, RenderWindowConstructorOptions as RenderWindowConstructorOptions$1, VirtualKey, WindowEvent } from "@overlayed-gg/render-interface";
21
10
 
22
11
  //#region ../utils/dist/index.d.ts
23
12
  type MaybePromise<T> = T | Promise<T>;
@@ -29,72 +18,72 @@ type Result<T, E = string> = [T, undefined] | [undefined, E];
29
18
  //#endregion
30
19
  //#region src/brand.d.ts
31
20
  /**
32
- * A `Brand` is a type that takes at minimum two type parameters. Given a base
33
- * type `Base` and some unique and arbitrary branding type `Branding`, it
34
- * produces a type based on but distinct from `Base`. The resulting branded
35
- * type is not directly assignable from the base type, and not mutually
36
- * assignable with another branded type derived from the same base type.
37
- *
38
- * Take care that the branding type is unique. Two branded types that share the
39
- * same base type and branding type are considered the same type! There are two
40
- * ways to avoid this.
41
- *
42
- * The first way is to supply a third type parameter, `ReservedName`, with a
43
- * string literal type that is not `__type__`, which is the default.
44
- *
45
- * The second way is to define a branded type in terms of its surrounding
46
- * interface, thereby forming a recursive type. This is possible because there
47
- * are no constraints on what the branding type must be. It does not have to
48
- * be a string literal type, even though it often is.
49
- *
50
- * @example
51
- * ```
52
- * type Path = Brand<string, 'path'>;
53
- * type UserId = Brand<number, 'user'>;
54
- * type DifferentUserId = Brand<number, 'user', '__kind__'>;
55
- * interface Post { id: Brand<number, Post> }
56
- * ```
57
- */
21
+ * A `Brand` is a type that takes at minimum two type parameters. Given a base
22
+ * type `Base` and some unique and arbitrary branding type `Branding`, it
23
+ * produces a type based on but distinct from `Base`. The resulting branded
24
+ * type is not directly assignable from the base type, and not mutually
25
+ * assignable with another branded type derived from the same base type.
26
+ *
27
+ * Take care that the branding type is unique. Two branded types that share the
28
+ * same base type and branding type are considered the same type! There are two
29
+ * ways to avoid this.
30
+ *
31
+ * The first way is to supply a third type parameter, `ReservedName`, with a
32
+ * string literal type that is not `__type__`, which is the default.
33
+ *
34
+ * The second way is to define a branded type in terms of its surrounding
35
+ * interface, thereby forming a recursive type. This is possible because there
36
+ * are no constraints on what the branding type must be. It does not have to
37
+ * be a string literal type, even though it often is.
38
+ *
39
+ * @example
40
+ * ```
41
+ * type Path = Brand<string, 'path'>;
42
+ * type UserId = Brand<number, 'user'>;
43
+ * type DifferentUserId = Brand<number, 'user', '__kind__'>;
44
+ * interface Post { id: Brand<number, Post> }
45
+ * ```
46
+ */
58
47
  type Brand<Base, Branding, ReservedName extends string = "__type__"> = Base & { [K in ReservedName]: Branding } & {
59
- __witness__: Base;
48
+ __witness__: Base;
60
49
  };
61
50
  /**
62
- * An `AnyBrand` is a branded type based on any base type branded with any
63
- * branding type. By itself it is not useful, but it can act as type constraint
64
- * when manipulating branded types in general.
65
- */
51
+ * An `AnyBrand` is a branded type based on any base type branded with any
52
+ * branding type. By itself it is not useful, but it can act as type constraint
53
+ * when manipulating branded types in general.
54
+ */
66
55
  //#endregion
67
56
  //#region ../utils-node/dist/index.d.ts
68
57
  //#endregion
69
58
  //#region src/asSingleton.d.ts
70
59
  type Singleton<T extends new (...args: any[]) => any> = T & {
71
- getInstance: () => InstanceType<T>;
72
- clearInstance: () => void;
60
+ getInstance: () => InstanceType<T>;
61
+ clearInstance: () => void;
73
62
  };
74
63
  //#endregion
75
64
  //#region src/logger.d.ts
76
65
  interface LoggerScope {
77
- scope: (name: string) => LoggerScope;
78
- error: (...args: unknown[]) => void;
79
- warn: (...args: unknown[]) => void;
80
- info: (...args: unknown[]) => void;
81
- log: (...args: unknown[]) => void;
66
+ scope: (name: string) => LoggerScope;
67
+ error: (...args: unknown[]) => void;
68
+ warn: (...args: unknown[]) => void;
69
+ info: (...args: unknown[]) => void;
70
+ log: (...args: unknown[]) => void;
82
71
  }
83
72
  declare class LoggerClass {
84
- private fileLogger;
85
- private path;
86
- private appId;
87
- private messageQueue;
88
- fileName: string;
89
- constructor(fileName: string);
90
- init(appId: string): void;
91
- scope(name: string): LoggerScope;
92
- error(...args: unknown[]): void;
93
- warn(...args: unknown[]): void;
94
- info(...args: unknown[]): void;
95
- debug(...args: unknown[]): void;
96
- log(...args: unknown[]): void;
97
- private handle;
73
+ private fileLogger;
74
+ private path;
75
+ private appId;
76
+ private messageQueue;
77
+ fileName: string;
78
+ constructor(fileName: string);
79
+ init(appId: string): void;
80
+ scope(name: string): LoggerScope;
81
+ error(...args: unknown[]): void;
82
+ warn(...args: unknown[]): void;
83
+ info(...args: unknown[]): void;
84
+ debug(...args: unknown[]): void;
85
+ log(...args: unknown[]): void;
86
+ private handle;
98
87
  }
99
88
  declare const Logger: Singleton<typeof LoggerClass>;
100
89
  type CustomLoggerScope = ReturnType<typeof Logger.prototype.scope>;
@@ -104,73 +93,73 @@ type CustomLoggerScope = ReturnType<typeof Logger.prototype.scope>;
104
93
  //#endregion
105
94
  //#region src/errorManager.d.ts
106
95
  type ErrorManagerEvent = {
107
- code: string;
108
- message: string;
109
- data: Record<string, any>;
110
- timestamp: number;
96
+ code: string;
97
+ message: string;
98
+ data: Record<string, any>;
99
+ timestamp: number;
111
100
  };
112
101
  interface FatalElevationMismatch extends ErrorManagerEvent {
113
- code: "ELEVATION_MISMATCH";
114
- data: {
115
- appElevated: boolean;
116
- gameElevated: boolean;
117
- };
102
+ code: "ELEVATION_MISMATCH";
103
+ data: {
104
+ appElevated: boolean;
105
+ gameElevated: boolean;
106
+ };
118
107
  }
119
108
  interface ErrorPipeServerError extends ErrorManagerEvent {
120
- code: "PIPE_SERVER_ERROR";
121
- data: {
122
- error: unknown;
123
- };
109
+ code: "PIPE_SERVER_ERROR";
110
+ data: {
111
+ error: unknown;
112
+ };
124
113
  }
125
114
  interface ErrorInvalidConfigFile extends ErrorManagerEvent {
126
- code: "INVALID_CONFIG_FILE";
127
- data: {
128
- issues: string[];
129
- filePath: string;
130
- data: unknown;
131
- };
115
+ code: "INVALID_CONFIG_FILE";
116
+ data: {
117
+ issues: string[];
118
+ filePath: string;
119
+ data: unknown;
120
+ };
132
121
  }
133
122
  interface WarningInvalidEvent extends ErrorManagerEvent {
134
- code: "INVALID_EVENT";
135
- data: {
136
- summary: string;
137
- };
123
+ code: "INVALID_EVENT";
124
+ data: {
125
+ summary: string;
126
+ };
138
127
  }
139
128
  type ErrorEvents = ErrorPipeServerError | ErrorInvalidConfigFile;
140
129
  type WarningEvents = WarningInvalidEvent;
141
130
  type FatalEvents = FatalElevationMismatch;
142
131
  type ErrorManagerEvents = {
143
- fatal: FatalEvents;
144
- error: ErrorEvents;
145
- warning: WarningEvents;
132
+ fatal: FatalEvents;
133
+ error: ErrorEvents;
134
+ warning: WarningEvents;
146
135
  };
147
136
  interface OverlayedConfig {
148
- /**
149
- * Your Overlayed application ID.
150
- */
151
- applicationId: string;
152
- /**
153
- * The bundle config for your electron app.
154
- */
155
- app: BundleAppConfig;
156
- /**
157
- * The optional bundle config for your site.
158
- */
159
- site?: BundleSiteConfig;
137
+ /**
138
+ * Your Overlayed application ID.
139
+ */
140
+ applicationId: string;
141
+ /**
142
+ * The bundle config for your electron app.
143
+ */
144
+ app: BundleAppConfig;
145
+ /**
146
+ * The optional bundle config for your site.
147
+ */
148
+ site?: BundleSiteConfig;
160
149
  }
161
150
  interface BundleConfigBase {
162
- /**
163
- * String or array of string [glob](https://www.npmjs.com/package/glob) patterns to bundle.
164
- *
165
- * `package.json` is always included.
166
- */
167
- include: MaybeArray<string>;
168
- /**
169
- * String or array of string [glob](https://www.npmjs.com/package/glob) patterns to exclude from the bundle.
170
- *
171
- * `/installer` is always excluded.
172
- */
173
- exclude?: string | string[];
151
+ /**
152
+ * String or array of string [glob](https://www.npmjs.com/package/glob) patterns to bundle.
153
+ *
154
+ * `package.json` is always included.
155
+ */
156
+ include: MaybeArray<string>;
157
+ /**
158
+ * String or array of string [glob](https://www.npmjs.com/package/glob) patterns to exclude from the bundle.
159
+ *
160
+ * `/installer` is always excluded.
161
+ */
162
+ exclude?: string | string[];
174
163
  }
175
164
  interface BundleAppConfig extends BundleConfigBase {}
176
165
  interface BundleSiteConfig extends BundleConfigBase {}
@@ -180,42 +169,34 @@ declare function defineConfig(config: OverlayedConfig): OverlayedConfig;
180
169
  //#endregion
181
170
  //#region src/utils.d.ts
182
171
  declare const BaseEvent: Type<{
183
- game: string;
184
- type: string;
185
- creation_time: number;
172
+ game: string;
173
+ type: string;
174
+ creation_time: number;
186
175
  }>;
187
176
  type BaseEvent = typeof BaseEvent.infer;
188
177
  //#endregion
189
178
  //#region src/types.d.ts
190
179
  type EventType<TEvent extends BaseEvent> = TEvent["type"];
191
180
  type GameModuleEvent<TEvents extends Record<string, BaseEvent>> = TEvents & {
192
- event: BaseEvent;
181
+ event: BaseEvent;
193
182
  };
194
183
  type GameModuleEventInfer<TModule extends GameModule> = TModule["events"]["event"]["infer"];
195
- interface GameModule<
196
- TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>,
197
- TKey extends string = string,
198
- > {
199
- key: TKey;
200
- events: Module<GameModuleEvent<TEvents>>;
184
+ interface GameModule<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>, TKey extends string = string> {
185
+ key: TKey;
186
+ events: Module<GameModuleEvent<TEvents>>;
201
187
  }
202
- type EventCallback<TEvent extends BaseEvent, TEventType extends EventType<TEvent>> = (
203
- event: Extract<
204
- TEvent,
205
- {
206
- type: TEventType;
207
- }
208
- >,
209
- ) => void;
188
+ type EventCallback<TEvent extends BaseEvent, TEventType extends EventType<TEvent>> = (event: Extract<TEvent, {
189
+ type: TEventType;
190
+ }>) => void;
210
191
  //#endregion
211
192
  //#region src/managers/manager.d.ts
212
193
  /** This should be kept in sync with EventEmitterManager */
213
194
  declare class Manager {
214
- protected logger: CustomLoggerScope;
215
- initialized: boolean;
216
- constructor(name: string);
217
- init(): void;
218
- destroy(): void;
195
+ protected logger: CustomLoggerScope;
196
+ initialized: boolean;
197
+ constructor(name: string);
198
+ init(): void;
199
+ destroy(): void;
219
200
  }
220
201
  /** This should be kept in sync with Manager */
221
202
  //#endregion
@@ -224,57 +205,66 @@ type KeybindPressedCallback = () => string | void;
224
205
  type KeybindDownCallback = () => string | void;
225
206
  type KeybindUpCallback = () => void;
226
207
  type KeybindCallbacks = {
227
- toggle?: KeybindPressedCallback;
228
- down?: KeybindDownCallback;
229
- up?: KeybindUpCallback;
208
+ toggle?: KeybindPressedCallback;
209
+ down?: KeybindDownCallback;
210
+ up?: KeybindUpCallback;
230
211
  };
231
- declare const KeybindSchema: arktype_internal_methods_object_ts0.ObjectType<
232
- {
233
- [x: string]: {
234
- keys: string[];
235
- mode: (In: "toggle" | "hold") => arktype0.Out<"toggle" | "hold">;
236
- };
237
- },
238
- {}
239
- >;
212
+ declare const KeybindSchema: arktype_internal_methods_object_ts0.ObjectType<{
213
+ [x: string]: {
214
+ keys: string[];
215
+ mode: (In: "toggle" | "hold") => arktype0.Out<"toggle" | "hold">;
216
+ };
217
+ }, {}>;
240
218
  type KeybindSchemaEntry = (typeof KeybindSchema.infer)[string];
241
219
  //#endregion
242
220
  //#region ../api/dist/index.d.ts
243
221
  //#endregion
244
222
  //#region src/endpoints/raven/games.d.ts
245
223
  interface GameModel {
246
- name: string;
247
- identifier: Brand<string, GameModel>;
248
- modules: string[];
249
- executables: string[];
224
+ name: string;
225
+ identifier: Brand<string, GameModel>;
226
+ modules: string[];
227
+ executables: string[];
250
228
  }
251
229
  //#endregion
252
230
  //#region src/instances.d.ts
253
231
  declare function setUpdaterTokenResolver(newTokenResolver: () => string | undefined): void;
254
232
  //#endregion
255
- //#endregion
256
233
  //#region src/managers/gameLaunchManager.d.ts
257
234
  type GameLaunchManagerEvents = {
258
- gameCloseInternal: (args: { ravenGame: GameModel; process: Process }) => MaybePromise<void>;
259
- gameLaunch: (args: { game: string; reject: () => void }) => MaybePromise<boolean>;
260
- gameClose: (args: { game: string }) => MaybePromise<void>;
261
- gameReady: (args: { game: string }) => MaybePromise<void>;
262
- gameReadyInternal: (args: { ravenGame: GameModel; process: Process }) => MaybePromise<void>;
235
+ gameCloseInternal: (args: {
236
+ ravenGame: GameModel;
237
+ process: Process;
238
+ }) => MaybePromise<void>;
239
+ gameLaunch: (args: {
240
+ game: string;
241
+ reject: () => void;
242
+ }) => MaybePromise<boolean>;
243
+ gameClose: (args: {
244
+ game: string;
245
+ }) => MaybePromise<void>;
246
+ gameReady: (args: {
247
+ game: string;
248
+ }) => MaybePromise<void>;
249
+ gameReadyInternal: (args: {
250
+ ravenGame: GameModel;
251
+ process: Process;
252
+ }) => MaybePromise<void>;
263
253
  };
264
254
  //#endregion
265
255
  //#region src/utilities/publicTypes.d.ts
266
256
  type ActiveGameInfo = {
267
- isConnected: boolean;
268
- resolution: {
269
- width: number;
270
- height: number;
271
- };
257
+ isConnected: boolean;
258
+ resolution: {
259
+ width: number;
260
+ height: number;
261
+ };
272
262
  };
273
263
  interface OverridesManagerScope {
274
- setGlobalCursorOverride: (override: boolean) => void;
275
- setGlobalMouseBlock: (block: boolean) => void;
276
- setGlobalKeyboardBlock: (block: boolean) => void;
277
- setKeyInputBlock: (key: number, block: boolean) => void;
264
+ setGlobalCursorOverride: (override: boolean) => void;
265
+ setGlobalMouseBlock: (block: boolean) => void;
266
+ setGlobalKeyboardBlock: (block: boolean) => void;
267
+ setKeyInputBlock: (key: number, block: boolean) => void;
278
268
  }
279
269
  //#endregion
280
270
  //#region ../native-managers/dist/index.d.ts
@@ -283,390 +273,291 @@ type RenderInterfaceName = "OGG_SIEGE";
283
273
  //#endregion
284
274
  //#region src/managers/overridesManager.d.ts
285
275
  declare class OverridesManager extends Manager {
286
- private renderInterface;
287
- private globalCursorOverrideCount;
288
- private globalMouseBlockCount;
289
- private globalKeyboardBlockCount;
290
- private keyInputBlocks;
291
- constructor(interfaceName: RenderInterfaceName);
292
- scope(scopeName: string): OverridesManagerScope;
293
- private setGlobalCursorOverride;
294
- private setGlobalMouseBlock;
295
- private setGlobalKeyboardBlock;
296
- private setKeyInputBlock;
276
+ private renderInterface;
277
+ private globalCursorOverrideCount;
278
+ private globalMouseBlockCount;
279
+ private globalKeyboardBlockCount;
280
+ private keyInputBlocks;
281
+ constructor(interfaceName: RenderInterfaceName);
282
+ scope(scopeName: string): OverridesManagerScope;
283
+ private setGlobalCursorOverride;
284
+ private setGlobalMouseBlock;
285
+ private setGlobalKeyboardBlock;
286
+ private setKeyInputBlock;
297
287
  }
298
288
  //#endregion
299
289
  //#region src/utilities/types.d.ts
300
- type OverlayedAppGameModules<TModule extends GameModule> = {
301
- [TKey in TModule["key"]]: {
302
- onAny<
303
- TEvent extends Extract<
304
- TModule,
305
- {
306
- key: TKey;
307
- }
308
- >["events"]["event"]["infer"],
309
- >(
310
- cb: (data: TEvent) => void,
311
- ): void;
312
- on<
313
- TEvent extends Extract<
314
- TModule,
315
- {
316
- key: TKey;
317
- }
318
- >["events"]["event"]["infer"],
319
- TEventType extends EventType<TEvent> = EventType<TEvent>,
320
- >(
321
- event: TEventType,
322
- cb: EventCallback<TEvent, TEventType>,
323
- ): void;
324
- offAny<
325
- TEvent extends Extract<
326
- TModule,
327
- {
328
- key: TKey;
329
- }
330
- >["events"]["event"]["infer"],
331
- >(
332
- cb: (data: TEvent) => void,
333
- ): void;
334
- off<
335
- TEvent extends GameModuleEventInfer<
336
- Extract<
337
- TModule,
338
- {
339
- key: TKey;
340
- }
341
- >
342
- >,
343
- TEventType extends EventType<TEvent> = EventType<TEvent>,
344
- >(
345
- event: TEventType,
346
- cb: EventCallback<TEvent, TEventType>,
347
- ): void;
348
- };
349
- };
290
+ type OverlayedAppGameModules<TModule extends GameModule> = { [TKey in TModule["key"]]: {
291
+ onAny<TEvent extends Extract<TModule, {
292
+ key: TKey;
293
+ }>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
294
+ on<TEvent extends Extract<TModule, {
295
+ key: TKey;
296
+ }>["events"]["event"]["infer"], TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
297
+ offAny<TEvent extends Extract<TModule, {
298
+ key: TKey;
299
+ }>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
300
+ off<TEvent extends GameModuleEventInfer<Extract<TModule, {
301
+ key: TKey;
302
+ }>>, TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
303
+ } };
350
304
  type OverlayedAppHandlersMapping = {
351
- error: (data: ErrorManagerEvents["error"]) => void;
352
- warning: (data: ErrorManagerEvents["warning"]) => void;
353
- fatal: (data: ErrorManagerEvents["fatal"]) => void;
354
- gameLaunch: GameLaunchManagerEvents["gameLaunch"];
355
- gameClose: GameLaunchManagerEvents["gameClose"];
356
- gameReady: GameLaunchManagerEvents["gameReady"];
305
+ error: (data: ErrorManagerEvents["error"]) => void;
306
+ warning: (data: ErrorManagerEvents["warning"]) => void;
307
+ fatal: (data: ErrorManagerEvents["fatal"]) => void;
308
+ gameLaunch: GameLaunchManagerEvents["gameLaunch"];
309
+ gameClose: GameLaunchManagerEvents["gameClose"];
310
+ gameReady: GameLaunchManagerEvents["gameReady"];
357
311
  };
358
312
  type OverlayedAppHandlers = {
359
- on: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(
360
- event: TEvent,
361
- cb: OverlayedAppHandlersMapping[TEvent],
362
- ) => void;
363
- off: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(
364
- event: TEvent,
365
- cb: OverlayedAppHandlersMapping[TEvent],
366
- ) => void;
313
+ on: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(event: TEvent, cb: OverlayedAppHandlersMapping[TEvent]) => void;
314
+ off: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(event: TEvent, cb: OverlayedAppHandlersMapping[TEvent]) => void;
367
315
  };
368
316
  type OverlayedAppKeybindsConfigMode = "toggle" | "hold";
369
- type OverlayedAppKeybindsConfigKey =
370
- | "ControlLeft"
371
- | "AltLeft"
372
- | "ShiftLeft"
373
- | "AltRight"
374
- | "ControlRight"
375
- | "ShiftRight"
376
- | (string & {});
377
- type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<
378
- TKeybind,
379
- {
380
- /**
381
- * - An array of [KeyboardEvent#code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code)
382
- * - Whatever you configure will be the default value
383
- * - [Here](https://www.toptal.com/developers/keycode) is a good tool to easily find the codes for a given hotkey
384
- */
385
- keys: OverlayedAppKeybindsConfigKey[];
386
- /**
387
- * - `toggle` will trigger the callback when the key is toggled on and off
388
- * - `hold` will trigger the callback when the key is held down
389
- * - This can be updated at runtime
390
- */
391
- mode: OverlayedAppKeybindsConfigMode;
392
- }
393
- >;
394
- type OverlayedAppKeybindModule<TKeybind extends string> = Record<
395
- TKeybind,
396
- {
397
- on: <TEvent extends "down" | "up" | "toggle">(event: TEvent, cb: KeybindCallbacks[TEvent]) => void;
398
- }
399
- > & {
400
- /**
401
- * Get the current user keybinds.
402
- */
403
- getConfig: () => OverlayedAppKeybindsConfig<TKeybind>;
404
- /**
405
- * Pause keybind listening. Essential for pausing keybind listening when recording new keybinds.
406
- */
407
- pauseKeybindListening: () => void;
408
- /**
409
- * Resume keybind listening. Essential for resuming keybind listening after recording new keybinds.
410
- */
411
- resumeKeybindListening: () => void;
412
- /**
413
- * Update a single keybind.
414
- *
415
- * @param keybind The keybind to update.
416
- * @param keybindConfig The new keybind config.
417
- */
418
- updateKeybind: (keybind: TKeybind, keybindConfig: OverlayedAppKeybindsConfig<TKeybind>[TKeybind]) => void;
419
- /**
420
- * Bulk update keybinds.
421
- *
422
- * @param keybinds The keybinds to update. Keybind keys not provided will not be updated.
423
- */
424
- updateKeybinds: (keybinds: Partial<OverlayedAppKeybindsConfig<TKeybind>>) => void;
317
+ type OverlayedAppKeybindsConfigKey = "ControlLeft" | "AltLeft" | "ShiftLeft" | "AltRight" | "ControlRight" | "ShiftRight" | (string & {});
318
+ type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<TKeybind, {
319
+ /**
320
+ * - An array of [KeyboardEvent#code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code)
321
+ * - Whatever you configure will be the default value
322
+ * - [Here](https://www.toptal.com/developers/keycode) is a good tool to easily find the codes for a given hotkey
323
+ */
324
+ keys: OverlayedAppKeybindsConfigKey[];
325
+ /**
326
+ * - `toggle` will trigger the callback when the key is toggled on and off
327
+ * - `hold` will trigger the callback when the key is held down
328
+ * - This can be updated at runtime
329
+ */
330
+ mode: OverlayedAppKeybindsConfigMode;
331
+ }>;
332
+ type OverlayedAppKeybindModule<TKeybind extends string> = Record<TKeybind, {
333
+ on: <TEvent extends "down" | "up" | "toggle">(event: TEvent, cb: KeybindCallbacks[TEvent]) => void;
334
+ }> & {
335
+ /**
336
+ * Get the current user keybinds.
337
+ */
338
+ getConfig: () => OverlayedAppKeybindsConfig<TKeybind>;
339
+ /**
340
+ * Pause keybind listening. Essential for pausing keybind listening when recording new keybinds.
341
+ */
342
+ pauseKeybindListening: () => void;
343
+ /**
344
+ * Resume keybind listening. Essential for resuming keybind listening after recording new keybinds.
345
+ */
346
+ resumeKeybindListening: () => void;
347
+ /**
348
+ * Update a single keybind.
349
+ *
350
+ * @param keybind The keybind to update.
351
+ * @param keybindConfig The new keybind config.
352
+ */
353
+ updateKeybind: (keybind: TKeybind, keybindConfig: OverlayedAppKeybindsConfig<TKeybind>[TKeybind]) => void;
354
+ /**
355
+ * Bulk update keybinds.
356
+ *
357
+ * @param keybinds The keybinds to update. Keybind keys not provided will not be updated.
358
+ */
359
+ updateKeybinds: (keybinds: Partial<OverlayedAppKeybindsConfig<TKeybind>>) => void;
425
360
  };
426
- interface OverlayedAppWindowsModule
427
- extends Pick<
428
- RenderInterface$1,
429
- | "on"
430
- | "off"
431
- | "once"
432
- | "addListener"
433
- | "prependListener"
434
- | "prependOnceListener"
435
- | "removeListener"
436
- | "removeAllListeners"
437
- > {
438
- createWindow(options: RenderWindowConstructorOptions$1): RenderWindow$1;
439
- getActiveGameInfo: () => ActiveGameInfo;
361
+ interface OverlayedAppWindowsModule extends Pick<RenderInterface$1, "on" | "off" | "once" | "addListener" | "prependListener" | "prependOnceListener" | "removeListener" | "removeAllListeners"> {
362
+ createWindow(options: BrowserWindowConstructorOptions): BrowserWindow;
363
+ createInGameWindow(options: RenderWindowConstructorOptions$1): RenderWindow$1;
364
+ getActiveGameInfo: () => ActiveGameInfo;
440
365
  }
441
366
  type OverlayedAppInputModuleRaw = {
442
- /**
443
- * Block the game from receiving mouse input.
444
- *
445
- * @param block Whether to block mouse input.
446
- */
447
- setGlobalMouseBlock(block: boolean): void;
448
- /**
449
- * Block the game from receiving keyboard input.
450
- *
451
- * @param block Whether to block keyboard input.
452
- */
453
- setGlobalKeyboardBlock(block: boolean): void;
454
- /**
455
- * Show or hide the cursor.
456
- *
457
- * @param show Whether to show or hide the cursor.
458
- */
459
- setGlobalCursorOverride(show: boolean): void;
460
- /**
461
- * Block the game from receiving input for a specific key.
462
- *
463
- * @param key The key to block input for.
464
- * @param block Whether to block input for the key.
465
- */
466
- setKeyInputBlock(key: VirtualKey, block: boolean): void;
467
- /**
468
- * Get the current state of the global mouse block.
469
- */
470
- getGlobalMouseBlock(): boolean;
471
- /**
472
- * Get the current state of the global keyboard block.
473
- */
474
- getGlobalKeyboardBlock(): boolean;
475
- /**
476
- * Get the current state of the global cursor override.
477
- */
478
- getGlobalCursorOverride(): boolean;
479
- /**
480
- * Get the current state of the key input block for a specific key.
481
- * @param key The key to block input for.
482
- */
483
- getKeyInputBlock(key: VirtualKey): boolean;
367
+ /**
368
+ * Block the game from receiving mouse input.
369
+ *
370
+ * @param block Whether to block mouse input.
371
+ */
372
+ setGlobalMouseBlock(block: boolean): void;
373
+ /**
374
+ * Block the game from receiving keyboard input.
375
+ *
376
+ * @param block Whether to block keyboard input.
377
+ */
378
+ setGlobalKeyboardBlock(block: boolean): void;
379
+ /**
380
+ * Show or hide the cursor.
381
+ *
382
+ * @param show Whether to show or hide the cursor.
383
+ */
384
+ setGlobalCursorOverride(show: boolean): void;
385
+ /**
386
+ * Block the game from receiving input for a specific key.
387
+ *
388
+ * @param key The key to block input for.
389
+ * @param block Whether to block input for the key.
390
+ */
391
+ setKeyInputBlock(key: VirtualKey, block: boolean): void;
392
+ /**
393
+ * Get the current state of the global mouse block.
394
+ */
395
+ getGlobalMouseBlock(): boolean;
396
+ /**
397
+ * Get the current state of the global keyboard block.
398
+ */
399
+ getGlobalKeyboardBlock(): boolean;
400
+ /**
401
+ * Get the current state of the global cursor override.
402
+ */
403
+ getGlobalCursorOverride(): boolean;
404
+ /**
405
+ * Get the current state of the key input block for a specific key.
406
+ * @param key The key to block input for.
407
+ */
408
+ getKeyInputBlock(key: VirtualKey): boolean;
484
409
  };
485
410
  interface OverlayedAppInputModule {
486
- scope: (scopeName: string) => ReturnType<OverridesManager["scope"]>;
487
- raw: OverlayedAppInputModuleRaw;
411
+ scope: (scopeName: string) => ReturnType<OverridesManager["scope"]>;
412
+ raw: OverlayedAppInputModuleRaw;
488
413
  }
489
414
  interface CortexEvents {}
490
415
  interface OverlayedAppCortexModule {
491
- track: <TEventName extends keyof CortexEvents>(name: TEventName, data: CortexEvents[TEventName]) => void;
416
+ track: <TEventName extends keyof CortexEvents>(name: TEventName, data: CortexEvents[TEventName]) => void;
492
417
  }
493
418
  interface OverlayedAppAdsModule {
494
- registerWindow(
495
- window: BrowserWindow,
496
- options?: {
497
- linkHandler?: {
498
- allowHosts?: string[];
499
- };
500
- },
501
- ): void;
419
+ registerWindow(window: BrowserWindow, options?: {
420
+ linkHandler?: {
421
+ allowHosts?: string[];
422
+ };
423
+ }): void;
502
424
  }
503
425
  interface OverlayedAppLoggingModuleInfo extends Record<string, string | undefined> {
504
- email?: string;
505
- username?: string;
506
- message?: string;
507
- category?: string;
508
- version?: string;
426
+ email?: string;
427
+ username?: string;
428
+ message?: string;
429
+ category?: string;
430
+ version?: string;
509
431
  }
510
432
  interface OverlayedAppLoggingModuleSubmitBugReportOptions {
511
- /**
512
- * A key value record of additional files to include in the bug report.
513
- *
514
- * The key is the name of the file, and the value is the content of the file.
515
- */
516
- additionalFiles?: Record<string, string>;
433
+ /**
434
+ * A key value record of additional files to include in the bug report.
435
+ *
436
+ * The key is the name of the file, and the value is the content of the file.
437
+ */
438
+ additionalFiles?: Record<string, string>;
517
439
  }
518
440
  interface OverlayedAppLoggingModule {
519
- /**
520
- * Returns a scoped logging instance. Each message will be prefixed with the scope name.
521
- *
522
- * ```ts
523
- * const scope = overlayed.log.scope("MyScope");
524
- * scope.info("Hello, world!");
525
- * // [2025-07-20 01:51:40.969] [log] [MyScope] Hello, world!
526
- * ```
527
- *
528
- * @param scopeName - The name of the scope.
529
- * @returns The logger scope.
530
- */
531
- scope: (scopeName: string) => LoggerScope;
532
- info: (message: string) => void;
533
- warn: (message: string) => void;
534
- error: (message: string) => void;
535
- /**
536
- * Submits info you provide, app logs, overlayed logs, and any additional files you provide to be viewed
537
- * in your Overlayed dashboard.
538
- *
539
- * @param info - The information to include in the bug report.
540
- * @param options - The options to include in the bug report.
541
- * @returns The bug report id.
542
- */
543
- submitBugReport: (
544
- info: OverlayedAppLoggingModuleInfo,
545
- options?: OverlayedAppLoggingModuleSubmitBugReportOptions,
546
- ) => Promise<
547
- Result<
548
- true,
549
- {
550
- message: string;
551
- error: unknown;
552
- }
553
- >
554
- >;
441
+ /**
442
+ * Returns a scoped logging instance. Each message will be prefixed with the scope name.
443
+ *
444
+ * ```ts
445
+ * const scope = overlayed.log.scope("MyScope");
446
+ * scope.info("Hello, world!");
447
+ * // [2025-07-20 01:51:40.969] [log] [MyScope] Hello, world!
448
+ * ```
449
+ *
450
+ * @param scopeName - The name of the scope.
451
+ * @returns The logger scope.
452
+ */
453
+ scope: (scopeName: string) => LoggerScope;
454
+ info: (message: string) => void;
455
+ warn: (message: string) => void;
456
+ error: (message: string) => void;
457
+ /**
458
+ * Submits info you provide, app logs, overlayed logs, and any additional files you provide to be viewed
459
+ * in your Overlayed dashboard.
460
+ *
461
+ * @param info - The information to include in the bug report.
462
+ * @param options - The options to include in the bug report.
463
+ * @returns The bug report id.
464
+ */
465
+ submitBugReport: (info: OverlayedAppLoggingModuleInfo, options?: OverlayedAppLoggingModuleSubmitBugReportOptions) => Promise<Result<true, {
466
+ message: string;
467
+ error: unknown;
468
+ }>>;
555
469
  }
556
- type OverlayedApp<TModule extends GameModule, TKeybind extends string> = OverlayedAppGameModules<TModule> &
557
- OverlayedAppHandlers & {
558
- keybinds: OverlayedAppKeybindModule<TKeybind>;
559
- windows: OverlayedAppWindowsModule;
560
- input: OverlayedAppInputModule;
561
- ads: OverlayedAppAdsModule;
562
- cortex: OverlayedAppCortexModule;
563
- log: OverlayedAppLoggingModule;
564
- /**
565
- * Returns true if any monitored processes are running.
566
- *
567
- * Useful for stopping the overlay from updating when the game is running.
568
- */
569
- hasAnyActiveProcesses: () => boolean;
570
- /**
571
- * Initializes the overlayed app.
572
- *
573
- * This should only be called once, and is automatically called by default, unless `init: false` is passed:
574
- * ```ts
575
- * overlayed({
576
- * init: false,
577
- * });
578
- * ```
579
- */
580
- init: () => void;
581
- /**
582
- * Returns true if the overlayed app has been initialized.
583
- */
584
- initialized: boolean;
585
- };
470
+ type OverlayedApp<TModule extends GameModule, TKeybind extends string> = OverlayedAppGameModules<TModule> & OverlayedAppHandlers & {
471
+ keybinds: OverlayedAppKeybindModule<TKeybind>;
472
+ windows: OverlayedAppWindowsModule;
473
+ input: OverlayedAppInputModule;
474
+ ads: OverlayedAppAdsModule;
475
+ cortex: OverlayedAppCortexModule;
476
+ log: OverlayedAppLoggingModule;
477
+ /**
478
+ * Returns true if any monitored processes are running.
479
+ *
480
+ * Useful for stopping the overlay from updating when the game is running.
481
+ */
482
+ hasAnyActiveProcesses: () => boolean;
483
+ /**
484
+ * Initializes the overlayed app.
485
+ *
486
+ * This should only be called once, and is automatically called by default, unless `init: false` is passed:
487
+ * ```ts
488
+ * overlayed({
489
+ * init: false,
490
+ * });
491
+ * ```
492
+ */
493
+ init: () => void;
494
+ /**
495
+ * Returns true if the overlayed app has been initialized.
496
+ */
497
+ initialized: boolean;
498
+ };
586
499
  interface OverlayedOptions<TModule extends GameModule, TKeybind extends string> {
587
- /**
588
- * The electron instance.
589
- *
590
- * Must be imported globally like:
591
- * ```ts
592
- * import { electron } from "electron";
593
- * ```
594
- * or
595
- * ```ts
596
- * const electron = require("electron");
597
- * ```
598
- */
599
- electron: typeof electron0;
600
- /**
601
- * The application id, this can be found in the [Overlayed Dashboard](https://dashboard.overlayed.gg/settings/applications).
602
- */
603
- applicationId: string;
604
- /**
605
- * App modules to load.
606
- */
607
- modules: TModule[];
608
- /**
609
- * App keybinds config.
610
- */
611
- keybinds: OverlayedAppKeybindsConfig<TKeybind>;
612
- /**
613
- * Whether to initialize the app when the module is loaded.
614
- * @default true;
615
- */
616
- init?: boolean;
617
- /**
618
- * When true, the overlay will be loaded for all supported games.
619
- * When false, only games registered under the `modules` array will be loaded.
620
- *
621
- * @default false
622
- */
623
- universal?: boolean;
624
- /**
625
- * @deprecated
626
- */
627
- channel?: string;
628
- /**
629
- * The version of the app.
630
- *
631
- * @deprecated
632
- */
633
- version?: string;
500
+ /**
501
+ * The electron instance.
502
+ *
503
+ * Must be imported globally like:
504
+ * ```ts
505
+ * import { electron } from "electron";
506
+ * ```
507
+ * or
508
+ * ```ts
509
+ * const electron = require("electron");
510
+ * ```
511
+ */
512
+ electron: typeof electron0;
513
+ /**
514
+ * The application id, this can be found in the [Overlayed Dashboard](https://dashboard.overlayed.gg/settings/applications).
515
+ */
516
+ applicationId: string;
517
+ /**
518
+ * App modules to load.
519
+ */
520
+ modules: TModule[];
521
+ /**
522
+ * App keybinds config.
523
+ */
524
+ keybinds: OverlayedAppKeybindsConfig<TKeybind>;
525
+ /**
526
+ * Whether to initialize the app when the module is loaded.
527
+ * @default true;
528
+ */
529
+ init?: boolean;
530
+ /**
531
+ * When true, the overlay will be loaded for all supported games.
532
+ * When false, only games registered under the `modules` array will be loaded.
533
+ *
534
+ * @default false
535
+ */
536
+ universal?: boolean;
537
+ /**
538
+ * @deprecated
539
+ */
540
+ channel?: string;
541
+ /**
542
+ * The version of the app.
543
+ *
544
+ * @deprecated
545
+ */
546
+ version?: string;
634
547
  }
635
548
  //#endregion
636
549
  //#region src/utilities/overlayed.d.ts
637
- declare function overlayed<TModule extends GameModule, TShortcut extends string>(
638
- options: OverlayedOptions<TModule, TShortcut>,
639
- ): OverlayedApp<TModule, TShortcut>;
550
+ declare function overlayed<TModule extends GameModule, TShortcut extends string>(options: OverlayedOptions<TModule, TShortcut>): OverlayedApp<TModule, TShortcut>;
640
551
  //#endregion
641
552
  //#region src/managers/nativeModuleManager.d.ts
642
553
  declare function setFetchLatestTokenCallback(newFetchLatestToken: () => Promise<unknown> | undefined): void;
643
554
  //#endregion
644
- export {
645
- type AccessLevel,
646
- ActiveGameInfo,
647
- type BundleAppConfig,
648
- type BundleSiteConfig,
649
- type GameLaunchManagerEvents,
650
- type KeybindSchemaEntry as KeybindConfig,
651
- type KeyboardKeyEvent,
652
- type MouseButtonEvent,
653
- type OverlayedApp,
654
- type OverlayedConfig,
655
- OverridesManagerScope,
656
- type RenderInterface,
657
- type RenderWindow,
658
- type RenderWindowConstructorOptions,
659
- type VirtualKey,
660
- type WindowEvent,
661
- defineConfig,
662
- overlayed,
663
- setFetchLatestTokenCallback,
664
- setUpdaterTokenResolver,
665
- };
666
- declare global {
667
- namespace Electron {
668
- interface BrowserWindow {
669
- isShown(): boolean;
670
- }
671
- }
672
- }
555
+ export { type AccessLevel, ActiveGameInfo, type BundleAppConfig, type BundleSiteConfig, type GameLaunchManagerEvents, type KeybindSchemaEntry as KeybindConfig, type KeyboardKeyEvent, type MouseButtonEvent, type OverlayedApp, type OverlayedConfig, OverridesManagerScope, type RenderInterface, type RenderWindow, type RenderWindowConstructorOptions, type VirtualKey, type WindowEvent, defineConfig, overlayed, setFetchLatestTokenCallback, setUpdaterTokenResolver };
556
+ declare global {
557
+ namespace Electron {
558
+ interface BrowserWindow {
559
+ isShown(): boolean;
560
+ }
561
+ }
562
+ }
563
+