@overlayed/app 0.13.1 → 0.14.1

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,35 +1,202 @@
1
+ import * as arktype0 from "arktype";
2
+ import { Module, Type } from "arktype";
3
+ import EventEmitter$1 from "events";
4
+ import "xior";
1
5
  import * as electron0 from "electron";
2
6
  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
7
  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
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";
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";
24
10
 
11
+ //#region ../utils/dist/index.d.ts
12
+ type MaybePromise<T> = T | Promise<T>;
13
+ type MaybeArray<T> = T | T[];
14
+ type Result<T, E = string> = [T, undefined] | [undefined, E];
15
+ //#endregion
16
+ //#region src/utilities.d.ts
17
+
18
+ //#endregion
19
+ //#region src/brand.d.ts
20
+ /**
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
+ */
47
+ type Brand<Base, Branding, ReservedName extends string = "__type__"> = Base & { [K in ReservedName]: Branding } & {
48
+ __witness__: Base;
49
+ };
50
+ /**
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
+ */
55
+ //#endregion
56
+ //#region ../utils-node/dist/index.d.ts
57
+ //#endregion
58
+ //#region src/asSingleton.d.ts
59
+ type Singleton<T extends new (...args: any[]) => any> = T & {
60
+ getInstance: () => InstanceType<T>;
61
+ clearInstance: () => void;
62
+ };
63
+ //#endregion
64
+ //#region src/logger.d.ts
65
+ interface LoggerScope {
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;
71
+ }
72
+ declare class LoggerClass {
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;
87
+ }
88
+ declare const Logger: Singleton<typeof LoggerClass>;
89
+ type CustomLoggerScope = ReturnType<typeof Logger.prototype.scope>;
90
+ //#endregion
91
+ //#region src/consts.d.ts
92
+
93
+ //#endregion
94
+ //#region src/errorManager.d.ts
95
+ type ErrorManagerEvent = {
96
+ code: string;
97
+ message: string;
98
+ data: Record<string, any>;
99
+ timestamp: number;
100
+ };
101
+ interface FatalElevationMismatch extends ErrorManagerEvent {
102
+ code: "ELEVATION_MISMATCH";
103
+ data: {
104
+ appElevated: boolean;
105
+ gameElevated: boolean;
106
+ };
107
+ }
108
+ interface ErrorPipeServerError extends ErrorManagerEvent {
109
+ code: "PIPE_SERVER_ERROR";
110
+ data: {
111
+ error: unknown;
112
+ };
113
+ }
114
+ interface ErrorInvalidConfigFile extends ErrorManagerEvent {
115
+ code: "INVALID_CONFIG_FILE";
116
+ data: {
117
+ issues: string[];
118
+ filePath: string;
119
+ data: unknown;
120
+ };
121
+ }
122
+ interface WarningInvalidEvent extends ErrorManagerEvent {
123
+ code: "INVALID_EVENT";
124
+ data: {
125
+ summary: string;
126
+ };
127
+ }
128
+ type ErrorEvents = ErrorPipeServerError | ErrorInvalidConfigFile;
129
+ type WarningEvents = WarningInvalidEvent;
130
+ type FatalEvents = FatalElevationMismatch;
131
+ type ErrorManagerEvents = {
132
+ fatal: FatalEvents;
133
+ error: ErrorEvents;
134
+ warning: WarningEvents;
135
+ };
136
+ interface OverlayedConfig {
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;
149
+ }
150
+ interface BundleConfigBase {
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[];
163
+ }
164
+ interface BundleAppConfig extends BundleConfigBase {}
165
+ interface BundleSiteConfig extends BundleConfigBase {}
166
+ declare function defineConfig(config: OverlayedConfig): OverlayedConfig;
167
+ //#endregion
168
+ //#region ../events/dist/index.d.ts
169
+ //#endregion
170
+ //#region src/utils.d.ts
171
+ declare const BaseEvent: Type<{
172
+ game: string;
173
+ type: string;
174
+ creation_time: number;
175
+ }>;
176
+ type BaseEvent = typeof BaseEvent.infer;
177
+ //#endregion
178
+ //#region src/types.d.ts
179
+ type EventType<TEvent extends BaseEvent> = TEvent["type"];
180
+ type GameModuleEvent<TEvents extends Record<string, BaseEvent>> = TEvents & {
181
+ event: BaseEvent;
182
+ };
183
+ type GameModuleEventInfer<TModule extends GameModule> = TModule["events"]["event"]["infer"];
184
+ interface GameModule<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>, TKey extends string = string> {
185
+ key: TKey;
186
+ events: Module<GameModuleEvent<TEvents>>;
187
+ }
188
+ type EventCallback<TEvent extends BaseEvent, TEventType extends EventType<TEvent>> = (event: Extract<TEvent, {
189
+ type: TEventType;
190
+ }>) => void;
191
+ //#endregion
25
192
  //#region src/managers/manager.d.ts
