@overlayed/app 1.3.6 → 1.3.9

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.mts CHANGED
@@ -1,90 +1,17 @@
1
- import * as arktype0 from "arktype";
1
+ import * as _$arktype from "arktype";
2
2
  import { Module, Type } from "arktype";
3
3
  import EventEmitter$1 from "events";
4
- import "xior";
5
4
  import JSZip from "jszip";
6
- import * as electron0 from "electron";
5
+ import * as _$electron from "electron";
7
6
  import { BrowserWindow, BrowserWindowConstructorOptions } from "electron";
8
7
  import { CancellationToken, 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";
8
+ import * as _$arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
10
9
  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
10
 
12
11
  //#region ../utils/dist/index.d.ts
13
12
  type MaybePromise<T> = T | Promise<T>;
14
- type MaybeArray<T> = T | T[];
15
- //#endregion
13
+ type MaybeArray<T> = T | T[]; //#endregion
16
14
  //#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
15
  //#endregion
89
16
  //#region ../utils-node/dist/index.d.mts
90
17
  //#endregion
@@ -124,10 +51,8 @@ declare class LoggerClass {
124
51
  private logToConsole;
125
52
  }
126
53
  declare const Logger: Singleton<typeof LoggerClass>;
127
- type CustomLoggerScope = ReturnType<typeof Logger.prototype.scope>;
128
- //#endregion
54
+ type CustomLoggerScope = ReturnType<typeof Logger.prototype.scope>; //#endregion
129
55
  //#region src/consts.d.ts
130
-
131
56
  //#endregion
132
57
  //#region src/errorManager.d.ts
133
58
  type ErrorManagerEvent = {
@@ -249,16 +174,15 @@ declare const BaseEvent: Type<{
249
174
  type: string;
250
175
  creation_time: number;
251
176
  }>;
252
- type BaseEvent = typeof BaseEvent.infer;
253
- //#endregion
177
+ type BaseEvent = typeof BaseEvent.infer; //#endregion
254
178
  //#region src/types.d.ts
255
179
  type EventType<TEvent extends BaseEvent> = TEvent["type"];
256
180
  type GameModuleEvent<TEvents extends Record<string, BaseEvent>> = TEvents & {
257
181
  event: BaseEvent;
258
182
  };
259
183
  type GameModuleEventInfer<TModule extends GameModule> = TModule["events"]["event"]["infer"];
260
- interface GameModule<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>, TKey$1 extends string = string> {
261
- key: TKey$1;
184
+ interface GameModule<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>, TKey extends string = string> {
185
+ key: TKey;
262
186
  events: Module<GameModuleEvent<TEvents>>;
263
187
  }
264
188
  type EventCallback<TEvent extends BaseEvent, TEventType extends EventType<TEvent>> = (event: Extract<TEvent, {
@@ -285,16 +209,88 @@ type KeybindCallbacks = {
285
209
  down: KeybindDownCallback[];
286
210
  up: KeybindUpCallback[];
287
211
  };
288
- declare const KeybindSchema: arktype_internal_variants_object_ts0.ObjectType<{
212
+ declare const KeybindSchema: _$arktype_internal_variants_object_ts0.ObjectType<{
289
213
  [x: string]: {
290
214
  keys: string[];
291
- mode: (In: "toggle" | "hold") => arktype0.Out<"toggle" | "hold">;
215
+ mode: (In: "hold" | "toggle") => _$arktype.Out<"hold" | "toggle">;
292
216
  };
293
217
  }, {}>;
294
218
  type KeybindSchemaEntry = (typeof KeybindSchema.infer)[string];
295
219
  //#endregion
296
220
  //#region ../api/dist/index.d.ts
297
-
221
+ //#region ../utils/dist/index.d.ts
222
+ //#endregion
223
+ //#region src/brand.d.ts
224
+ /**
225
+ * A `Brand` is a type that takes at minimum two type parameters. Given a base
226
+ * type `Base` and some unique and arbitrary branding type `Branding`, it
227
+ * produces a type based on but distinct from `Base`. The resulting branded
228
+ * type is not directly assignable from the base type, and not mutually
229
+ * assignable with another branded type derived from the same base type.
230
+ *
231
+ * Take care that the branding type is unique. Two branded types that share the
232
+ * same base type and branding type are considered the same type! There are two
233
+ * ways to avoid this.
234
+ *
235
+ * The first way is to supply a third type parameter, `ReservedName`, with a
236
+ * string literal type that is not `__type__`, which is the default.
237
+ *
238
+ * The second way is to define a branded type in terms of its surrounding
239
+ * interface, thereby forming a recursive type. This is possible because there
240
+ * are no constraints on what the branding type must be. It does not have to
241
+ * be a string literal type, even though it often is.
242
+ *
243
+ * @example
244
+ * ```
245
+ * type Path = Brand<string, 'path'>;
246
+ * type UserId = Brand<number, 'user'>;
247
+ * type DifferentUserId = Brand<number, 'user', '__kind__'>;
248
+ * interface Post { id: Brand<number, Post> }
249
+ * ```
250
+ */
251
+ type Brand<Base, Branding, ReservedName extends string = "__type__"> = Base & { [K in ReservedName]: Branding } & {
252
+ __witness__: Base;
253
+ };
254
+ /**
255
+ * An `AnyBrand` is a branded type based on any base type branded with any
256
+ * branding type. By itself it is not useful, but it can act as type constraint
257
+ * when manipulating branded types in general.
258
+ */
259
+ type AnyBrand = Brand<unknown, any>;
260
+ /**
261
+ * `BaseOf` is a type that takes any branded type `B` and yields its base type.
262
+ */
263
+ type BaseOf<B extends AnyBrand> = B["__witness__"];
264
+ /**
265
+ * A `Brander` is a function that takes a value of some base type and casts
266
+ * that value to a branded type derived from said base type. It can be thought
267
+ * of as the type of a "constructor", in the functional programming sense of
268
+ * the word.
269
+ *
270
+ * @example
271
+ * ```
272
+ * type UserId = Brand<number, 'user'>;
273
+ * // A Brander<UserId> would take a number and return a UserId
274
+ * ```
275
+ */
276
+ type Brander<B extends AnyBrand> = (underlying: BaseOf<B>) => B;
277
+ /**
278
+ * A generic function that, when given some branded type, can take a value with
279
+ * the base type of the branded type, and cast that value to the branded type.
280
+ * It fulfills the contract of a `Brander`.
281
+ *
282
+ * At runtime, this function simply returns the value as-is.
283
+ *
284
+ * @param underlying The value with a base type, to be casted
285
+ * @return The same underlying value, but casted
286
+ * @example
287
+ * ```
288
+ * type UserId = Brand<number, 'user'>;
289
+ * const UserId: Brander<UserId> = identity;
290
+ * ```
291
+ */
292
+ //#endregion
293
+ //#region src/endpoints/applications/applications.d.ts
298
294
  //#endregion
299
295
  //#region src/endpoints/applications/crashDumps.d.ts
300
296
  type GameCrashReportId = Brand<string, "GameCrashReportId">;
@@ -401,21 +397,21 @@ declare class OverridesManager extends Manager {
401
397
  //#region src/module.d.ts
402
398
  declare function module(): {
403
399
  readonly key: "universal";
404
- readonly events: arktype0.Module<{
400
+ readonly events: _$arktype.Module<{
405
401
  event: {
406
402
  game: "siege" | "tft";
407
- type: "logged_in";
403
+ type: "module_loaded";
408
404
  creation_time: number;
409
405
  content: {
410
- account_id: string;
406
+ game_version: string;
407
+ process_hash: string;
411
408
  };
412
409
  } | {
413
410
  game: "siege" | "tft";
414
- type: "module_loaded";
411
+ type: "logged_in";
415
412
  creation_time: number;
416
413
  content: {
417
- game_version: string;
418
- process_hash: string;
414
+ account_id: string;
419
415
  };
420
416
  } | {
421
417
  game: "siege" | "tft";
@@ -462,8 +458,7 @@ declare function module(): {
462
458
  };
463
459
  };
464
460
  }>;
465
- };
466
- //#endregion
461
+ }; //#endregion
467
462
  //#region src/events/loggedIn.d.ts
468
463
  //#endregion
469
464
  //#region src/managers/crashDumpManager.d.ts
@@ -506,13 +501,13 @@ type UpdateManagerEvents = {
506
501
  //#region src/utilities/types.d.ts
507
502
  type UniversalGameModule = ReturnType<typeof module>;
508
503
  type OverlayedAppGameModules<TModule extends GameModule> = { [TKey in TModule["key"]]: OverlayedAppGameModuleListeners<TModule, TKey> } & { [TKey in UniversalGameModule["key"]]: OverlayedAppGameModuleListeners<UniversalGameModule, TKey> };
509
- type OverlayedAppGameModuleListeners<TModule extends GameModule, TKey$1 extends TModule["key"] = TModule["key"]> = {
504
+ type OverlayedAppGameModuleListeners<TModule extends GameModule, TKey extends TModule["key"] = TModule["key"]> = {
510
505
  /**
511
506
  * Listen to any event emitted by the module.
512
507
  * @param cb - The callback to call when any event is emitted.
513
508
  */
514
509
  onAny<TEvent extends Extract<TModule, {
515
- key: TKey$1;
510
+ key: TKey;
516
511
  }>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
517
512
  /**
518
513
  * Listen to a specific event emitted by the module.
@@ -520,14 +515,14 @@ type OverlayedAppGameModuleListeners<TModule extends GameModule, TKey$1 extends
520
515
  * @param cb - The callback to call when the event is emitted.
521
516
  */
522
517
  on<TEvent extends Extract<TModule, {
523
- key: TKey$1;
518
+ key: TKey;
524
519
  }>["events"]["event"]["infer"], TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
525
520
  /**
526
521
  * Stop listening to any event emitted by the module.
527
522
  * @param cb - The callback to stop listening to.
528
523
  */
529
524
  offAny<TEvent extends Extract<TModule, {
530
- key: TKey$1;
525
+ key: TKey;
531
526
  }>["events"]["event"]["infer"]>(cb: (data: TEvent) => void): void;
532
527
  /**
533
528
  * Stop listening to a specific event emitted by the module.
@@ -535,7 +530,7 @@ type OverlayedAppGameModuleListeners<TModule extends GameModule, TKey$1 extends
535
530
  * @param cb - The callback to stop listening to.
536
531
  */
537
532
  off<TEvent extends GameModuleEventInfer<Extract<TModule, {
538
- key: TKey$1;
533
+ key: TKey;
539
534
  }>>, TEventType extends EventType<TEvent> = EventType<TEvent>>(event: TEventType, cb: EventCallback<TEvent, TEventType>): void;
540
535
  /**
541
536
  * Call this when you are ready to receive game events.
@@ -1103,7 +1098,7 @@ interface OverlayedOptions<TModule extends GameModule, TKeybind extends string,
1103
1098
  * const electron = require("electron");
1104
1099
  * ```
1105
1100
  */
1106
- electron: typeof electron0;
1101
+ electron: typeof _$electron;
1107
1102
  /**
1108
1103
  * The application id, this can be found in the [Overlayed Dashboard](https://overlay.dev/settings/applications).
1109
1104
  */