@overwolf/ow-electron 39.8.10-beta.3 → 39.8.10-beta.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/checksums.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "electron-api.json": "d3c769853e7cac1098c3e33b0f5743ad3f890cf5003e738abb27aa7e9157d944",
3
3
  "electron.d.ts": "a332d5d3fafb45e224218d44c5c471d215dca76889956d5f36f59ec0f8716d10",
4
- "ow-electron-v39.8.10-beta.3-darwin-arm64.zip": "ee6d5aaede2d638b0ff7470d366093ba7cef508b0b69132c756ced97b08753d5",
5
- "ow-electron-v39.8.10-beta.3-darwin-x64.zip": "166ad42073185540efd628344e5a229e4d9cb18a4ce1cdc0e3f76618f9c6e442",
6
- "ow-electron-v39.8.10-beta.3-linux-arm64.zip": "b7f255d4e3c6ac67f18aa11a59bc04194ef5ded9c48249053af96ecaf2ed33f3",
7
- "ow-electron-v39.8.10-beta.3-linux-armv7l.zip": "6e4d0d96b5ed98b9973868b8ea6234a5511cae866f15e586be7003a753b7afcc",
8
- "ow-electron-v39.8.10-beta.3-linux-x64.zip": "5a1a3474e6718a9629cdeb425da3936a349a484bd40b0df663aa6354c99c45fa",
9
- "ow-electron-v39.8.10-beta.3-win32-arm64.zip": "bff199e35ef75181dd65db2386df20444e876b8adc604d0778099a2baa3dc0b7",
10
- "ow-electron-v39.8.10-beta.3-win32-ia32.zip": "9d5957e472682389b732e611854fba8a189590fd36b04385c045df1085baad8f",
11
- "ow-electron-v39.8.10-beta.3-win32-x64.zip": "9461bc79eb3eaff8ffdb71d0217d8fecf1e0934442976ec4da898e30d4bb98ef"
4
+ "ow-electron-v39.8.10-beta.4-darwin-arm64.zip": "ee6d5aaede2d638b0ff7470d366093ba7cef508b0b69132c756ced97b08753d5",
5
+ "ow-electron-v39.8.10-beta.4-darwin-x64.zip": "166ad42073185540efd628344e5a229e4d9cb18a4ce1cdc0e3f76618f9c6e442",
6
+ "ow-electron-v39.8.10-beta.4-linux-arm64.zip": "b7f255d4e3c6ac67f18aa11a59bc04194ef5ded9c48249053af96ecaf2ed33f3",
7
+ "ow-electron-v39.8.10-beta.4-linux-armv7l.zip": "6e4d0d96b5ed98b9973868b8ea6234a5511cae866f15e586be7003a753b7afcc",
8
+ "ow-electron-v39.8.10-beta.4-linux-x64.zip": "5a1a3474e6718a9629cdeb425da3936a349a484bd40b0df663aa6354c99c45fa",
9
+ "ow-electron-v39.8.10-beta.4-win32-arm64.zip": "bff199e35ef75181dd65db2386df20444e876b8adc604d0778099a2baa3dc0b7",
10
+ "ow-electron-v39.8.10-beta.4-win32-ia32.zip": "9d5957e472682389b732e611854fba8a189590fd36b04385c045df1085baad8f",
11
+ "ow-electron-v39.8.10-beta.4-win32-x64.zip": "38a914e748ffac10dd2c8a021502c1ac673e2266c85cd2736b23367fd83cbbca"
12
12
  }
package/ow-electron.d.ts CHANGED
@@ -187,6 +187,39 @@ declare namespace overwolf {
187
187
  details: PackageInfo[];
188
188
  };
189
189
 
190
+ /**
191
+ * Result returned by `setChannel()`.
192
+ * `error` is `'invalid-package'` when the package is not found on the server,
193
+ * or `'invalid-channel'` when the channel does not exist for that package.
194
+ */
195
+ type SetChannelResult = {
196
+ success: boolean;
197
+ error?: 'invalid-package' | 'invalid-channel';
198
+ };
199
+
200
+ /**
201
+ * Passed to the `ready` callback of `setChannel()`.
202
+ * Identifies the downloaded package that is pending a restart.
203
+ */
204
+ interface ChannelPackageInfo {
205
+ name: string;
206
+ version: string;
207
+ }
208
+
209
+ /**
210
+ * Returned by `getAvailableChannels()`.
211
+ * Maps each package name to the list of channel names available on the server.
212
+ * Packages with no channels defined return an empty array.
213
+ */
214
+ type AvailableChannelsResult = Record<string, string[]>;
215
+
216
+ /**
217
+ * Returned by `getChannel()`.
218
+ * Maps each package name to its currently active channel.
219
+ * `'public'` means the package is on the default public release.
220
+ */
221
+ type CurrentChannelsResult = Record<string, string>;
222
+
190
223
  /**
191
224
  * Overwolf Package Manager interface.
192
225
  *
@@ -253,6 +286,19 @@ declare namespace overwolf {
253
286
  listener: (event: Event, packageName: PackageName) => void
254
287
  ): this;
255
288
 
289
+ /**
290
+ * Register listener for when an Overwolf Package begins its load sequence.
291
+ * Fires before 'ready'.
292
+ *
293
+ * @param {string} eventName Name of the node event ('loading')
294
+ * @param {(Event, PackageName) => void} listener The listener that will be invoked when this event is fired
295
+ * @returns {this} The current instance of the Overwolf Package Manager
296
+ */
297
+ on(
298
+ eventName: 'loading',
299
+ listener: (event: Event, packageName: PackageName) => void
300
+ ): this;
301
+
256
302
  /**
257
303
  * Relaunch the Overwolf Package Manager. Call it to force all pending Overwolf Package updates.
258
304
  *
@@ -267,6 +313,95 @@ declare namespace overwolf {
267
313
  */
