@overwolf/ow-electron-packages-types 1.1.2-beta.4 → 1.1.2-beta.5

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 +36 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron-packages-types",
3
- "version": "1.1.2-beta.4",
3
+ "version": "1.1.2-beta.5",
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
@@ -5574,7 +5574,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
5574
5574
  */
5575
5575
  exitExclusiveMode(): void;
5576
5576
 
5577
- /**
5577
+ /**
5578
5578
  * Install ow-electron helpers to
5579
5579
  * `%CommonProgramFiles%\<app-name>\` with UAC elevation.
5580
5580
  * Allows injection into high elevation games.
@@ -5620,20 +5620,20 @@ interface IOverwolfOverlayApi extends EventEmitter {
5620
5620
  * }
5621
5621
  * ```
5622
5622
  * @returns Resolves when installation completes.
5623
- *
5624
- *
5625
- *
5623
+ *
5624
+ *
5625
+ *
5626
5626
  */
5627
5627
  installHighElevationHelper?(): Promise<void>;
5628
5628
 
5629
5629
  /**
5630
5630
  * Returns true if ow-electron helpers is already installed in
5631
5631
  * `%CommonProgramFiles%\<app-name>\`.
5632
- *
5632
+ *
5633
5633
  * @returns `true` if the helper is installed and ready.
5634
- *
5634
+ *
5635
5635
  * @example
5636
- * ```ts
5636
+ * ```ts
5637
5637
  * const installed: boolean = await api.isHighElevationHelperInstalled();
5638
5638
  * if (!installed) {
5639
5639
  * // Prompt the user to run the one-time setup before injecting into elevated games
@@ -5649,17 +5649,24 @@ interface IOverwolfOverlayApi extends EventEmitter {
5649
5649
  * while a previous capture is still pending will reject immediately —
5650
5650
  * wait for the returned promise to settle before issuing the next call.
5651
5651
  *
5652
- * The file extension in `filePath` is normalized automatically: if it does
5653
- * not already end with `.jpg` or `.bmp` (matching `format`), the correct
5654
- * extension is appended.
5652
+ * The output format is resolved by precedence: an explicit `format`
5653
+ * argument wins; otherwise the extension already present in `filePath`
5654
+ * (`.jpg`/`.jpeg` or `.bmp`) is used; otherwise it defaults to `'bmp'`.
5655
+ * The file extension is then normalized to match the resolved format, so
5656
+ * an existing extension is rewritten rather than doubled (e.g.
5657
+ * `shot.jpg` stays `shot.jpg`, and `shot.png` with `format: 'jpg'` becomes
5658
+ * `shot.jpg`).
5655
5659
  *
5656
5660
  * Internally all backends (D3D9, D3D11, D3D12, Vulkan) capture as BMP
5657
5661
  * first and transcode to JPEG on demand, ensuring correct colors across
5658
5662
  * all graphics APIs and formats.
5659
5663
  *
5660
5664
  * @param filePath - Absolute path (UTF-8) where the image will be saved.
5661
- * @param format - Output image format: `'jpg'` or `'bmp'`. Defaults to `'bmp'`.
5662
- * @returns A promise that resolves with `void` when the file is written.
5665
+ * @param format - Output image format: `'jpg'` or `'bmp'`. When omitted,
5666
+ * the extension in `filePath` is used, falling back to `'bmp'`.
5667
+ * @returns A promise that resolves with the absolute path the file was
5668
+ * actually written to, including the normalized extension (which may
5669
+ * differ from `filePath`).
5663
5670
  *
5664
5671
  * @throws `'no active game'` — the overlay is not currently injected into
5665
5672
  * any game. Wait for the `game-injected` event before calling.
@@ -5681,8 +5688,8 @@ interface IOverwolfOverlayApi extends EventEmitter {
5681
5688
  * const ts = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
5682
5689
  * const filePath = path.join(app.getPath('pictures'), `screenshot_${ts}`);
5683
5690
  * try {
5684
- * await overlay.takeScreenshot(filePath, 'jpg');
5685
- * // file written to filePath + '.jpg'
5691
+ * const savedPath = await overlay.takeScreenshot(filePath, 'jpg');
5692
+ * console.log('screenshot written to', savedPath); // ...filePath.jpg
5686
5693
  * } catch (err) {
5687
5694
  * console.error('Screenshot failed:', err.message);
5688
5695
  * }
@@ -5706,7 +5713,10 @@ interface IOverwolfOverlayApi extends EventEmitter {
5706
5713
  * @param listener - Callback with game launch event and game metadata.
5707
5714
  * @see {@link GameInfo}.
5708
5715
  */
5709
- on(eventName: 'game-launched', listener: (event: GameLaunchEvent, gameInfo: GameInfo) => void): this;
5716
+ on(
5717
+ eventName: 'game-launched',
5718
+ listener: (event: GameLaunchEvent, gameInfo: GameInfo) => void,
5719
+ ): this;
5710
5720
 
5711
5721
  /**
5712
5722
  * Fires when a registered game process terminates.
@@ -5726,7 +5736,10 @@ interface IOverwolfOverlayApi extends EventEmitter {
5726
5736
  *
5727
5737
  * @see {@link GameInfo}.
5728
5738
  */
5729
- on(eventName: 'game-exit', listener: (gameInfo: GameInfo, wasInjected: boolean) => void): this;
5739
+ on(
5740
+ eventName: 'game-exit',
5741
+ listener: (gameInfo: GameInfo, wasInjected: boolean) => void,
5742
+ ): this;
5730
5743
 
5731
5744
  /**
5732
5745
  * Fires when the overlay is ready and successfully injected into the game.
@@ -5746,7 +5759,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
5746
5759
  */
5747
5760
  on(
5748
5761
  eventName: 'game-injection-error',
5749
- listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void
5762
+ listener: (gameInfo: GameInfo, error: string, ...args: any[]) => void,
5750
5763
  ): this;
5751
5764
 
5752
5765
  /**
@@ -5762,8 +5775,8 @@ interface IOverwolfOverlayApi extends EventEmitter {
5762
5775
  listener: (
5763
5776
  window: GameWindowInfo,
5764
5777
  gameInfo: GameInfo,
5765
- focus: boolean
5766
- ) => void
5778
+ focus: boolean,
5779
+ ) => void,
5767
5780
  ): this;
5768
5781
 
5769
5782
  /**
@@ -5780,8 +5793,8 @@ interface IOverwolfOverlayApi extends EventEmitter {
5780
5793
  listener: (
5781
5794
  window: GameWindowInfo,
5782
5795
  gameInfo: GameInfo,
5783
- reason?: GameWindowUpdateReason
5784
- ) => void
5796
+ reason?: GameWindowUpdateReason,
5797
+ ) => void,
5785
5798
  ): this;
5786
5799
 
5787
5800
  /**
@@ -5794,7 +5807,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
5794
5807
  */
5795
5808
  on(
5796
5809
  eventName: 'game-input-interception-changed',
5797
- listener: (info: GameInputInterception) => void
5810
+ listener: (info: GameInputInterception) => void,
5798
5811
  ): this;
5799
5812
 
5800
5813
  /**
@@ -5806,7 +5819,7 @@ interface IOverwolfOverlayApi extends EventEmitter {
5806
5819
  */
5807
5820
  on(
5808
5821
  eventName: 'game-input-exclusive-mode-changed',
5809
- listener: (info: GameInputInterception) => void
5822
+ listener: (info: GameInputInterception) => void,
5810
5823
  ): this;
5811
5824
  }
5812
5825