26
193
  /** This should be kept in sync with EventEmitterManager */
27
194
  declare class Manager {
28
- protected logger: CustomLoggerScope;
29
- initialized: boolean;
30
- constructor(name: string);
31
- init(): void;
32
- destroy(): void;
195
+ protected logger: CustomLoggerScope;
196
+ initialized: boolean;
197
+ constructor(name: string);
198
+ init(): void;
199
+ destroy(): void;
33
200
  }
34
201
  /** This should be kept in sync with Manager */
35
202
  //#endregion
@@ -38,427 +205,358 @@ type KeybindPressedCallback = () => string | void;
38
205
  type KeybindDownCallback = () => string | void;
39
206
  type KeybindUpCallback = () => void;
40
207
  type KeybindCallbacks = {
41
- toggle?: KeybindPressedCallback;
42
- down?: KeybindDownCallback;
43
- up?: KeybindUpCallback;
208
+ toggle?: KeybindPressedCallback;
209
+ down?: KeybindDownCallback;
210
+ up?: KeybindUpCallback;
44
211
  };
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
- >;
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
+ }, {}>;
54
218
  type KeybindSchemaEntry = (typeof KeybindSchema.infer)[string];
55
219
  //#endregion
220
+ //#region ../api/dist/index.d.ts
221
+ //#endregion
222
+ //#region src/endpoints/raven/games.d.ts
223
+ interface GameModel {
224
+ name: string;
225
+ identifier: Brand<string, GameModel>;
226
+ modules: string[];
227
+ executables: string[];
228
+ }
229
+ //#endregion
230
+ //#region src/instances.d.ts
231
+ declare function setUpdaterTokenResolver(newTokenResolver: () => string | undefined): void;
232
+ //#endregion
56
233
  //#region src/managers/gameLaunchManager.d.ts
57
234
  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>;
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>;
63
253
  };
64
254
  //#endregion
65
255
  //#region src/utilities/publicTypes.d.ts
66
256
  type ActiveGameInfo = {
67
- isConnected: boolean;
68
- resolution: {
69
- width: number;
70
- height: number;
71
- };
257
+ isConnected: boolean;
258
+ resolution: {
259
+ width: number;
260
+ height: number;
261
+ };
72
262
  };
73
263
  interface OverridesManagerScope {
74
- setGlobalCursorOverride: (override: boolean) => void;
75
- setGlobalMouseBlock: (block: boolean) => void;
76
- setGlobalKeyboardBlock: (block: boolean) => void;
77
- 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;
78
268
  }
79
269
  //#endregion
270
+ //#region ../native-managers/dist/index.d.ts
271
+ //#region src/renderInterfaceManager.d.ts
272
+ type RenderInterfaceName = "OGG_SIEGE";
273
+ //#endregion
80
274
  //#region src/managers/overridesManager.d.ts
81
275
  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;
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;
93
287
  }
94
288
  //#endregion
95
289
  //#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
- };
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
+ } };
146
304
  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"];
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"];
153
311
  };
154
312
  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;
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;
163
315
  };
164
316
  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;
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;
221
360
  };
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;
361
+ interface OverlayedAppWindowsModule extends Pick<RenderInterface$1, "on" | "off" | "once" | "addListener" | "prependListener" | "prependOnceListener" | "removeListener" | "removeAllListeners"> {
362
+ createWindow(options: RenderWindowConstructorOptions$1): RenderWindow$1;
363
+ getActiveGameInfo: () => ActiveGameInfo;
236
364
  }
