@overwolf/ow-electron-packages-types 1.1.5-beta.8 → 1.1.6-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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +231 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron-packages-types",
3
- "version": "1.1.5-beta.8",
3
+ "version": "1.1.6-1",
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
@@ -70,9 +70,9 @@ interface IOverwolfUtilityApi {
70
70
  * Allows injection into high elevation games.
71
71
  * No-ops if files are already present.
72
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.
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
76
  *
77
77
  * @remarks
78
78
  * The helper binaries are installed to:
@@ -1782,7 +1782,8 @@ type VideoRecordingSplitType =
1782
1782
  *
1783
1783
  * This interface serves as a blueprint for all audio filters within the system,
1784
1784
  * ensuring they have a unique identifier and a flexible container for settings.
1785
- * * @example
1785
+ *
1786
+ * @example
1786
1787
  * ```typescript
1787
1788
  * const lowPass: AudioFilterBase = {
1788
1789
  * id: 'low-pass-001',
@@ -1808,7 +1809,8 @@ export interface AudioFilterBase {
1808
1809
 
1809
1810
  /**
1810
1811
  * A specialized filter for dynamic range compression.
1811
- * * @example
1812
+ *
1813
+ * @example
1812
1814
  * ```typescript
1813
1815
  * const vocalComp: AudioCompressorFilter = {
1814
1816
  * id: 'compressor_filter',
@@ -1863,7 +1865,8 @@ export interface AudioCompressorFilter extends AudioFilterBase {
1863
1865
 
1864
1866
  /**
1865
1867
  * A specialized filter for dynamic range expansion or noise gating.
1866
- * * @example
1868
+ *
1869
+ * @example
1867
1870
  * ```typescript
1868
1871
  * const noiseGate: AudioExpanderFilter = {
1869
1872
  * id: 'expander_filter',
@@ -1932,7 +1935,8 @@ export interface AudioExpanderFilter extends AudioFilterBase {
1932
1935
 
1933
1936
  /**
1934
1937
  * A simple filter used to adjust the volume or amplitude of an audio signal.
1935
- * * @example
1938
+ *
1939
+ * @example
1936
1940
  * ```typescript
1937
1941
  * const boost: AudioGainFilter = {
1938
1942
  * id: 'gain_filter',
@@ -1963,7 +1967,8 @@ export interface AudioGainFilter extends AudioFilterBase {
1963
1967
 
1964
1968
  /**
1965
1969
  * A utility filter that flips the phase of the audio signal by 180 degrees.
1966
- * * @example
1970
+ *
1971
+ * @example
1967
1972
  * ```typescript
1968
1973
  * const phaseFlip: AudioInvertPolarityFilter = {
1969
1974
  * id: 'invert_polarity_filter',
@@ -1985,7 +1990,8 @@ export interface AudioInvertPolarityFilter extends AudioFilterBase {
1985
1990
 
1986
1991
  /**
1987
1992
  * A specialized dynamics processor used to prevent an audio signal from exceeding a specific decibel level.
1988
- * * @example
1993
+ *
1994
+ * @example
1989
1995
  * ```typescript
1990
1996
  * const masterLimiter: AudioLimiterFilter = {
1991
1997
  * id: 'limiter_filter',
@@ -2025,7 +2031,8 @@ export interface AudioLimiterFilter extends AudioFilterBase {
2025
2031
  /**
2026
2032
  * A noise gate filter used to attenuate signals that fall below a certain threshold.
2027
2033
  * It is primarily used to remove background noise during silent passages.
2028
- * * @example
2034
+ *
2035
+ * @example
2029
2036
  * ```typescript
2030
2037
  * const gate: AudioNoiseGateFilter = {
2031
2038
  * id: 'noise_gate_filter',
@@ -2083,7 +2090,8 @@ export interface AudioNoiseGateFilter extends AudioFilterBase {
2083
2090
 
2084
2091
  /**
2085
2092
  * An advanced noise suppression filter utilizing machine learning or digital signal processing algorithms.
2086
- * * @example
2093
+ *
2094
+ * @example
2087
2095
  * ```typescript
2088
2096
  * const aiDenoise: AudioNoiseSuppressFilterV2 = {
2089
2097
  * id: 'noise_suppress_filter_v2',
@@ -3815,6 +3823,32 @@ interface EncoderInformation {
3815
3823
  audio: AudioEncoderInfo[];
3816
3824
  }
3817
3825
 
3826
+ /**
3827
+ * Crash dump detail level for the OBS host process.
3828
+ * - `off`: no crash dumps are captured. The OBS text crash report is still
3829
+ * written, and dump files already on disk are left untouched.
3830
+ * - `mini`: small dump (thread stacks + module list); the default.
3831
+ * - `full`: complete-memory dump; large — opt-in for debugging only.
3832
+ */
3833
+ type CrashDumpType = 'off' | 'mini' | 'full';
3834
+
3835
+ /**
3836
+ * Crash dump configuration for the OBS host process.
3837
+ */
3838
+ interface CrashDumpOptions {
3839
+ /**
3840
+ * Dump detail level; defaults to `mini`. Set to `off` to disable crash dump
3841
+ * capture entirely. See {@link CrashDumpType}.
3842
+ */
3843
+ type?: CrashDumpType;
3844
+
3845
+ /**
3846
+ * Max crash dumps to retain in `ow-obs/crashdumps`; the oldest are deleted
3847
+ * beyond this count. Positive integer, defaults to `3`.
3848
+ */
3849
+ maxFiles?: number;
3850
+ }
3851
+
3818
3852
  /**
3819
3853
  * Configuration options for launching or customizing the recording application behavior.
3820
3854
  *
@@ -3850,6 +3884,15 @@ interface RecordingAppOptions {
3850
3884
  * Must be a positive integer. Defaults to `10`.
3851
3885
  */
3852
3886
  maxLogFiles?: number;
3887
+
3888
+ /**
3889
+ * Tune OBS-host crash dumps. Mini-dump capture is on by default; these
3890
+ * options change the detail level and retention count, or turn capture off
3891
+ * entirely via `type: 'off'`.
3892
+ *
3893
+ * @see {@link CrashDumpOptions}
3894
+ */
3895
+ crashDumps?: CrashDumpOptions;
3853
3896
  }
3854
3897
 
3855
3898
 
@@ -4963,6 +5006,43 @@ type ZOrderType = "default" | "topMost" | "bottomMost";
4963
5006
 
4964
5007
 
4965
5008
 
5009
+ /**
5010
+ * Which GPU Windows should run this application on.
5011
+ *
5012
+ * - `default`—No preference is recorded; Windows decides (normally the adapter driving the primary display).
5013
+ * - `highPerformance`—Pin the application to the high-performance (usually discrete) adapter.
5014
+ *
5015
+ * @see {@link IOverwolfOverlayApi.setGpuPreference}.
5016
+ *
5017
+ * @since 2.0.5
5018
+ */
5019
+ type GpuPreference = "default" | "highPerformance";
5020
+
5021
+ /**
5022
+ * Why the shared-texture rendering path cannot be used with the current game.
5023
+ *
5024
+ * - `unsupportedGraphicsApi`—The game's graphics API cannot composite GPU textures
5025
+ * (D3D9 / OpenGL / Vulkan). Nothing to fix; the overlay uses the CPU copy path for this
5026
+ * game.
5027
+ * - `gpuAdapterMismatch`—The game renders on a different GPU adapter than Chromium,
5028
+ * and a shared texture handle can only be opened on the adapter that created it. Fixable
5029
+ * with {@link IOverwolfOverlayApi.setGpuPreference} and an application restart.
5030
+ * - `copyFailure`—The game repeatedly failed to open the shared texture handles it
5031
+ * received in-game. The overlay retried, then fell back to the CPU copy path.
5032
+ * {@link IOverwolfOverlayApi.setGpuPreference} may help when the root cause is
5033
+ * adapter-related.
5034
+ *
5035
+ * @see {@link IOverwolfOverlayApi.on} `shared-texture-unavailable`.
5036
+ *
5037
+ * @since 2.0.5
5038
+ */
5039
+ type SharedTextureUnavailableReason =
5040
+ | "unsupportedGraphicsApi"
5041
+ | "gpuAdapterMismatch"
5042
+ | "copyFailure";
5043
+
5044
+
5045
+
4966
5046
  /**
4967
5047
  * Overlay configuration options for creating or modifying an overlay window.
4968
5048
  *
@@ -5048,6 +5128,8 @@ interface OverlayWindowOptions
5048
5128
  *
5049
5129
  * @default false
5050
5130
  *
5131
+ * @see {@link https://www.electronjs.org/docs/latest/tutorial/offscreen-rendering#software-output-device | Software output device}
5132
+ *
5051
5133
  * @since 1.13.20
5052
5134
  */
5053
5135
  disableHardwareAcceleration?: boolean;
@@ -5062,10 +5144,11 @@ interface OverlayWindowOptions
5062
5144
  * composites it without any CPU-side pixel copy, significantly lowering
5063
5145
  * per-frame CPU overhead.
5064
5146
  *
5065
- * Requires hardware acceleration to be enabled and the current game to report
5066
- * shared-texture support (see {@link GameWindowInfo.isSharedTextureSupported}).
5067
- * The flag is silently ignored when either condition is not met, falling back
5068
- * to the shared-memory (CPU copy) path.
5147
+ * Requires hardware acceleration to be enabled and the shared-texture path to
5148
+ * be usable with the current game (see
5149
+ * {@link GameWindowInfo.isSharedTextureAvailable}). The flag is silently
5150
+ * ignored when either condition is not met, falling back to the
5151
+ * shared-memory (CPU copy) path.
5069
5152
  *
5070
5153
  * The rendering path follows the active game: when the overlay moves to a
5071
5154
  * different game, a shared-texture window automatically falls back to the
@@ -5075,6 +5158,8 @@ interface OverlayWindowOptions
5075
5158
  *
5076
5159
  * @default false
5077
5160
  *
5161
+ * @see {@link https://dev.overwolf.com/ow-electron/reference/examples/overlay | Overlay examples}
5162
+ *
5078
5163
  * @since 2.0.2
5079
5164
  */
5080
5165
  useSharedTexture?: boolean;
@@ -5434,10 +5519,36 @@ interface GameWindowInfo {
5434
5519
  readonly isOOPOFullscreenRenderingDisabled?: boolean;
5435
5520
 
5436
5521
  /**
5437
- * Indicates if the game supports shared-texture (GPU) overlay rendering.
5522
+ * Indicates whether the game's **graphics API** supports shared-texture (GPU) overlay
5523
+ * rendering: `true` for D3D11 / D3D12, `false` for D3D9 / OpenGL / Vulkan.
5524
+ *
5525
+ * This is a capability probe only — to decide whether the path can actually be used
5526
+ * on this machine, gate on {@link GameWindowInfo.isSharedTextureAvailable} instead.
5527
+ *
5528
+ * `undefined` until the game is injected and its graphics API is detected.
5529
+ *
5438
5530
  * @since 2.0.0
5439
5531
  */
5440
5532
  readonly isSharedTextureSupported?: boolean;
5533
+
5534
+ /**
5535
+ * Indicates whether shared-texture (GPU) overlay rendering can actually be used with this
5536
+ * game — gate `useSharedTexture` window creation on it.
5537
+ *
5538
+ * `true` when the game's graphics API supports it
5539
+ * ({@link GameWindowInfo.isSharedTextureSupported}), no GPU adapter mismatch was detected,
5540
+ * **and** the path was not abandoned after repeated in-game copy failures. When it is
5541
+ * `false`, the `shared-texture-unavailable` event names the reason. It can therefore turn
5542
+ * `false` mid-game: the copy-failure verdict is reached only after frames were sent and
5543
+ * repeatedly failed to draw.
5544
+ *
5545
+ * `undefined` until the game is injected and its graphics API is detected.
5546
+ *
5547
+ * @see {@link https://dev.overwolf.com/ow-electron/reference/examples/overlay | Overlay examples}
5548
+ *
5549
+ * @since 2.0.5
5550
+ */
5551
+ readonly isSharedTextureAvailable?: boolean;
5441
5552
  }
5442
5553
 
5443
5554
  /**
@@ -5778,7 +5889,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
5778
5889
  * Allows injection into high elevation games.
5779
5890
  * No-ops if files are already present.
5780
5891
  *
5781
- * @throws \{HelperInstallError\}
5892
+ * @throws `HelperInstallError`
5782
5893
  * - `exitCode 1223` — user cancelled the UAC prompt (ERROR_CANCELLED)
5783
5894
  * - `err.exitCode !== 1223` — the installer process failed. Log `err.exitCode` and investigate.
5784
5895
  * - any other non-zero exitCode — installation failed.
@@ -5898,6 +6009,65 @@ interface IOverwolfOverlayApi extends EventEmitter {
5898
6009
  */
5899
6010
  takeScreenshot(filePath: string, format?: 'jpg' | 'bmp'): Promise<void>;
5900
6011
 
6012
+ /**
6013
+ * Records a Windows per-executable GPU preference for this application, so
6014
+ * Chromium's GPU process runs on the same adapter as games do.
6015
+ *
6016
+ * The shared-texture path requires that: a shared GPU texture handle can only be opened on
6017
+ * the adapter that created it, and Chromium takes the adapter driving the **primary
6018
+ * display** while games run on the discrete GPU. When those differ the overlay falls back
6019
+ * to the CPU copy path and emits `shared-texture-unavailable`.
6020
+ *
6021
+ * **An application restart is normally required.** DXGI reads this preference when a
6022
+ * process creates its D3D device, which Chromium's GPU process has already done by the time
6023
+ * this API is reachable. Call {@link IOverwolfOverlayApi.getGpuPreference} to learn whether
6024
+ * the application is *already* aligned and therefore needs no restart; this method is
6025
+ * idempotent, so calling it unconditionally is safe.
6026
+ *
6027
+ * **Side effects &mdash; read before calling.** It moves the **entire application's**
6028
+ * rendering to that GPU, draining laptop battery and keeping the discrete GPU awake; it is
6029
+ * persistent, user-visible Windows state under
6030
+ * Settings &rarr; System &rarr; Display &rarr; Graphics; and it is keyed on the executable
6031
+ * path, so moving or renaming the application leaves a stale entry behind. It is therefore
6032
+ * **never applied implicitly**. Pass `'default'` to remove the entry, the recommended
6033
+ * revert on uninstall or when the user turns the overlay off.
6034
+ *
6035
+ * @param preference - `'highPerformance'` to pin this application to the high-performance
6036
+ * adapter, or `'default'` to remove the entry and let Windows decide.
6037
+ * @returns A promise that resolves once the preference has been recorded.
6038
+ * @throws If the registry cannot be written, or on a non-Windows platform.
6039
+ * @see {@link GpuPreference}.
6040
+ * @see {@link https://dev.overwolf.com/ow-electron/reference/examples/overlay | Overlay examples}
6041
+ *
6042
+ * @example
6043
+ * ```ts
6044
+ * overlay.on('shared-texture-unavailable', async (reason) => {
6045
+ * if (reason !== 'gpuAdapterMismatch') return;
6046
+ * if ((await overlay.getGpuPreference()) === 'highPerformance') return;
6047
+ * await overlay.setGpuPreference('highPerformance');
6048
+ * promptUserToRestart(); // takes effect on the next launch
6049
+ * });
6050
+ * ```
6051
+ *
6052
+ * @since 2.0.5
6053
+ */
6054
+ setGpuPreference(preference: GpuPreference): Promise<void>;
6055
+
6056
+ /**
6057
+ * Returns the GPU preference currently recorded for this application's executable.
6058
+ *
6059
+ * Resolves to `'default'` when no entry exists &mdash; "no entry" and "let Windows decide"
6060
+ * are the same state, so this never resolves `undefined`.
6061
+ *
6062
+ * @returns A promise resolving to the recorded preference.
6063
+ * @throws On a non-Windows platform.
6064
+ * @see {@link IOverwolfOverlayApi.setGpuPreference}.
6065
+ * @see {@link GpuPreference}.
6066
+ *
6067
+ * @since 2.0.5
6068
+ */
6069
+ getGpuPreference(): Promise<GpuPreference>;
6070
+
5901
6071
  /**
5902
6072
  * Fires when an internal error occurs within the overlay system.
5903
6073
  */
@@ -6019,6 +6189,50 @@ interface IOverwolfOverlayApi extends EventEmitter {
6019
6189
  eventName: 'game-input-exclusive-mode-changed',
6020
6190
  listener: (info: GameInputInterception) => void,
6021
6191
  ): this;
6192
+
6193
+ /**
6194
+ * Fires when the shared-texture rendering path cannot be used with the current game, with
6195
+ * the reason:
6196
+ *
6197
+ * - `unsupportedGraphicsApi`&mdash;the game's graphics API cannot composite GPU textures
6198
+ * (D3D9 / OpenGL / Vulkan). Nothing to fix.
6199
+ * - `gpuAdapterMismatch`&mdash;the game renders on a **different GPU adapter than
6200
+ * Chromium**; a shared texture handle can only be opened on the adapter that created it.
6201
+ * Fixable with {@link IOverwolfOverlayApi.setGpuPreference} and a restart; both adapters
6202
+ * are named in the overlay log.
6203
+ * - `copyFailure`&mdash;the game **repeatedly failed to open the shared texture handles it
6204
+ * received in-game**. The overlay retried, then abandoned the path for this game.
6205
+ * {@link IOverwolfOverlayApi.setGpuPreference} may help when the root cause is
6206
+ * adapter-related; details are in the overlay log.
6207
+ *
6208
+ * Fires at most **once per injected game**. The first two reasons are detected when the
6209
+ * game's graphics are detected, before any frame is sent; `copyFailure` is reached only
6210
+ * after frames were sent and repeatedly failed to draw. Either way, the affected overlay
6211
+ * windows have already been switched to the CPU copy path by the time the event fires, so
6212
+ * they stay visible and interactive, and
6213
+ * {@link GameWindowInfo.isSharedTextureAvailable} reports `false` for the game.
6214
+ *
6215
+ * @param eventName - `shared-texture-unavailable`
6216
+ * @param listener - Callback invoked once for the current game with the reason.
6217
+ *
6218
+ * @see {@link https://dev.overwolf.com/ow-electron/reference/examples/overlay | Overlay examples}
6219
+ *
6220
+ * @example
6221
+ * ```ts
6222
+ * overlay.on('shared-texture-unavailable', async (reason) => {
6223
+ * if (reason !== 'gpuAdapterMismatch') return;
6224
+ * if ((await overlay.getGpuPreference()) === 'highPerformance') return;
6225
+ * await overlay.setGpuPreference('highPerformance');
6226
+ * promptUserToRestart();
6227
+ * });
6228
+ * ```
6229
+ *
6230
+ * @since 2.0.5
6231
+ */
6232
+ on(
6233
+ eventName: 'shared-texture-unavailable',
6234
+ listener: (reason: SharedTextureUnavailableReason) => void,
6235
+ ): this;
6022
6236
  }
6023
6237
 
6024
6238