@overlayed/app 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +30 -16
- package/dist/index.js +396 -333
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -78,20 +78,24 @@ declare interface FatalElevationMismatch extends ErrorManagerEvent {
|
|
|
78
78
|
declare type FatalEvents = FatalElevationMismatch;
|
|
79
79
|
|
|
80
80
|
export declare type GameLaunchManagerEvents = {
|
|
81
|
-
|
|
81
|
+
gameCloseInternal: (args: {
|
|
82
82
|
ravenGame: RavenGame;
|
|
83
83
|
process: Process;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
ravenGame: RavenGame;
|
|
87
|
-
process: Process;
|
|
88
|
-
};
|
|
89
|
-
gameLaunch: {
|
|
84
|
+
}) => MaybePromise<void>;
|
|
85
|
+
gameLaunch: (args: {
|
|
90
86
|
game: string;
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
reject: () => void;
|
|
88
|
+
}) => MaybePromise<boolean>;
|
|
89
|
+
gameClose: (args: {
|
|
93
90
|
game: string;
|
|
94
|
-
}
|
|
91
|
+
}) => MaybePromise<void>;
|
|
92
|
+
gameReady: (args: {
|
|
93
|
+
game: string;
|
|
94
|
+
}) => MaybePromise<void>;
|
|
95
|
+
gameReadyInternal: (args: {
|
|
96
|
+
ravenGame: RavenGame;
|
|
97
|
+
process: Process;
|
|
98
|
+
}) => MaybePromise<void>;
|
|
95
99
|
};
|
|
96
100
|
|
|
97
101
|
declare interface GameModule<TEvents extends Record<string, BaseEvent> = Record<string, BaseEvent>, TKey extends string = string> {
|
|
@@ -141,6 +145,8 @@ declare class Manager {
|
|
|
141
145
|
destroy(): void;
|
|
142
146
|
}
|
|
143
147
|
|
|
148
|
+
declare type MaybePromise<T> = T | Promise<T>;
|
|
149
|
+
|
|
144
150
|
export interface MouseButtonEvent extends WindowEvent {
|
|
145
151
|
x: number;
|
|
146
152
|
y: number;
|
|
@@ -151,7 +157,7 @@ export interface MouseButtonEvent extends WindowEvent {
|
|
|
151
157
|
key: VirtualKey;
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
export declare function overlayed<TModule extends GameModule, TShortcut extends string>(
|
|
160
|
+
export declare function overlayed<TModule extends GameModule, TShortcut extends string>(options: OverlayedOptions<TModule, TShortcut>): OverlayedApp<TModule, TShortcut>;
|
|
155
161
|
|
|
156
162
|
export declare type OverlayedApp<TModule extends GameModule, TKeybind extends string> = OverlayedAppGameModules<TModule> & OverlayedAppHandlers & {
|
|
157
163
|
keybinds: OverlayedAppKeybindModule<TKeybind>;
|
|
@@ -206,8 +212,9 @@ declare type OverlayedAppHandlersMapping = {
|
|
|
206
212
|
error: (data: ErrorManagerEvents["error"]) => void;
|
|
207
213
|
warning: (data: ErrorManagerEvents["warning"]) => void;
|
|
208
214
|
fatal: (data: ErrorManagerEvents["fatal"]) => void;
|
|
209
|
-
gameLaunch:
|
|
210
|
-
gameClose:
|
|
215
|
+
gameLaunch: GameLaunchManagerEvents["gameLaunch"];
|
|
216
|
+
gameClose: GameLaunchManagerEvents["gameClose"];
|
|
217
|
+
gameReady: GameLaunchManagerEvents["gameReady"];
|
|
211
218
|
};
|
|
212
219
|
|
|
213
220
|
declare interface OverlayedAppInputModule {
|
|
@@ -296,7 +303,7 @@ declare type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<TKeybi
|
|
|
296
303
|
* - Whatever you configure will be the default value
|
|
297
304
|
* - [Here](https://www.toptal.com/developers/keycode) is a good tool to easily find the codes for a given hotkey
|
|
298
305
|
*/
|
|
299
|
-
keys:
|
|
306
|
+
keys: OverlayedAppKeybindsConfigKey[];
|
|
300
307
|
/**
|
|
301
308
|
* - `toggle` will trigger the callback when the key is toggled on and off
|
|
302
309
|
* - `hold` will trigger the callback when the key is held down
|
|
@@ -305,7 +312,7 @@ declare type OverlayedAppKeybindsConfig<TKeybind extends string> = Record<TKeybi
|
|
|
305
312
|
mode: OverlayedAppKeybindsConfigMode;
|
|
306
313
|
}>;
|
|
307
314
|
|
|
308
|
-
declare type OverlayedAppKeybindsConfigKey = "
|
|
315
|
+
declare type OverlayedAppKeybindsConfigKey = "ControlLeft" | "AltLeft" | "ShiftLeft" | "AltRight" | "ControlRight" | "ShiftRight" | (string & {});
|
|
309
316
|
|
|
310
317
|
declare type OverlayedAppKeybindsConfigMode = "toggle" | "hold";
|
|
311
318
|
|
|
@@ -314,7 +321,7 @@ declare interface OverlayedAppWindowsModule extends Pick<RenderInterface, "on" |
|
|
|
314
321
|
getActiveGameInfo: () => ActiveGameInfo;
|
|
315
322
|
}
|
|
316
323
|
|
|
317
|
-
declare interface
|
|
324
|
+
declare interface OverlayedOptions<TModule extends GameModule, TKeybind extends string> {
|
|
318
325
|
/**
|
|
319
326
|
* The app name.
|
|
320
327
|
*
|
|
@@ -334,6 +341,13 @@ declare interface OverlayedData<TModule extends GameModule, TKeybind extends str
|
|
|
334
341
|
* @default true;
|
|
335
342
|
*/
|
|
336
343
|
init?: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* When true, the overlay will be loaded for all supported games.
|
|
346
|
+
* When false, only games registered under the `modules` array will be loaded.
|
|
347
|
+
*
|
|
348
|
+
* @default false
|
|
349
|
+
*/
|
|
350
|
+
universal?: boolean;
|
|
337
351
|
}
|
|
338
352
|
|
|
339
353
|
declare class OverridesManager extends Manager {
|