@overwolf/ow-electron 22.0.3 → 22.3.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/electron.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for ow-electron 22.0.3
1
+ // Type definitions for Electron 22.3.0
2
2
  // Project: http://electronjs.org/
3
3
  // Definitions by: The Electron Team <https://github.com/electron/electron>
4
4
  // Definitions: https://github.com/electron/electron-typescript-definitions
@@ -1536,7 +1536,8 @@ declare namespace Electron {
1536
1536
  * WOW).
1537
1537
  *
1538
1538
  * You can use this property to prompt users to download the arm64 version of your
1539
- * application when they are running the x64 version under Rosetta incorrectly.
1539
+ * application when they are mistakenly running the x64 version under Rosetta or
1540
+ * WOW.
1540
1541
  *
1541
1542
  * @platform darwin,win32
1542
1543
  */
@@ -1566,62 +1567,6 @@ declare namespace Electron {
1566
1567
  * app's initialization to ensure that your overridden value is used.
1567
1568
  */
1568
1569
  userAgentFallback: string;
1569
-
1570
- /**
1571
- * Overwolf additional api's
1572
- */
1573
- overwolf: OverwolfApi;
1574
- }
1575
-
1576
- interface OverwolfApi {
1577
- /**
1578
- * Disable sending any anonymous analytics,
1579
- * this should be call before app.ready
1580
- */
1581
- disableAnonymousAnalytics(): void;
1582
-
1583
- /**
1584
- * Returns true if the current user should be able to update their cmp
1585
- * configurations (i.e. openCMPWindow).
1586
- *
1587
- * Note that this is an async function and should be called with await.
1588
- * The function will never throw an exception - the default value is true.
1589
- */
1590
- isCMPRequired() : Promise<boolean>;
1591
-
1592
- /**
1593
- * Opens the CMP configuration window - should only be called when
1594
- * isCMPRequired returns true.
1595
- */
1596
- openCMPWindow(options?: CMPWindowOptions): Promise<void>;
1597
- }
1598
-
1599
- interface CMPWindowOptions {
1600
- /**
1601
- * Select open tab. The default is 'purposes'
1602
- */
1603
- tab? : ['purposes' | 'features' | 'vendors']
1604
-
1605
- /**
1606
- * Whether this is a modal window. This only works when the window is a child
1607
- * window. Default is `false`.
1608
- */
1609
- modal?: boolean;
1610
-
1611
- /**
1612
- * Specify parent window. Default is `null`.
1613
- */
1614
- parent?: BrowserWindow;
1615
-
1616
- /**
1617
- * Show window in the center of the screen. Default is `true`.
1618
- */
1619
- center?: boolean;
1620
-
1621
- /**
1622
- * Control the CMP preloader background window
1623
- */
1624
- backgroundColor?: string;
1625
1570
  }
1626
1571
 
