@overwolf/ow-electron-packages-types 1.1.12-beta.0 → 1.1.12-beta.2
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 +4 -2
- package/types.d.ts +121 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overwolf/ow-electron-packages-types",
|
|
3
|
-
"version": "1.1.12-beta.
|
|
3
|
+
"version": "1.1.12-beta.2",
|
|
4
4
|
"description": "Type definition file for autocompletion and documentation purposes for ow-electron packages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "types.d.ts",
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"combine": "node combine-dts.js ./modules"
|
|
35
|
+
"combine": "node combine-dts.js ./modules",
|
|
36
|
+
"beta": "node beta.js",
|
|
37
|
+
"release": "node release.js"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"glob": "^13.0.0"
|
package/types.d.ts
CHANGED
|
@@ -39,6 +39,68 @@ import { EventEmitter } from 'events';
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Reason `canInjectElevated()` reports {@link ElevatedInjectionCapability.supported} as `false`.
|
|
44
|
+
*/
|
|
45
|
+
type ElevatedInjectionUnsupportedReason =
|
|
46
|
+
/**
|
|
47
|
+
* `owe-helper-ui.exe` / `owe-helper-ui-x86.exe` are not installed yet in
|
|
48
|
+
* `%CommonProgramFiles%\<app-name>\`. Call `installHighElevationHelper()` to fix this.
|
|
49
|
+
*/
|
|
50
|
+
| 'helper-not-installed'
|
|
51
|
+
/**
|
|
52
|
+
* The account running the app is a standard (non-administrator) user. A
|
|
53
|
+
* uiAccess helper launched from such an account only gets a MEDIUM+16
|
|
54
|
+
* integrity token, and Windows will not map a hook dll into a HIGH
|
|
55
|
+
* integrity (elevated) game.
|
|
56
|
+
*
|
|
57
|
+
* Call `installElevationBroker()` to inject anyway; without it the game has
|
|
58
|
+
* to run un-elevated, or the account needs administrator rights.
|
|
59
|
+
*/
|
|
60
|
+
| 'account-cannot-elevate';
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Reports whether an elevated (HIGH integrity) game can actually be injected
|
|
64
|
+
* under the account the app is running as.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const capability = await api.canInjectElevated();
|
|
69
|
+
* if (!capability.supported) {
|
|
70
|
+
* console.warn('Cannot inject elevated games:', capability.reason);
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
interface ElevatedInjectionCapability {
|
|
75
|
+
/**
|
|
76
|
+
* `true` only when an elevated game can actually be injected right now.
|
|
77
|
+
*/
|
|
78
|
+
readonly supported: boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Set when {@link supported} is `false`.
|
|
82
|
+
*/
|
|
83
|
+
readonly reason?: ElevatedInjectionUnsupportedReason;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* `true` when the account can obtain a HIGH integrity token
|
|
87
|
+
* (administrator). When the check itself cannot run this is reported as
|
|
88
|
+
* `true`, so an undetermined account is attempted rather than blocked.
|
|
89
|
+
*/
|
|
90
|
+
readonly accountCanElevate: boolean;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* `true` when the uiAccess helper binaries are installed.
|
|
94
|
+
*/
|
|
95
|
+
readonly helperInstalled: boolean;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* `true` when the LocalSystem broker service is registered. It makes
|
|
99
|
+
* elevated injection possible regardless of {@link accountCanElevate}.
|
|
100
|
+
*/
|
|
101
|
+
readonly brokerInstalled: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
42
104
|
/**
|
|
43
105
|
* Defines the API for managing game launch and utility operations.
|
|
44
106
|
*/
|
|
@@ -115,11 +177,17 @@ interface IOverwolfUtilityApi {
|
|
|
115
177
|
/**
|
|
116
178
|
* Returns true if ow-electron helpers is already installed in
|
|
117
179
|
* `%CommonProgramFiles%\<app-name>\`.
|
|
118
|
-
*
|
|
180
|
+
*
|
|
119
181
|
* @returns `true` if the helper is installed and ready.
|
|
120
|
-
*
|
|
182
|
+
*
|
|
183
|
+
* @remarks
|
|
184
|
+
* This only reports whether the binaries are present. On a standard
|
|
185
|
+
* (non-administrator) account they can be present and elevated injection
|
|
186
|
+
* still won't work — use `canInjectElevated()` to decide what to tell the
|
|
187
|
+
* user.
|
|
188
|
+
*
|
|
121
189
|
* @example
|
|
122
|
-
* ```ts
|
|
190
|
+
* ```ts
|
|
123
191
|
* const installed: boolean = await api.isHighElevationHelperInstalled();
|
|
124
192
|
* if (!installed) {
|
|
125
193
|
* // Prompt the user to run the one-time setup before injecting into elevated games
|
|
@@ -128,6 +196,56 @@ interface IOverwolfUtilityApi {
|
|
|
128
196
|
*/
|
|
129
197
|
isHighElevationHelperInstalled?(): Promise<boolean>;
|
|
130
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Whether an elevated (HIGH integrity) game can actually be injected under
|
|
201
|
+
* the account this app is running as.
|
|
202
|
+
*
|
|
203
|
+
* @returns An {@link ElevatedInjectionCapability} describing what's
|
|
204
|
+
* missing when elevated injection isn't currently possible.
|
|
205
|
+
*
|
|
206
|
+
* @remarks
|
|
207
|
+
* `supported` is `false` with reason `'account-cannot-elevate'` on a
|
|
208
|
+
* standard user account: Windows gives a uiAccess helper launched from such
|
|
209
|
+
* an account a MEDIUM+16 integrity token, which cannot get a dll mapped
|
|
210
|
+
* into an elevated game. The only workarounds are running the game
|
|
211
|
+
* un-elevated, granting the account administrator rights, or installing the
|
|
212
|
+
* elevation broker via `installElevationBroker()`.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```ts
|
|
216
|
+
* const capability = await api.canInjectElevated();
|
|
217
|
+
* if (!capability.supported) {
|
|
218
|
+
* console.warn('Cannot inject elevated games:', capability.reason);
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
canInjectElevated?(): Promise<ElevatedInjectionCapability>;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Installs the elevated injection broker: a LocalSystem service that
|
|
226
|
+
* injects into elevated games for accounts that cannot reach HIGH
|
|
227
|
+
* integrity, which is the only way an app running under a standard user
|
|
228
|
+
* account can overlay an elevated game. Prompts for UAC once.
|
|
229
|
+
*
|
|
230
|
+
* @throws `HelperInstallError` `exitCode 1223` — user cancelled the UAC prompt (ERROR_CANCELLED)
|
|
231
|
+
* @throws `HelperInstallError` any other non-zero exitCode — installation failed
|
|
232
|
+
*
|
|
233
|
+
* @remarks
|
|
234
|
+
* The service stays registered until `uninstallElevationBroker()` removes
|
|
235
|
+
* it, so the app's uninstaller must call that.
|
|
236
|
+
*
|
|
237
|
+
* @returns Resolves when installation completes.
|
|
238
|
+
*/
|
|
239
|
+
installElevationBroker?(): Promise<void>;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Stops and removes the elevation broker service. Prompts for UAC once.
|
|
243
|
+
* Succeeds when the service is already absent.
|
|
244
|
+
*
|
|
245
|
+
* @returns Resolves when removal completes.
|
|
246
|
+
*/
|
|
247
|
+
uninstallElevationBroker?(): Promise<void>;
|
|
248
|
+
|
|
131
249
|
/**
|
|
132
250
|
* Fires when a tracked game is launched.
|
|
133
251
|
*
|