@overwolf/ow-electron-packages-types 1.1.2 → 1.1.5-beta.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 +5 -2
- package/types.d.ts +172 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@overwolf/ow-electron-packages-types",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-beta.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",
|
|
@@ -31,7 +31,10 @@
|
|
|
31
31
|
"types": "./gep-supported-games.d.ts"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"combine": "node combine-dts.js ./modules"
|
|
36
|
+
},
|
|
34
37
|
"dependencies": {
|
|
35
38
|
"glob": "^13.0.0"
|
|
36
39
|
}
|
|
37
|
-
}
|
|
40
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -940,6 +940,38 @@ interface VideoInformation {
|
|
|
940
940
|
readonly defaultEncoder: kSupportedEncodersTypes;
|
|
941
941
|
}
|
|
942
942
|
|
|
943
|
+
/**
|
|
944
|
+
* Information about the current Xbox Game DVR state on the system.
|
|
945
|
+
*
|
|
946
|
+
* Xbox Game DVR captures game video in the background and can interfere with
|
|
947
|
+
* recording. This interface reports whether it is active and the underlying
|
|
948
|
+
* registry values that drive it.
|
|
949
|
+
*
|
|
950
|
+
* @example
|
|
951
|
+
* const dvr: XboxDVRInfo = {
|
|
952
|
+
* enabled: true,
|
|
953
|
+
* appCaptureEnabled: true,
|
|
954
|
+
* gameDVREnabled: false
|
|
955
|
+
* };
|
|
956
|
+
*/
|
|
957
|
+
interface XboxDVRInfo {
|
|
958
|
+
/**
|
|
959
|
+
* `true` if Xbox Game DVR is active via either capture path
|
|
960
|
+
* (`appCaptureEnabled || gameDVREnabled`).
|
|
961
|
+
*/
|
|
962
|
+
readonly enabled: boolean;
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* The `AppCaptureEnabled` registry value.
|
|
966
|
+
*/
|
|
967
|
+
readonly appCaptureEnabled: boolean;
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* The `GameDVR_Enabled` registry value.
|
|
971
|
+
*/
|
|
972
|
+
readonly gameDVREnabled: boolean;
|
|
973
|
+
}
|
|
974
|
+
|
|
943
975
|
/**
|
|
944
976
|
* Information about the complete recording configuration for the current system.
|
|
945
977
|
*
|
|
@@ -975,6 +1007,13 @@ interface RecordingInformation {
|
|
|
975
1007
|
* @see MonitorInfo
|
|
976
1008
|
*/
|
|
977
1009
|
monitors: MonitorInfo[];
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* The current Xbox Game DVR state on the system.
|
|
1013
|
+
*
|
|
1014
|
+
* @see XboxDVRInfo
|
|
1015
|
+
*/
|
|
1016
|
+
xboxDVR: XboxDVRInfo;
|
|
978
1017
|
}
|
|
979
1018
|
|
|
980
1019
|
|
|
@@ -4340,10 +4379,15 @@ interface IOverwolfRecordingApi {
|
|
|
4340
4379
|
readonly version: string;
|
|
4341
4380
|
|
|
4342
4381
|
/**
|
|
4343
|
-
* Path to ffmpeg
|
|
4382
|
+
* Path to ffmpeg executable
|
|
4344
4383
|
*/
|
|
4345
4384
|
readonly ffmpegPath: string;
|
|
4346
4385
|
|
|
4386
|
+
/**
|
|
4387
|
+
* Path to ffprobe executable
|
|
4388
|
+
*/
|
|
4389
|
+
readonly ffprobePath: string;
|
|
4390
|
+
|
|
4347
4391
|
/**
|
|
4348
4392
|
* Path to OBS binaries folder.
|
|
4349
4393
|
*/
|
|
@@ -4367,10 +4411,30 @@ interface IOverwolfRecordingApi {
|
|
|
4367
4411
|
/**
|
|
4368
4412
|
* Queries supported encoders, audio/video devices, and configuration options.
|
|
4369
4413
|
*
|
|
4414
|
+
* The result also includes the current Xbox Game DVR state (`xboxDVR`).
|
|
4415
|
+
*
|
|
4416
|
+
* @param overrideCache If `true`, bypasses cached result and queries OBS directly.
|
|
4370
4417
|
* @returns A promise that resolves to the full recording capability information.
|
|
4371
4418
|
* @see {@link RecordingInformation}
|
|
4372
4419
|
*/
|
|
4373
|
-
queryInformation(): Promise<RecordingInformation>;
|
|
4420
|
+
queryInformation(overrideCache?: boolean): Promise<RecordingInformation>;
|
|
4421
|
+
|
|
4422
|
+
/**
|
|
4423
|
+
* Returns whether Xbox Game DVR is enabled, checking both the
|
|
4424
|
+
* `GameDVR_Enabled` and `AppCaptureEnabled` registry values.
|
|
4425
|
+
*
|
|
4426
|
+
* @returns A promise that resolves to the current Xbox Game DVR state.
|
|
4427
|
+
* @see {@link XboxDVRInfo}
|
|
4428
|
+
*/
|
|
4429
|
+
isXboxDVREnabled(): Promise<XboxDVRInfo>;
|
|
4430
|
+
|
|
4431
|
+
/**
|
|
4432
|
+
* Disables Xbox Game DVR by setting `AppCaptureEnabled` and
|
|
4433
|
+
* `GameDVR_Enabled` to `0` in the registry.
|
|
4434
|
+
*
|
|
4435
|
+
* @returns A promise that resolves once the values have been written.
|
|
4436
|
+
*/
|
|
4437
|
+
disableXboxDVR(): Promise<void>;
|
|
4374
4438
|
|
|
4375
4439
|
/**
|
|
4376
4440
|
* Creates a capture settings builder instance to configure video/audio sources.
|
|
@@ -4461,7 +4525,7 @@ interface IOverwolfRecordingApi {
|
|
|
4461
4525
|
*
|
|
4462
4526
|
* @param filter Filtering rules for which games to track.
|
|
4463
4527
|
*/
|
|
4464
|
-
registerGames(filter: GamesFilter): void
|
|
4528
|
+
registerGames(filter: GamesFilter): Promise<void>;
|
|
4465
4529
|
|
|
4466
4530
|
/**
|
|
4467
4531
|
* Updates runtime settings for an audio device while recording.
|
|
@@ -4577,6 +4641,30 @@ interface OWPackages extends overwolf.packages.OverwolfPackageManager {
|
|
|
4577
4641
|
gep: OverwolfGameEventPackage;
|
|
4578
4642
|
}
|
|
4579
4643
|
|
|
4644
|
+
/**
|
|
4645
|
+
* Augments the base `OverwolfPackageManager` so that `app.overwolf.packages`
|
|
4646
|
+
* is fully typed without any casting or manual global.d.ts augmentation in
|
|
4647
|
+
* the consuming project.
|
|
4648
|
+
*/
|
|
4649
|
+
declare global {
|
|
4650
|
+
namespace overwolf {
|
|
4651
|
+
namespace packages {
|
|
4652
|
+
interface OverwolfPackageManager {
|
|
4653
|
+
/** Access to Overwolf's video recording and replay functionality. */
|
|
4654
|
+
recorder: IOverwolfRecordingApi;
|
|
4655
|
+
/** Access to overlay-related APIs such as window creation, input control, and hotkeys. */
|
|
4656
|
+
overlay: IOverwolfOverlayApi;
|
|
4657
|
+
/** Access to utility APIs for game launch tracking and game scanning. */
|
|
4658
|
+
utility: IOverwolfUtilityApi;
|
|
4659
|
+
/** Access to crash reporting and notification APIs. */
|
|
4660
|
+
crn: IOverwolfCRNApi;
|
|
4661
|
+
/** Subscribe to real-time in-game events and info updates from supported games. */
|
|
4662
|
+
gep: OverwolfGameEventPackage;
|
|
4663
|
+
}
|
|
4664
|
+
}
|
|
4665
|
+
}
|
|
4666
|
+
}
|
|
4667
|
+
|
|
4580
4668
|
|
|
4581
4669
|
// --- modules\overlay.d.ts ---
|
|
4582
4670
|
/**
|
|
@@ -5573,7 +5661,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5573
5661
|
*/
|
|
5574
5662
|
exitExclusiveMode(): void;
|
|
5575
5663
|
|
|
5576
|
-
|
|
5664
|
+
/**
|
|
5577
5665
|
* Install ow-electron helpers to
|
|
5578
5666
|
* `%CommonProgramFiles%\<app-name>\` with UAC elevation.
|
|
5579
5667
|
* Allows injection into high elevation games.
|
|
@@ -5619,20 +5707,20 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5619
5707
|
* }
|
|
5620
5708
|
* ```
|
|
5621
5709
|
* @returns Resolves when installation completes.
|
|
5622
|
-
*
|
|
5623
|
-
*
|
|
5624
|
-
*
|
|
5710
|
+
*
|
|
5711
|
+
*
|
|
5712
|
+
*
|
|
5625
5713
|
*/
|
|
5626
5714
|
installHighElevationHelper?(): Promise<void>;
|
|
5627
5715
|
|
|
5628
5716
|
/**
|
|
5629
5717
|
* Returns true if ow-electron helpers is already installed in
|
|
5630
5718
|
* `%CommonProgramFiles%\<app-name>\`.
|
|
5631
|
-
*
|
|
5719
|
+
*
|
|
5632
5720
|
* @returns `true` if the helper is installed and ready.
|
|
5633
|
-
*
|
|
5721
|
+
*
|
|
5634
5722
|
* @example
|
|
5635
|
-
* ```ts
|
|
5723
|
+
* ```ts
|
|
5636
5724
|
* const installed: boolean = await api.isHighElevationHelperInstalled();
|
|
5637
5725
|
* if (!installed) {
|
|
5638
5726
|
* // Prompt the user to run the one-time setup before injecting into elevated games
|
|
@@ -5641,6 +5729,64 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5641
5729
|
*/
|
|
5642
5730
|
isHighElevationHelperInstalled?(): Promise<boolean>;
|
|
5643
5731
|
|
|
5732
|
+
/**
|
|
5733
|
+
* Captures the current game frame and saves it to disk.
|
|
5734
|
+
*
|
|
5735
|
+
* Only one screenshot can be in progress at a time. Calling this method
|
|
5736
|
+
* while a previous capture is still pending will reject immediately —
|
|
5737
|
+
* wait for the returned promise to settle before issuing the next call.
|
|
5738
|
+
*
|
|
5739
|
+
* The output format is resolved by precedence: an explicit `format`
|
|
5740
|
+
* argument wins; otherwise the extension already present in `filePath`
|
|
5741
|
+
* (`.jpg`/`.jpeg` or `.bmp`) is used; otherwise it defaults to `'bmp'`.
|
|
5742
|
+
* The file extension is then normalized to match the resolved format, so
|
|
5743
|
+
* an existing extension is rewritten rather than doubled (e.g.
|
|
5744
|
+
* `shot.jpg` stays `shot.jpg`, and `shot.png` with `format: 'jpg'` becomes
|
|
5745
|
+
* `shot.jpg`).
|
|
5746
|
+
*
|
|
5747
|
+
* Internally all backends (D3D9, D3D11, D3D12, Vulkan) capture as BMP
|
|
5748
|
+
* first and transcode to JPEG on demand, ensuring correct colors across
|
|
5749
|
+
* all graphics APIs and formats.
|
|
5750
|
+
*
|
|
5751
|
+
* @param filePath - Absolute path (UTF-8) where the image will be saved.
|
|
5752
|
+
* @param format - Output image format: `'jpg'` or `'bmp'`. When omitted,
|
|
5753
|
+
* the extension in `filePath` is used, falling back to `'bmp'`.
|
|
5754
|
+
* @returns A promise that resolves with the absolute path the file was
|
|
5755
|
+
* actually written to, including the normalized extension (which may
|
|
5756
|
+
* differ from `filePath`).
|
|
5757
|
+
*
|
|
5758
|
+
* @throws `'no active game'` — the overlay is not currently injected into
|
|
5759
|
+
* any game. Wait for the `game-injected` event before calling.
|
|
5760
|
+
* @throws `'screenshot already in progress'` — a previous capture has not
|
|
5761
|
+
* yet completed. Await the previous promise before calling again.
|
|
5762
|
+
* @throws `'no active graphics device'` — the game has no active GPU
|
|
5763
|
+
* device at this moment (e.g. the game window is minimized or in a
|
|
5764
|
+
* device-lost state). Try again once the game is in the foreground.
|
|
5765
|
+
* @throws `'capture failed: <backend>'` — the GPU-side readback failed
|
|
5766
|
+
* (e.g. staging texture creation, memory map, or WIC encode error).
|
|
5767
|
+
*
|
|
5768
|
+
* @example
|
|
5769
|
+
* ```ts
|
|
5770
|
+
* overlay.on('game-injected', () => {
|
|
5771
|
+
* overlay.hotkeys.register(
|
|
5772
|
+
* { name: 'screenshot', keyCode: 'F9', passthrough: false },
|
|
5773
|
+
* async (hotkey, state) => {
|
|
5774
|
+
* if (state !== 'pressed') return;
|
|
5775
|
+
* const ts = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
5776
|
+
* const filePath = path.join(app.getPath('pictures'), `screenshot_${ts}`);
|
|
5777
|
+
* try {
|
|
5778
|
+
* const savedPath = await overlay.takeScreenshot(filePath, 'jpg');
|
|
5779
|
+
* console.log('screenshot written to', savedPath); // ...filePath.jpg
|
|
5780
|
+
* } catch (err) {
|
|
5781
|
+
* console.error('Screenshot failed:', err.message);
|
|
5782
|
+
* }
|
|
5783
|
+
* }
|
|
5784
|
+
* );
|
|
5785
|
+
* });
|
|
5786
|
+
* ```
|
|
5787
|
+
*/
|
|
5788
|
+
takeScreenshot(filePath: string, format?: 'jpg' | 'bmp'): Promise<void>;
|
|
5789
|
+
|
|
5644
5790
|
/**
|
|
5645
5791
|
* Fires when an internal error occurs within the overlay system.
|
|
5646
5792
|
*/
|
|
@@ -5654,7 +5800,10 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5654
5800
|
* @param listener - Callback with game launch event and game metadata.
|
|
5655
5801
|
* @see {@link GameInfo}.
|
|
5656
5802
|
*/
|
|
5657
|
-
on(
|
|
5803
|
+
on(
|
|
5804
|
+
eventName: 'game-launched',
|
|
5805
|
+
listener: (event: GameLaunchEvent, gameInfo: GameInfo) => void,
|
|
5806
|
+
): this;
|
|
5658
5807
|
|
|
5659
5808
|
/**
|
|
5660
5809
|
* Fires when a registered game process terminates.
|
|
@@ -5674,7 +5823,10 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5674
5823
|
*
|
|
5675
5824
|
* @see {@link GameInfo}.
|
|
5676
5825
|
*/
|
|
5677
|
-
on(
|
|
5826
|
+
on(
|
|
5827
|
+
eventName: 'game-exit',
|
|
5828
|
+
listener: (gameInfo: GameInfo, wasInjected: boolean) => void,
|
|
5829
|
+
): this;
|
|
5678
5830
|
|
|
5679
5831
|
/**
|
|
5680
5832
|
* Fires when the overlay is ready and successfully injected into the game.
|
|
@@ -5694,7 +5846,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5694
5846
|
*/
|
|
5695
5847
|
on(
|
|
5696
5848
|
eventName: 'game-injection-error',
|
|
5697
|
-
listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void
|
|
5849
|
+
listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void,
|
|
5698
5850
|
): this;
|
|
5699
5851
|
|
|
5700
5852
|
/**
|
|
@@ -5710,8 +5862,8 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5710
5862
|
listener: (
|
|
5711
5863
|
window: GameWindowInfo,
|
|
5712
5864
|
gameInfo: GameInfo,
|
|
5713
|
-
focus: boolean
|
|
5714
|
-
) => void
|
|
5865
|
+
focus: boolean,
|
|
5866
|
+
) => void,
|
|
5715
5867
|
): this;
|
|
5716
5868
|
|
|
5717
5869
|
/**
|
|
@@ -5728,8 +5880,8 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5728
5880
|
listener: (
|
|
5729
5881
|
window: GameWindowInfo,
|
|
5730
5882
|
gameInfo: GameInfo,
|
|
5731
|
-
reason?: GameWindowUpdateReason
|
|
5732
|
-
) => void
|
|
5883
|
+
reason?: GameWindowUpdateReason,
|
|
5884
|
+
) => void,
|
|
5733
5885
|
): this;
|
|
5734
5886
|
|
|
5735
5887
|
/**
|
|
@@ -5742,7 +5894,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5742
5894
|
*/
|
|
5743
5895
|
on(
|
|
5744
5896
|
eventName: 'game-input-interception-changed',
|
|
5745
|
-
listener: (info: GameInputInterception) => void
|
|
5897
|
+
listener: (info: GameInputInterception) => void,
|
|
5746
5898
|
): this;
|
|
5747
5899
|
|
|
5748
5900
|
/**
|
|
@@ -5754,7 +5906,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5754
5906
|
*/
|
|
5755
5907
|
on(
|
|
5756
5908
|
eventName: 'game-input-exclusive-mode-changed',
|
|
5757
|
-
listener: (info: GameInputInterception) => void
|
|
5909
|
+
listener: (info: GameInputInterception) => void,
|
|
5758
5910
|
): this;
|
|
5759
5911
|
}
|
|
5760
5912
|
|
|
@@ -5832,7 +5984,7 @@ interface OverwolfGameEventPackage extends NodeJS.EventEmitter {
|
|
|
5832
5984
|
getSupportedGames(): Promise<{
|
|
5833
5985
|
name: string;
|
|
5834
5986
|
id: number;
|
|
5835
|
-
}>;
|
|
5987
|
+
}[]>;
|
|
5836
5988
|
|
|
5837
5989
|
/**
|
|
5838
5990
|
* Returns the target game's current Game Info.
|