268
314
  hasPendingUpdates(): PendingUpdatesResult;
269
315
 
316
+ /**
317
+ * Switches a package to a named release channel and immediately triggers a
318
+ * download of that channel's version.
319
+ *
320
+ * - Channel preferences are persisted in storage and applied on every subsequent
321
+ * update check, including the next app launch.
322
+ * - Pass `undefined`, `null`, an empty string, or `'public'` to restore the
323
+ * default public release.
324
+ * - The optional `ready` callback is invoked with `{ name, version }` once the
325
+ * download completes and the app must restart to apply the new version.
326
+ * - If the package is already at the requested channel version, `ready` never fires.
327
+ * - Throws if `packageName` is not listed in the app's `package.json`
328
+ * `overwolf.packages` array.
329
+ *
330
+ * @param {PackageName} packageName The package to switch.
331
+ * @param {string} [channel] Target channel name. Omit or pass `'public'` /
332
+ * empty string to restore the public release.
333
+ * @param {Function} [ready] Invoked when the download completes and a
334
+ * restart is required.
335
+ * @returns {Promise<SetChannelResult>}
336
+ *
337
+ * @example
338
+ * ```typescript
339
+ * const result = await api.setChannel('overlay', 'pre-release', (pkg) => {
340
+ * console.log(`overlay v${pkg.version} ready - restart required`);
341
+ * api.relaunch();
342
+ * });
343
+ * if (!result.success) console.error('setChannel failed:', result.error);
344
+ * ```
345
+ *
346
+ * @example
347
+ * ```typescript
348
+ * // Restore the public release - all four are equivalent
349
+ * await api.setChannel('overlay');
350
+ * await api.setChannel('overlay', undefined);
351
+ * await api.setChannel('overlay', '');
352
+ * await api.setChannel('overlay', 'public');
353
+ * ```
354
+ */
355
+ setChannel(
356
+ packageName: PackageName,
357
+ channel?: string | 'public',
358
+ ready?: (packageInfo: ChannelPackageInfo) => void
359
+ ): Promise<SetChannelResult>;
360
+
361
+ /**
362
+ * Returns the list of release channels available on the server for one or more packages.
363
+ *
364
+ * - Pass no arguments to query all packages registered in the app's `overwolf.packages` list.
365
+ * - Pass one or more package names to query a specific subset.
366
+ * - Packages with no channels defined return an empty array `[]`.
367
+ * - Throws if any supplied name is not in the registered packages list.
368
+ *
369
+ * @param {...PackageName} packageNames Optional package names to query.
370
+ * @returns {Promise<AvailableChannelsResult>}
371
+ *
372
+ * @example
373
+ * ```typescript
374
+ * const channels = await api.getAvailableChannels();
375
+ * // { overlay: ['pre-release', 'beta'], gep: ['pre-release'], utility: [] }
376
+ *
377
+ * const { overlay } = await api.getAvailableChannels('overlay');
378
+ * // overlay: ['pre-release', 'beta']
379
+ * ```
380
+ */
381
+ getAvailableChannels(...packageNames: PackageName[]): Promise<AvailableChannelsResult>;
382
+
383
+ /**
384
+ * Returns the currently active release channel for one or more packages.
385
+ *
386
+ * - `'public'` means the package is on the default public release.
387
+ * - Pass no arguments to query all registered packages (plus any package with a
388
+ * non-public channel stored, even if not in `package.json`).
389
+ * - Unknown package names are silently omitted from the result (no error thrown).
390
+ *
391
+ * @param {...PackageName} packageNames Optional package names to query.
392
+ * @returns {Promise<CurrentChannelsResult>}
393
+ *
394
+ * @example
395
+ * ```typescript
396
+ * const current = await api.getChannel();
397
+ * // { overlay: 'pre-release', gep: 'public', utility: 'public' }
398
+ *
399
+ * const { overlay } = await api.getChannel('overlay');
400
+ * // 'pre-release'
401
+ * ```
402
+ */
403
+ getChannel(...packageNames: PackageName[]): Promise<CurrentChannelsResult>;
404
+
270
405
  /**
271
406
  * @property returns the path to the application's logs folder.
272
407
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@overwolf/ow-electron",
3
- "version": "39.8.10-beta.3",
4
- "owElectronVersion": "39.8.10-beta.3",
3
+ "version": "39.8.10-beta.4",
4
+ "owElectronVersion": "39.8.10-beta.4",
5
5
  "electronVersion": "39.8.10",
6
6
  "repository": "https://github.com/electron/electron",
7
7
  "description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",