1627
1572
  interface AutoUpdater extends NodeJS.EventEmitter {
@@ -2481,11 +2426,11 @@ declare namespace Electron {
2481
2426
  */
2482
2427
  isEnabled(): boolean;
2483
2428
  /**
2484
- * Returns whether the window can be focused.
2429
+ * Whether the window can be focused.
2485
2430
  *
2486
2431
  * @platform darwin,win32
2487
2432
  */
2488
- isFocusable(): void;
2433
+ isFocusable(): boolean;
2489
2434
  /**
2490
2435
  * Whether the window is focused.
2491
2436
  */
@@ -2499,6 +2444,12 @@ declare namespace Electron {
2499
2444
  * window.
2500
2445
  */
2501
2446
  isFullScreenable(): boolean;
2447
+ /**
2448
+ * Whether the window will be hidden when the user toggles into mission control.
2449
+ *
2450
+ * @platform darwin
2451
+ */
2452
+ isHiddenInMissionControl(): boolean;
2502
2453
  /**
2503
2454
  * Whether the window is in kiosk mode.
2504
2455
  */
@@ -2833,6 +2784,13 @@ declare namespace Electron {
2833
2784
  * Sets whether the window should have a shadow.
2834
2785
  */
2835
2786
  setHasShadow(hasShadow: boolean): void;
2787
+ /**
2788
+ * Sets whether the window will be hidden when the user toggles into mission
2789
+ * control.
2790
+ *
2791
+ * @platform darwin
2792
+ */
2793
+ setHiddenInMissionControl(hidden: boolean): void;
2836
2794
  /**
2837
2795
  * Changes window icon.
2838
2796
  *
@@ -4501,6 +4459,10 @@ declare namespace Electron {
4501
4459
  * `true` for an internal display and `false` for an external display
4502
4460
  */
4503
4461
  internal: boolean;
4462
+ /**
4463
+ * User-friendly label, determined by the platform.
4464
+ */
4465
+ label: string;
4504
4466
  /**
4505
4467
  * Whether or not the display is a monochrome display.
4506
4468
  */
@@ -8226,7 +8188,7 @@ declare namespace Electron {
8226
8188
  * `setPermissionCheckHandler` to get complete permission handling. Most web APIs
8227
8189
  * do a permission check and then make a permission request if the check is denied.
8228
8190
  */
8229
- setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'media' | 'display-capture' | 'mediaKeySystem' | 'geolocation' | 'notifications' | 'midi' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' | 'window-placement' | 'unknown', callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerHandlerDetails) => void) | (null)): void;
8191
+ setPermissionRequestHandler(handler: ((webContents: WebContents, permission: 'clipboard-read' | 'clipboard-sanitized-write' | 'media' | 'display-capture' | 'mediaKeySystem' | 'geolocation' | 'notifications' | 'midi' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' | 'window-placement' | 'unknown', callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerHandlerDetails) => void) | (null)): void;
8230
8192
  /**
8231
8193
  * Adds scripts that will be executed on ALL web contents that are associated with
8232
8194
  * this session just before normal `preload` scripts run.
@@ -13383,6 +13345,12 @@ declare namespace Electron {
13383
13345
  * @platform darwin,win32
13384
13346
  */
13385
13347
  skipTaskbar?: boolean;
13348
+ /**
13349
+ * Whether window should be hidden when the user toggles into mission control.
13350
+ *
13351
+ * @platform darwin
13352
+ */
13353
+ hiddenInMissionControl?: boolean;
13386
13354
  /**
13387
13355
  * Whether the window is in kiosk mode. Default is `false`.
13388
13356
  */
@@ -13597,9 +13565,9 @@ declare namespace Electron {
13597
13565
  */
13598
13566
  origin?: string;
13599
13567
  /**
13600
- * The types of storages to clear, can contain: `appcache`, `cookies`,
13601
- * `filesystem`, `indexdb`, `localstorage`, `shadercache`, `websql`,
13602
- * `serviceworkers`, `cachestorage`. If not specified, clear all storage types.
13568
+ * The types of storages to clear, can contain: `cookies`, `filesystem`, `indexdb`,
13569
+ * `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If
13570
+ * not specified, clear all storage types.
13603
13571
  */
13604
13572
  storages?: string[];
13605
13573
  /**
@@ -16310,8 +16278,9 @@ declare namespace Electron {
16310
16278
  */
16311
16279
  footer?: string;
16312
16280
  /**
16313
- * Specify page size of the printed document. Can be `A3`, `A4`, `A5`, `Legal`,
16314
- * `Letter`, `Tabloid` or an Object containing `height` and `width`.
16281
+ * Specify page size of the printed document. Can be `A0`, `A1`, `A2`, `A3`, `A4`,
16282
+ * `A5`, `A6`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and
16283
+ * `width`.
16315
16284
  */
16316
16285
  pageSize?: (string) | (Size);
16317
16286
  }
@@ -0,0 +1,309 @@
1
+ // Type definitions for ow-electron 22.3.0
2
+
3
+ import { App, BrowserWindow, Event } from 'electron'
4
+ import { errorMonitor } from 'events';
5
+
6
+ declare namespace overwolf {
7
+ interface OverwolfApp extends App {
8
+ /**
9
+ * Overwolf additional api's
10
+ */
11
+ overwolf: OverwolfApi;
12
+ }
13
+
14
+ interface OverwolfApi {
15
+ /**
16
+ * Disable sending any anonymous analytics,
17
+ * this should be call before app.ready
18
+ */
19
+ disableAnonymousAnalytics(): void;
20
+
21
+ /**
22
+ * Returns true if the current user should be able to update their cmp
23
+ * configurations (i.e. openCMPWindow).
24
+ *
25
+ * Note that this is an async function and should be called with await.
26
+ * The function will never throw an exception - the default value is true.
27
+ */
28
+ isCMPRequired(): Promise<boolean>;
29
+
30
+ /**
31
+ * Opens the CMP configuration window - should only be called when
32
+ * isCMPRequired returns true.
33
+ */
34
+ openCMPWindow(options?: CMPWindowOptions): Promise<void>;
35
+
36
+ /**
37
+ * The Overwolf Package Manager instance
38
+ */
39
+ packages: overwolf.packages.OverwolfPackageManager;
40
+
41
+ /**
42
+ * Client persistence phasing precent
43
+ */
44
+ readonly phasePercent: number
45
+ }
46
+
47
+ interface CMPWindowOptions {
48
+ /**
49
+ * Select open tab. The default is 'purposes'
50
+ */
51
+ tab?: 'purposes' | 'features' | 'vendors';
52
+
53
+ /**
54
+ * Whether this is a modal window. This only works when the window is a child
55
+ * window. Default is `false`.
56
+ */
57
+ modal?: boolean;
58
+
59
+ /**
60
+ * Specify parent window. Default is `null`.
61
+ */
62
+ parent?: BrowserWindow;
63
+
64
+ /**
65
+ * Show window in the center of the screen. Default is `true`.
66
+ */
67
+ center?: boolean;
68
+
69
+ /**
70
+ * Control the CMP preloader background window
71
+ */
72
+ backgroundColor?: string;
73
+ }
74
+
75
+ /**
76
+ * A utility type for registering to `error` events, that includes the `errorMonitor` type
77
+ */
78
+ type error = 'error' | typeof errorMonitor;
79
+
80
+ /**
81
+ * Namespace containing everything related to Overwolf Packages
82
+ */
83
+ namespace packages {
84
+ /**
85
+ * A fake enum for all built-in packIge names
86
+ */
87
+ type PackageName = 'gep';
88
+
89
+ /**
90
+ * Package info
91
+ */
92
+ interface PackageInfo {
93
+ name: string;
94
+ version: string;
95
+ }
96
+
97
+ /**
98
+ * Overwolf Package Manager interface
99
+ */
100
+ interface OverwolfPackageManager extends NodeJS.EventEmitter {
101
+ /**
102
+ * Register listener for Overwolf Package crashes.
103
+ * Calling `event.preventDefault()` will prevent the package from automatically attempting to re-launch itself.
104
+ *
105
+ * @param {string | symbol} eventName Name of the node event ('crashed')
106
+ * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
107
+ * @returns {this} The current instance of the Overwolf Package Manager
108
+ */
109
+ on(
110
+ eventName: 'crashed',
111
+ listener: (event: Event, canRecover: boolean) => void,
112
+ ): this;
113
+
114
+ /**
115
+ * Register listener for when an Overwolf Package is ready
116
+ *
117
+ * @param {string | symbol} eventName Name of the node event ('ready')
118
+ * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
119
+ * @returns {this} The current instance of the Overwolf Package Manager
120
+ */
121
+ on(
122
+ eventName: 'ready',
123
+ listener: (event: Event, packageName: PackageName) => void,
124
+ ): this;
125
+
126
+ /**
127
+ * Register listener for when an Overwolf Package is ready to update
128
+ *
129
+ * @param {string | symbol} eventName Name of the node event ('package-update-pending')
130
+ * @param {(Event, PackageInfo[]) => void} listener The listener that will be invoked when this event is fired
131
+ * @returns {this} The current instance of the Overwolf Package Manager
132
+ */
133
+ on(
134
+ eventName: 'package-update-pending',
135
+ listener: (event: Event, info: PackageInfo[]) => void,
136
+ ): this;
137
+
138
+ /**
139
+ * Register listener for Overwolf Package initialization failures
140
+ *
141
+ * @param {string | symbol} eventName Name of the node event ('failed-to-initialize')
142
+ * @param {(Event, any[]) => void} listener **The listener that will be invoked when this event is fired**
143
+ * @returns {this} The current instance of the Overwolf Package Manager
144
+ */
145
+ on(
146
+ eventName: 'failed-to-initialize',
147
+ listener: (event: Event, packageName: PackageName) => void,
148
+ ): this;
149
+
150
+ /**
151
+ * Relaunch the Overwolf Package Manager. Call it to force all pending Overwolf Package updates.
152
+ *
153
+ * *The Overwolf Package Manager will automatically relaunch itself if an update is available and no package is currently running.*
154
+ */
155
+ relaunch(): void;
156
+
157
+ /**
158
+ * @property {packages.IOverwolfGameEventPackage} gep The Game Events Provider Package Instance
159
+ * note: available once 'ready' is fired.
160
+ */
161
+ readonly gep: packages.OverwolfGameEventPackage;
162
+ }
163
+
164
+ /**
165
+ * Game Events Package interface
166
+ */
167
+ interface OverwolfGameEventPackage extends NodeJS.EventEmitter {
168
+ /**
169
+ * Returns an array of supported Game Event Features for a game
170
+ *
171
+ * @param {number} gameId Game ID of the targeted game
172
+ * @returns {Promise<string[]>} Promise resolving to an array of supported game features
173
+ */
174
+ getFeatures(gameId: number): Promise<string[]>;
175
+
176
+ /**
177
+ * Sets the requires Game Event Features for a given game ID
178
+ *
179
+ * @param {number} gameId Game ID of the targeted game
180
+ * @param {string[] | undefined} features Array of required Game Event Features
181
+ * @returns {Promise<void>} Promise reporting the success of the operation
182
+ */
183
+ setRequiredFeatures(
184
+ gameId: number,
185
+ features: string[] | undefined,
186
+ ): Promise<void>;
187
+
188
+ /**
189
+ * Returns an array of Game Events supported games
190
+ *
191
+ * @returns {Promise<{
192
+ * name: string;
193
+ * id: number;
194
+ * }>} Promise resolving to an array of supported games
195
+ */
196
+ getSupportedGames(): Promise<{
197
+ name: string;
198
+ id: number;
199
+ }>;
200
+
201
+ /**
202
+ * Returns the target game's current Game Info
203
+ *
204
+ * @param {number} gameId Game ID of the targeted game
205
+ * @returns {Promise<any>} Promise resolving to the targeted game's current Game Info
206
+ */
207
+ getInfo(gameId: number): Promise<any>;
208
+
209
+ /**
210
+ * Register listener for Game Info Updates
211
+ *
212
+ * @param {string | symbol} eventName Name of the node event ('new-info-update')
213
+ * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
214
+ * @returns {this} The current instance of the Overwolf Game Events Package
215
+ */
216
+ on(
217
+ eventName: 'new-info-update',
218
+ listener: (event: Event, gameId: number, data: gep.InfoUpdate) => void,
219
+ ): this;
220
+
221
+ /**
222
+ * Register listener for New Game Events
223
+ *
224
+ * @param {string | symbol} eventName Name of the node event ('new-game-event')
225
+ * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
226
+ * @returns {this} The current instance of the Overwolf Game Events Package
227
+ */
228
+ on(
229
+ eventName: 'new-game-event',
230
+ listener: (event: Event, gameId: number, data: gep.GameEvent) => void,
231
+ ): this;
232
+
233
+ /**
234
+ * Register listener for a game being detected.
235
+ * Calling `event.preventDefault()` will prevent the Game Events Provider Package from connecting to the game.
236
+ *
237
+ * @param {string | symbol} eventName Name of the node event ('game-detected')
238
+ * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
239
+ * @returns {this} The current instance of the Overwolf Game Events Package
240
+ */
241
+ on(
242
+ eventName: 'game-detected',
243
+ listener: (event: Event, gameId: number, name: string, ...args: any[]) => void,
244
+ ): this;
245
+
246
+ /**
247
+ * Register listener for when a detected game is ran as adminstrator.
248
+ * If this fires, it means the app must also run as adminstrator in order for Game Events to be detected.
249
+ *
250
+ * @param {string | symbol} eventName Name of the node event ('elevated-privileges-required')
251
+ * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
252
+ * @returns {this} The current instance of the Overwolf Game Events Package
253
+ */
254
+ on(
255
+ eventName: 'elevated-privileges-required',
256
+ listener: (event: Event, gameId: number, name: string, pid: number) => void,
257
+ ): this;
258
+
259
+ /**
260
+ * Register listener for errors thrown by the Game Events Provider Package
261
+ *
262
+ * @param {string | symbol} eventName Name of the node event ('error' or the `errorMonitor` symbol)
263
+ * @param {(Event, any[]) => void} listener The listener that will be invoked when this event is fired
264
+ * @returns {this} The current instance of the Overwolf Game Events Package
265
+ */
266
+ on(
267
+ eventName: error,
268
+ listener: (event: Event, gameId: number, error: string, ...args: any[]) => void,
269
+ ): this;
270
+ }
271
+
272
+ /**
273
+ * Namespace for GEP-related interfaces
274
+ */
275
+ namespace gep {
276
+ /**
277
+ * Interface defining a Game Event's structure
278
+ */
279
+ interface GameEvent {
280
+ /**
281
+ * @property {number} gameId The game id of the game the Event comes from
282
+ */
283
+ gameId: number;
284
+ /**
285
+ * @property {string} feature The feature the Event belongs to
286
+ */
287
+ feature: string;
288
+ /**
289
+ * @property {string} key The name of the Event
290
+ */
291
+ key: string;
292
+ /**
293
+ * @property {any} value The value of the Event
294
+ */
295
+ value: any;
296
+ }
297
+
298
+ /**
299
+ * Interface defining an Info Update's structure
300
+ */
301
+ interface InfoUpdate extends GameEvent {
302
+ /**
303
+ * @property {string} category The category the Info Item belongs to
304
+ */
305
+ category: string;
306
+ }
307
+ }
308
+ }
309
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron",
3
- "version": "22.0.3",
4
- "owElectronVersion": "22.0.3",
3
+ "version": "22.3.0",
4
+ "owElectronVersion": "22.3.0",
5
5
  "repository": "https://github.com/electron/electron",
6
6
  "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
7
7
  "license": "MIT",
@@ -11,7 +11,7 @@
11
11
  "overwolf electron"
12
12
  ],
13
13
  "main": "index.js",
14
- "types": "electron.d.ts",
14
+ "types": "ow-electron.d.ts",
15
15
  "bin": {
16
16
  "ow-electron": "cli.js"
17
17
  },