@overlayed/app 0.0.0-canary-20260207042615
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/LICENSE.md +16 -0
- package/README.md +0 -0
- package/dist/index.d.mts +1027 -0
- package/dist/index.mjs +3 -0
- package/dist/native-interface/build/overlayed_injector_x86.exe +0 -0
- package/dist/native-interface/build/overlayed_native_interface_x64.node +0 -0
- package/dist/native-interface/dist/index.mjs +18 -0
- package/dist/native-interface/dist/types.d.mts +136 -0
- package/dist/native-interface/dist/types.d.mts.map +1 -0
- package/dist/preload.d.ts +1 -0
- package/dist/preload.js +1 -0
- package/dist/render-interface/build/overlayed_render_hook_x64.dll +0 -0
- package/dist/render-interface/build/overlayed_render_hook_x86.dll +0 -0
- package/dist/render-interface/build/overlayed_render_interface_x64.node +0 -0
- package/dist/render-interface/dist/index.mjs +212 -0
- package/dist/render-interface/dist/types.d.mts +332 -0
- package/dist/render-interface/dist/types.d.mts.map +1 -0
- package/dist/security.d.mts +26 -0
- package/dist/security.mjs +1 -0
- package/dist/siege.d.ts +2789 -0
- package/dist/siege.js +1 -0
- package/dist/universal.d.ts +116 -0
- package/dist/universal.js +0 -0
- package/package.json +103 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1027 @@
|
|
|
1
|
+
import * as arktype0 from "arktype";
|
|
2
|
+
import { Module, Type } from "arktype";
|
|
3
|
+
import EventEmitter$1 from "events";
|
|
4
|
+
import "xior";
|
|
5
|
+
import JSZip from "jszip";
|
|
6
|
+
import * as electron0 from "electron";
|
|
7
|
+
import { BrowserWindow, BrowserWindowConstructorOptions } from "electron";
|
|
8
|
+
import { ProgressInfo, ProgressInfo as ProgressInfo$1, UpdateCheckResult, UpdateCheckResult as UpdateCheckResult$1, UpdateDownloadedEvent, UpdateInfo } from "electron-updater";
|
|
9
|
+
import * as arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
|
|
10
|
+
import { KeyboardKeyEvent, MouseButtonEvent, RenderInterface, RenderInterface as RenderInterface$1, RenderWindow, RenderWindow as RenderWindow$1, RenderWindowConstructorOptions, RenderWindowConstructorOptions as RenderWindowConstructorOptions$1, VirtualKey, VirtualKey as VirtualKey$1, WindowEvent } from "@overlayed-gg/render-interface";
|
|
11
|
+
|
|
12
|
+
//#region ../utils/dist/index.d.ts
|
|
13
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
14
|
+
type MaybeArray<T> = T | T[];
|
|
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
|
+
type AnyBrand = Brand<unknown, any>;
|
|
56
|
+
/**
|
|
57
|
+
* `BaseOf` is a type that takes any branded type `B` and yields its base type.
|
|
58
|
+
*/
|
|
59
|
+
type BaseOf<B extends AnyBrand> = B["__witness__"];
|
|
60
|
+
/**
|
|
61
|
+
* A `Brander` is a function that takes a value of some base type and casts
|
|
62
|
+
* that value to a branded type derived from said base type. It can be thought
|
|
63
|
+
* of as the type of a "constructor", in the functional programming sense of
|
|
64
|
+
* the word.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```
|
|
68
|
+
* type UserId = Brand<number, 'user'>;
|
|
69
|
+
* // A Brander<UserId> would take a number and return a UserId
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
type Brander<B extends AnyBrand> = (underlying: BaseOf<B>) => B;
|
|
73
|
+
/**
|
|
74
|
+
* A generic function that, when given some branded type, can take a value with
|
|
75
|
+
* the base type of the branded type, and cast that value to the branded type.
|
|
76
|
+
* It fulfills the contract of a `Brander`.
|
|
77
|
+
*
|
|
78
|
+
* At runtime, this function simply returns the value as-is.
|
|
79
|
+
*
|
|
80
|
+
* @param underlying The value with a base type, to be casted
|
|
81
|
+
* @return The same underlying value, but casted
|
|
82
|
+
* @example
|
|
83
|
+
* ```
|
|
84
|
+
* type UserId = Brand<number, 'user'>;
|
|
85
|
+
* const UserId: Brander<UserId> = identity;
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region ../utils-node/dist/index.d.mts
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/asSingleton.d.ts
|
|
92
|
+
type Singleton<T extends new (...args: any[]) => any> = T & {
|
|
93
|
+
getInstance: () => InstanceType<T>;
|
|
94
|
+
clearInstance: () => void;
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/logger.d.ts
|
|
98
|
+
interface LoggerScope {
|
|
99
|
+
scope: (name: string) => LoggerScope;
|
|
100
|
+
error: (...args: unknown[]) => void;
|
|
101
|
+
warn: (...args: unknown[]) => void;
|
|
102
|
+
info: (...args: unknown[]) => void;
|
|
103
|
+
log: (...args: unknown[]) => void;
|
|
104
|
+
debug: (...args: unknown[]) => void;
|
|
105
|
+
}
|
|
106
|
+
declare class LoggerClass {
|
|
107
|
+
private fileLogger;
|
|
108
|
+
private path;
|
|
109
|
+
private appId;
|
|
110
|
+
private messageQueue;
|
|
111
|
+
fileName: string;
|
|
112
|
+
private _debug;
|
|
113
|
+
private silent;
|
|
114
|
+
constructor(fileName: string);
|
|
115
|
+
init(appId: string, debug?: boolean, silent?: boolean): void;
|
|
116
|
+
scope(name: string): LoggerScope;
|
|
117
|
+
error(...args: unknown[]): void;
|
|
118
|
+
warn(...args: unknown[]): void;
|
|
119
|
+
info(...args: unknown[]): void;
|
|
120
|
+
debug(...args: unknown[]): void;
|
|
121
|
+
log(...args: unknown[]): void;
|
|
122
|
+
private handle;
|
|
123
|
+
private logToConsole;
|
|
124
|
+
}
|
|
125
|
+
declare const Logger: Singleton<typeof LoggerClass>;
|
|
126
|
+
type CustomLoggerScope = ReturnType<typeof Logger.prototype.scope>;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/consts.d.ts
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/errorManager.d.ts
|
|
132
|
+
type ErrorManagerEvent = {
|
|
133
|
+
code: string;
|
|
134
|
+
message: string;
|
|
135
|
+
data: Record<string, any>;
|
|
136
|
+
timestamp: number;
|
|
137
|
+
};
|
|
138
|
+
interface FatalElevationMismatch extends ErrorManagerEvent {
|
|
139
|
+
code: "ELEVATION_MISMATCH";
|
|
140
|
+
data: {
|
|
141
|
+
appElevated: boolean;
|
|
142
|
+
gameElevated: boolean;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
interface ErrorPipeServerError extends ErrorManagerEvent {
|
|
146
|
+
code: "PIPE_SERVER_ERROR";
|
|
147
|
+
data: {
|
|
148
|
+
error: unknown;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
interface ErrorSetupCortex extends ErrorManagerEvent {
|
|
152
|
+
code: "SETUP_CORTEX_ERROR";
|
|
153
|
+
data: {
|
|
154
|
+
error: unknown;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
interface ErrorInvalidConfigFile extends ErrorManagerEvent {
|
|
158
|
+
code: "INVALID_CONFIG_FILE";
|
|
159
|
+
data: {
|
|
160
|
+
issues: string[];
|
|
161
|
+
filePath: string;
|
|
162
|
+
data: unknown;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
interface WarningInvalidEvent extends ErrorManagerEvent {
|
|
166
|
+
code: "INVALID_EVENT";
|
|
167
|
+
data: {
|
|
168
|
+
summary: string;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
interface WarningEventBufferFull extends ErrorManagerEvent {
|
|
172
|
+
code: "EVENT_BUFFER_FULL";
|
|
173
|
+
data: {
|
|
174
|
+
summary: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
type ErrorEvents = ErrorPipeServerError | ErrorInvalidConfigFile | ErrorSetupCortex;
|
|
178
|
+
type WarningEvents = WarningInvalidEvent | WarningEventBufferFull;
|
|
179
|
+
type FatalEvents = FatalElevationMismatch;
|
|
180
|
+
interface OverlayedConfig {
|
|
181
|
+
/**
|
|
182
|
+
* Your Overlayed application ID.
|
|
183
|
+
*/
|
|
184
|
+
applicationId: string;
|
|
185
|
+
/**
|
|
186
|
+
* The bundle config for your electron app.
|
|
187
|
+
*/
|
|
188
|
+
app: BundleAppConfig;
|
|
189
|
+
/**
|
|
190
|
+
* The optional bundle config for your site.
|
|
191
|
+
*/
|
|
192
|
+
site?: BundleSiteConfig;
|
|
193
|
+
/**
|
|
194
|
+
* When true, the bundle will be created in debug mode.
|
|
195
|
+
* - Extra logs will occur
|
|
196
|
+
* - The bundles will be outputted as a zip **instead of uploading to the Overlayed platform**
|
|
197
|
+
*
|
|
198
|
+
* @default false
|
|
199
|
+
*/
|
|
200
|
+
debug?: boolean;
|
|
201
|
+
}
|
|
202
|
+
interface BundleConfigBase {
|
|
203
|
+
/**
|
|
204
|
+
* The base directory to bundle from.
|
|
205
|
+
*
|
|
206
|
+
* @default location of the overlayed.config.ts file
|
|
207
|
+
*/
|
|
208
|
+
baseDir?: string;
|
|
209
|
+
/**
|
|
210
|
+
* String or array of string [glob](https://www.npmjs.com/package/glob) patterns to bundle.
|
|
211
|
+
*
|
|
212
|
+
* `package.json` is always included.
|
|
213
|
+
*/
|
|
214
|
+
include: MaybeArray<string>;
|
|
215
|
+
/**
|
|
216
|
+
* String or array of string [glob](https://www.npmjs.com/package/glob) patterns to exclude from the bundle.
|
|
217
|
+
*
|
|
218
|
+
* `/installer` is always excluded.
|
|
219
|
+
*/
|
|
220
|
+
exclude?: string | string[];
|
|
221
|
+
}
|
|
222
|
+
interface BundleAppConfig extends BundleConfigBase {}
|
|
223
|
+
interface BundleSiteConfig extends BundleConfigBase {}
|
|
224
|
+
declare function defineConfig(config: OverlayedConfig): OverlayedConfig;
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region ../events/dist/index.d.mts
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/utils.d.ts
|
|
229
|
+
declare const BaseEvent: Type<{
|
|
230
|
+
game: string;
|
|
231
|
+
type: string;
|
|
232
|
+
creation_time: number;
|
|
233
|
+
}>;
|
|
234
|
+
type BaseEvent = typeof BaseEvent.infer;
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/types.d.ts
|
|
237
|
+
type EventType<TEvent extends BaseEvent> = TEvent["type"];
|
|
238
|
+
type GameModuleEvent<TEvents extends Record<string, BaseEvent>> = TEvents & {
|
|
239
|
+
event: BaseEvent;
|
|
240
|
+
};
|
|
241
|
+
type GameModuleEventInfer<TModule extends GameModule> = TModule["events"]["event"]["infer"];
|
|
242
|
+
interface GameModule<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>, TKey$1 extends string = string> {
|
|
243
|
+
key: TKey$1;
|
|
244
|
+
events: Module<GameModuleEvent<TEvents>>;
|
|
245
|
+
}
|
|
246
|
+
type EventCallback<TEvent extends BaseEvent, TEventType extends EventType<TEvent>> = (event: Extract<TEvent, {
|
|
247
|
+
type: TEventType;
|
|
248
|
+
}>) => void;
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/managers/manager.d.ts
|
|
251
|
+
/** This should be kept in sync with EventEmitterManager */
|
|
252
|
+
declare class Manager<O extends Record<string, any> = {}> {
|
|
253
|
+
protected options: O | null;
|
|
254
|
+
protected logger: CustomLoggerScope;
|
|
255
|
+
initialized: boolean;
|
|
256
|
+
constructor(name: string);
|
|
257
|
+
init(options?: O): void;
|
|
258
|
+
destroy(): void;
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/managers/keybindManager.d.ts
|
|
262
|
+
type KeybindPressedCallback = () => string | void;
|
|
263
|
+
type KeybindDownCallback = () => string | void;
|
|
264
|
+
type KeybindUpCallback = () => void;
|
|
265
|
+
type KeybindCallbacks = {
|
|
266
|
+
toggle: KeybindPressedCallback[];
|
|
267
|
+
down: KeybindDownCallback[];
|
|
268
|
+
up: KeybindUpCallback[];
|
|
269
|
+
};
|
|
270
|
+
declare const KeybindSchema: arktype_internal_variants_object_ts0.ObjectType<{
|
|
271
|
+
[x: string]: {
|
|
272
|
+
keys: string[];
|
|
273
|
+
mode: (In: "toggle" | "hold") => arktype0.Out<"toggle" | "hold">;
|
|
274
|
+
};
|
|
275
|
+
}, {}>;
|
|
276
|
+
type KeybindSchemaEntry = (typeof KeybindSchema.infer)[string];
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region ../api/dist/index.d.ts
|
|
279
|
+
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/endpoints/modules/releases.d.ts
|
|
282
|
+
type ReleaseId = Brand<string, "release_id">;
|
|
283
|
+
declare const ReleaseId: Brander<Brand<string, "release_id">>;
|
|
284
|
+
type FeedbackType = "suggestion" | "bug_report";
|
|
285
|
+
interface FeedbackRequestDataModel {
|
|
286
|
+
release_id?: ReleaseId;
|
|
287
|
+
type: FeedbackType;
|
|
288
|
+
cortex_user_id: string;
|
|
289
|
+
email?: string;
|
|
290
|
+
username?: string;
|
|
291
|
+
message?: string;
|
|
292
|
+
extra?: Record<string, unknown>;
|
|
293
|
+
}
|
|
294
|
+
interface FeedbackResponseModel {
|
|
295
|
+
id: Brand<string, FeedbackResponseModel>;
|
|
296
|
+
}
|
|
297
|
+
type FeedbackId = FeedbackResponseModel["id"];
|
|
298
|
+
declare const FeedbackId: Brander<Brand<string, FeedbackResponseModel>>;
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/endpoints/raven/games.d.ts
|
|
301
|
+
interface GameModel {
|
|
302
|
+
name: string;
|
|
303
|
+
identifier: Brand<string, GameModel>;
|
|
304
|
+
modules: string[];
|
|
305
|
+
executables: string[];
|
|
306
|
+
allow_dll_injections: boolean;
|
|
307
|
+
has_render_support: boolean;
|
|
308
|
+
}
|
|
309
|
+
type GameIdentifier = GameModel["identifier"];
|
|
310
|
+
declare const GameIdentifier: Brander<GameIdentifier>;
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/endpoints/applications/notices.d.ts
|
|
313
|
+
type NoticeType = "info" | "warning" | "error" | "critical";
|
|
314
|
+
interface NoticeModel {
|
|
315
|
+
id: Brand<string, NoticeModel>;
|
|
316
|
+
message: string;
|
|
317
|
+
priority: number;
|
|
318
|
+
dismissible: boolean;
|
|
319
|
+
game?: GameIdentifier;
|
|
320
|
+
type?: NoticeType;
|
|
321
|
+
title?: string;
|
|
322
|
+
link?: string;
|
|
323
|
+
start_time?: string;
|
|
324
|
+
end_time?: string;
|
|
325
|
+
}
|
|
326
|
+
type NoticeId = NoticeModel["id"];
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/managers/gameLaunchManager.d.ts
|
|
329
|
+
type GameReadyEvent = {
|
|
330
|
+
game: string;
|
|
331
|
+
inGameRenderingSupported: boolean;
|
|
332
|
+
};
|
|
333
|
+
type GameLaunchEvent = {
|
|
334
|
+
game: GameIdentifier;
|
|
335
|
+
reject: () => void;
|
|
336
|
+
};
|
|
337
|
+
type GameCloseEvent = {
|
|
338
|
+
game: GameIdentifier;
|
|
339
|
+
};
|
|
340
|
+
type GameLaunchManagerEvents = {
|
|
341
|
+
gameLaunch: (args: GameLaunchEvent) => MaybePromise<boolean>;
|
|
342
|
+
gameClose: (args: GameCloseEvent) => MaybePromise<void>;
|
|
343
|
+
gameReady: (args: GameReadyEvent) => MaybePromise<void>;
|
|
344
|
+
};
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region ../native-managers/dist/index.d.mts
|
|
347
|
+
//#region src/renderInterfaceManager.d.ts
|
|
348
|
+
type RenderInterfaceName = "OGG_SIEGE";
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/managers/overridesManager.d.ts
|
|
351
|
+
interface OverridesManagerScope {
|
|
352
|
+
setGlobalCursorOverride: (override: boolean) => void;
|
|
353
|
+
setGlobalMouseBlock: (block: boolean) => void;
|
|
354
|
+
setGlobalKeyboardBlock: (block: boolean) => void;
|
|
355
|
+
setKeyInputBlock: (key: number, block: boolean) => void;
|
|
356
|
+
}
|
|
357
|
+
declare class OverridesManager extends Manager {
|
|
358
|
+
private renderInterface;
|
|
359
|
+
private globalCursorOverrideCount;
|
|
360
|
+
private globalMouseBlockCount;
|
|
361
|
+
private globalKeyboardBlockCount;
|
|
362
|
+
private keyInputBlocks;
|
|
363
|
+
constructor(interfaceName: RenderInterfaceName);
|
|
364
|
+
scope(scopeName: string): OverridesManagerScope;
|
|
365
|
+
private setGlobalCursorOverride;
|
|
366
|
+
private setGlobalMouseBlock;
|
|
367
|
+
private setGlobalKeyboardBlock;
|
|
368
|
+
private setKeyInputBlock;
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region ../games/universal/dist/index.d.ts
|
|
372
|
+
//#region src/module.d.ts
|
|
373
|
+
declare function module(): {
|
|
374
|
+
readonly key: "universal";
|
|
375
|
+
readonly events: arktype0.Module<{
|
|
376
|
+
event: {
|
|
377
|
+
game: "siege" | "tft";
|
|
378
|
+
type: "logged_in";
|
|
379
|
+
creation_time: number;
|
|
380
|
+
content: {
|
|
381
|
+
account_id: string;
|
|
382
|
+
};
|
|
383
|
+
} | {
|
|
384
|
+
game: "siege" | "tft";
|
|
385
|
+
type: "module_loaded";
|
|
386
|
+
creation_time: number;
|
|
387
|
+
content: {
|
|
388
|
+
game_version: string;
|
|
389
|
+
process_hash: string;
|
|
390
|
+
};
|
|
391
|
+
} | {
|
|
392
|
+
game: "siege" | "tft";
|
|
393
|
+
type: "module_unloaded";
|
|
394
|
+
creation_time: number;
|
|
395
|
+
} | {
|
|
396
|
+
game: "siege" | "tft";
|
|
397
|
+
type: "unsupported_game_version";
|
|
398
|
+
creation_time: number;
|
|
399
|
+
content: {
|
|
400
|
+
game_version: string;
|
|
401
|
+
process_hash: string;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
logged_in: {
|
|
405
|
+
game: "siege" | "tft";
|
|
406
|
+
type: "logged_in";
|
|
407
|
+
creation_time: number;
|
|
408
|
+
content: {
|
|
409
|
+
account_id: string;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
module_loaded: {
|
|
413
|
+
game: "siege" | "tft";
|
|
414
|
+
type: "module_loaded";
|
|
415
|
+
creation_time: number;
|
|
416
|
+
content: {
|
|
417
|
+
game_version: string;
|
|
418
|
+
process_hash: string;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
module_unloaded: {
|
|
422
|
+
game: "siege" | "tft";
|
|
423
|
+
type: "module_unloaded";
|
|
424
|
+
creation_time: number;
|
|
425
|
+
};
|
|
426
|
+
unsupported_game_version: {
|
|
427
|
+
game: "siege" | "tft";
|
|
428
|
+
type: "unsupported_game_version";
|
|
429
|
+
creation_time: number;
|
|
430
|
+
content: {
|
|
431
|
+
game_version: string;
|
|
432
|
+
process_hash: string;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
}>;
|
|
436
|
+
};
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/events/loggedIn.d.ts
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region src/managers/updateManager/updateManager.d.ts
|
|
441
|
+
type UpdateManagerEvents = {
|
|
442
|
+
error: {
|
|
443
|
+
error: Error;
|
|
444
|
+
message?: string;
|
|
445
|
+
};
|
|
446
|
+
checkingForUpdates: {};
|
|
447
|
+
updateNotAvailable: {
|
|
448
|
+
info: UpdateInfo;
|
|
449
|
+
};
|
|
450
|
+
updateAvailable: {
|
|
451
|
+
info: UpdateInfo;
|
|
452
|
+
};
|
|
453
|
+
updateDownloaded: {
|
|
454
|
+
event: UpdateDownloadedEvent;
|
|
455
|
+
};
|
|
456
|
+
updateCancelled: {
|
|
457
|
+
info: UpdateInfo;
|
|
458
|
+
};
|
|
459
|
+
downloadProgress: {
|
|
460
|
+
info: ProgressInfo$1;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* Emitted when the access token fetcher returns an invalid token.
|
|
464
|
+
*
|
|
465
|
+
* We strongly recommend logging the user out in this case, as it likely means
|
|
466
|
+
* their account no longer has access to the private channel.
|
|
467
|
+
*/
|
|
468
|
+
authTokenInvalid: {};
|
|
469
|
+
};
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region src/utilities/types.d.ts
|
|
472
|
+
type UniversalGameModule = ReturnType<typeof module>;
|
|
473
|
+
type OverlayedAppGameModules<TModule extends GameModule> = { [TKey in TModule["key"]]: OverlayedAppGameModuleListeners<TModule, TKey> } & { [TKey in UniversalGameModule["key"]]: OverlayedAppGameModuleListeners<UniversalGameModule, TKey> };
|
|
474
|
+
type OverlayedAppGameModuleListeners<TModule extends GameModule, TKey$1 extends TModule["key"] = TModule["key"]> = {
|
|
475
|
+
/**
|
|
476
|
+
* Listen to any event emitted by the module.
|
|
477
|
+
* @param cb - The callback to call when any event is emitted.
|
|
478
|
+
*/
|
|
479
|
+
onAny<TEvent extends Extract<TModule, {
|
|
480
|
+
key: TKey$1;
|
|
481
|
+
}>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
|
|
482
|
+
/**
|
|
483
|
+
* Listen to a specific event emitted by the module.
|
|
484
|
+
* @param event - The event to listen to.
|
|
485
|
+
* @param cb - The callback to call when the event is emitted.
|
|
486
|
+
*/
|
|
487
|
+
on<TEvent extends Extract<TModule, {
|
|
488
|
+
key: TKey$1;
|
|
489
|
+
}>["events"]["event"]["infer"], TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
|
|
490
|
+
/**
|
|
491
|
+
* Stop listening to any event emitted by the module.
|
|
492
|
+
* @param cb - The callback to stop listening to.
|
|
493
|
+
*/
|
|
494
|
+
offAny<TEvent extends Extract<TModule, {
|
|
495
|
+
key: TKey$1;
|
|
496
|
+
}>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
|
|
497
|
+
/**
|
|
498
|
+
* Stop listening to a specific event emitted by the module.
|
|
499
|
+
* @param event - The event to stop listening to.
|
|
500
|
+
* @param cb - The callback to stop listening to.
|
|
501
|
+
*/
|
|
502
|
+
off<TEvent extends GameModuleEventInfer<Extract<TModule, {
|
|
503
|
+
key: TKey$1;
|
|
504
|
+
}>>, TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
|
|
505
|
+
/**
|
|
506
|
+
* Call this when you are ready to receive game events.
|
|
507
|
+
*
|
|
508
|
+
* Before this is called, any incoming events will be stored to be emitted when this method gets called.
|
|
509
|
+
*/
|
|
510
|
+
readyForGameEvents: () => void;
|
|
511
|
+
};
|
|
512
|
+
type OverlayedAppHandlersMapping = GameLaunchManagerEvents & {
|
|
513
|
+
error: (data: ErrorEvents) => void;
|
|
514
|
+
warning: (data: WarningEvents) => void;
|
|
515
|
+
fatal: (data: FatalEvents) => void;
|
|
516
|
+
};
|
|
517
|
+
type OverlayedAppHandlers = {
|
|
518
|
+
on: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(event: TEvent, cb: OverlayedAppHandlersMapping[TEvent]) => void;
|
|
519
|
+
off: <TEvent extends keyof OverlayedAppHandlersMapping = keyof OverlayedAppHandlersMapping>(event: TEvent, cb: OverlayedAppHandlersMapping[TEvent]) => void;
|
|
520
|
+
};
|
|
521
|
+
type OverlayedAppKeybindsConfigMode = "toggle" | "hold";
|
|
522
|
+
type OverlayedAppKeybindsConfigKey = "ControlLeft" | "AltLeft" | "ShiftLeft" | "AltRight" | "ControlRight" | "ShiftRight" | (string & {});
|
|
523
|
+
type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<TKeybind, {
|
|
524
|
+
/**
|
|
525
|
+
* - An array of [KeyboardEvent#code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code)
|
|
526
|
+
* - Whatever you configure will be the default value
|
|
527
|
+
* - [Here](https://www.toptal.com/developers/keycode) is a good tool to easily find the codes for a given hotkey
|
|
528
|
+
*/
|
|
529
|
+
keys: OverlayedAppKeybindsConfigKey[];
|
|
530
|
+
/**
|
|
531
|
+
* - `toggle` will trigger the callback when the key is toggled on and off
|
|
532
|
+
* - `hold` will trigger the callback when the key is held down
|
|
533
|
+
* - This can be updated at runtime
|
|
534
|
+
*/
|
|
535
|
+
mode: OverlayedAppKeybindsConfigMode;
|
|
536
|
+
}>;
|
|
537
|
+
type OverlayedAppKeybindModule<TKeybind extends string> = Record<TKeybind, {
|
|
538
|
+
on: <TEvent extends "down" | "up" | "toggle">(event: TEvent, cb: KeybindCallbacks[TEvent][number]) => void;
|
|
539
|
+
}> & {
|
|
540
|
+
/**
|
|
541
|
+
* Get the current user keybinds.
|
|
542
|
+
*/
|
|
543
|
+
getConfig: () => OverlayedAppKeybindsConfig<TKeybind>;
|
|
544
|
+
/**
|
|
545
|
+
* Pause keybind listening. Essential for pausing keybind listening when recording new keybinds.
|
|
546
|
+
*/
|
|
547
|
+
pauseKeybindListening: () => void;
|
|
548
|
+
/**
|
|
549
|
+
* Resume keybind listening. Essential for resuming keybind listening after recording new keybinds.
|
|
550
|
+
*/
|
|
551
|
+
resumeKeybindListening: () => void;
|
|
552
|
+
/**
|
|
553
|
+
* Update a single keybind.
|
|
554
|
+
*
|
|
555
|
+
* @param keybind The keybind to update.
|
|
556
|
+
* @param keybindConfig The new keybind config.
|
|
557
|
+
*/
|
|
558
|
+
updateKeybind: (keybind: TKeybind, keybindConfig: OverlayedAppKeybindsConfig<TKeybind>[TKeybind]) => void;
|
|
559
|
+
/**
|
|
560
|
+
* Bulk update keybinds.
|
|
561
|
+
*
|
|
562
|
+
* @param keybinds The keybinds to update. Keybind keys not provided will not be updated.
|
|
563
|
+
*/
|
|
564
|
+
updateKeybinds: (keybinds: Partial<OverlayedAppKeybindsConfig<TKeybind>>) => void;
|
|
565
|
+
};
|
|
566
|
+
type ActiveGameInfo = {
|
|
567
|
+
isConnected: boolean;
|
|
568
|
+
resolution: {
|
|
569
|
+
width: number;
|
|
570
|
+
height: number;
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
interface OverlayedAppWindowsModule extends Pick<RenderInterface$1, "on" | "off" | "once" | "addListener" | "prependListener" | "prependOnceListener" | "removeListener" | "removeAllListeners"> {
|
|
574
|
+
/**
|
|
575
|
+
* Returns the production site url configured in the [Overlayed Dashboard](https://overlay.dev/settings).
|
|
576
|
+
*
|
|
577
|
+
* @returns The production site url.
|
|
578
|
+
*/
|
|
579
|
+
getProductionSiteUrl: () => URL;
|
|
580
|
+
/**
|
|
581
|
+
* Creates a new window. All windows must be created with this method.
|
|
582
|
+
*
|
|
583
|
+
* @param options The options for the window.
|
|
584
|
+
* @returns The created window.
|
|
585
|
+
*/
|
|
586
|
+
createWindow(options: BrowserWindowConstructorOptions): BrowserWindow;
|
|
587
|
+
/**
|
|
588
|
+
* Creates a new in-game window. All in-game windows must be created with this method.
|
|
589
|
+
*
|
|
590
|
+
* @param options The options for the window.
|
|
591
|
+
* @returns The created window.
|
|
592
|
+
*/
|
|
593
|
+
createInGameWindow(options: RenderWindowConstructorOptions$1): RenderWindow$1;
|
|
594
|
+
/**
|
|
595
|
+
* Returns information about the currently active game.
|
|
596
|
+
*
|
|
597
|
+
* @returns The active game info.
|
|
598
|
+
*/
|
|
599
|
+
getActiveGameInfo: () => ActiveGameInfo;
|
|
600
|
+
}
|
|
601
|
+
type OverlayedAppInputModuleRaw = {
|
|
602
|
+
/**
|
|
603
|
+
* Block the game from receiving mouse input.
|
|
604
|
+
*
|
|
605
|
+
* @param block Whether to block mouse input.
|
|
606
|
+
*/
|
|
607
|
+
setGlobalMouseBlock(block: boolean): void;
|
|
608
|
+
/**
|
|
609
|
+
* Block the game from receiving keyboard input.
|
|
610
|
+
*
|
|
611
|
+
* @param block Whether to block keyboard input.
|
|
612
|
+
*/
|
|
613
|
+
setGlobalKeyboardBlock(block: boolean): void;
|
|
614
|
+
/**
|
|
615
|
+
* Show or hide the cursor.
|
|
616
|
+
*
|
|
617
|
+
* @param show Whether to show or hide the cursor.
|
|
618
|
+
*/
|
|
619
|
+
setGlobalCursorOverride(show: boolean): void;
|
|
620
|
+
/**
|
|
621
|
+
* Block the game from receiving input for a specific key.
|
|
622
|
+
*
|
|
623
|
+
* @param key The key to block input for.
|
|
624
|
+
* @param block Whether to block input for the key.
|
|
625
|
+
*/
|
|
626
|
+
setKeyInputBlock(key: VirtualKey$1, block: boolean): void;
|
|
627
|
+
/**
|
|
628
|
+
* Get the current state of the global mouse block.
|
|
629
|
+
*/
|
|
630
|
+
getGlobalMouseBlock(): boolean;
|
|
631
|
+
/**
|
|
632
|
+
* Get the current state of the global keyboard block.
|
|
633
|
+
*/
|
|
634
|
+
getGlobalKeyboardBlock(): boolean;
|
|
635
|
+
/**
|
|
636
|
+
* Get the current state of the global cursor override.
|
|
637
|
+
*/
|
|
638
|
+
getGlobalCursorOverride(): boolean;
|
|
639
|
+
/**
|
|
640
|
+
* Get the current state of the key input block for a specific key.
|
|
641
|
+
* @param key The key to block input for.
|
|
642
|
+
*/
|
|
643
|
+
getKeyInputBlock(key: VirtualKey$1): boolean;
|
|
644
|
+
};
|
|
645
|
+
interface OverlayedAppInputModule {
|
|
646
|
+
scope: (scopeName: string) => ReturnType<OverridesManager["scope"]>;
|
|
647
|
+
raw: OverlayedAppInputModuleRaw;
|
|
648
|
+
}
|
|
649
|
+
interface CortexEvents extends Record<string, unknown> {}
|
|
650
|
+
interface OverlayedAppCortexModule {
|
|
651
|
+
track: <TEventName extends keyof CortexEvents>(name: TEventName, data: CortexEvents[TEventName]) => void;
|
|
652
|
+
}
|
|
653
|
+
interface OverlayedAppAdsModule {
|
|
654
|
+
registerWindow(window: BrowserWindow, options?: {
|
|
655
|
+
linkHandler?: {
|
|
656
|
+
allowHosts?: string[];
|
|
657
|
+
};
|
|
658
|
+
}): void;
|
|
659
|
+
}
|
|
660
|
+
type OverlayedAppLoggingModuleSubmitFeedbackInfo = Omit<FeedbackRequestDataModel, "app_version" | "app_channel" | "type" | "cortex_user_id">;
|
|
661
|
+
interface OverlayedAppLoggingModuleSubmitFeedbackOptions {
|
|
662
|
+
/**
|
|
663
|
+
* A key value record of additional files to include in the feedback.
|
|
664
|
+
*
|
|
665
|
+
* The key is the name of the file, and the value is the content of the file.
|
|
666
|
+
*/
|
|
667
|
+
additionalFiles?: Record<string, string>;
|
|
668
|
+
/**
|
|
669
|
+
* When true, silences logs
|
|
670
|
+
*
|
|
671
|
+
* @default false
|
|
672
|
+
*/
|
|
673
|
+
silent?: boolean;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* The logging module.
|
|
677
|
+
* - This module is used to log messages to the console and file.
|
|
678
|
+
* - Logs are stored in `%appdata%/overlayed/<appId>/logs/app.log`.
|
|
679
|
+
* - One log file is created per day, and is deleted after 7 days.
|
|
680
|
+
* - Enabling debug mode will show in the overlayed options .debug logs, and internal overlayed logs.
|
|
681
|
+
*
|
|
682
|
+
* @example
|
|
683
|
+
* ```ts
|
|
684
|
+
* const scope = overlayed.log.scope("MyScope");
|
|
685
|
+
* scope.info("Hello, world!");
|
|
686
|
+
* // [2025-07-20 01:51:40.969] [info] [MyScope] Hello, world!
|
|
687
|
+
* ```
|
|
688
|
+
*/
|
|
689
|
+
interface OverlayedAppLoggingModule {
|
|
690
|
+
/**
|
|
691
|
+
* Returns a scoped logging instance. Each message will be prefixed with the scope name.
|
|
692
|
+
*
|
|
693
|
+
* ```ts
|
|
694
|
+
* const scope = overlayed.log.scope("MyScope");
|
|
695
|
+
* scope.info("Hello, world!");
|
|
696
|
+
* // [2025-07-20 01:51:40.969] [log] [MyScope] Hello, world!
|
|
697
|
+
* ```
|
|
698
|
+
*
|
|
699
|
+
* @param scopeName - The name of the scope.
|
|
700
|
+
* @returns The logger scope.
|
|
701
|
+
*/
|
|
702
|
+
scope: (scopeName: string) => LoggerScope;
|
|
703
|
+
info: (message: string) => void;
|
|
704
|
+
warn: (message: string) => void;
|
|
705
|
+
error: (message: string) => void;
|
|
706
|
+
/**
|
|
707
|
+
* Log a message to the console if debug mode is enabled.
|
|
708
|
+
*
|
|
709
|
+
* @param message - The message to log.
|
|
710
|
+
*/
|
|
711
|
+
debug: (message: string) => void;
|
|
712
|
+
/**
|
|
713
|
+
* Submits info you provide, app logs, overlayed logs, and any additional files you provide to be viewed
|
|
714
|
+
* in your Overlayed dashboard.
|
|
715
|
+
*
|
|
716
|
+
* @throws Error if files fail to zip
|
|
717
|
+
* @throws ApiError if the request fails
|
|
718
|
+
*
|
|
719
|
+
* @param type - The type of feedback to submit.
|
|
720
|
+
* @param info - The information to include in the feedback.
|
|
721
|
+
* @param options - The options to include in the feedback.
|
|
722
|
+
* @returns The unique feedback identifier, or undefined if the request fails.
|
|
723
|
+
*/
|
|
724
|
+
submitFeedback: (type: FeedbackType, info: OverlayedAppLoggingModuleSubmitFeedbackInfo, options?: OverlayedAppLoggingModuleSubmitFeedbackOptions) => Promise<FeedbackId | undefined>;
|
|
725
|
+
/**
|
|
726
|
+
* Get the zip of logs sent via the submitFeedback method.
|
|
727
|
+
*
|
|
728
|
+
* ```ts
|
|
729
|
+
* const zip = overlayed.logger.getLogsZip();
|
|
730
|
+
*
|
|
731
|
+
* // prep to send off to a server
|
|
732
|
+
* const zipBase64 = await zip.generateAsync({ type: "base64" });
|
|
733
|
+
* ```
|
|
734
|
+
*
|
|
735
|
+
* @param options - The options to include in the zip.
|
|
736
|
+
* @returns Returns a zip of app and overlayed logs, and any additional files you provide.
|
|
737
|
+
*/
|
|
738
|
+
getLogsZip: (options?: OverlayedAppLoggingModuleSubmitFeedbackOptions) => JSZip;
|
|
739
|
+
}
|
|
740
|
+
type OverlayedAppNoticeHandlerMapping = {
|
|
741
|
+
/**
|
|
742
|
+
* Emitted when:
|
|
743
|
+
* - Notices are automatically fetched from the API
|
|
744
|
+
* - A notice is dismissed
|
|
745
|
+
* - `gameReady` is triggered
|
|
746
|
+
*
|
|
747
|
+
* The `notices` will never include dismissed notices.
|
|
748
|
+
*
|
|
749
|
+
* @param data - The data containing the notices.
|
|
750
|
+
*/
|
|
751
|
+
noticesUpdated: (data: {
|
|
752
|
+
notices: NoticeModel[];
|
|
753
|
+
}) => void;
|
|
754
|
+
};
|
|
755
|
+
/**
|
|
756
|
+
* Module to show notices to the user.
|
|
757
|
+
*
|
|
758
|
+
* Create a notice in the [Overlayed Dashboard](https://overlay.dev/notices).
|
|
759
|
+
*/
|
|
760
|
+
interface OverlayedAppNoticesModule {
|
|
761
|
+
on: <TEvent extends keyof OverlayedAppNoticeHandlerMapping = keyof OverlayedAppNoticeHandlerMapping>(event: TEvent, cb: OverlayedAppNoticeHandlerMapping[TEvent]) => void;
|
|
762
|
+
off: <TEvent extends keyof OverlayedAppNoticeHandlerMapping = keyof OverlayedAppNoticeHandlerMapping>(event: TEvent, cb: OverlayedAppNoticeHandlerMapping[TEvent]) => void;
|
|
763
|
+
/**
|
|
764
|
+
* Dismiss a notice. This will remove it from the list of notices returned by `getNotices` and the `noticesUpdated` event.
|
|
765
|
+
*
|
|
766
|
+
* Notices are stored in a `notice.json` file in your app directory.
|
|
767
|
+
* A maximum of 100 dismissed notices are stored. Once this limit is reached, the oldest dismissed notice is removed.
|
|
768
|
+
*
|
|
769
|
+
* When passing a notice id that is not dismissible, nothing will happen.
|
|
770
|
+
*
|
|
771
|
+
* @param noticeId - The id of the notice to dismiss.
|
|
772
|
+
*/
|
|
773
|
+
dismissNotice: (noticeId: NoticeId) => void;
|
|
774
|
+
/**
|
|
775
|
+
* Returns notices that are not dismissed and not expired.
|
|
776
|
+
*
|
|
777
|
+
* Notices for the currently launched games are included, and any notices without a game attached are included.
|
|
778
|
+
*
|
|
779
|
+
* @returns an array of notices
|
|
780
|
+
*/
|
|
781
|
+
getNotices: () => NoticeModel[];
|
|
782
|
+
}
|
|
783
|
+
type OverlayedAppUpdateHandlerMapping = { [K in keyof UpdateManagerEvents]: (data: UpdateManagerEvents[K]) => void };
|
|
784
|
+
interface OverlayedAppUpdateModule {
|
|
785
|
+
site: OverlayedAppSiteModule;
|
|
786
|
+
on: <TEvent extends keyof OverlayedAppUpdateHandlerMapping = keyof OverlayedAppUpdateHandlerMapping>(event: TEvent, cb: OverlayedAppUpdateHandlerMapping[TEvent]) => void;
|
|
787
|
+
off: <TEvent extends keyof OverlayedAppUpdateHandlerMapping = keyof OverlayedAppUpdateHandlerMapping>(event: TEvent, cb: OverlayedAppUpdateHandlerMapping[TEvent]) => void;
|
|
788
|
+
/**
|
|
789
|
+
* Checks for updates.
|
|
790
|
+
* @returns Promise<UpdateCheckResult | null>
|
|
791
|
+
*/
|
|
792
|
+
checkForUpdates: () => Promise<UpdateCheckResult$1 | null>;
|
|
793
|
+
/**
|
|
794
|
+
* Sets the function to fetch the access token.
|
|
795
|
+
* This function should return the access token or null if the channel is public.
|
|
796
|
+
*
|
|
797
|
+
* @param accessTokenFetcher - The function to fetch the access token. Optionally pass the new channel to fetch the access token for.
|
|
798
|
+
*/
|
|
799
|
+
setAccessTokenFetcher: (accessTokenFetcher: (newChannel: string) => Promise<string | null>) => void;
|
|
800
|
+
/**
|
|
801
|
+
* Switches the channel for the next checkForUpdates call.
|
|
802
|
+
*
|
|
803
|
+
* Example code:
|
|
804
|
+
*
|
|
805
|
+
* ```ts
|
|
806
|
+
* function changeChannel(newChannel: string) {
|
|
807
|
+
* await overlayed.updater.switchChannel(newChannel);
|
|
808
|
+
* await overlayed.updater.checkForUpdates();
|
|
809
|
+
* }
|
|
810
|
+
* ```
|
|
811
|
+
*
|
|
812
|
+
* @param channel - The channel to switch to.
|
|
813
|
+
*/
|
|
814
|
+
switchChannel: (channel: string) => Promise<UpdateCheckResult$1 | null>;
|
|
815
|
+
/**
|
|
816
|
+
* Restarts the app and installs the update after it has been downloaded.
|
|
817
|
+
* It should only be called after `update-downloaded` has been emitted.
|
|
818
|
+
*
|
|
819
|
+
* **Note:** `autoUpdater.quitAndInstall()` will close all application windows first and only emit `before-quit` event on `app` after that.
|
|
820
|
+
* This is different from the normal quit event sequence.
|
|
821
|
+
*
|
|
822
|
+
* @param isSilent *windows-only* Runs the installer in silent mode. Defaults to `false`.
|
|
823
|
+
* @param isForceRunAfter Run the app after finish even on silent install. Not applicable for macOS.
|
|
824
|
+
* Ignored if `isSilent` is set to `false`(In this case you can still set `autoRunAppAfterInstall` to `false` to prevent run the app after finish).
|
|
825
|
+
*
|
|
826
|
+
* @throws Error if `canUpdate` is false.
|
|
827
|
+
*/
|
|
828
|
+
quitAndInstall: (isSilent?: boolean, isForceRunAfter?: boolean) => void;
|
|
829
|
+
/**
|
|
830
|
+
* Checks if the user can update.
|
|
831
|
+
*
|
|
832
|
+
* @example
|
|
833
|
+
* ```ts
|
|
834
|
+
* const [canUpdate, denialReason] = overlayed.updater.canUpdate();
|
|
835
|
+
* ```
|
|
836
|
+
*
|
|
837
|
+
* @returns `[true, null]` if the user can update, `[false, reason]` if the user cannot update.
|
|
838
|
+
*
|
|
839
|
+
* Reasons:
|
|
840
|
+
* - "User is in game"
|
|
841
|
+
*/
|
|
842
|
+
canUpdate: () => [true, null] | [false, string];
|
|
843
|
+
}
|
|
844
|
+
interface OverlayedAppApplicationModule {
|
|
845
|
+
/**
|
|
846
|
+
* Get the application channel.
|
|
847
|
+
* @returns string
|
|
848
|
+
*/
|
|
849
|
+
getChannel: () => string;
|
|
850
|
+
/**
|
|
851
|
+
* Get the application version.
|
|
852
|
+
* @returns string
|
|
853
|
+
*/
|
|
854
|
+
getVersion: () => string;
|
|
855
|
+
/**
|
|
856
|
+
* Get the application release id.
|
|
857
|
+
* @returns string | null
|
|
858
|
+
*/
|
|
859
|
+
getReleaseId: () => string | null;
|
|
860
|
+
}
|
|
861
|
+
type OverlayedAppSiteHandlerMapping = {
|
|
862
|
+
/**
|
|
863
|
+
* Emitted when a new site version is available.
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* ```ts
|
|
867
|
+
* overlayed.site.on("siteUpdateReady", () => {
|
|
868
|
+
* showUserSiteUpdateButton();
|
|
869
|
+
* });
|
|
870
|
+
*
|
|
871
|
+
* onUserClickSiteUpdateButton(() => {
|
|
872
|
+
* overlayed.site.allowSiteUpdateOnNextLoad();
|
|
873
|
+
* allWindows.forEach((window) => {
|
|
874
|
+
* window.webContents.reload();
|
|
875
|
+
* });
|
|
876
|
+
* });
|
|
877
|
+
*
|
|
878
|
+
* @param data - releaseId and version
|
|
879
|
+
* @returns
|
|
880
|
+
*/
|
|
881
|
+
siteUpdateReady: (data: {
|
|
882
|
+
releaseId: ReleaseId;
|
|
883
|
+
version: string;
|
|
884
|
+
}) => void;
|
|
885
|
+
};
|
|
886
|
+
interface OverlayedAppSiteModule {
|
|
887
|
+
on: <TEvent extends keyof OverlayedAppSiteHandlerMapping = keyof OverlayedAppSiteHandlerMapping>(event: TEvent, cb: OverlayedAppSiteHandlerMapping[TEvent]) => void;
|
|
888
|
+
off: <TEvent extends keyof OverlayedAppSiteHandlerMapping = keyof OverlayedAppSiteHandlerMapping>(event: TEvent, cb: OverlayedAppSiteHandlerMapping[TEvent]) => void;
|
|
889
|
+
/**
|
|
890
|
+
* If an update is available, the next time BrowserWindow#loadURL is called, the new site version will be used.
|
|
891
|
+
*
|
|
892
|
+
* Must be called only after `siteUpdateReady` has been emitted.
|
|
893
|
+
*
|
|
894
|
+
* @example
|
|
895
|
+
* ```ts
|
|
896
|
+
* overlayed.site.on("siteUpdateReady", () => {
|
|
897
|
+
* showUserSiteUpdateButton();
|
|
898
|
+
* });
|
|
899
|
+
*
|
|
900
|
+
* onUserClickSiteUpdateButton(() => {
|
|
901
|
+
* overlayed.site.allowSiteUpdateOnNextLoad();
|
|
902
|
+
* allWindows.forEach((window) => {
|
|
903
|
+
* window.webContents.reload();
|
|
904
|
+
* });
|
|
905
|
+
* });
|
|
906
|
+
* ```
|
|
907
|
+
*/
|
|
908
|
+
allowSiteUpdateOnNextLoad: () => void;
|
|
909
|
+
}
|
|
910
|
+
type OverlayedApp<TModule extends GameModule, TKeybind extends string> = OverlayedAppGameModules<TModule> & OverlayedAppHandlers & {
|
|
911
|
+
keybinds: OverlayedAppKeybindModule<TKeybind>;
|
|
912
|
+
windows: OverlayedAppWindowsModule;
|
|
913
|
+
input: OverlayedAppInputModule;
|
|
914
|
+
ads: OverlayedAppAdsModule;
|
|
915
|
+
cortex: OverlayedAppCortexModule;
|
|
916
|
+
log: OverlayedAppLoggingModule;
|
|
917
|
+
notices: OverlayedAppNoticesModule;
|
|
918
|
+
updater: OverlayedAppUpdateModule;
|
|
919
|
+
application: OverlayedAppApplicationModule;
|
|
920
|
+
/**
|
|
921
|
+
* Returns true if any monitored processes are running.
|
|
922
|
+
*
|
|
923
|
+
* Useful for stopping the overlay from updating when the game is running.
|
|
924
|
+
*
|
|
925
|
+
* @returns True if any monitored processes are running.
|
|
926
|
+
*/
|
|
927
|
+
hasAnyActiveProcesses: () => boolean;
|
|
928
|
+
/**
|
|
929
|
+
* Returns true if any monitored games are running.
|
|
930
|
+
*
|
|
931
|
+
* @returns True if any monitored games are running.
|
|
932
|
+
*/
|
|
933
|
+
hasAnyActiveGames: () => boolean;
|
|
934
|
+
/**
|
|
935
|
+
* Initializes the overlayed app.
|
|
936
|
+
*
|
|
937
|
+
* This should only be called once, and is automatically called by default, unless `init: false` is passed:
|
|
938
|
+
* ```ts
|
|
939
|
+
* overlayed({
|
|
940
|
+
* init: false,
|
|
941
|
+
* });
|
|
942
|
+
* ```
|
|
943
|
+
*/
|
|
944
|
+
init: () => void;
|
|
945
|
+
/**
|
|
946
|
+
* Returns true if the overlayed app has been initialized.
|
|
947
|
+
*/
|
|
948
|
+
initialized: boolean;
|
|
949
|
+
};
|
|
950
|
+
interface OverlayedOptions<TModule extends GameModule, TKeybind extends string> {
|
|
951
|
+
/**
|
|
952
|
+
* The electron instance.
|
|
953
|
+
*
|
|
954
|
+
* Must be imported globally like:
|
|
955
|
+
* ```ts
|
|
956
|
+
* import { electron } from "electron";
|
|
957
|
+
* ```
|
|
958
|
+
* or
|
|
959
|
+
* ```ts
|
|
960
|
+
* const electron = require("electron");
|
|
961
|
+
* ```
|
|
962
|
+
*/
|
|
963
|
+
electron: typeof electron0;
|
|
964
|
+
/**
|
|
965
|
+
* The application id, this can be found in the [Overlayed Dashboard](https://overlay.dev/settings/applications).
|
|
966
|
+
*/
|
|
967
|
+
applicationId: string;
|
|
968
|
+
/**
|
|
969
|
+
* App modules to load.
|
|
970
|
+
*/
|
|
971
|
+
modules: TModule[];
|
|
972
|
+
/**
|
|
973
|
+
* App keybinds config.
|
|
974
|
+
*/
|
|
975
|
+
keybinds: OverlayedAppKeybindsConfig<TKeybind>;
|
|
976
|
+
/**
|
|
977
|
+
* Whether to initialize the app when the module is loaded.
|
|
978
|
+
* @default true;
|
|
979
|
+
*/
|
|
980
|
+
init?: boolean;
|
|
981
|
+
/**
|
|
982
|
+
* When true, the overlay will be loaded for all supported games.
|
|
983
|
+
* When false, only games registered under the `modules` array will be loaded.
|
|
984
|
+
*
|
|
985
|
+
* @default false
|
|
986
|
+
*/
|
|
987
|
+
universal?: boolean;
|
|
988
|
+
/**
|
|
989
|
+
* When true, the overlay will be loaded in debug mode.
|
|
990
|
+
*
|
|
991
|
+
* @default false
|
|
992
|
+
*/
|
|
993
|
+
debug?: boolean;
|
|
994
|
+
/**
|
|
995
|
+
* When true, internal overlayed logs will not be logged to the console.
|
|
996
|
+
*
|
|
997
|
+
* @default true
|
|
998
|
+
*/
|
|
999
|
+
silent?: boolean;
|
|
1000
|
+
/**
|
|
1001
|
+
* Site module configuration.
|
|
1002
|
+
*/
|
|
1003
|
+
site?: {
|
|
1004
|
+
/**
|
|
1005
|
+
* When true, users will not update automatically when a new site version is available.
|
|
1006
|
+
*
|
|
1007
|
+
* If you'd prefer users to have to click an "update" button when a new site version,
|
|
1008
|
+
* set this to true.
|
|
1009
|
+
*
|
|
1010
|
+
* @default false
|
|
1011
|
+
*/
|
|
1012
|
+
manualUpdates?: boolean;
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
//#endregion
|
|
1016
|
+
//#region src/utilities/overlayed.d.ts
|
|
1017
|
+
declare function overlayed<TModule extends GameModule, TShortcut extends string>(optionsRaw: OverlayedOptions<TModule, TShortcut>): OverlayedApp<TModule, TShortcut>;
|
|
1018
|
+
//#endregion
|
|
1019
|
+
export { type ActiveGameInfo, type BundleAppConfig, type BundleSiteConfig, type ErrorEvents, type FatalEvents, type FeedbackId, type FeedbackType, type GameCloseEvent, type GameLaunchEvent, type GameReadyEvent, type KeybindSchemaEntry as KeybindConfig, type KeyboardKeyEvent, type LoggerScope, type MouseButtonEvent, type NoticeId, type NoticeModel, type NoticeType, type OverlayedApp, type OverlayedConfig, type OverridesManagerScope, type ProgressInfo, RenderInterface, type RenderWindow, type RenderWindowConstructorOptions, type UpdateCheckResult, VirtualKey, type WarningEvents, type WindowEvent, defineConfig, overlayed };
|
|
1020
|
+
declare global {
|
|
1021
|
+
namespace Electron {
|
|
1022
|
+
interface BrowserWindow {
|
|
1023
|
+
isShown(): boolean;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|