@overwolf/ow-electron-packages-types 1.1.12-beta.1 → 1.1.12-beta.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +190 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron-packages-types",
3
- "version": "1.1.12-beta.1",
3
+ "version": "1.1.12-beta.3",
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",
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
  *
@@ -4114,6 +4232,24 @@ type CrashDumpType = 'off' | 'mini' | 'full';
4114
4232
  */
4115
4233
  type ObsHostMode = 'process' | 'dll';
4116
4234
 
4235
+ /**
4236
+ * Lifecycle of the recording or replays output.
4237
+ *
4238
+ * | Value | Meaning |
4239
+ * | ------------ | -------------------------------------------------------------------- |
4240
+ * | `idle` | Not started. |
4241
+ * | `starting` | Start accepted, output not running yet - OBS waits for a capture source to hook. |
4242
+ * | `active` | Running and producing frames. |
4243
+ *
4244
+ * An output stays `starting` for as long as its capture source fails to hook,
4245
+ * with no timeout. Operations that need a running output - `captureReplay`,
4246
+ * `splitRecording` - fail with `CaptureSourceNotHooked` while it does.
4247
+ *
4248
+ * @see {@link IOverwolfRecordingApi.getRecordingState}
4249
+ * @see {@link IOverwolfRecordingApi.getReplayState}
4250
+ */
4251
+ type OutputState = 'idle' | 'starting' | 'active';
4252
+
4117
4253
  /**
4118
4254
  * Crash dump configuration for the OBS host process.
4119
4255
  */
@@ -4203,6 +4339,10 @@ interface RecordingAppOptions {
4203
4339
  * | `-998` | `ConnectionOBSError` | Failed to connect to the OBS process. |
4204
4340
  * | `-997` | `AlreadyRunning` | Operation attempted while recording is already running. |
4205
4341
  * | `-996` | `ElevationHelperMissing` | Elevated game capture requested while the High Elevation Helper isn't installed. |
4342
+ * | `-995` | `CaptureSourceNotHooked` | Output accepted by OBS but not running yet - waiting for a capture source. |
4343
+ * | `-994` | `CaptureSourceNotFound` | A game or window capture source's target process wasn't found. Retryable. |
4344
+ * | `-993` | `CaptureSourceCreationFailed`| OBS refused to create the capture source. Not retryable. |
4345
+ * | `-992` | `OBSNotReady` | OBS accepted the connection but its core isn't initialized yet. Retryable. |
4206
4346
  * | `-12` | `SplitRecordingDisabled` | Attempted to split recording when split recording is disabled. |
4207
4347
  * | `-11` | `MissingOrInvalidParameters` | One or more required parameters are missing or invalid. |
4208
4348
  * | `-10` | `NoActiveRecording` | No active recording session found. |
@@ -4230,6 +4370,10 @@ type ErrorCode =
4230
4370
  | -998 // Failed to connect to the OBS process. 'ConnectionOBSError'
4231
4371
  | -997 // Operation attempted while recording is already running. 'AlreadyRunning'
4232
4372
  | -996 // Elevated game capture requested while the High Elevation Helper isn't installed. 'ElevationHelperMissing'
4373
+ | -995 // Output accepted by OBS but not running yet - waiting for a capture source. 'CaptureSourceNotHooked'
4374
+ | -994 // A game or window capture source's target process wasn't found. Retryable. 'CaptureSourceNotFound'
4375
+ | -993 // OBS refused to create the capture source. 'CaptureSourceCreationFailed'
4376
+ | -992 // OBS accepted the connection but its core isn't initialized yet. Retryable. 'OBSNotReady'
4233
4377
  | -12 // Attempted to split recording when split recording is disabled. 'SplitRecordingDisabled'
4234
4378
  | -11 // One or more required parameters are missing or invalid. 'MissingOrInvalidParameters'
4235
4379
  | -10 // No active recording session found. 'NoActiveRecording'
@@ -4818,20 +4962,60 @@ interface IOverwolfRecordingApi {
4818
4962
  readonly binFolderPath: string;
4819
4963
 
4820
4964
  /**
4821
- * Checks if either recording or replays are currently active.
4965
+ * Whether a recording or a replays service has been started and not yet
4966
+ * stopped - `true` for both the `starting` and `active` states.
4967
+ *
4968
+ * @see {@link getRecordingState}
4969
+ * @see {@link getReplayState}
4822
4970
  */
4823
4971
  isActive(): Promise<boolean>;
4824
4972
 
4825
4973
  /**
4826
- * Checks if a recording is currently active.
4974
+ * Whether a recording has been started and not yet stopped.
4975
+ *
4976
+ * `true` from the moment {@link startRecording} resolves, including while the
4977
+ * output is still `starting` - waiting for a capture source to hook - so it
4978
+ * does not mean frames are being written.
4979
+ *
4980
+ * @see {@link getRecordingState} to tell those apart.
4827
4981
  */
4828
4982
  isRecordingActive(): Promise<boolean>;
4829
4983
 
4830
4984
  /**
4831
- * Checks if a replay session is currently active.
4985
+ * Whether a replays service has been started and not yet stopped.
4986
+ *
4987
+ * `true` from the moment {@link startReplays} resolves, including while the
4988
+ * buffer is still `starting` - waiting for a capture source to hook - so it
4989
+ * does not mean the buffer holds any footage.
4990
+ *
4991
+ * @see {@link getReplayState} to tell those apart.
4832
4992
  */
4833
4993
  isReplayActive(): Promise<boolean>;
4834
4994
 
4995
+ /**
4996
+ * The recording output's current state.
4997
+ *
4998
+ * @example
4999
+ * ```ts
5000
+ * if (await recorder.getRecordingState() === 'starting') {
5001
+ * // started, but no capture source has hooked yet - nothing is written
5002
+ * }
5003
+ * ```
5004
+ *
5005
+ * @see {@link OutputState}
5006
+ */
5007
+ getRecordingState(): Promise<OutputState>;
5008
+
5009
+ /**
5010
+ * The replays buffer's current state.
5011
+ *
5012
+ * {@link captureReplay} fails with `CaptureSourceNotHooked` while this is
5013
+ * `starting`, since the buffer holds no footage yet.
5014
+ *
5015
+ * @see {@link OutputState}
5016
+ */
5017
+ getReplayState(): Promise<OutputState>;
5018
+
4835
5019
  /**
4836
5020
  * Queries supported encoders, audio/video devices, and configuration options.
4837
5021
  *