@capgo/capacitor-updater 5.7.3 → 5.7.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/README.md CHANGED
@@ -153,7 +153,7 @@ Capacitor Updater works by unzipping a compiled app bundle to the native device
153
153
  <docgen-config>
154
154
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
155
155
 
156
- CapacitorUpdater can be configured with this options:
156
+ CapacitorUpdater can be configured with these options:
157
157
 
158
158
  | Prop | Type | Description | Default | Since |
159
159
  | ------------------------ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------- |
@@ -270,6 +270,11 @@ export default config;
270
270
  * [`unsetChannel(...)`](#unsetchannel)
271
271
  * [`getChannel()`](#getchannel)
272
272
  * [`setCustomId(...)`](#setcustomid)
273
+ * [`getBuiltinVersion()`](#getbuiltinversion)
274
+ * [`getDeviceId()`](#getdeviceid)
275
+ * [`getPluginVersion()`](#getpluginversion)
276
+ * [`isAutoUpdateEnabled()`](#isautoupdateenabled)
277
+ * [`removeAllListeners()`](#removealllisteners)
273
278
  * [`addListener('download', ...)`](#addlistenerdownload)
274
279
  * [`addListener('noNeedUpdate', ...)`](#addlistenernoneedupdate)
275
280
  * [`addListener('updateAvailable', ...)`](#addlistenerupdateavailable)
@@ -279,11 +284,6 @@ export default config;
279
284
  * [`addListener('downloadFailed', ...)`](#addlistenerdownloadfailed)
280
285
  * [`addListener('appReloaded', ...)`](#addlistenerappreloaded)
281
286
  * [`addListener('appReady', ...)`](#addlistenerappready)
282
- * [`getBuiltinVersion()`](#getbuiltinversion)
283
- * [`getDeviceId()`](#getdeviceid)
284
- * [`getPluginVersion()`](#getpluginversion)
285
- * [`isAutoUpdateEnabled()`](#isautoupdateenabled)
286
- * [`removeAllListeners()`](#removealllisteners)
287
287
  * [Interfaces](#interfaces)
288
288
  * [Type Aliases](#type-aliases)
289
289
 
@@ -295,14 +295,14 @@ export default config;
295
295
  ### notifyAppReady()
296
296
 
297
297
  ```typescript
298
- notifyAppReady() => Promise<{ bundle: BundleInfo; }>
298
+ notifyAppReady() => Promise<AppReadyResult>
299
299
  ```
300
300
 
301
301
  Notify Capacitor Updater that the current bundle is working (a rollback will occur if this method is not called on every app launch)
302
302
  By default this method should be called in the first 10 sec after app launch, otherwise a rollback will occur.
303
303
  Change this behaviour with {@link appReadyTimeout}
304
304
 
305
- **Returns:** <code>Promise&lt;{ bundle: <a href="#bundleinfo">BundleInfo</a>; }&gt;</code>
305
+ **Returns:** <code>Promise&lt;<a href="#appreadyresult">AppReadyResult</a>&gt;</code>
306
306
 
307
307
  --------------------
308
308
 
@@ -310,14 +310,14 @@ Change this behaviour with {@link appReadyTimeout}
310
310
  ### setUpdateUrl(...)
311
311
 
312
312
  ```typescript
313
- setUpdateUrl(options: { url: string; }) => Promise<void>
313
+ setUpdateUrl(options: UpdateUrl) => Promise<void>
314
314
  ```
315
315
 
316
316
  Set the updateUrl for the app, this will be used to check for updates.
317
317
 
318
- | Param | Type |
319
- | ------------- | ----------------------------- |
320
- | **`options`** | <code>{ url: string; }</code> |
318
+ | Param | Type | Description |
319
+ | ------------- | ----------------------------------------------- | ------------------------------------------------- |
320
+ | **`options`** | <code><a href="#updateurl">UpdateUrl</a></code> | contains the URL to use for checking for updates. |
321
321
 
322
322
  **Since:** 5.4.0
323
323
 
@@ -327,14 +327,14 @@ Set the updateUrl for the app, this will be used to check for updates.
327
327
  ### setStatsUrl(...)
328
328
 
329
329
  ```typescript
330
- setStatsUrl(options: { url: string; }) => Promise<void>
330
+ setStatsUrl(options: StatsUrl) => Promise<void>
331
331
  ```
332
332
 
333
- Set the statsUrl for the app, this will be used to send statistics.
333
+ Set the statsUrl for the app, this will be used to send statistics. Passing an empty string will disable statistics gathering.
334
334
 
335
- | Param | Type |
336
- | ------------- | ----------------------------- |
337
- | **`options`** | <code>{ url: string; }</code> |
335
+ | Param | Type | Description |
336
+ | ------------- | --------------------------------------------- | ----------------------------------------------- |
337
+ | **`options`** | <code><a href="#statsurl">StatsUrl</a></code> | contains the URL to use for sending statistics. |
338
338
 
339
339
  **Since:** 5.4.0
340
340
 
@@ -344,14 +344,14 @@ Set the statsUrl for the app, this will be used to send statistics.
344
344
  ### setChannelUrl(...)
345
345
 
346
346
  ```typescript
347
- setChannelUrl(options: { url: string; }) => Promise<void>
347
+ setChannelUrl(options: ChannelUrl) => Promise<void>
348
348
  ```
349
349
 
350
350
  Set the channelUrl for the app, this will be used to set the channel.
351
351
 
352
- | Param | Type |
353
- | ------------- | ----------------------------- |
354
- | **`options`** | <code>{ url: string; }</code> |
352
+ | Param | Type | Description |
353
+ | ------------- | ------------------------------------------------- | ------------------------------------------------ |
354
+ | **`options`** | <code><a href="#channelurl">ChannelUrl</a></code> | contains the URL to use for setting the channel. |
355
355
 
356
356
  **Since:** 5.4.0
357
357
 
@@ -361,14 +361,14 @@ Set the channelUrl for the app, this will be used to set the channel.
361
361
  ### download(...)
362
362
 
363
363
  ```typescript
364
- download(options: { url: string; version: string; sessionKey?: string; checksum?: string; }) => Promise<BundleInfo>
364
+ download(options: DownloadOptions) => Promise<BundleInfo>
365
365
  ```
366
366
 
367
367
  Download a new bundle from the provided URL, it should be a zip file, with files inside or with a unique id inside with all your files
368
368
 
369
- | Param | Type |
370
- | ------------- | -------------------------------------------------------------------------------------- |
371
- | **`options`** | <code>{ url: string; version: string; sessionKey?: string; checksum?: string; }</code> |
369
+ | Param | Type | Description |
370
+ | ------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
371
+ | **`options`** | <code><a href="#downloadoptions">DownloadOptions</a></code> | The {@link <a href="#downloadoptions">DownloadOptions</a>} for downloading a new bundle zip. |
372
372
 
373
373
  **Returns:** <code>Promise&lt;<a href="#bundleinfo">BundleInfo</a>&gt;</code>
374
374
 
@@ -378,14 +378,14 @@ Download a new bundle from the provided URL, it should be a zip file, with files
378
378
  ### next(...)
379
379
 
380
380
  ```typescript
381
- next(options: { id: string; }) => Promise<BundleInfo>
381
+ next(options: BundleId) => Promise<BundleInfo>
382
382
  ```
383
383
 
384
384
  Set the next bundle to be used when the app is reloaded.
385
385
 
386
- | Param | Type |
387
- | ------------- | ---------------------------- |
388
- | **`options`** | <code>{ id: string; }</code> |
386
+ | Param | Type | Description |
387
+ | ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
388
+ | **`options`** | <code><a href="#bundleid">BundleId</a></code> | Contains the ID of the next Bundle to set on next app launch. {@link <a href="#bundleinfo">BundleInfo.id</a>} |
389
389
 
390
390
  **Returns:** <code>Promise&lt;<a href="#bundleinfo">BundleInfo</a>&gt;</code>
391
391
 
@@ -395,14 +395,14 @@ Set the next bundle to be used when the app is reloaded.
395
395
  ### set(...)
396
396
 
397
397
  ```typescript
398
- set(options: { id: string; }) => Promise<void>
398
+ set(options: BundleId) => Promise<void>
399
399
  ```
400
400
 
401
401
  Set the current bundle and immediately reloads the app.
402
402
 
403
- | Param | Type |
404
- | ------------- | ---------------------------- |
405
- | **`options`** | <code>{ id: string; }</code> |
403
+ | Param | Type | Description |
404
+ | ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------- |
405
+ | **`options`** | <code><a href="#bundleid">BundleId</a></code> | A {@link <a href="#bundleid">BundleId</a>} object containing the new bundle id to set as current. |
406
406
 
407
407
  --------------------
408
408
 
@@ -410,14 +410,14 @@ Set the current bundle and immediately reloads the app.
410
410
  ### delete(...)
411
411
 
412
412
  ```typescript
413
- delete(options: { id: string; }) => Promise<void>
413
+ delete(options: BundleId) => Promise<void>
414
414
  ```
415
415
 
416
- Delete bundle in storage
416
+ Deletes the specified bundle from the native app storage. Use with {@link list} to get the stored Bundle IDs.
417
417
 
418
- | Param | Type |
419
- | ------------- | ---------------------------- |
420
- | **`options`** | <code>{ id: string; }</code> |
418
+ | Param | Type | Description |
419
+ | ------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
420
+ | **`options`** | <code><a href="#bundleid">BundleId</a></code> | A {@link <a href="#bundleid">BundleId</a>} object containing the ID of a bundle to delete (note, this is the bundle id, NOT the version name) |
421
421
 
422
422
  --------------------
423
423
 
@@ -425,12 +425,12 @@ Delete bundle in storage
425
425
  ### list()
426
426
 
427
427
  ```typescript
428
- list() => Promise<{ bundles: BundleInfo[]; }>
428
+ list() => Promise<BundleListResult>
429
429
  ```
430
430
 
431
431
  Get all locally downloaded bundles in your app
432
432
 
433
- **Returns:** <code>Promise&lt;{ bundles: BundleInfo[]; }&gt;</code>
433
+ **Returns:** <code>Promise&lt;<a href="#bundlelistresult">BundleListResult</a>&gt;</code>
434
434
 
435
435
  --------------------
436
436
 
@@ -438,14 +438,14 @@ Get all locally downloaded bundles in your app
438
438
  ### reset(...)
439
439
 
440
440
  ```typescript
441
- reset(options?: { toLastSuccessful?: boolean | undefined; } | undefined) => Promise<void>
441
+ reset(options?: ResetOptions | undefined) => Promise<void>
442
442
  ```
443
443
 
444
- Set the `builtin` bundle (the one sent to Apple store / Google play store ) as current bundle
444
+ Reset the app to the `builtin` bundle (the one sent to Apple App Store / Google Play Store ) or the last successfully loaded bundle.
445
445
 
446
- | Param | Type |
447
- | ------------- | -------------------------------------------- |
448
- | **`options`** | <code>{ toLastSuccessful?: boolean; }</code> |
446
+ | Param | Type | Description |
447
+ | ------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
448
+ | **`options`** | <code><a href="#resetoptions">ResetOptions</a></code> | Containing {@link <a href="#resetoptions">ResetOptions.toLastSuccessful</a>}, `true` resets to the builtin bundle and `false` will reset to the last successfully loaded bundle. |
449
449
 
450
450
  --------------------
451
451
 
@@ -453,12 +453,12 @@ Set the `builtin` bundle (the one sent to Apple store / Google play store ) as c
453
453
  ### current()
454
454
 
455
455
  ```typescript
456
- current() => Promise<{ bundle: BundleInfo; native: string; }>
456
+ current() => Promise<CurrentBundleResult>
457
457
  ```
458
458
 
459
- Get the current bundle, if none are set it returns `builtin`, currentNative is the original bundle installed on the device
459
+ Get the current bundle, if none are set it returns `builtin`. currentNative is the original bundle installed on the device
460
460
 
461
- **Returns:** <code>Promise&lt;{ bundle: <a href="#bundleinfo">BundleInfo</a>; native: string; }&gt;</code>
461
+ **Returns:** <code>Promise&lt;<a href="#currentbundleresult">CurrentBundleResult</a>&gt;</code>
462
462
 
463
463
  --------------------
464
464
 
@@ -477,14 +477,14 @@ Reload the view
477
477
  ### setMultiDelay(...)
478
478
 
479
479
  ```typescript
480
- setMultiDelay(options: { delayConditions: DelayCondition[]; }) => Promise<void>
480
+ setMultiDelay(options: MultiDelayConditions) => Promise<void>
481
481
  ```
482
482
 
483
- Set <a href="#delaycondition">DelayCondition</a>, skip updates until one of the conditions is met
483
+ Sets a {@link <a href="#delaycondition">DelayCondition</a>} array containing conditions that the Plugin will use to determine when to install updates.
484
484
 
485
- | Param | Type | Description |
486
- | ------------- | --------------------------------------------------- | ------------------------------------------------------------------------ |
487
- | **`options`** | <code>{ delayConditions: DelayCondition[]; }</code> | are the {@link <a href="#delaycondition">DelayCondition</a>} list to set |
485
+ | Param | Type | Description |
486
+ | ------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
487
+ | **`options`** | <code><a href="#multidelayconditions">MultiDelayConditions</a></code> | Containing the {@link <a href="#multidelayconditions">MultiDelayConditions</a>} array of conditions to set |
488
488
 
489
489
  **Since:** 4.3.0
490
490
 
@@ -497,7 +497,7 @@ Set <a href="#delaycondition">DelayCondition</a>, skip updates until one of the
497
497
  cancelDelay() => Promise<void>
498
498
  ```
499
499
 
500
- Cancel delay to updates as usual
500
+ Cancels a {@link <a href="#delaycondition">DelayCondition</a>} to process an update immediately.
501
501
 
502
502
  **Since:** 4.0.0
503
503
 
@@ -507,12 +507,12 @@ Cancel delay to updates as usual
507
507
  ### getLatest()
508
508
 
509
509
  ```typescript
510
- getLatest() => Promise<latestVersion>
510
+ getLatest() => Promise<LatestVersion>
511
511
  ```
512
512
 
513
513
  Get Latest bundle available from update Url
514
514
 
515
- **Returns:** <code>Promise&lt;<a href="#latestversion">latestVersion</a>&gt;</code>
515
+ **Returns:** <code>Promise&lt;<a href="#latestversion">LatestVersion</a>&gt;</code>
516
516
 
517
517
  **Since:** 4.0.0
518
518
 
@@ -522,17 +522,18 @@ Get Latest bundle available from update Url
522
522
  ### setChannel(...)
523
523
 
524
524
  ```typescript
525
- setChannel(options: SetChannelOptions) => Promise<channelRes>
525
+ setChannel(options: SetChannelOptions) => Promise<ChannelRes>
526
526
  ```
527
527
 
528
- Set Channel for this device, the channel have to allow self assignement to make this work
529
- Do not use this method to set the channel at boot when autoUpdate is enabled, this method is made to set the channel after the app is ready when user click on a button for example
528
+ Sets the channel for this device. The channel has to allow for self assignment for this to work.
529
+ Do not use this method to set the channel at boot when `autoUpdate` is enabled in the {@link PluginsConfig}.
530
+ This method is to set the channel after the app is ready.
530
531
 
531
532
  | Param | Type | Description |
532
533
  | ------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------- |
533
- | **`options`** | <code><a href="#setchanneloptions">SetChannelOptions</a></code> | is the {@link <a href="#setchanneloptions">SetChannelOptions</a>} channel to set |
534
+ | **`options`** | <code><a href="#setchanneloptions">SetChannelOptions</a></code> | Is the {@link <a href="#setchanneloptions">SetChannelOptions</a>} channel to set |
534
535
 
535
- **Returns:** <code>Promise&lt;<a href="#channelres">channelRes</a>&gt;</code>
536
+ **Returns:** <code>Promise&lt;<a href="#channelres">ChannelRes</a>&gt;</code>
536
537
 
537
538
  **Since:** 4.7.0
538
539
 
@@ -545,7 +546,7 @@ Do not use this method to set the channel at boot when autoUpdate is enabled, th
545
546
  unsetChannel(options: UnsetChannelOptions) => Promise<void>
546
547
  ```
547
548
 
548
- Unset Channel for this device, the device will return to the default channel
549
+ Unset the channel for this device. The device will then return to the default channel
549
550
 
550
551
  | Param | Type |
551
552
  | ------------- | ------------------------------------------------------------------- |
@@ -559,12 +560,12 @@ Unset Channel for this device, the device will return to the default channel
559
560
  ### getChannel()
560
561
 
561
562
  ```typescript
562
- getChannel() => Promise<getChannelRes>
563
+ getChannel() => Promise<GetChannelRes>
563
564
  ```
564
565
 
565
- get Channel for this device
566
+ Get the channel for this device
566
567
 
567
- **Returns:** <code>Promise&lt;<a href="#getchannelres">getChannelRes</a>&gt;</code>
568
+ **Returns:** <code>Promise&lt;<a href="#getchannelres">GetChannelRes</a>&gt;</code>
568
569
 
569
570
  **Since:** 4.8.0
570
571
 
@@ -577,7 +578,7 @@ get Channel for this device
577
578
  setCustomId(options: SetCustomIdOptions) => Promise<void>
578
579
  ```
579
580
 
580
- Set Channel for this device
581
+ Set a custom ID for this device
581
582
 
582
583
  | Param | Type | Description |
583
584
  | ------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
@@ -588,18 +589,85 @@ Set Channel for this device
588
589
  --------------------
589
590
 
590
591
 
592
+ ### getBuiltinVersion()
593
+
594
+ ```typescript
595
+ getBuiltinVersion() => Promise<BuiltinVersion>
596
+ ```
597
+
598
+ Get the native app version or the builtin version if set in config
599
+
600
+ **Returns:** <code>Promise&lt;<a href="#builtinversion">BuiltinVersion</a>&gt;</code>
601
+
602
+ **Since:** 5.2.0
603
+
604
+ --------------------
605
+
606
+
607
+ ### getDeviceId()
608
+
609
+ ```typescript
610
+ getDeviceId() => Promise<DeviceId>
611
+ ```
612
+
613
+ Get unique ID used to identify device (sent to auto update server)
614
+
615
+ **Returns:** <code>Promise&lt;<a href="#deviceid">DeviceId</a>&gt;</code>
616
+
617
+ --------------------
618
+
619
+
620
+ ### getPluginVersion()
621
+
622
+ ```typescript
623
+ getPluginVersion() => Promise<PluginVersion>
624
+ ```
625
+
626
+ Get the native Capacitor Updater plugin version (sent to auto update server)
627
+
628
+ **Returns:** <code>Promise&lt;<a href="#pluginversion">PluginVersion</a>&gt;</code>
629
+
630
+ --------------------
631
+
632
+
633
+ ### isAutoUpdateEnabled()
634
+
635
+ ```typescript
636
+ isAutoUpdateEnabled() => Promise<AutoUpdateEnabled>
637
+ ```
638
+
639
+ Get the state of auto update config.
640
+
641
+ **Returns:** <code>Promise&lt;<a href="#autoupdateenabled">AutoUpdateEnabled</a>&gt;</code>
642
+
643
+ --------------------
644
+
645
+
646
+ ### removeAllListeners()
647
+
648
+ ```typescript
649
+ removeAllListeners() => Promise<void>
650
+ ```
651
+
652
+ Remove all listeners for this plugin.
653
+
654
+ **Since:** 1.0.0
655
+
656
+ --------------------
657
+
658
+
591
659
  ### addListener('download', ...)
592
660
 
593
661
  ```typescript
594
- addListener(eventName: "download", listenerFunc: DownloadChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle
662
+ addListener(eventName: "download", listenerFunc: (state: DownloadEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
595
663
  ```
596
664
 
597
- Listen for download event in the App, let you know when the download is started, loading and finished, with a percent value
665
+ Listen for bundle download event in the App. Fires once a download has started, during downloading and when finished.
598
666
 
599
- | Param | Type |
600
- | ------------------ | ------------------------------------------------------------------------- |
601
- | **`eventName`** | <code>'download'</code> |
602
- | **`listenerFunc`** | <code><a href="#downloadchangelistener">DownloadChangeListener</a></code> |
667
+ | Param | Type |
668
+ | ------------------ | --------------------------------------------------------------------------- |
669
+ | **`eventName`** | <code>'download'</code> |
670
+ | **`listenerFunc`** | <code>(state: <a href="#downloadevent">DownloadEvent</a>) =&gt; void</code> |
603
671
 
604
672
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
605
673
 
@@ -611,15 +679,15 @@ Listen for download event in the App, let you know when the download is started,
611
679
  ### addListener('noNeedUpdate', ...)
612
680
 
613
681
  ```typescript
614
- addListener(eventName: "noNeedUpdate", listenerFunc: NoNeedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
682
+ addListener(eventName: "noNeedUpdate", listenerFunc: (state: NoNeedEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
615
683
  ```
616
684
 
617
- Listen for no need to update event, usefull when you want force check every time the app is launched
685
+ Listen for no need to update event, useful when you want force check every time the app is launched
618
686
 
619
- | Param | Type |
620
- | ------------------ | --------------------------------------------------------- |
621
- | **`eventName`** | <code>'noNeedUpdate'</code> |
622
- | **`listenerFunc`** | <code><a href="#noneedlistener">NoNeedListener</a></code> |
687
+ | Param | Type |
688
+ | ------------------ | ----------------------------------------------------------------------- |
689
+ | **`eventName`** | <code>'noNeedUpdate'</code> |
690
+ | **`listenerFunc`** | <code>(state: <a href="#noneedevent">NoNeedEvent</a>) =&gt; void</code> |
623
691
 
624
692
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
625
693
 
@@ -631,15 +699,15 @@ Listen for no need to update event, usefull when you want force check every time
631
699
  ### addListener('updateAvailable', ...)
632
700
 
633
701
  ```typescript
634
- addListener(eventName: "updateAvailable", listenerFunc: UpdateAvailabledListener) => Promise<PluginListenerHandle> & PluginListenerHandle
702
+ addListener(eventName: "updateAvailable", listenerFunc: (state: UpdateAvailableEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
635
703
  ```
636
704
 
637
- Listen for availbale update event, usefull when you want to force check every time the app is launched
705
+ Listen for available update event, useful when you want to force check every time the app is launched
638
706
 
639
- | Param | Type |
640
- | ------------------ | ----------------------------------------------------------------------------- |
641
- | **`eventName`** | <code>'updateAvailable'</code> |
642
- | **`listenerFunc`** | <code><a href="#updateavailabledlistener">UpdateAvailabledListener</a></code> |
707
+ | Param | Type |
708
+ | ------------------ | ----------------------------------------------------------------------------------------- |
709
+ | **`eventName`** | <code>'updateAvailable'</code> |
710
+ | **`listenerFunc`** | <code>(state: <a href="#updateavailableevent">UpdateAvailableEvent</a>) =&gt; void</code> |
643
711
 
644
712
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
645
713
 
@@ -651,15 +719,15 @@ Listen for availbale update event, usefull when you want to force check every ti
651
719
  ### addListener('downloadComplete', ...)
652
720
 
653
721
  ```typescript
654
- addListener(eventName: "downloadComplete", listenerFunc: DownloadCompleteListener) => Promise<PluginListenerHandle> & PluginListenerHandle
722
+ addListener(eventName: "downloadComplete", listenerFunc: (state: DownloadCompleteEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
655
723
  ```
656
724
 
657
- Listen for download event in the App, let you know when the download is started, loading and finished
725
+ Listen for downloadComplete events.
658
726
 
659
- | Param | Type |
660
- | ------------------ | ----------------------------------------------------------------------------- |
661
- | **`eventName`** | <code>'downloadComplete'</code> |
662
- | **`listenerFunc`** | <code><a href="#downloadcompletelistener">DownloadCompleteListener</a></code> |
727
+ | Param | Type |
728
+ | ------------------ | ------------------------------------------------------------------------------------------- |
729
+ | **`eventName`** | <code>'downloadComplete'</code> |
730
+ | **`listenerFunc`** | <code>(state: <a href="#downloadcompleteevent">DownloadCompleteEvent</a>) =&gt; void</code> |
663
731
 
664
732
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
665
733
 
@@ -671,15 +739,15 @@ Listen for download event in the App, let you know when the download is started,
671
739
  ### addListener('majorAvailable', ...)
672
740
 
673
741
  ```typescript
674
- addListener(eventName: "majorAvailable", listenerFunc: MajorAvailableListener) => Promise<PluginListenerHandle> & PluginListenerHandle
742
+ addListener(eventName: "majorAvailable", listenerFunc: (state: MajorAvailableEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
675
743
  ```
676
744
 
677
745
  Listen for Major update event in the App, let you know when major update is blocked by setting disableAutoUpdateBreaking
678
746
 
679
- | Param | Type |
680
- | ------------------ | ------------------------------------------------------------------------- |
681
- | **`eventName`** | <code>'majorAvailable'</code> |
682
- | **`listenerFunc`** | <code><a href="#majoravailablelistener">MajorAvailableListener</a></code> |
747
+ | Param | Type |
748
+ | ------------------ | --------------------------------------------------------------------------------------- |
749
+ | **`eventName`** | <code>'majorAvailable'</code> |
750
+ | **`listenerFunc`** | <code>(state: <a href="#majoravailableevent">MajorAvailableEvent</a>) =&gt; void</code> |
683
751
 
684
752
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
685
753
 
@@ -691,15 +759,15 @@ Listen for Major update event in the App, let you know when major update is bloc
691
759
  ### addListener('updateFailed', ...)
692
760
 
693
761
  ```typescript
694
- addListener(eventName: "updateFailed", listenerFunc: UpdateFailedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
762
+ addListener(eventName: "updateFailed", listenerFunc: (state: UpdateFailedEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
695
763
  ```
696
764
 
697
765
  Listen for update fail event in the App, let you know when update has fail to install at next app start
698
766
 
699
- | Param | Type |
700
- | ------------------ | --------------------------------------------------------------------- |
701
- | **`eventName`** | <code>'updateFailed'</code> |
702
- | **`listenerFunc`** | <code><a href="#updatefailedlistener">UpdateFailedListener</a></code> |
767
+ | Param | Type |
768
+ | ------------------ | ----------------------------------------------------------------------------------- |
769
+ | **`eventName`** | <code>'updateFailed'</code> |
770
+ | **`listenerFunc`** | <code>(state: <a href="#updatefailedevent">UpdateFailedEvent</a>) =&gt; void</code> |
703
771
 
704
772
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
705
773
 
@@ -711,15 +779,15 @@ Listen for update fail event in the App, let you know when update has fail to in
711
779
  ### addListener('downloadFailed', ...)
712
780
 
713
781
  ```typescript
714
- addListener(eventName: "downloadFailed", listenerFunc: DownloadFailedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
782
+ addListener(eventName: "downloadFailed", listenerFunc: (state: DownloadFailedEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
715
783
  ```
716
784
 
717
- Listen for download fail event in the App, let you know when download has fail finished
785
+ Listen for download fail event in the App, let you know when a bundle download has failed
718
786
 
719
- | Param | Type |
720
- | ------------------ | ------------------------------------------------------------------------- |
721
- | **`eventName`** | <code>'downloadFailed'</code> |
722
- | **`listenerFunc`** | <code><a href="#downloadfailedlistener">DownloadFailedListener</a></code> |
787
+ | Param | Type |
788
+ | ------------------ | --------------------------------------------------------------------------------------- |
789
+ | **`eventName`** | <code>'downloadFailed'</code> |
790
+ | **`listenerFunc`** | <code>(state: <a href="#downloadfailedevent">DownloadFailedEvent</a>) =&gt; void</code> |
723
791
 
724
792
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
725
793
 
@@ -731,15 +799,15 @@ Listen for download fail event in the App, let you know when download has fail f
731
799
  ### addListener('appReloaded', ...)
732
800
 
733
801
  ```typescript
734
- addListener(eventName: "appReloaded", listenerFunc: AppReloadedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
802
+ addListener(eventName: "appReloaded", listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
735
803
  ```
736
804
 
737
- Listen for reload event in the App, let you know when reload has happend
805
+ Listen for reload event in the App, let you know when reload has happened
738
806
 
739
- | Param | Type |
740
- | ------------------ | ------------------------------------------------------------------- |
741
- | **`eventName`** | <code>'appReloaded'</code> |
742
- | **`listenerFunc`** | <code><a href="#appreloadedlistener">AppReloadedListener</a></code> |
807
+ | Param | Type |
808
+ | ------------------ | -------------------------- |
809
+ | **`eventName`** | <code>'appReloaded'</code> |
810
+ | **`listenerFunc`** | <code>() =&gt; void</code> |
743
811
 
744
812
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
745
813
 
@@ -751,15 +819,15 @@ Listen for reload event in the App, let you know when reload has happend
751
819
  ### addListener('appReady', ...)
752
820
 
753
821
  ```typescript
754
- addListener(eventName: "appReady", listenerFunc: AppReadyListener) => Promise<PluginListenerHandle> & PluginListenerHandle
822
+ addListener(eventName: "appReady", listenerFunc: (state: AppReadyEvent) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
755
823
  ```
756
824
 
757
825
  Listen for app ready event in the App, let you know when app is ready to use
758
826
 
759
- | Param | Type |
760
- | ------------------ | ------------------------------------------------------------- |
761
- | **`eventName`** | <code>'appReady'</code> |
762
- | **`listenerFunc`** | <code><a href="#appreadylistener">AppReadyListener</a></code> |
827
+ | Param | Type |
828
+ | ------------------ | --------------------------------------------------------------------------- |
829
+ | **`eventName`** | <code>'appReady'</code> |
830
+ | **`listenerFunc`** | <code>(state: <a href="#appreadyevent">AppReadyEvent</a>) =&gt; void</code> |
763
831
 
764
832
  **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
765
833
 
@@ -768,85 +836,92 @@ Listen for app ready event in the App, let you know when app is ready to use
768
836
  --------------------
769
837
 
770
838
 
771
- ### getBuiltinVersion()
772
-
773
- ```typescript
774
- getBuiltinVersion() => Promise<{ version: string; }>
775
- ```
839
+ ### Interfaces
776
840
 
777
- Get the native app version or the builtin version if set in config
778
841
 
779
- **Returns:** <code>Promise&lt;{ version: string; }&gt;</code>
842
+ #### AppReadyResult
780
843
 
781
- **Since:** 5.2.0
844
+ | Prop | Type |
845
+ | ------------ | ------------------------------------------------- |
846
+ | **`bundle`** | <code><a href="#bundleinfo">BundleInfo</a></code> |
782
847
 
783
- --------------------
784
848
 
849
+ #### BundleInfo
785
850
 
786
- ### getDeviceId()
851
+ | Prop | Type |
852
+ | ---------------- | ----------------------------------------------------- |
853
+ | **`id`** | <code>string</code> |
854
+ | **`version`** | <code>string</code> |
855
+ | **`downloaded`** | <code>string</code> |
856
+ | **`checksum`** | <code>string</code> |
857
+ | **`status`** | <code><a href="#bundlestatus">BundleStatus</a></code> |
787
858
 
788
- ```typescript
789
- getDeviceId() => Promise<{ deviceId: string; }>
790
- ```
791
859
 
792
- Get unique ID used to identify device (sent to auto update server)
860
+ #### UpdateUrl
793
861
 
794
- **Returns:** <code>Promise&lt;{ deviceId: string; }&gt;</code>
862
+ | Prop | Type |
863
+ | --------- | ------------------- |
864
+ | **`url`** | <code>string</code> |
795
865
 
796
- --------------------
797
866
 
867
+ #### StatsUrl
798
868
 
799
- ### getPluginVersion()
869
+ | Prop | Type |
870
+ | --------- | ------------------- |
871
+ | **`url`** | <code>string</code> |
800
872
 
801
- ```typescript
802
- getPluginVersion() => Promise<{ version: string; }>
803
- ```
804
873
 
805
- Get the native Capacitor Updater plugin version (sent to auto update server)
874
+ #### ChannelUrl
806
875
 
807
- **Returns:** <code>Promise&lt;{ version: string; }&gt;</code>
876
+ | Prop | Type |
877
+ | --------- | ------------------- |
878
+ | **`url`** | <code>string</code> |
808
879
 
809
- --------------------
810
880
 
881
+ #### DownloadOptions
811
882
 
812
- ### isAutoUpdateEnabled()
883
+ | Prop | Type | Description |
884
+ | ---------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
885
+ | **`url`** | <code>string</code> | The URL of the bundle zip file (e.g: dist.zip) to be downloaded. (This can be any URL. E.g: Amazon S3, a GitHub tag, any other place you've hosted your bundle.) |
886
+ | **`version`** | <code>string</code> | The version code/name of this bundle/version |
887
+ | **`sessionKey`** | <code>string</code> | |
888
+ | **`checksum`** | <code>string</code> | |
813
889
 
814
- ```typescript
815
- isAutoUpdateEnabled() => Promise<{ enabled: boolean; }>
816
- ```
817
890
 
818
- Get the state of auto update config. This will return `false` in manual mode.
891
+ #### BundleId
819
892
 
820
- **Returns:** <code>Promise&lt;{ enabled: boolean; }&gt;</code>
893
+ | Prop | Type |
894
+ | -------- | ------------------- |
895
+ | **`id`** | <code>string</code> |
821
896
 
822
- --------------------
823
897
 
898
+ #### BundleListResult
824
899
 
825
- ### removeAllListeners()
900
+ | Prop | Type |
901
+ | ------------- | ------------------------- |
902
+ | **`bundles`** | <code>BundleInfo[]</code> |
826
903
 
827
- ```typescript
828
- removeAllListeners() => Promise<void>
829
- ```
830
904
 
831
- Remove all listeners for this plugin.
905
+ #### ResetOptions
832
906
 
833
- **Since:** 1.0.0
907
+ | Prop | Type |
908
+ | ---------------------- | -------------------- |
909
+ | **`toLastSuccessful`** | <code>boolean</code> |
834
910
 
835
- --------------------
836
911
 
912
+ #### CurrentBundleResult
837
913
 
838
- ### Interfaces
914
+ | Prop | Type |
915
+ | ------------ | ------------------------------------------------- |
916
+ | **`bundle`** | <code><a href="#bundleinfo">BundleInfo</a></code> |
917
+ | **`native`** | <code>string</code> |
839
918
 
840
919
 
841
- #### BundleInfo
920
+ #### MultiDelayConditions
842
921
 
843
- | Prop | Type |
844
- | ---------------- | ----------------------------------------------------- |
845
- | **`id`** | <code>string</code> |
846
- | **`version`** | <code>string</code> |
847
- | **`downloaded`** | <code>string</code> |
848
- | **`checksum`** | <code>string</code> |
849
- | **`status`** | <code><a href="#bundlestatus">BundleStatus</a></code> |
922
+ | Prop | Type |
923
+ | --------------------- | ----------------------------- |
924
+ | **`delayConditions`** | <code>DelayCondition[]</code> |
850
925
 
851
926
 
852
927
  #### DelayCondition
@@ -857,20 +932,20 @@ Remove all listeners for this plugin.
857
932
  | **`value`** | <code>string</code> | |
858
933
 
859
934
 
860
- #### latestVersion
935
+ #### LatestVersion
861
936
 
862
- | Prop | Type | Description | Since |
863
- | ---------------- | -------------------- | ----------------------- | ----- |
864
- | **`version`** | <code>string</code> | Res of getLatest method | 4.0.0 |
865
- | **`major`** | <code>boolean</code> | | |
866
- | **`message`** | <code>string</code> | | |
867
- | **`sessionKey`** | <code>string</code> | | |
868
- | **`error`** | <code>string</code> | | |
869
- | **`old`** | <code>string</code> | | |
870
- | **`url`** | <code>string</code> | | |
937
+ | Prop | Type | Description | Since |
938
+ | ---------------- | -------------------- | -------------------------- | ----- |
939
+ | **`version`** | <code>string</code> | Result of getLatest method | 4.0.0 |
940
+ | **`major`** | <code>boolean</code> | | |
941
+ | **`message`** | <code>string</code> | | |
942
+ | **`sessionKey`** | <code>string</code> | | |
943
+ | **`error`** | <code>string</code> | | |
944
+ | **`old`** | <code>string</code> | | |
945
+ | **`url`** | <code>string</code> | | |
871
946
 
872
947
 
873
- #### channelRes
948
+ #### ChannelRes
874
949
 
875
950
  | Prop | Type | Description | Since |
876
951
  | ------------- | ------------------- | ----------------------------- | ----- |
@@ -894,7 +969,7 @@ Remove all listeners for this plugin.
894
969
  | **`triggerAutoUpdate`** | <code>boolean</code> |
895
970
 
896
971
 
897
- #### getChannelRes
972
+ #### GetChannelRes
898
973
 
899
974
  | Prop | Type | Description | Since |
900
975
  | -------------- | -------------------- | ----------------------------- | ----- |
@@ -912,6 +987,34 @@ Remove all listeners for this plugin.
912
987
  | **`customId`** | <code>string</code> |
913
988
 
914
989
 
990
+ #### BuiltinVersion
991
+
992
+ | Prop | Type |
993
+ | ------------- | ------------------- |
994
+ | **`version`** | <code>string</code> |
995
+
996
+
997
+ #### DeviceId
998
+
999
+ | Prop | Type |
1000
+ | -------------- | ------------------- |
1001
+ | **`deviceId`** | <code>string</code> |
1002
+
1003
+
1004
+ #### PluginVersion
1005
+
1006
+ | Prop | Type |
1007
+ | ------------- | ------------------- |
1008
+ | **`version`** | <code>string</code> |
1009
+
1010
+
1011
+ #### AutoUpdateEnabled
1012
+
1013
+ | Prop | Type |
1014
+ | ------------- | -------------------- |
1015
+ | **`enabled`** | <code>boolean</code> |
1016
+
1017
+
915
1018
  #### PluginListenerHandle
916
1019
 
917
1020
  | Prop | Type |
@@ -927,14 +1030,14 @@ Remove all listeners for this plugin.
927
1030
  | **`bundle`** | <code><a href="#bundleinfo">BundleInfo</a></code> | | |
928
1031
 
929
1032
 
930
- #### noNeedEvent
1033
+ #### NoNeedEvent
931
1034
 
932
1035
  | Prop | Type | Description | Since |
933
1036
  | ------------ | ------------------------------------------------- | ---------------------------------------------- | ----- |
934
1037
  | **`bundle`** | <code><a href="#bundleinfo">BundleInfo</a></code> | Current status of download, between 0 and 100. | 4.0.0 |
935
1038
 
936
1039
 
937
- #### updateAvailableEvent
1040
+ #### UpdateAvailableEvent
938
1041
 
939
1042
  | Prop | Type | Description | Since |
940
1043
  | ------------ | ------------------------------------------------- | ---------------------------------------------- | ----- |
@@ -971,10 +1074,10 @@ Remove all listeners for this plugin.
971
1074
 
972
1075
  #### AppReadyEvent
973
1076
 
974
- | Prop | Type | Description | Since |
975
- | ------------ | ------------------------------------------------- | -------------------------------- | ----- |
976
- | **`bundle`** | <code><a href="#bundleinfo">BundleInfo</a></code> | Emit when a app is ready to use. | 5.2.0 |
977
- | **`status`** | <code>string</code> | | |
1077
+ | Prop | Type | Description | Since |
1078
+ | ------------ | ------------------------------------------------- | ------------------------------------- | ----- |
1079
+ | **`bundle`** | <code><a href="#bundleinfo">BundleInfo</a></code> | Emitted when the app is ready to use. | 5.2.0 |
1080
+ | **`status`** | <code>string</code> | | |
978
1081
 
979
1082
 
980
1083
  ### Type Aliases
@@ -989,51 +1092,6 @@ Remove all listeners for this plugin.
989
1092
 
990
1093
  <code>"background" | "kill" | "nativeVersion" | "date"</code>
991
1094
 
992
-
993
- #### DownloadChangeListener
994
-
995
- <code>(state: <a href="#downloadevent">DownloadEvent</a>): void</code>
996
-
997
-
998
- #### NoNeedListener
999
-
1000
- <code>(state: <a href="#noneedevent">noNeedEvent</a>): void</code>
1001
-
1002
-
1003
- #### UpdateAvailabledListener
1004
-
1005
- <code>(state: <a href="#updateavailableevent">updateAvailableEvent</a>): void</code>
1006
-
1007
-
1008
- #### DownloadCompleteListener
1009
-
1010
- <code>(state: <a href="#downloadcompleteevent">DownloadCompleteEvent</a>): void</code>
1011
-
1012
-
1013
- #### MajorAvailableListener
1014
-
1015
- <code>(state: <a href="#majoravailableevent">MajorAvailableEvent</a>): void</code>
1016
-
1017
-
1018
- #### UpdateFailedListener
1019
-
1020
- <code>(state: <a href="#updatefailedevent">UpdateFailedEvent</a>): void</code>
1021
-
1022
-
1023
- #### DownloadFailedListener
1024
-
1025
- <code>(state: <a href="#downloadfailedevent">DownloadFailedEvent</a>): void</code>
1026
-
1027
-
1028
- #### AppReloadedListener
1029
-
1030
- <code>(state: void): void</code>
1031
-
1032
-
1033
- #### AppReadyListener
1034
-
1035
- <code>(state: <a href="#appreadyevent">AppReadyEvent</a>): void</code>
1036
-
1037
1095
  </docgen-api>
1038
1096
 
1039
1097
  ### Listen to download events