@overwolf/ow-electron-packages-types 1.1.1 → 1.1.2-beta.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/package.json +1 -1
- package/types.d.ts +186 -49
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { overwolf } from '@overwolf/ow-electron';
|
|
2
|
-
import type {
|
|
3
|
-
BrowserWindow,
|
|
4
|
-
BrowserWindowConstructorOptions,
|
|
5
|
-
Size,
|
|
6
|
-
WebContents,
|
|
7
|
-
Display,
|
|
8
|
-
Rectangle
|
|
9
|
-
} from 'electron';
|
|
10
|
-
|
|
11
|
-
import { EventEmitter } from 'events';
|
|
12
|
-
|
|
13
|
-
// -----------------------------------------------------------------------------
|
|
14
|
-
|
|
15
|
-
// --- modules\utility.d.ts ---
|
|
1
|
+
import { overwolf } from '@overwolf/ow-electron';
|
|
2
|
+
import type {
|
|
3
|
+
BrowserWindow,
|
|
4
|
+
BrowserWindowConstructorOptions,
|
|
5
|
+
Size,
|
|
6
|
+
WebContents,
|
|
7
|
+
Display,
|
|
8
|
+
Rectangle
|
|
9
|
+
} from 'electron';
|
|
10
|
+
|
|
11
|
+
import { EventEmitter } from 'events';
|
|
12
|
+
|
|
13
|
+
// -----------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
// --- modules\utility.d.ts ---
|
|
16
16
|
/**
|
|
17
17
|
* @packageDocumentation
|
|
18
18
|
*
|
|
@@ -65,18 +65,66 @@ interface IOverwolfUtilityApi {
|
|
|
65
65
|
scan(filter?: GamesFilter): Promise<InstalledGameInfo[]>;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
68
|
+
* Install ow-electron helpers to
|
|
69
|
+
* `%CommonProgramFiles%\<app-name>\` with UAC elevation.
|
|
70
|
+
* Allows injection into high elevation games.
|
|
71
71
|
* No-ops if files are already present.
|
|
72
|
-
*
|
|
73
|
-
* @throws {HelperInstallError}
|
|
72
|
+
*
|
|
73
|
+
* @throws \{HelperInstallError\} `exitCode 1223` — user cancelled the UAC prompt (ERROR_CANCELLED)
|
|
74
|
+
* @throws - {HelperInstallError} `err.exitCode !== 1223` — the installer process failed. Log `err.exitCode` and investigate.
|
|
75
|
+
* @throws \{HelperInstallError\} any other non-zero exitCode — installation failed.
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* The helper binaries are installed to:
|
|
79
|
+
* - `%CommonProgramFiles%\<app-name>\owe-helper-ui.exe` (x64)
|
|
80
|
+
* - `%CommonProgramFiles%\<app-name>\owe-helper-ui-x86.exe` (x86)
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* // Check whether the helper is already installed
|
|
85
|
+
* const installed: boolean = await api.isHighElevationHelperInstalled();
|
|
86
|
+
*
|
|
87
|
+
* // Trigger UAC-elevated installation (shows a UAC prompt to the user)
|
|
88
|
+
* try {
|
|
89
|
+
* await api.installHighElevationHelper();
|
|
90
|
+
* console.log('Helper installed successfully');
|
|
91
|
+
* } catch (err: any) {
|
|
92
|
+
* if (err.exitCode === 1223) {
|
|
93
|
+
* // User cancelled the UAC prompt — not an error, just inform the user
|
|
94
|
+
* console.warn('User cancelled UAC prompt');
|
|
95
|
+
* } else {
|
|
96
|
+
* console.error('Installation failed, exitCode:', err.exitCode);
|
|
97
|
+
* }
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* @example Typical integration flow
|
|
102
|
+
* ```ts
|
|
103
|
+
* async function ensureElevatedInjection(api: IOverwolfUtilityApi) {
|
|
104
|
+
* const installed = await api.isHighElevationHelperInstalled();
|
|
105
|
+
* if (!installed) {
|
|
106
|
+
* await api.installHighElevationHelper(); // may throw — handle UAC cancel
|
|
107
|
+
* }
|
|
108
|
+
* // Injection into elevated games now happens automatically on game launch
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
* @returns Resolves when installation completes.
|
|
74
112
|
*/
|
|
75
113
|
installHighElevationHelper?(): Promise<void>;
|
|
76
114
|
|
|
77
|
-
|
|
115
|
+
/**
|
|
78
116
|
* Returns true if ow-electron helpers is already installed in
|
|
79
|
-
*
|
|
117
|
+
* `%CommonProgramFiles%\<app-name>\`.
|
|
118
|
+
*
|
|
119
|
+
* @returns `true` if the helper is installed and ready.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const installed: boolean = await api.isHighElevationHelperInstalled();
|
|
124
|
+
* if (!installed) {
|
|
125
|
+
* // Prompt the user to run the one-time setup before injecting into elevated games
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
80
128
|
*/
|
|
81
129
|
isHighElevationHelperInstalled?(): Promise<boolean>;
|
|
82
130
|
|
|
@@ -98,9 +146,9 @@ interface IOverwolfUtilityApi {
|
|
|
98
146
|
*/
|
|
99
147
|
on(eventName: 'game-exit', listener: (gameInfo: GameInfo) => void): this;
|
|
100
148
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// --- modules\recorder.d.ts ---
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
// --- modules\recorder.d.ts ---
|
|
104
152
|
/**
|
|
105
153
|
*
|
|
106
154
|
* The Overwolf Electron recording APIs integrate recording into the Overwolf Electron framework allowing you to record both audio and video.
|
|
@@ -3052,7 +3100,7 @@ interface EncoderSettingsNVENC extends VideoEncoderSettingsBase {
|
|
|
3052
3100
|
* If `true`, the encoder dynamically determines the number of B-frames up to `bf`.
|
|
3053
3101
|
* Improves quality but increases GPU usage.
|
|
3054
3102
|
*
|
|
3055
|
-
* @default
|
|
3103
|
+
* @default true
|
|
3056
3104
|
*/
|
|
3057
3105
|
lookahead?: boolean;
|
|
3058
3106
|
|
|
@@ -4464,9 +4512,9 @@ interface IOverwolfRecordingApi {
|
|
|
4464
4512
|
*/
|
|
4465
4513
|
on(eventName: 'stats', listener: (args: RecorderStats) => void): this;
|
|
4466
4514
|
}
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
// --- modules\packages.d.ts ---
|
|
4515
|
+
|
|
4516
|
+
|
|
4517
|
+
// --- modules\packages.d.ts ---
|
|
4470
4518
|
// -----------------------------------------------------------------------------
|
|
4471
4519
|
//
|
|
4472
4520
|
/**
|
|
@@ -4528,9 +4576,9 @@ interface OWPackages extends overwolf.packages.OverwolfPackageManager {
|
|
|
4528
4576
|
*/
|
|
4529
4577
|
gep: OverwolfGameEventPackage;
|
|
4530
4578
|
}
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
// --- modules\overlay.d.ts ---
|
|
4579
|
+
|
|
4580
|
+
|
|
4581
|
+
// --- modules\overlay.d.ts ---
|
|
4534
4582
|
/**
|
|
4535
4583
|
* APIs for controlling and creating overlays in games. Overlay is the ability to show windows on top of the current game window.
|
|
4536
4584
|
*
|
|
@@ -4891,10 +4939,47 @@ interface IOverlayHotkey {
|
|
|
4891
4939
|
/**
|
|
4892
4940
|
* Primary key code for the hotkey.
|
|
4893
4941
|
*
|
|
4894
|
-
* Accepts a numeric Windows Virtual-Key code or
|
|
4895
|
-
*
|
|
4896
|
-
*
|
|
4897
|
-
*
|
|
4942
|
+
* Accepts a numeric Windows Virtual-Key (VK) code or a W3C {@link https://www.w3.org/TR/uievents-code/ | KeyboardEvent.code}
|
|
4943
|
+
* string (e.g. `'KeyF'`, `'F10'`, `'ArrowUp'`).
|
|
4944
|
+
*
|
|
4945
|
+
* @remarks
|
|
4946
|
+
* Numeric VK codes are layout-dependent — the same physical key produces a different
|
|
4947
|
+
* VK number on non-QWERTY keyboards. Passing a `KeyboardEvent.code` string identifies
|
|
4948
|
+
* the physical key unambiguously regardless of the user's keyboard layout.
|
|
4949
|
+
*
|
|
4950
|
+
* String values are resolved to VK codes at registration time. An unrecognized string
|
|
4951
|
+
* throws immediately so misconfigured hotkeys are caught early.
|
|
4952
|
+
*
|
|
4953
|
+
* **Supported string codes include:** `KeyA`–`KeyZ`, `Digit0`–`Digit9`,
|
|
4954
|
+
* `F1`–`F24`, `Numpad0`–`Numpad9`, `ArrowUp`/`Down`/`Left`/`Right`, `Tab`, `Enter`,
|
|
4955
|
+
* `Space`, `Backspace`, `Delete`, `Escape`, `Home`, `End`, `PageUp`, `PageDown`,
|
|
4956
|
+
* `ShiftLeft`/`Right`, `ControlLeft`/`Right`, `AltLeft`/`Right`, `Backquote`,
|
|
4957
|
+
* `Minus`, `Equal`, `BracketLeft`/`Right`, `Semicolon`, `Quote`, `Comma`,
|
|
4958
|
+
* `Period`, `Slash`, `Backslash`, and media/browser/launch keys.
|
|
4959
|
+
*
|
|
4960
|
+
* @throws `Error('Unknown hotkey code: "<value>". Pass a valid KeyboardEvent.code string…')`
|
|
4961
|
+
* thrown at registration time when the string does not map to a known VK code.
|
|
4962
|
+
* Validate the string before calling `register` if the value comes from user input.
|
|
4963
|
+
*
|
|
4964
|
+
* @example
|
|
4965
|
+
* ```ts
|
|
4966
|
+
* // Preferred: physical key position, layout-independent
|
|
4967
|
+
* api.hotkeys.register({ name: 'toggle', keyCode: 'KeyF' }, callback);
|
|
4968
|
+
*
|
|
4969
|
+
* // With modifier using string code
|
|
4970
|
+
* api.hotkeys.register({
|
|
4971
|
+
* name: 'screenshot',
|
|
4972
|
+
* keyCode: 'KeyP',
|
|
4973
|
+
* modifiers: { ctrl: true }
|
|
4974
|
+
* }, callback);
|
|
4975
|
+
*
|
|
4976
|
+
* // Legacy: numeric VK code (still valid)
|
|
4977
|
+
* api.hotkeys.register({ name: 'toggle-legacy', keyCode: 70 }, callback);
|
|
4978
|
+
*
|
|
4979
|
+
* // Throws at registration — unknown string
|
|
4980
|
+
* api.hotkeys.register({ name: 'bad', keyCode: 'Bogus' }, callback);
|
|
4981
|
+
* // Error: Unknown hotkey code: "Bogus". Pass a valid KeyboardEvent.code string…
|
|
4982
|
+
* ```
|
|
4898
4983
|
*/
|
|
4899
4984
|
keyCode: number | string;
|
|
4900
4985
|
|
|
@@ -5489,18 +5574,70 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5489
5574
|
exitExclusiveMode(): void;
|
|
5490
5575
|
|
|
5491
5576
|
/**
|
|
5492
|
-
*
|
|
5493
|
-
*
|
|
5494
|
-
*
|
|
5577
|
+
* Install ow-electron helpers to
|
|
5578
|
+
* `%CommonProgramFiles%\<app-name>\` with UAC elevation.
|
|
5579
|
+
* Allows injection into high elevation games.
|
|
5495
5580
|
* No-ops if files are already present.
|
|
5496
|
-
*
|
|
5497
|
-
* @throws {HelperInstallError}
|
|
5581
|
+
*
|
|
5582
|
+
* @throws \{HelperInstallError\}
|
|
5583
|
+
* - `exitCode 1223` — user cancelled the UAC prompt (ERROR_CANCELLED)
|
|
5584
|
+
* - `err.exitCode !== 1223` — the installer process failed. Log `err.exitCode` and investigate.
|
|
5585
|
+
* - any other non-zero exitCode — installation failed.
|
|
5586
|
+
*
|
|
5587
|
+
* @remarks
|
|
5588
|
+
* The helper binaries are installed to:
|
|
5589
|
+
* - `%CommonProgramFiles%\<app-name>\owe-helper-ui.exe` (x64)
|
|
5590
|
+
* - `%CommonProgramFiles%\<app-name>\owe-helper-ui-x86.exe` (x86)
|
|
5591
|
+
*
|
|
5592
|
+
* @example
|
|
5593
|
+
* ```ts
|
|
5594
|
+
* // Check whether the helper is already installed
|
|
5595
|
+
* const installed: boolean = await api.isHighElevationHelperInstalled();
|
|
5596
|
+
*
|
|
5597
|
+
* // Trigger UAC-elevated installation (shows a UAC prompt to the user)
|
|
5598
|
+
* try {
|
|
5599
|
+
* await api.installHighElevationHelper();
|
|
5600
|
+
* console.log('Helper installed successfully');
|
|
5601
|
+
* } catch (err: any) {
|
|
5602
|
+
* if (err.exitCode === 1223) {
|
|
5603
|
+
* // User cancelled the UAC prompt — not an error, just inform the user
|
|
5604
|
+
* console.warn('User cancelled UAC prompt');
|
|
5605
|
+
* } else {
|
|
5606
|
+
* console.error('Installation failed, exitCode:', err.exitCode);
|
|
5607
|
+
* }
|
|
5608
|
+
* }
|
|
5609
|
+
* ```
|
|
5610
|
+
*
|
|
5611
|
+
* @example Typical integration flow
|
|
5612
|
+
* ```ts
|
|
5613
|
+
* async function ensureElevatedInjection(api: IOverwolfOverlayApi) {
|
|
5614
|
+
* const installed = await api.isHighElevationHelperInstalled();
|
|
5615
|
+
* if (!installed) {
|
|
5616
|
+
* await api.installHighElevationHelper(); // may throw — handle UAC cancel
|
|
5617
|
+
* }
|
|
5618
|
+
* // Injection into elevated games now happens automatically on game launch
|
|
5619
|
+
* }
|
|
5620
|
+
* ```
|
|
5621
|
+
* @returns Resolves when installation completes.
|
|
5622
|
+
*
|
|
5623
|
+
*
|
|
5624
|
+
*
|
|
5498
5625
|
*/
|
|
5499
5626
|
installHighElevationHelper?(): Promise<void>;
|
|
5500
5627
|
|
|
5501
5628
|
/**
|
|
5502
5629
|
* Returns true if ow-electron helpers is already installed in
|
|
5503
|
-
*
|
|
5630
|
+
* `%CommonProgramFiles%\<app-name>\`.
|
|
5631
|
+
*
|
|
5632
|
+
* @returns `true` if the helper is installed and ready.
|
|
5633
|
+
*
|
|
5634
|
+
* @example
|
|
5635
|
+
* ```ts
|
|
5636
|
+
* const installed: boolean = await api.isHighElevationHelperInstalled();
|
|
5637
|
+
* if (!installed) {
|
|
5638
|
+
* // Prompt the user to run the one-time setup before injecting into elevated games
|
|
5639
|
+
* }
|
|
5640
|
+
* ```
|
|
5504
5641
|
*/
|
|
5505
5642
|
isHighElevationHelperInstalled?(): Promise<boolean>;
|
|
5506
5643
|
|
|
@@ -5620,9 +5757,9 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5620
5757
|
listener: (info: GameInputInterception) => void
|
|
5621
5758
|
): this;
|
|
5622
5759
|
}
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
// --- modules\gep.d.ts ---
|
|
5760
|
+
|
|
5761
|
+
|
|
5762
|
+
// --- modules\gep.d.ts ---
|
|
5626
5763
|
/**
|
|
5627
5764
|
* The *Game Events Provider* (GEP) APIs allow your app to subscribe to real-time in-game events and info updates
|
|
5628
5765
|
* from supported games. GEP detects when a supported game launches, tracks gameplay state, and emits structured
|
|
@@ -5821,9 +5958,9 @@ interface OverwolfGameEventPackage extends NodeJS.EventEmitter {
|
|
|
5821
5958
|
*/
|
|
5822
5959
|
category: string;
|
|
5823
5960
|
}
|
|
5824
|
-
}
|
|
5825
|
-
|
|
5826
|
-
// --- modules\crn.d.ts ---
|
|
5961
|
+
}
|
|
5962
|
+
|
|
5963
|
+
// --- modules\crn.d.ts ---
|
|
5827
5964
|
/**
|
|
5828
5965
|
* The *Content Recommendation Notification* (CRN) APIs give you tools to help manage the content notification settings in your app.
|
|
5829
5966
|
*
|
|
@@ -5960,4 +6097,4 @@ export interface IOverwolfCRNApi {
|
|
|
5960
6097
|
eventName: 'notification-action',
|
|
5961
6098
|
listener: (event: CRNActionType) => void
|
|
5962
6099
|
): this;
|
|
5963
|
-
}
|
|
6100
|
+
}
|