@overwolf/ow-electron-packages-types 1.1.1 → 1.1.2-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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +158 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron-packages-types",
3
- "version": "1.1.1",
3
+ "version": "1.1.2-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",
package/types.d.ts CHANGED
@@ -65,18 +65,66 @@ interface IOverwolfUtilityApi {
65
65
  scan(filter?: GamesFilter): Promise<InstalledGameInfo[]>;
66
66
 
67
67
  /**
68
- * install ow-electron helpers to
69
- * %CommonProgramFiles%\<app-name>\ with UAC elevation.
70
- * will allow us to inject into high elevation games
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
- * @throws {HelperInstallError} exitCode 1223 — user cancelled the UAC prompt (ERROR_CANCELLED)
73
- * @throws {HelperInstallError} any other non-zero exitCode — installation failed
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
- * %CommonProgramFiles%\<app-name>\.
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
 
@@ -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 false
3103
+ * @default true
3056
3104
  */
3057
3105
  lookahead?: boolean;
3058
3106
 
@@ -4319,10 +4367,11 @@ interface IOverwolfRecordingApi {
4319
4367
  /**
4320
4368
  * Queries supported encoders, audio/video devices, and configuration options.
4321
4369
  *
4370
+ * @param overrideCache If `true`, bypasses cached result and queries OBS directly.
4322
4371
  * @returns A promise that resolves to the full recording capability information.
4323
4372
  * @see {@link RecordingInformation}
4324
4373
  */
4325
- queryInformation(): Promise<RecordingInformation>;
4374
+ queryInformation(overrideCache?: boolean): Promise<RecordingInformation>;
4326
4375
 
4327
4376
  /**
4328
4377
  * Creates a capture settings builder instance to configure video/audio sources.
@@ -4413,7 +4462,7 @@ interface IOverwolfRecordingApi {
4413
4462
  *
4414
4463
  * @param filter Filtering rules for which games to track.
4415
4464
  */
4416
- registerGames(filter: GamesFilter): void;
4465
+ registerGames(filter: GamesFilter): Promise<void>;
4417
4466
 
4418
4467
  /**
4419
4468
  * Updates runtime settings for an audio device while recording.
@@ -4891,10 +4940,47 @@ interface IOverlayHotkey {
4891
4940
  /**
4892
4941
  * Primary key code for the hotkey.
4893
4942
  *
4894
- * Accepts a numeric Windows Virtual-Key code or, since 1.13.3, a W3C
4895
- * `KeyboardEvent.code` string (e.g. `'KeyA'`, `'F10'`, `'ArrowUp'`).
4896
- * String values are resolved to VK codes at registration time; an unknown
4897
- * string throws an error.
4943
+ * Accepts a numeric Windows Virtual-Key (VK) code or a W3C {@link https://www.w3.org/TR/uievents-code/ | KeyboardEvent.code}
4944
+ * string (e.g. `'KeyF'`, `'F10'`, `'ArrowUp'`).
4945
+ *
4946
+ * @remarks
4947
+ * Numeric VK codes are layout-dependent — the same physical key produces a different
4948
+ * VK number on non-QWERTY keyboards. Passing a `KeyboardEvent.code` string identifies
4949
+ * the physical key unambiguously regardless of the user's keyboard layout.
4950
+ *
4951
+ * String values are resolved to VK codes at registration time. An unrecognized string
4952
+ * throws immediately so misconfigured hotkeys are caught early.
4953
+ *
4954
+ * **Supported string codes include:** `KeyA`–`KeyZ`, `Digit0`–`Digit9`,
4955
+ * `F1`–`F24`, `Numpad0`–`Numpad9`, `ArrowUp`/`Down`/`Left`/`Right`, `Tab`, `Enter`,
4956
+ * `Space`, `Backspace`, `Delete`, `Escape`, `Home`, `End`, `PageUp`, `PageDown`,
4957
+ * `ShiftLeft`/`Right`, `ControlLeft`/`Right`, `AltLeft`/`Right`, `Backquote`,
4958
+ * `Minus`, `Equal`, `BracketLeft`/`Right`, `Semicolon`, `Quote`, `Comma`,
4959
+ * `Period`, `Slash`, `Backslash`, and media/browser/launch keys.
4960
+ *
4961
+ * @throws `Error('Unknown hotkey code: "<value>". Pass a valid KeyboardEvent.code string…')`
4962
+ * thrown at registration time when the string does not map to a known VK code.
4963
+ * Validate the string before calling `register` if the value comes from user input.
4964
+ *
4965
+ * @example
4966
+ * ```ts
4967
+ * // Preferred: physical key position, layout-independent
4968
+ * api.hotkeys.register({ name: 'toggle', keyCode: 'KeyF' }, callback);
4969
+ *
4970
+ * // With modifier using string code
4971
+ * api.hotkeys.register({
4972
+ * name: 'screenshot',
4973
+ * keyCode: 'KeyP',
4974
+ * modifiers: { ctrl: true }
4975
+ * }, callback);
4976
+ *
4977
+ * // Legacy: numeric VK code (still valid)
4978
+ * api.hotkeys.register({ name: 'toggle-legacy', keyCode: 70 }, callback);
4979
+ *
4980
+ * // Throws at registration — unknown string
4981
+ * api.hotkeys.register({ name: 'bad', keyCode: 'Bogus' }, callback);
4982
+ * // Error: Unknown hotkey code: "Bogus". Pass a valid KeyboardEvent.code string…
4983
+ * ```
4898
4984
  */
4899
4985
  keyCode: number | string;
4900
4986
 
@@ -5489,18 +5575,70 @@ interface IOverwolfOverlayApi extends EventEmitter {
5489
5575
  exitExclusiveMode(): void;
5490
5576
 
5491
5577
  /**
5492
- * install ow-electron helpers to
5493
- * %CommonProgramFiles%\<app-name>\ with UAC elevation.
5494
- * will allow us to inject into high elevation games
5578
+ * Install ow-electron helpers to
5579
+ * `%CommonProgramFiles%\<app-name>\` with UAC elevation.
5580
+ * Allows injection into high elevation games.
5495
5581
  * No-ops if files are already present.
5496
- * @throws {HelperInstallError} exitCode 1223 — user cancelled the UAC prompt (ERROR_CANCELLED)
5497
- * @throws {HelperInstallError} any other non-zero exitCode — installation failed
5582
+ *
5583
+ * @throws \{HelperInstallError\}
5584
+ * - `exitCode 1223` — user cancelled the UAC prompt (ERROR_CANCELLED)
5585
+ * - `err.exitCode !== 1223` — the installer process failed. Log `err.exitCode` and investigate.
5586
+ * - any other non-zero exitCode — installation failed.
5587
+ *
5588
+ * @remarks
5589
+ * The helper binaries are installed to:
5590
+ * - `%CommonProgramFiles%\<app-name>\owe-helper-ui.exe` (x64)
5591
+ * - `%CommonProgramFiles%\<app-name>\owe-helper-ui-x86.exe` (x86)
5592
+ *
5593
+ * @example
5594
+ * ```ts
5595
+ * // Check whether the helper is already installed
5596
+ * const installed: boolean = await api.isHighElevationHelperInstalled();
5597
+ *
5598
+ * // Trigger UAC-elevated installation (shows a UAC prompt to the user)
5599
+ * try {
5600
+ * await api.installHighElevationHelper();
5601
+ * console.log('Helper installed successfully');
5602
+ * } catch (err: any) {
5603
+ * if (err.exitCode === 1223) {
5604
+ * // User cancelled the UAC prompt — not an error, just inform the user
5605
+ * console.warn('User cancelled UAC prompt');
5606
+ * } else {
5607
+ * console.error('Installation failed, exitCode:', err.exitCode);
5608
+ * }
5609
+ * }
5610
+ * ```
5611
+ *
5612
+ * @example Typical integration flow
5613
+ * ```ts
5614
+ * async function ensureElevatedInjection(api: IOverwolfOverlayApi) {
5615
+ * const installed = await api.isHighElevationHelperInstalled();
5616
+ * if (!installed) {
5617
+ * await api.installHighElevationHelper(); // may throw — handle UAC cancel
5618
+ * }
5619
+ * // Injection into elevated games now happens automatically on game launch
5620
+ * }
5621
+ * ```
5622
+ * @returns Resolves when installation completes.
5623
+ *
5624
+ *
5625
+ *
5498
5626
  */
5499
5627
  installHighElevationHelper?(): Promise<void>;
5500
5628
 
5501
5629
  /**
5502
5630
  * Returns true if ow-electron helpers is already installed in
5503
- * %CommonProgramFiles%\<app-name>\.
5631
+ * `%CommonProgramFiles%\<app-name>\`.
5632
+ *
5633
+ * @returns `true` if the helper is installed and ready.
5634
+ *
5635
+ * @example
5636
+ * ```ts
5637
+ * const installed: boolean = await api.isHighElevationHelperInstalled();
5638
+ * if (!installed) {
5639
+ * // Prompt the user to run the one-time setup before injecting into elevated games
5640
+ * }
5641
+ * ```
5504
5642
  */
5505
5643
  isHighElevationHelperInstalled?(): Promise<boolean>;
5506
5644