237
365
  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;
366
+ /**
367
+ * Block the game from receiving mouse input.
368
+ *
369
+ * @param block Whether to block mouse input.
370
+ */
371
+ setGlobalMouseBlock(block: boolean): void;
372
+ /**
373
+ * Block the game from receiving keyboard input.
374
+ *
375
+ * @param block Whether to block keyboard input.
376
+ */
377
+ setGlobalKeyboardBlock(block: boolean): void;
378
+ /**
379
+ * Show or hide the cursor.
380
+ *
381
+ * @param show Whether to show or hide the cursor.
382
+ */
383
+ setGlobalCursorOverride(show: boolean): void;
384
+ /**
385
+ * Block the game from receiving input for a specific key.
386
+ *
387
+ * @param key The key to block input for.
388
+ * @param block Whether to block input for the key.
389
+ */
390
+ setKeyInputBlock(key: VirtualKey, block: boolean): void;
391
+ /**
392
+ * Get the current state of the global mouse block.
393
+ */
394
+ getGlobalMouseBlock(): boolean;
395
+ /**
396
+ * Get the current state of the global keyboard block.
397
+ */
398
+ getGlobalKeyboardBlock(): boolean;
399
+ /**
400
+ * Get the current state of the global cursor override.
401
+ */
402
+ getGlobalCursorOverride(): boolean;
403
+ /**
404
+ * Get the current state of the key input block for a specific key.
405
+ * @param key The key to block input for.
406
+ */
407
+ getKeyInputBlock(key: VirtualKey): boolean;
280
408
  };
281
409
  interface OverlayedAppInputModule {
282
- scope: (scopeName: string) => ReturnType<OverridesManager["scope"]>;
283
- raw: OverlayedAppInputModuleRaw;
410
+ scope: (scopeName: string) => ReturnType<OverridesManager["scope"]>;
411
+ raw: OverlayedAppInputModuleRaw;
284
412
  }
285
- interface CortexEvents extends Record<string, unknown> {}
413
+ interface CortexEvents {}
286
414
  interface OverlayedAppCortexModule {
287
- track: <TEventName extends keyof CortexEvents>(name: TEventName, data: CortexEvents[TEventName]) => void;
415
+ track: <TEventName extends keyof CortexEvents>(name: TEventName, data: CortexEvents[TEventName]) => void;
288
416
  }
289
417
  interface OverlayedAppAdsModule {
290
- registerWindow(
291
- window: BrowserWindow,
292
- options?: {
293
- linkHandler?: {
294
- allowHosts?: string[];
295
- };
296
- },
297
- ): void;
418
+ registerWindow(window: BrowserWindow, options?: {
419
+ linkHandler?: {
420
+ allowHosts?: string[];
421
+ };
422
+ }): void;
298
423
  }
299
424
  interface OverlayedAppLoggingModuleInfo extends Record<string, string | undefined> {
300
- email?: string;
301
- username?: string;
302
- message?: string;
303
- category?: string;
304
- version?: string;
425
+ email?: string;
426
+ username?: string;
427
+ message?: string;
428
+ category?: string;
429
+ version?: string;
305
430
  }
306
431
  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>;
432
+ /**
433
+ * A key value record of additional files to include in the bug report.
434
+ *
435
+ * The key is the name of the file, and the value is the content of the file.
436
+ */
437
+ additionalFiles?: Record<string, string>;
313
438
  }
314
439
  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
