@overwolf/ow-electron-packages-types 1.1.2 → 1.1.4
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 +148 -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.4",
|
|
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.
|
|
@@ -5573,7 +5637,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5573
5637
|
*/
|
|
5574
5638
|
exitExclusiveMode(): void;
|
|
5575
5639
|
|
|
5576
|
-
|
|
5640
|
+
/**
|
|
5577
5641
|
* Install ow-electron helpers to
|
|
5578
5642
|
* `%CommonProgramFiles%\<app-name>\` with UAC elevation.
|
|
5579
5643
|
* Allows injection into high elevation games.
|
|
@@ -5619,20 +5683,20 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5619
5683
|
* }
|
|
5620
5684
|
* ```
|
|
5621
5685
|
* @returns Resolves when installation completes.
|
|
5622
|
-
*
|
|
5623
|
-
*
|
|
5624
|
-
*
|
|
5686
|
+
*
|
|
5687
|
+
*
|
|
5688
|
+
*
|
|
5625
5689
|
*/
|
|
5626
5690
|
installHighElevationHelper?(): Promise<void>;
|
|
5627
5691
|
|
|
5628
5692
|
/**
|
|
5629
5693
|
* Returns true if ow-electron helpers is already installed in
|
|
5630
5694
|
* `%CommonProgramFiles%\<app-name>\`.
|
|
5631
|
-
*
|
|
5695
|
+
*
|
|
5632
5696
|
* @returns `true` if the helper is installed and ready.
|
|
5633
|
-
*
|
|
5697
|
+
*
|
|
5634
5698
|
* @example
|
|
5635
|
-
* ```ts
|
|
5699
|
+
* ```ts
|
|
5636
5700
|
* const installed: boolean = await api.isHighElevationHelperInstalled();
|
|
5637
5701
|
* if (!installed) {
|
|
5638
5702
|
* // Prompt the user to run the one-time setup before injecting into elevated games
|
|
@@ -5641,6 +5705,64 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5641
5705
|
*/
|
|
5642
5706
|
isHighElevationHelperInstalled?(): Promise<boolean>;
|
|
5643
5707
|
|
|
5708
|
+
/**
|
|
5709
|
+
* Captures the current game frame and saves it to disk.
|
|
5710
|
+
*
|
|
5711
|
+
* Only one screenshot can be in progress at a time. Calling this method
|
|
5712
|
+
* while a previous capture is still pending will reject immediately —
|
|
5713
|
+
* wait for the returned promise to settle before issuing the next call.
|
|
5714
|
+
*
|
|
5715
|
+
* The output format is resolved by precedence: an explicit `format`
|
|
5716
|
+
* argument wins; otherwise the extension already present in `filePath`
|
|
5717
|
+
* (`.jpg`/`.jpeg` or `.bmp`) is used; otherwise it defaults to `'bmp'`.
|
|
5718
|
+
* The file extension is then normalized to match the resolved format, so
|
|
5719
|
+
* an existing extension is rewritten rather than doubled (e.g.
|
|
5720
|
+
* `shot.jpg` stays `shot.jpg`, and `shot.png` with `format: 'jpg'` becomes
|
|
5721
|
+
* `shot.jpg`).
|
|
5722
|
+
*
|
|
5723
|
+
* Internally all backends (D3D9, D3D11, D3D12, Vulkan) capture as BMP
|
|
5724
|
+
* first and transcode to JPEG on demand, ensuring correct colors across
|
|
5725
|
+
* all graphics APIs and formats.
|
|
5726
|
+
*
|
|
5727
|
+
* @param filePath - Absolute path (UTF-8) where the image will be saved.
|
|
5728
|
+
* @param format - Output image format: `'jpg'` or `'bmp'`. When omitted,
|
|
5729
|
+
* the extension in `filePath` is used, falling back to `'bmp'`.
|
|
5730
|
+
* @returns A promise that resolves with the absolute path the file was
|
|
5731
|
+
* actually written to, including the normalized extension (which may
|
|
5732
|
+
* differ from `filePath`).
|
|
5733
|
+
*
|
|
5734
|
+
* @throws `'no active game'` — the overlay is not currently injected into
|
|
5735
|
+
* any game. Wait for the `game-injected` event before calling.
|
|
5736
|
+
* @throws `'screenshot already in progress'` — a previous capture has not
|
|
5737
|
+
* yet completed. Await the previous promise before calling again.
|
|
5738
|
+
* @throws `'no active graphics device'` — the game has no active GPU
|
|
5739
|
+
* device at this moment (e.g. the game window is minimized or in a
|
|
5740
|
+
* device-lost state). Try again once the game is in the foreground.
|
|
5741
|
+
* @throws `'capture failed: <backend>'` — the GPU-side readback failed
|
|
5742
|
+
* (e.g. staging texture creation, memory map, or WIC encode error).
|
|
5743
|
+
*
|
|
5744
|
+
* @example
|
|
5745
|
+
* ```ts
|
|
5746
|
+
* overlay.on('game-injected', () => {
|
|
5747
|
+
* overlay.hotkeys.register(
|
|
5748
|
+
* { name: 'screenshot', keyCode: 'F9', passthrough: false },
|
|
5749
|
+
* async (hotkey, state) => {
|
|
5750
|
+
* if (state !== 'pressed') return;
|
|
5751
|
+
* const ts = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
5752
|
+
* const filePath = path.join(app.getPath('pictures'), `screenshot_${ts}`);
|
|
5753
|
+
* try {
|
|
5754
|
+
* const savedPath = await overlay.takeScreenshot(filePath, 'jpg');
|
|
5755
|
+
* console.log('screenshot written to', savedPath); // ...filePath.jpg
|
|
5756
|
+
* } catch (err) {
|
|
5757
|
+
* console.error('Screenshot failed:', err.message);
|
|
5758
|
+
* }
|
|
5759
|
+
* }
|
|
5760
|
+
* );
|
|
5761
|
+
* });
|
|
5762
|
+
* ```
|
|
5763
|
+
*/
|
|
5764
|
+
takeScreenshot(filePath: string, format?: 'jpg' | 'bmp'): Promise<void>;
|
|
5765
|
+
|
|
5644
5766
|
/**
|
|
5645
5767
|
* Fires when an internal error occurs within the overlay system.
|
|
5646
5768
|
*/
|
|
@@ -5654,7 +5776,10 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5654
5776
|
* @param listener - Callback with game launch event and game metadata.
|
|
5655
5777
|
* @see {@link GameInfo}.
|
|
5656
5778
|
*/
|
|
5657
|
-
on(
|
|
5779
|
+
on(
|
|
5780
|
+
eventName: 'game-launched',
|
|
5781
|
+
listener: (event: GameLaunchEvent, gameInfo: GameInfo) => void,
|
|
5782
|
+
): this;
|
|
5658
5783
|
|
|
5659
5784
|
/**
|
|
5660
5785
|
* Fires when a registered game process terminates.
|
|
@@ -5674,7 +5799,10 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5674
5799
|
*
|
|
5675
5800
|
* @see {@link GameInfo}.
|
|
5676
5801
|
*/
|
|
5677
|
-
on(
|
|
5802
|
+
on(
|
|
5803
|
+
eventName: 'game-exit',
|
|
5804
|
+
listener: (gameInfo: GameInfo, wasInjected: boolean) => void,
|
|
5805
|
+
): this;
|
|
5678
5806
|
|
|
5679
5807
|
/**
|
|
5680
5808
|
* Fires when the overlay is ready and successfully injected into the game.
|
|
@@ -5694,7 +5822,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5694
5822
|
*/
|
|
5695
5823
|
on(
|
|
5696
5824
|
eventName: 'game-injection-error',
|
|
5697
|
-
listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void
|
|
5825
|
+
listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void,
|
|
5698
5826
|
): this;
|
|
5699
5827
|
|
|
5700
5828
|
/**
|
|
@@ -5710,8 +5838,8 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5710
5838
|
listener: (
|
|
5711
5839
|
window: GameWindowInfo,
|
|
5712
5840
|
gameInfo: GameInfo,
|
|
5713
|
-
focus: boolean
|
|
5714
|
-
) => void
|
|
5841
|
+
focus: boolean,
|
|
5842
|
+
) => void,
|
|
5715
5843
|
): this;
|
|
5716
5844
|
|
|
5717
5845
|
/**
|
|
@@ -5728,8 +5856,8 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5728
5856
|
listener: (
|
|
5729
5857
|
window: GameWindowInfo,
|
|
5730
5858
|
gameInfo: GameInfo,
|
|
5731
|
-
reason?: GameWindowUpdateReason
|
|
5732
|
-
) => void
|
|
5859
|
+
reason?: GameWindowUpdateReason,
|
|
5860
|
+
) => void,
|
|
5733
5861
|
): this;
|
|
5734
5862
|
|
|
5735
5863
|
/**
|
|
@@ -5742,7 +5870,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5742
5870
|
*/
|
|
5743
5871
|
on(
|
|
5744
5872
|
eventName: 'game-input-interception-changed',
|
|
5745
|
-
listener: (info: GameInputInterception) => void
|
|
5873
|
+
listener: (info: GameInputInterception) => void,
|
|
5746
5874
|
): this;
|
|
5747
5875
|
|
|
5748
5876
|
/**
|
|
@@ -5754,7 +5882,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5754
5882
|
*/
|
|
5755
5883
|
on(
|
|
5756
5884
|
eventName: 'game-input-exclusive-mode-changed',
|
|
5757
|
-
listener: (info: GameInputInterception) => void
|
|
5885
|
+
listener: (info: GameInputInterception) => void,
|
|
5758
5886
|
): this;
|
|
5759
5887
|
}
|
|
5760
5888
|
|
|
@@ -5832,7 +5960,7 @@ interface OverwolfGameEventPackage extends NodeJS.EventEmitter {
|
|
|
5832
5960
|
getSupportedGames(): Promise<{
|
|
5833
5961
|
name: string;
|
|
5834
5962
|
id: number;
|
|
5835
|
-
}>;
|
|
5963
|
+
}[]>;
|
|
5836
5964
|
|
|
5837
5965
|
/**
|
|
5838
5966
|
* Returns the target game's current Game Info.
|