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