@overwolf/ow-electron-packages-types 1.1.5 → 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.
- package/package.json +1 -1
- package/types.d.ts +330 -15
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@overwolf/ow-electron';
|
|
1
2
|
import type {
|
|
2
3
|
BrowserWindow,
|
|
3
4
|
BrowserWindowConstructorOptions,
|
|
@@ -69,9 +70,9 @@ interface IOverwolfUtilityApi {
|
|
|
69
70
|
* Allows injection into high elevation games.
|
|
70
71
|
* No-ops if files are already present.
|
|
71
72
|
*
|
|
72
|
-
* @throws
|
|
73
|
-
* @throws
|
|
74
|
-
* @throws
|
|
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.
|
|
75
76
|
*
|
|
76
77
|
* @remarks
|
|
77
78
|
* The helper binaries are installed to:
|
|
@@ -1781,7 +1782,8 @@ type VideoRecordingSplitType =
|
|
|
1781
1782
|
*
|
|
1782
1783
|
* This interface serves as a blueprint for all audio filters within the system,
|
|
1783
1784
|
* ensuring they have a unique identifier and a flexible container for settings.
|
|
1784
|
-
*
|
|
1785
|
+
*
|
|
1786
|
+
* @example
|
|
1785
1787
|
* ```typescript
|
|
1786
1788
|
* const lowPass: AudioFilterBase = {
|
|
1787
1789
|
* id: 'low-pass-001',
|
|
@@ -1807,7 +1809,8 @@ export interface AudioFilterBase {
|
|
|
1807
1809
|
|
|
1808
1810
|
/**
|
|
1809
1811
|
* A specialized filter for dynamic range compression.
|
|
1810
|
-
*
|
|
1812
|
+
*
|
|
1813
|
+
* @example
|
|
1811
1814
|
* ```typescript
|
|
1812
1815
|
* const vocalComp: AudioCompressorFilter = {
|
|
1813
1816
|
* id: 'compressor_filter',
|
|
@@ -1862,7 +1865,8 @@ export interface AudioCompressorFilter extends AudioFilterBase {
|
|
|
1862
1865
|
|
|
1863
1866
|
/**
|
|
1864
1867
|
* A specialized filter for dynamic range expansion or noise gating.
|
|
1865
|
-
*
|
|
1868
|
+
*
|
|
1869
|
+
* @example
|
|
1866
1870
|
* ```typescript
|
|
1867
1871
|
* const noiseGate: AudioExpanderFilter = {
|
|
1868
1872
|
* id: 'expander_filter',
|
|
@@ -1931,7 +1935,8 @@ export interface AudioExpanderFilter extends AudioFilterBase {
|
|
|
1931
1935
|
|
|
1932
1936
|
/**
|
|
1933
1937
|
* A simple filter used to adjust the volume or amplitude of an audio signal.
|
|
1934
|
-
*
|
|
1938
|
+
*
|
|
1939
|
+
* @example
|
|
1935
1940
|
* ```typescript
|
|
1936
1941
|
* const boost: AudioGainFilter = {
|
|
1937
1942
|
* id: 'gain_filter',
|
|
@@ -1962,7 +1967,8 @@ export interface AudioGainFilter extends AudioFilterBase {
|
|
|
1962
1967
|
|
|
1963
1968
|
/**
|
|
1964
1969
|
* A utility filter that flips the phase of the audio signal by 180 degrees.
|
|
1965
|
-
*
|
|
1970
|
+
*
|
|
1971
|
+
* @example
|
|
1966
1972
|
* ```typescript
|
|
1967
1973
|
* const phaseFlip: AudioInvertPolarityFilter = {
|
|
1968
1974
|
* id: 'invert_polarity_filter',
|
|
@@ -1984,7 +1990,8 @@ export interface AudioInvertPolarityFilter extends AudioFilterBase {
|
|
|
1984
1990
|
|
|
1985
1991
|
/**
|
|
1986
1992
|
* A specialized dynamics processor used to prevent an audio signal from exceeding a specific decibel level.
|
|
1987
|
-
*
|
|
1993
|
+
*
|
|
1994
|
+
* @example
|
|
1988
1995
|
* ```typescript
|
|
1989
1996
|
* const masterLimiter: AudioLimiterFilter = {
|
|
1990
1997
|
* id: 'limiter_filter',
|
|
@@ -2024,7 +2031,8 @@ export interface AudioLimiterFilter extends AudioFilterBase {
|
|
|
2024
2031
|
/**
|
|
2025
2032
|
* A noise gate filter used to attenuate signals that fall below a certain threshold.
|
|
2026
2033
|
* It is primarily used to remove background noise during silent passages.
|
|
2027
|
-
*
|
|
2034
|
+
*
|
|
2035
|
+
* @example
|
|
2028
2036
|
* ```typescript
|
|
2029
2037
|
* const gate: AudioNoiseGateFilter = {
|
|
2030
2038
|
* id: 'noise_gate_filter',
|
|
@@ -2082,7 +2090,8 @@ export interface AudioNoiseGateFilter extends AudioFilterBase {
|
|
|
2082
2090
|
|
|
2083
2091
|
/**
|
|
2084
2092
|
* An advanced noise suppression filter utilizing machine learning or digital signal processing algorithms.
|
|
2085
|
-
*
|
|
2093
|
+
*
|
|
2094
|
+
* @example
|
|
2086
2095
|
* ```typescript
|
|
2087
2096
|
* const aiDenoise: AudioNoiseSuppressFilterV2 = {
|
|
2088
2097
|
* id: 'noise_suppress_filter_v2',
|
|
@@ -3070,6 +3079,18 @@ interface EncoderSettingsNVENC extends VideoEncoderSettingsBase {
|
|
|
3070
3079
|
*/
|
|
3071
3080
|
rate_control?: kNVENCEncoderRateControl;
|
|
3072
3081
|
|
|
3082
|
+
/**
|
|
3083
|
+
* Constant Quantization Parameter (CQP) level.
|
|
3084
|
+
*
|
|
3085
|
+
* Sets a fixed quality level for the entire stream. Only applies when
|
|
3086
|
+
* {@link rate_control} is `'CQP'`.
|
|
3087
|
+
*
|
|
3088
|
+
* Range: `1`–`51` (`1`–`63` for AV1).
|
|
3089
|
+
*
|
|
3090
|
+
* @default 20
|
|
3091
|
+
*/
|
|
3092
|
+
cqp?: number;
|
|
3093
|
+
|
|
3073
3094
|
/**
|
|
3074
3095
|
* Encoding quality preset.
|
|
3075
3096
|
*
|
|
@@ -3253,11 +3274,21 @@ interface EncoderSettingsAMF extends VideoEncoderSettingsBase {
|
|
|
3253
3274
|
ffmpeg_opts?: string;
|
|
3254
3275
|
|
|
3255
3276
|
/**
|
|
3256
|
-
* Constant
|
|
3257
|
-
*
|
|
3277
|
+
* Constant Quantization Parameter (CQP) level.
|
|
3278
|
+
*
|
|
3279
|
+
* Determines the quality level for quantizer-based rate control. Only applies
|
|
3280
|
+
* when {@link rate_control} is `'CQP'` or `'QVBR'`.
|
|
3281
|
+
*
|
|
3282
|
+
* Range: `0`–`51` (`0`–`63` for AV1).
|
|
3258
3283
|
*
|
|
3259
3284
|
* @default 20
|
|
3260
3285
|
*/
|
|
3286
|
+
cqp?: number;
|
|
3287
|
+
|
|
3288
|
+
/**
|
|
3289
|
+
* @deprecated Use {@link cqp} instead. Retained for backward compatibility;
|
|
3290
|
+
* this value is ignored by the encoder.
|
|
3291
|
+
*/
|
|
3261
3292
|
cpq?: number;
|
|
3262
3293
|
|
|
3263
3294
|
/**
|
|
@@ -3363,6 +3394,30 @@ interface EncoderSettingsQuickSync extends VideoEncoderSettingsBase {
|
|
|
3363
3394
|
*/
|
|
3364
3395
|
rate_control?: kQuickSyncEncoderRateControl;
|
|
3365
3396
|
|
|
3397
|
+
/**
|
|
3398
|
+
* Constant Quantization Parameter (CQP) level.
|
|
3399
|
+
*
|
|
3400
|
+
* Sets a fixed quantizer for the entire stream. Only applies when
|
|
3401
|
+
* {@link rate_control} is `'CQP'`.
|
|
3402
|
+
*
|
|
3403
|
+
* Range: `1`–`51` (`1`–`63` for AV1).
|
|
3404
|
+
*
|
|
3405
|
+
* @default 23
|
|
3406
|
+
*/
|
|
3407
|
+
cqp?: number;
|
|
3408
|
+
|
|
3409
|
+
/**
|
|
3410
|
+
* Intelligent Constant Quality (ICQ) level.
|
|
3411
|
+
*
|
|
3412
|
+
* Lower values yield higher quality. Only applies when
|
|
3413
|
+
* {@link rate_control} is `'ICQ'`.
|
|
3414
|
+
*
|
|
3415
|
+
* Range: `1`–`51`.
|
|
3416
|
+
*
|
|
3417
|
+
* @default 23
|
|
3418
|
+
*/
|
|
3419
|
+
icq_quality?: number;
|
|
3420
|
+
|
|
3366
3421
|
/**
|
|
3367
3422
|
* Target usage or encoding preset that balances performance and quality.
|
|
3368
3423
|
*
|
|
@@ -3454,6 +3509,18 @@ interface EncoderSettingsX264 extends VideoEncoderSettingsBase {
|
|
|
3454
3509
|
*/
|
|
3455
3510
|
rate_control?: kX264EncoderRateControl;
|
|
3456
3511
|
|
|
3512
|
+
/**
|
|
3513
|
+
* Constant Rate Factor (CRF) quality level.
|
|
3514
|
+
*
|
|
3515
|
+
* Lower values yield higher quality and larger files. Only applies when
|
|
3516
|
+
* {@link rate_control} is `'CRF'` or `'VBR'`.
|
|
3517
|
+
*
|
|
3518
|
+
* Range: `0`–`51`.
|
|
3519
|
+
*
|
|
3520
|
+
* @default 23
|
|
3521
|
+
*/
|
|
3522
|
+
crf?: number;
|
|
3523
|
+
|
|
3457
3524
|
/**
|
|
3458
3525
|
* Specifies the encoding speed/quality trade-off preset.
|
|
3459
3526
|
* A slower preset provides better compression (quality per bitrate).
|
|
@@ -3756,6 +3823,32 @@ interface EncoderInformation {
|
|
|
3756
3823
|
audio: AudioEncoderInfo[];
|
|
3757
3824
|
}
|
|
3758
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
|
+
|
|
3759
3852
|
/**
|
|
3760
3853
|
* Configuration options for launching or customizing the recording application behavior.
|
|
3761
3854
|
*
|
|
@@ -3767,6 +3860,7 @@ interface EncoderInformation {
|
|
|
3767
3860
|
* const options: RecordingAppOptions = {
|
|
3768
3861
|
* showDebugWindow: true,
|
|
3769
3862
|
* enableDebugLogs: true,
|
|
3863
|
+
* maxLogFiles: 20,
|
|
3770
3864
|
* };
|
|
3771
3865
|
* ```
|
|
3772
3866
|
*/
|
|
@@ -3782,6 +3876,23 @@ interface RecordingAppOptions {
|
|
|
3782
3876
|
* Can be used to troubleshoot issues during recording.
|
|
3783
3877
|
*/
|
|
3784
3878
|
enableDebugLogs?: boolean;
|
|
3879
|
+
|
|
3880
|
+
/**
|
|
3881
|
+
* Maximum number of OBS log files to retain under the recorder's
|
|
3882
|
+
* `ow-obs/logs` folder. Once the number of logs exceeds this value, the
|
|
3883
|
+
* oldest logs are gradually pruned.
|
|
3884
|
+
* Must be a positive integer. Defaults to `10`.
|
|
3885
|
+
*/
|
|
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;
|
|
3785
3896
|
}
|
|
3786
3897
|
|
|
3787
3898
|
|
|
@@ -4895,6 +5006,43 @@ type ZOrderType = "default" | "topMost" | "bottomMost";
|
|
|
4895
5006
|
|
|
4896
5007
|
|
|
4897
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
|
+
|
|
4898
5046
|
/**
|
|
4899
5047
|
* Overlay configuration options for creating or modifying an overlay window.
|
|
4900
5048
|
*
|
|
@@ -4980,10 +5128,42 @@ interface OverlayWindowOptions
|
|
|
4980
5128
|
*
|
|
4981
5129
|
* @default false
|
|
4982
5130
|
*
|
|
5131
|
+
* @see {@link https://www.electronjs.org/docs/latest/tutorial/offscreen-rendering#software-output-device | Software output device}
|
|
5132
|
+
*
|
|
4983
5133
|
* @since 1.13.20
|
|
4984
5134
|
*/
|
|
4985
5135
|
disableHardwareAcceleration?: boolean;
|
|
4986
5136
|
|
|
5137
|
+
/**
|
|
5138
|
+
* ⚠️ BETA — this option is experimental and its behavior may change in
|
|
5139
|
+
* a future release.
|
|
5140
|
+
*
|
|
5141
|
+
* `true`—renders this overlay window through a GPU shared texture
|
|
5142
|
+
* instead of copying pixels through shared memory on every paint. The overlay
|
|
5143
|
+
* forwards the GPU texture handle directly to the injected game process, which
|
|
5144
|
+
* composites it without any CPU-side pixel copy, significantly lowering
|
|
5145
|
+
* per-frame CPU overhead.
|
|
5146
|
+
*
|
|
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.
|
|
5152
|
+
*
|
|
5153
|
+
* The rendering path follows the active game: when the overlay moves to a
|
|
5154
|
+
* different game, a shared-texture window automatically falls back to the
|
|
5155
|
+
* shared-memory (CPU copy) path on a game that does not support shared
|
|
5156
|
+
* texture, and restores the shared-texture path on a game that does — so the
|
|
5157
|
+
* window stays visible on every game.
|
|
5158
|
+
*
|
|
5159
|
+
* @default false
|
|
5160
|
+
*
|
|
5161
|
+
* @see {@link https://dev.overwolf.com/ow-electron/reference/examples/overlay | Overlay examples}
|
|
5162
|
+
*
|
|
5163
|
+
* @since 2.0.2
|
|
5164
|
+
*/
|
|
5165
|
+
useSharedTexture?: boolean;
|
|
5166
|
+
|
|
4987
5167
|
/**
|
|
4988
5168
|
* Enables Chromium process isolation (sandboxing).
|
|
4989
5169
|
* Used to enforce stricter security policies or prevent resource sharing between renderer processes.
|
|
@@ -5332,11 +5512,43 @@ interface GameWindowInfo {
|
|
|
5332
5512
|
|
|
5333
5513
|
/**
|
|
5334
5514
|
* Indicates if fullscreen rendering is disabled.
|
|
5335
|
-
*
|
|
5515
|
+
*
|
|
5336
5516
|
* Relevant only for OOPO games.
|
|
5337
5517
|
* @since 1.9.0
|
|
5338
5518
|
*/
|
|
5339
5519
|
readonly isOOPOFullscreenRenderingDisabled?: boolean;
|
|
5520
|
+
|
|
5521
|
+
/**
|
|
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
|
+
*
|
|
5530
|
+
* @since 2.0.0
|
|
5531
|
+
*/
|
|
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;
|
|
5340
5552
|
}
|
|
5341
5553
|
|
|
5342
5554
|
/**
|
|
@@ -5677,7 +5889,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5677
5889
|
* Allows injection into high elevation games.
|
|
5678
5890
|
* No-ops if files are already present.
|
|
5679
5891
|
*
|
|
5680
|
-
* @throws
|
|
5892
|
+
* @throws `HelperInstallError`
|
|
5681
5893
|
* - `exitCode 1223` — user cancelled the UAC prompt (ERROR_CANCELLED)
|
|
5682
5894
|
* - `err.exitCode !== 1223` — the installer process failed. Log `err.exitCode` and investigate.
|
|
5683
5895
|
* - any other non-zero exitCode — installation failed.
|
|
@@ -5797,6 +6009,65 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5797
6009
|
*/
|
|
5798
6010
|
takeScreenshot(filePath: string, format?: 'jpg' | 'bmp'): Promise<void>;
|
|
5799
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 — 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 → System → Display → 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 — "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
|
+
|
|
5800
6071
|
/**
|
|
5801
6072
|
* Fires when an internal error occurs within the overlay system.
|
|
5802
6073
|
*/
|
|
@@ -5918,6 +6189,50 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5918
6189
|
eventName: 'game-input-exclusive-mode-changed',
|
|
5919
6190
|
listener: (info: GameInputInterception) => void,
|
|
5920
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`—the game's graphics API cannot composite GPU textures
|
|
6198
|
+
* (D3D9 / OpenGL / Vulkan). Nothing to fix.
|
|
6199
|
+
* - `gpuAdapterMismatch`—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`—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;
|
|
5921
6236
|
}
|
|
5922
6237
|
|
|
5923
6238
|
|