@overwolf/ow-electron-packages-types 1.1.0 → 1.1.1-beta.0
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 +209 -1
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { overwolf } from '@overwolf/ow-electron';
|
|
2
|
-
import {
|
|
2
|
+
import type {
|
|
3
3
|
BrowserWindow,
|
|
4
4
|
BrowserWindowConstructorOptions,
|
|
5
5
|
Size,
|
|
@@ -4459,6 +4459,8 @@ interface IOverwolfRecordingApi {
|
|
|
4459
4459
|
* - `overlay`—in-game overlay window management and hotkeys
|
|
4460
4460
|
* - `utility`—game tracking and scanning utilities
|
|
4461
4461
|
* - `crn`—crash report and notification system
|
|
4462
|
+
* - `gep`—subscribe to real-time in-game events and info updates
|
|
4463
|
+
* from supported games.
|
|
4462
4464
|
*
|
|
4463
4465
|
* It acts as a unified entry point for interacting with Overwolf's capabilities within a packaged app.
|
|
4464
4466
|
* @packageDocumentation
|
|
@@ -4501,6 +4503,11 @@ interface OWPackages extends overwolf.packages.OverwolfPackageManager {
|
|
|
4501
4503
|
* Access to crash reporting and notification APIs.
|
|
4502
4504
|
*/
|
|
4503
4505
|
crn: IOverwolfCRNApi;
|
|
4506
|
+
|
|
4507
|
+
/**
|
|
4508
|
+
* Allows your app to subscribe to real-time in-game events and info updates from supported games.
|
|
4509
|
+
*/
|
|
4510
|
+
gep: OverwolfGameEventPackage;
|
|
4504
4511
|
}
|
|
4505
4512
|
|
|
4506
4513
|
|
|
@@ -5596,6 +5603,207 @@ interface IOverwolfOverlayApi extends EventEmitter {
|
|
|
5596
5603
|
}
|
|
5597
5604
|
|
|
5598
5605
|
|
|
5606
|
+
// --- modules\gep.d.ts ---
|
|
5607
|
+
/**
|
|
5608
|
+
* The *Game Events Provider* (GEP) APIs allow your app to subscribe to real-time in-game events and info updates
|
|
5609
|
+
* from supported games. GEP detects when a supported game launches, tracks gameplay state, and emits structured
|
|
5610
|
+
* events your app can react to.
|
|
5611
|
+
*
|
|
5612
|
+
* ## Game detection
|
|
5613
|
+
* When a supported game is detected, the `game-detected` event fires. Call `event.enable()` inside the listener
|
|
5614
|
+
* to activate GEP for that game. If the game is running with elevated privileges, the
|
|
5615
|
+
* `elevated-privileges-required` event fires instead — your app must also run as administrator for events to be
|
|
5616
|
+
* captured.
|
|
5617
|
+
*
|
|
5618
|
+
* ## Features and info updates
|
|
5619
|
+
* Before events flow, call `setRequiredFeatures` with the feature names your app needs. GEP will only emit
|
|
5620
|
+
* `new-info-update` and `new-game-event` events for features you have registered. Use `getFeatures` to query
|
|
5621
|
+
* which features a game supports, and `getInfo` to read the current game state at any point.
|
|
5622
|
+
*
|
|
5623
|
+
* ## Supported events
|
|
5624
|
+
* - `new-game-event` — a discrete in-game event (kill, death, match start, etc.)
|
|
5625
|
+
* - `new-info-update` — a change to a persistent game info value (health, score, map, etc.)
|
|
5626
|
+
* - `game-detected` — a supported game process was found; call `event.enable()` to start GEP
|
|
5627
|
+
* - `game-exit` — the tracked game process has exited
|
|
5628
|
+
* - `elevated-privileges-required` — the game is running as administrator
|
|
5629
|
+
* - `error` — an internal GEP error occurred
|
|
5630
|
+
*
|
|
5631
|
+
* @packageDocumentation
|
|
5632
|
+
*/
|
|
5633
|
+
|
|
5634
|
+
// -----------------------------------------------------------------------------
|
|
5635
|
+
// ow-electron packages
|
|
5636
|
+
/**
|
|
5637
|
+
* Game Events game detection Event.
|
|
5638
|
+
*
|
|
5639
|
+
* Passed to the `game-detected` listener — call `enable()` on this object to activate Game Events for the detected game.
|
|
5640
|
+
*/
|
|
5641
|
+
interface GepGameLaunchEvent {
|
|
5642
|
+
enable: () => void;
|
|
5643
|
+
}
|
|
5644
|
+
|
|
5645
|
+
/**
|
|
5646
|
+
* Game Events Package interface.
|
|
5647
|
+
*
|
|
5648
|
+
* Provides methods to query supported games and features, configure the required features for a game, and subscribe to game event and info update streams.
|
|
5649
|
+
*/
|
|
5650
|
+
interface OverwolfGameEventPackage extends NodeJS.EventEmitter {
|
|
5651
|
+
/**
|
|
5652
|
+
* Returns an array of supported Game Event Features for a game.
|
|
5653
|
+
*
|
|
5654
|
+
* @param gameId - Game ID of the targeted game.
|
|
5655
|
+
* @returns Promise resolving to an array of supported game features.
|
|
5656
|
+
*/
|
|
5657
|
+
getFeatures(gameId: number): Promise<string[]>;
|
|
5658
|
+
|
|
5659
|
+
/**
|
|
5660
|
+
* Sets the requires Game Event Features for a given game ID.
|
|
5661
|
+
*
|
|
5662
|
+
* @param gameId - Game ID of the targeted game.
|
|
5663
|
+
* @param features - Array of required Game Event Features.
|
|
5664
|
+
* @returns Promise reporting the success of the operation.
|
|
5665
|
+
*/
|
|
5666
|
+
setRequiredFeatures(
|
|
5667
|
+
gameId: number,
|
|
5668
|
+
features: string[] | undefined
|
|
5669
|
+
): Promise<void>;
|
|
5670
|
+
|
|
5671
|
+
/**
|
|
5672
|
+
* Returns an array of Game Events supported games.
|
|
5673
|
+
*
|
|
5674
|
+
* @returns Promise resolving to the supported games.
|
|
5675
|
+
*/
|
|
5676
|
+
getSupportedGames(): Promise<{
|
|
5677
|
+
name: string;
|
|
5678
|
+
id: number;
|
|
5679
|
+
}>;
|
|
5680
|
+
|
|
5681
|
+
/**
|
|
5682
|
+
* Returns the target game's current Game Info.
|
|
5683
|
+
*
|
|
5684
|
+
* @param gameId - Game ID of the targeted game.
|
|
5685
|
+
* @returns Promise resolving to the targeted game's current Game Info.
|
|
5686
|
+
*/
|
|
5687
|
+
getInfo(gameId: number): Promise<any>;
|
|
5688
|
+
|
|
5689
|
+
/**
|
|
5690
|
+
* Register listener for Game Info Updates.
|
|
5691
|
+
*
|
|
5692
|
+
* @param eventName - Name of the node event ('new-info-update').
|
|
5693
|
+
* @param listener - The listener that will be invoked when this event is fired.
|
|
5694
|
+
* @returns The current instance of the Overwolf Game Events Package.
|
|
5695
|
+
*/
|
|
5696
|
+
on(
|
|
5697
|
+
eventName: 'new-info-update',
|
|
5698
|
+
listener: (event: Event, gameId: number, data: gep.InfoUpdate) => void
|
|
5699
|
+
): this;
|
|
5700
|
+
|
|
5701
|
+
/**
|
|
5702
|
+
* Register listener for New Game Events.
|
|
5703
|
+
*
|
|
5704
|
+
* @param eventName - Name of the node event ('new-game-event').
|
|
5705
|
+
* @param listener - The listener that will be invoked when this event is fired.
|
|
5706
|
+
* @returns The current instance of the Overwolf Game Events Package.
|
|
5707
|
+
*/
|
|
5708
|
+
on(
|
|
5709
|
+
eventName: 'new-game-event',
|
|
5710
|
+
listener: (event: Event, gameId: number, data: gep.GameEvent) => void,
|
|
5711
|
+
): this;
|
|
5712
|
+
|
|
5713
|
+
/**
|
|
5714
|
+
* Register listener for a game being detected.
|
|
5715
|
+
* Calling `event.enable()` to start gep for this game.
|
|
5716
|
+
*
|
|
5717
|
+
* @param eventName - Name of the node event ('game-detected').
|
|
5718
|
+
* @param listener - The listener that will be invoked when this event is fired.
|
|
5719
|
+
* @returns The current instance of the Overwolf Game Events Package.
|
|
5720
|
+
*/
|
|
5721
|
+
on(
|
|
5722
|
+
eventName: 'game-detected',
|
|
5723
|
+
listener: (event: GepGameLaunchEvent, gameId: number, name: string, ...args: any[]) => void,
|
|
5724
|
+
): this;
|
|
5725
|
+
|
|
5726
|
+
/**
|
|
5727
|
+
* Register listener for a game exit event.
|
|
5728
|
+
*
|
|
5729
|
+
* @param eventName - Name of the node event ('game-exit').
|
|
5730
|
+
* @param listener - The listener that will be invoked when this event is fired.
|
|
5731
|
+
* @returns The current instance of the Overwolf Game Events Package.
|
|
5732
|
+
*/
|
|
5733
|
+
on(
|
|
5734
|
+
eventName: 'game-exit',
|
|
5735
|
+
listener: (event: Event, gameId: number, gameName: string, pid: number, processName: string, processPath: string, commandLine: string) => void,
|
|
5736
|
+
): this;
|
|
5737
|
+
|
|
5738
|
+
/**
|
|
5739
|
+
* Register listener for when a detected game is ran as administrator.
|
|
5740
|
+
* If this fires, it means the app must also run as administrator in order for Game Events to be detected.
|
|
5741
|
+
*
|
|
5742
|
+
* @param eventName - Name of the node event ('elevated-privileges-required').
|
|
5743
|
+
* @param listener - The listener that will be invoked when this event is fired.
|
|
5744
|
+
* @returns The current instance of the Overwolf Game Events Package.
|
|
5745
|
+
*/
|
|
5746
|
+
on(
|
|
5747
|
+
eventName: 'elevated-privileges-required',
|
|
5748
|
+
listener: (event: Event, gameId: number, name: string, pid: number) => void,
|
|
5749
|
+
): this;
|
|
5750
|
+
|
|
5751
|
+
/**
|
|
5752
|
+
* Register listener for errors thrown by the Game Events Provider Package.
|
|
5753
|
+
*
|
|
5754
|
+
* @param eventName - Name of the node event ('error' or the `errorMonitor` symbol).
|
|
5755
|
+
* @param listener - The listener that will be invoked when this event is fired.
|
|
5756
|
+
* @returns The current instance of the Overwolf Game Events Package.
|
|
5757
|
+
*/
|
|
5758
|
+
on(
|
|
5759
|
+
eventName: 'error',
|
|
5760
|
+
listener: (event: Event, gameId: number, error: string, ...args: any[]) => void,
|
|
5761
|
+
): this;
|
|
5762
|
+
}
|
|
5763
|
+
|
|
5764
|
+
/**
|
|
5765
|
+
* Namespace for GEP-related interfaces.
|
|
5766
|
+
*
|
|
5767
|
+
* Contains the shared data types used to type the payloads received in `new-game-event` and `new-info-update` listeners.
|
|
5768
|
+
*/
|
|
5769
|
+
declare namespace gep {
|
|
5770
|
+
/**
|
|
5771
|
+
* Interface defining a Game Event's structure.
|
|
5772
|
+
*
|
|
5773
|
+
* Received as the `data` argument in a `new-game-event` listener, representing a single discrete in-game occurrence.
|
|
5774
|
+
*/
|
|
5775
|
+
interface GameEvent {
|
|
5776
|
+
/**
|
|
5777
|
+
* The game id of the game the Event comes from.
|
|
5778
|
+
*/
|
|
5779
|
+
gameId: number;
|
|
5780
|
+
/**
|
|
5781
|
+
* The feature the Event belongs to.
|
|
5782
|
+
*/
|
|
5783
|
+
feature: string;
|
|
5784
|
+
/**
|
|
5785
|
+
* The name of the Event.
|
|
5786
|
+
*/
|
|
5787
|
+
key: string;
|
|
5788
|
+
/**
|
|
5789
|
+
* The value of the Event.
|
|
5790
|
+
*/
|
|
5791
|
+
value: any;
|
|
5792
|
+
}
|
|
5793
|
+
|
|
5794
|
+
/**
|
|
5795
|
+
* Interface defining an Info Update's structure.
|
|
5796
|
+
*
|
|
5797
|
+
* Extends `GameEvent` with a `category` field and is received as the `data` argument in a `new-info-update` listener, representing a change to a persistent game state value.
|
|
5798
|
+
*/
|
|
5799
|
+
interface InfoUpdate extends GameEvent {
|
|
5800
|
+
/**
|
|
5801
|
+
* The category the Info Item belongs to.
|
|
5802
|
+
*/
|
|
5803
|
+
category: string;
|
|
5804
|
+
}
|
|
5805
|
+
}
|
|
5806
|
+
|
|
5599
5807
|
// --- modules\crn.d.ts ---
|
|
5600
5808
|
/**
|
|
5601
5809
|
* The *Content Recommendation Notification* (CRN) APIs give you tools to help manage the content notification settings in your app.
|