- >;
440
+ /**
441
+ * Returns a scoped logging instance. Each message will be prefixed with the scope name.
442
+ *
443
+ * ```ts
444
+ * const scope = overlayed.log.scope("MyScope");
445
+ * scope.info("Hello, world!");
446
+ * // [2025-07-20 01:51:40.969] [log] [MyScope] Hello, world!
447
+ * ```
448
+ *
449
+ * @param scopeName - The name of the scope.
450
+ * @returns The logger scope.
451
+ */
452
+ scope: (scopeName: string) => LoggerScope;
453
+ info: (message: string) => void;
454
+ warn: (message: string) => void;
455
+ error: (message: string) => void;
456
+ /**
457
+ * Submits info you provide, app logs, overlayed logs, and any additional files you provide to be viewed
458
+ * in your Overlayed dashboard.
459
+ *
460
+ * @param info - The information to include in the bug report.
461
+ * @param options - The options to include in the bug report.
462
+ * @returns The bug report id.
463
+ */
464
+ submitBugReport: (info: OverlayedAppLoggingModuleInfo, options?: OverlayedAppLoggingModuleSubmitBugReportOptions) => Promise<Result<true, {
465
+ message: string;
466
+ error: unknown;
467
+ }>>;
351
468
  }
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
- };
469
+ type OverlayedApp<TModule extends GameModule, TKeybind extends string> = OverlayedAppGameModules<TModule> & OverlayedAppHandlers & {
470
+ keybinds: OverlayedAppKeybindModule<TKeybind>;
471
+ windows: OverlayedAppWindowsModule;
472
+ input: OverlayedAppInputModule;
473
+ ads: OverlayedAppAdsModule;
474
+ cortex: OverlayedAppCortexModule;
475
+ log: OverlayedAppLoggingModule;
476
+ /**
477
+ * Returns true if any monitored processes are running.
478
+ *
479
+ * Useful for stopping the overlay from updating when the game is running.
480
+ */
481
+ hasAnyActiveProcesses: () => boolean;
482
+ /**
483
+ * Initializes the overlayed app.
484
+ *
485
+ * This should only be called once, and is automatically called by default, unless `init: false` is passed:
486
+ * ```ts
487
+ * overlayed({
488
+ * init: false,
489
+ * });
490
+ * ```
491
+ */
492
+ init: () => void;
493
+ /**
494
+ * Returns true if the overlayed app has been initialized.
495
+ */
496
+ initialized: boolean;
497
+ };
382
498
  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;
499
+ /**
500
+ * The electron instance.
501
+ *
502
+ * Must be imported globally like:
503
+ * ```ts
504
+ * import { electron } from "electron";
505
+ * ```
506
+ * or
507
+ * ```ts
508
+ * const electron = require("electron");
509
+ * ```
510
+ */
511
+ electron: typeof electron0;
512
+ /**
513
+ * The application id, this can be found in the [Overlayed Dashboard](https://dashboard.overlayed.gg/settings/applications).
514
+ */
515
+ applicationId: string;
516
+ /**
517
+ * App modules to load.
518
+ */
519
+ modules: TModule[];
520
+ /**
521
+ * App keybinds config.
522
+ */
523
+ keybinds: OverlayedAppKeybindsConfig<TKeybind>;
524
+ /**
525
+ * Whether to initialize the app when the module is loaded.
526
+ * @default true;
527
+ */
528
+ init?: boolean;
529
+ /**
530
+ * When true, the overlay will be loaded for all supported games.
531
+ * When false, only games registered under the `modules` array will be loaded.
532
+ *
533
+ * @default false
534
+ */
535
+ universal?: boolean;
536
+ /**
537
+ * @deprecated
538
+ */
539
+ channel?: string;
540
+ /**
541
+ * The version of the app.
542
+ *
543
+ * @deprecated
544
+ */
545
+ version?: string;
430
546
  }
431
547
  //#endregion
432
548
  //#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>;
549
+ declare function overlayed<TModule extends GameModule, TShortcut extends string>(options: OverlayedOptions<TModule, TShortcut>): OverlayedApp<TModule, TShortcut>;
436
550
  //#endregion
437
551
  //#region src/managers/nativeModuleManager.d.ts
438
552
  declare function setFetchLatestTokenCallback(newFetchLatestToken: () => Promise<unknown> | undefined): void;
439
553
  //#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
- }
554
+ 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 };
555
+ declare global {
556
+ namespace Electron {
557
+ interface BrowserWindow {
558
+ isShown(): boolean;
559
+ }
560
+ }
561
+ }
562
+