@capawesome/capacitor-live-update 6.7.2 → 7.0.0-dev.1765885034

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 (56) hide show
  1. package/CapawesomeCapacitorLiveUpdate.podspec +3 -3
  2. package/Package.swift +32 -0
  3. package/README.md +419 -83
  4. package/android/build.gradle +12 -12
  5. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdate.java +758 -273
  6. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateConfig.java +29 -27
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdateHttpClient.java +40 -7
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePlugin.java +212 -68
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/LiveUpdatePreferences.java +52 -3
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/api/GetLatestBundleResponse.java +27 -0
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/events/DownloadBundleProgressEvent.java +32 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/{results/GetBundleResult.java → events/NextBundleSetEvent.java} +9 -7
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/DownloadBundleOptions.java +16 -1
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetConfigOptions.java +19 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SyncOptions.java +4 -0
  16. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/FetchLatestBundleResult.java +29 -1
  17. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetBlockedBundlesResult.java +27 -0
  18. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetConfigResult.java +40 -0
  19. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/GetDownloadedBundlesResult.java +27 -0
  20. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/IsSyncingResult.java +26 -0
  21. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/results/ReadyResult.java +32 -0
  22. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/interfaces/DownloadProgressCallback.java +5 -0
  23. package/dist/docs.json +630 -103
  24. package/dist/esm/definitions.d.ts +365 -39
  25. package/dist/esm/definitions.js.map +1 -1
  26. package/dist/esm/index.js +1 -1
  27. package/dist/esm/index.js.map +1 -1
  28. package/dist/esm/web.d.ts +9 -2
  29. package/dist/esm/web.js +21 -0
  30. package/dist/esm/web.js.map +1 -1
  31. package/dist/plugin.cjs.js +22 -3
  32. package/dist/plugin.cjs.js.map +1 -1
  33. package/dist/plugin.js +22 -3
  34. package/dist/plugin.js.map +1 -1
  35. package/ios/Plugin/Classes/Events/DownloadBundleProgressEvent.swift +25 -0
  36. package/ios/Plugin/Classes/{Results/GetBundleResult.swift → Events/NextBundleSetEvent.swift} +3 -3
  37. package/ios/Plugin/Classes/Options/DownloadBundleOptions.swift +7 -1
  38. package/ios/Plugin/Classes/Options/SetConfigOptions.swift +14 -0
  39. package/ios/Plugin/Classes/Options/SyncOptions.swift +4 -0
  40. package/ios/Plugin/Classes/Results/{FetchLatestBundle.swift → FetchLatestBundleResult.swift} +16 -1
  41. package/ios/Plugin/Classes/Results/GetBlockedBundlesResult.swift +16 -0
  42. package/ios/Plugin/Classes/Results/GetConfigResult.swift +19 -0
  43. package/ios/Plugin/Classes/Results/GetDownloadedBundlesResult.swift +16 -0
  44. package/ios/Plugin/Classes/Results/IsSyncingResult.swift +16 -0
  45. package/ios/Plugin/Classes/Results/ReadyResult.swift +22 -0
  46. package/ios/Plugin/LiveUpdate.swift +370 -151
  47. package/ios/Plugin/LiveUpdateConfig.swift +4 -4
  48. package/ios/Plugin/LiveUpdateHttpClient.swift +10 -4
  49. package/ios/Plugin/LiveUpdatePlugin.swift +138 -35
  50. package/ios/Plugin/LiveUpdatePreferences.swift +56 -14
  51. package/ios/Plugin/Protocols/Api/GetLatestBundleResponse.swift +3 -0
  52. package/package.json +19 -20
  53. package/android/src/main/java/io/capawesome/capacitorjs/plugins/liveupdate/classes/options/SetBundleOptions.java +0 -18
  54. package/ios/Plugin/Classes/Options/SetBundleOptions.swift +0 -14
  55. package/ios/Plugin/LiveUpdatePlugin.h +0 -10
  56. package/ios/Plugin/LiveUpdatePlugin.m +0 -27
@@ -1,8 +1,9 @@
1
+ import type { PluginListenerHandle } from '@capacitor/core';
1
2
  declare module '@capacitor/cli' {
2
3
  interface PluginsConfig {
3
4
  LiveUpdate?: {
4
5
  /**
5
- * The app ID is used to identify the app when using [Capawesome Cloud](https://capawesome.io/cloud).
6
+ * The app ID is used to identify the app when using [Capawesome Cloud](https://capawesome.io/cloud/).
6
7
  *
7
8
  * This is **NOT** the same as the app identifier (e.g. `com.example.app`).
8
9
  * This is a unique identifier generated by Capawesome Cloud (e.g. `6e351b4f-69a7-415e-a057-4567df7ffe94`).
@@ -11,6 +12,21 @@ declare module '@capacitor/cli' {
11
12
  * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
12
13
  */
13
14
  appId?: string;
15
+ /**
16
+ * Whether or not to automatically block bundles that have been rolled back.
17
+ *
18
+ * When enabled, the plugin will automatically block bundles that caused a rollback
19
+ * (up to 100 bundles). When the limit is reached, the oldest blocked bundle is unblocked.
20
+ * Blocked bundles will be skipped in future sync operations.
21
+ *
22
+ * **Attention**: This option has no effect if `readyTimeout` is set to `0`.
23
+ *
24
+ * Only available on Android and iOS.
25
+ *
26
+ * @since 7.3.0
27
+ * @default false
28
+ */
29
+ autoBlockRolledBackBundles?: boolean;
14
30
  /**
15
31
  * Whether or not to automatically delete unused bundles.
16
32
  *
@@ -20,6 +36,21 @@ declare module '@capacitor/cli' {
20
36
  * @default false
21
37
  */
22
38
  autoDeleteBundles?: boolean;
39
+ /**
40
+ * The auto-update strategy for live updates.
41
+ *
42
+ * - `none`: Live updates will not be applied automatically.
43
+ * - `background`: Live updates will be automatically downloaded
44
+ * and applied in the background at app startup and when the app resumes
45
+ * (if the last check was more than 15 minutes ago).
46
+ *
47
+ * Only available on Android and iOS.
48
+ *
49
+ * @since 7.3.0
50
+ * @default 'none'
51
+ * @example 'background'
52
+ */
53
+ autoUpdateStrategy?: 'none' | 'background';
23
54
  /**
24
55
  * The default channel of the app.
25
56
  *
@@ -27,13 +58,6 @@ declare module '@capacitor/cli' {
27
58
  * @example 'production'
28
59
  */
29
60
  defaultChannel?: string;
30
- /**
31
- * Whether or not the plugin is enabled.
32
- *
33
- * @since 5.0.0
34
- * @default true
35
- */
36
- enabled?: boolean;
37
61
  /**
38
62
  * The timeout in milliseconds for HTTP requests.
39
63
  *
@@ -41,15 +65,6 @@ declare module '@capacitor/cli' {
41
65
  * @default 60000
42
66
  */
43
67
  httpTimeout?: number;
44
- /**
45
- * The location of the server to use when using [Capawesome Cloud](https://capawesome.io/cloud).
46
- *
47
- * @since 6.2.0
48
- * @default 'us'
49
- * @example 'eu'
50
- * @deprecated This option will be removed in the future.
51
- */
52
- location?: 'us' | 'eu';
53
68
  /**
54
69
  * The public key to verify the integrity of the bundle.
55
70
  *
@@ -60,23 +75,44 @@ declare module '@capacitor/cli' {
60
75
  */
61
76
  publicKey?: string;
62
77
  /**
63
- * The timeout in milliseconds to wait for the app to be ready before resetting to the default bundle.
78
+ * The timeout in milliseconds to wait for the app to be ready
79
+ * before resetting to the default bundle.
80
+ *
81
+ * It is strongly **recommended** to configure this option (e.g. `10000` ms)
82
+ * so that the plugin can roll back to the default bundle in case of problems.
83
+ * If configured, the plugin will wait for the app to call the `ready()`
84
+ * method before resetting to the default bundle.
85
+ *
86
+ * Set to `0` to disable the timeout.
64
87
  *
65
88
  * @since 5.0.0
66
- * @default 10000
89
+ * @default 0
90
+ * @example 10000
67
91
  */
68
92
  readyTimeout?: number;
69
93
  /**
70
- * Whether or not the app should be reset to the default bundle during an update.
94
+ * The API domain of the [Capawesome Cloud](https://cloud.capawesome.io) server **without** scheme or path.
71
95
  *
72
- * @since 5.0.0
73
- * @default true
96
+ * @since 7.0.0
97
+ * @default 'api.cloud.capawesome.io'
98
+ * @example 'api.cloud.capawesome.eu'
74
99
  */
75
- resetOnUpdate?: boolean;
100
+ serverDomain?: string;
76
101
  };
77
102
  }
78
103
  }
79
104
  export interface LiveUpdatePlugin {
105
+ /**
106
+ * Clear all blocked bundles from the blocked list.
107
+ *
108
+ * This removes all bundle identifiers that were automatically blocked
109
+ * due to rollbacks when `autoBlockRolledBackBundles` is enabled.
110
+ *
111
+ * Only available on Android and iOS.
112
+ *
113
+ * @since 7.4.0
114
+ */
115
+ clearBlockedBundles(): Promise<void>;
80
116
  /**
81
117
  * Delete a bundle from the app.
82
118
  *
@@ -102,20 +138,23 @@ export interface LiveUpdatePlugin {
102
138
  */
103
139
  fetchLatestBundle(options?: FetchLatestBundleOptions): Promise<FetchLatestBundleResult>;
104
140
  /**
105
- * Get the active bundle identifier.
141
+ * Get all blocked bundle identifiers.
142
+ *
143
+ * Returns the list of bundle identifiers that were automatically blocked
144
+ * due to rollbacks when `autoBlockRolledBackBundles` is enabled.
106
145
  *
107
146
  * Only available on Android and iOS.
108
147
  *
109
- * @since 5.0.0
110
- * @deprecated Use `getCurrentBundle()` instead.
148
+ * @since 7.4.0
111
149
  */
112
- getBundle(): Promise<GetBundleResult>;
150
+ getBlockedBundles(): Promise<GetBlockedBundlesResult>;
113
151
  /**
114
152
  * Get all identifiers of bundles that have been downloaded.
115
153
  *
116
154
  * Only available on Android and iOS.
117
155
  *
118
156
  * @since 5.0.0
157
+ * @deprecated Use `getDownloadedBundles()` instead.
119
158
  */
120
159
  getBundles(): Promise<GetBundlesResult>;
121
160
  /**
@@ -126,6 +165,25 @@ export interface LiveUpdatePlugin {
126
165
  * @since 5.0.0
127
166
  */
128
167
  getChannel(): Promise<GetChannelResult>;
168
+ /**
169
+ * Get the runtime configuration.
170
+ *
171
+ * Returns the current plugin configuration including any runtime
172
+ * overrides set via `setConfig()`.
173
+ *
174
+ * Only available on Android and iOS.
175
+ *
176
+ * @since 7.4.0
177
+ */
178
+ getConfig(): Promise<GetConfigResult>;
179
+ /**
180
+ * Get all identifiers of bundles that have been downloaded.
181
+ *
182
+ * Only available on Android and iOS.
183
+ *
184
+ * @since 7.4.0
185
+ */
186
+ getDownloadedBundles(): Promise<GetDownloadedBundlesResult>;
129
187
  /**
130
188
  * Get the bundle identifier of the current bundle.
131
189
  * The current bundle is the bundle that is currently used by the app.
@@ -151,6 +209,14 @@ export interface LiveUpdatePlugin {
151
209
  * @since 5.0.0
152
210
  */
153
211
  getDeviceId(): Promise<GetDeviceIdResult>;
212
+ /**
213
+ * Check whether a sync operation is currently in progress.
214
+ *
215
+ * Only available on Android and iOS.
216
+ *
217
+ * @since 7.4.0
218
+ */
219
+ isSyncing(): Promise<IsSyncingResult>;
154
220
  /**
155
221
  * Get the bundle identifier of the next bundle.
156
222
  * The next bundle is the bundle that will be used after calling `reload()`
@@ -164,6 +230,9 @@ export interface LiveUpdatePlugin {
164
230
  /**
165
231
  * Get the version code of the app.
166
232
  *
233
+ * On **Android**, this is the `versionCode` from the `android/app/build.gradle` file.
234
+ * On **iOS**, this is the `CFBundleVersion` from the `Info.plist` file.
235
+ *
167
236
  * Only available on Android and iOS.
168
237
  *
169
238
  * @since 5.0.0
@@ -172,6 +241,9 @@ export interface LiveUpdatePlugin {
172
241
  /**
173
242
  * Get the version name of the app.
174
243
  *
244
+ * On **Android**, this is the `versionName` from the `android/app/build.gradle` file.
245
+ * On **iOS**, this is the `CFBundleShortVersionString` from the `Info.plist` file.
246
+ *
175
247
  * Only available on Android and iOS.
176
248
  *
177
249
  * @since 5.0.0
@@ -187,7 +259,7 @@ export interface LiveUpdatePlugin {
187
259
  *
188
260
  * @since 5.0.0
189
261
  */
190
- ready(): Promise<void>;
262
+ ready(): Promise<ReadyResult>;
191
263
  /**
192
264
  * Reload the app to apply the new bundle.
193
265
  *
@@ -207,16 +279,16 @@ export interface LiveUpdatePlugin {
207
279
  */
208
280
  reset(): Promise<void>;
209
281
  /**
210
- * Set the next bundle to use for the app.
282
+ * Reset the runtime configuration to the values from the Capacitor config file.
211
283
  *
212
- * Call `reload()` or restart the app to apply the changes.
284
+ * This clears any runtime configuration set via `setConfig()`.
285
+ * The changes take effect immediately.
213
286
  *
214
287
  * Only available on Android and iOS.
215
288
  *
216
- * @since 5.0.0
217
- * @deprecated Use `setNextBundle()` instead.
289
+ * @since 7.4.0
218
290
  */
219
- setBundle(options: SetBundleOptions): Promise<void>;
291
+ resetConfig(): Promise<void>;
220
292
  /**
221
293
  * Set the channel to use for the update.
222
294
  *
@@ -225,6 +297,21 @@ export interface LiveUpdatePlugin {
225
297
  * @since 5.0.0
226
298
  */
227
299
  setChannel(options: SetChannelOptions): Promise<void>;
300
+ /**
301
+ * Set the runtime configuration.
302
+ *
303
+ * This allows updating plugin configuration options at runtime.
304
+ * The changes are persisted across app restarts and take effect immediately.
305
+ *
306
+ * **Important:** Runtime configuration is automatically reset to default values
307
+ * whenever the native app is updated to a new version. This ensures that
308
+ * configuration from previous versions doesn't persist after an app update.
309
+ *
310
+ * Only available on Android and iOS.
311
+ *
312
+ * @since 7.4.0
313
+ */
314
+ setConfig(options: SetConfigOptions): Promise<void>;
228
315
  /**
229
316
  * Set the custom identifier of the device.
230
317
  *
@@ -253,6 +340,46 @@ export interface LiveUpdatePlugin {
253
340
  * @since 5.0.0
254
341
  */
255
342
  sync(options?: SyncOptions): Promise<SyncResult>;
343
+ /**
344
+ * Listen for the download progress of a bundle.
345
+ *
346
+ * Only available on Android and iOS.
347
+ *
348
+ * @since 7.0.0
349
+ */
350
+ addListener(eventName: 'downloadBundleProgress', listenerFunc: DownloadBundleProgressListener): Promise<PluginListenerHandle>;
351
+ /**
352
+ * Listen for when a bundle is set as the next bundle.
353
+ *
354
+ * This event is triggered whenever a bundle is set to be used on the next app restart,
355
+ * either through automatic updates or manual calls to `setNextBundle()`.
356
+ *
357
+ * Only available on Android and iOS.
358
+ *
359
+ * @since 7.3.0
360
+ */
361
+ addListener(eventName: 'nextBundleSet', listenerFunc: NextBundleSetListener): Promise<PluginListenerHandle>;
362
+ /**
363
+ * Listen for when the app is reloaded.
364
+ *
365
+ * This event is triggered after the `reload()` method is called
366
+ * and the app has been reloaded.
367
+ *
368
+ * **Note:** To verify whether an update was successfully applied after a reload,
369
+ * use the `ready()` method instead. The `ready()` method provides detailed information
370
+ * about the current bundle, previous bundle, and whether a rollback occurred.
371
+ *
372
+ * Only available on Android and iOS.
373
+ *
374
+ * @since 7.4.0
375
+ */
376
+ addListener(eventName: 'reloaded', listenerFunc: ReloadedListener): Promise<PluginListenerHandle>;
377
+ /**
378
+ * Remove all listeners for this plugin.
379
+ *
380
+ * @since 7.2.0
381
+ */
382
+ removeAllListeners(): Promise<void>;
256
383
  }
257
384
  /**
258
385
  * @since 5.0.0
@@ -278,19 +405,30 @@ export interface DownloadBundleOptions {
278
405
  /**
279
406
  * The unique identifier of the bundle.
280
407
  *
408
+ * **Attention**: The value `public` is reserved and cannot be used as a bundle identifier.
409
+ *
281
410
  * @since 5.0.0
282
411
  * @example '1.0.0'
283
412
  */
284
413
  bundleId: string;
285
414
  /**
286
- * The checksum of the bundle to verify the integrity of the ZIP file.
415
+ * The checksum of the self-hosted bundle as a SHA-256 hash
416
+ * in base64 format to verify the integrity of the bundle.
287
417
  *
288
- * Must be a SHA-256 hash in base64 format.
418
+ * **Attention**: Only supported for the `zip` artifact type.
289
419
  *
290
- * @since 6.1.0
291
- * @deprecated The server should return a `X-Checksum` header instead.
420
+ * @since 7.1.0
292
421
  */
293
422
  checksum?: string;
423
+ /**
424
+ * The signature of the self-hosted bundle as a signed SHA-256 hash
425
+ * in base64 format to verify the integrity of the bundle.
426
+ *
427
+ * **Attention**: Only supported for the `zip` artifact type.
428
+ *
429
+ * @since 7.1.0
430
+ */
431
+ signature?: string;
294
432
  /**
295
433
  * The URL of the bundle to download.
296
434
  *
@@ -300,10 +438,10 @@ export interface DownloadBundleOptions {
300
438
  * `https://example.com/download`, the plugin will download the file
301
439
  * with the href `index.html` from `https://example.com/download?href=index.html`.
302
440
  *
303
- * To **verify the integrity** of the file, the server must return
441
+ * To **verify the integrity** of the file, the server should return
304
442
  * a `X-Checksum` header with the SHA-256 hash in base64 format.
305
443
  *
306
- * To **verify the signature** of the file, the server must return
444
+ * To **verify the signature** of the file, the server should return
307
445
  * a `X-Signature` header with the signed SHA-256 hash in base64 format.
308
446
  *
309
447
  * @since 5.0.0
@@ -340,6 +478,24 @@ export interface FetchLatestBundleResult {
340
478
  * @since 6.6.0
341
479
  */
342
480
  bundleId: string | null;
481
+ /**
482
+ * The checksum of the latest bundle if the bundle is self-hosted.
483
+ *
484
+ * If the bundle is hosted on Capawesome Cloud, the checksum will be
485
+ * returned as response header when downloading the bundle.
486
+ *
487
+ * @since 7.1.0
488
+ */
489
+ checksum?: string;
490
+ /**
491
+ * Custom properties that are associated with the latest bundle.
492
+ *
493
+ * @since 7.0.0
494
+ * @example { "key": "value" }
495
+ */
496
+ customProperties?: {
497
+ [key: string]: string;
498
+ };
343
499
  /**
344
500
  * The URL of the latest bundle to download.
345
501
  * Pass this URL to the `downloadBundle(...)` method to download the bundle.
@@ -347,6 +503,15 @@ export interface FetchLatestBundleResult {
347
503
  * @since 6.7.0
348
504
  */
349
505
  downloadUrl?: string;
506
+ /**
507
+ * The signature of the latest bundle if the bundle is self-hosted.
508
+ *
509
+ * If the bundle is hosted on Capawesome Cloud, the signature will be
510
+ * returned as response header when downloading the bundle.
511
+ *
512
+ * @since 7.1.0
513
+ */
514
+ signature?: string;
350
515
  }
351
516
  /**
352
517
  * @since 5.0.0
@@ -362,6 +527,17 @@ export interface GetBundleResult {
362
527
  */
363
528
  bundleId: string | null;
364
529
  }
530
+ /**
531
+ * @since 7.4.0
532
+ */
533
+ export interface GetBlockedBundlesResult {
534
+ /**
535
+ * An array of unique identifiers of all blocked bundles.
536
+ *
537
+ * @since 7.4.0
538
+ */
539
+ bundleIds: string[];
540
+ }
365
541
  /**
366
542
  * @since 5.0.0
367
543
  */
@@ -373,6 +549,17 @@ export interface GetBundlesResult {
373
549
  */
374
550
  bundleIds: string[];
375
551
  }
552
+ /**
553
+ * @since 7.4.0
554
+ */
555
+ export interface GetDownloadedBundlesResult {
556
+ /**
557
+ * An array of unique identifiers of all downloaded bundles.
558
+ *
559
+ * @since 7.4.0
560
+ */
561
+ bundleIds: string[];
562
+ }
376
563
  /**
377
564
  * @since 5.0.0
378
565
  */
@@ -387,6 +574,27 @@ export interface GetChannelResult {
387
574
  */
388
575
  channel: string | null;
389
576
  }
577
+ /**
578
+ * @since 7.4.0
579
+ */
580
+ export interface GetConfigResult {
581
+ /**
582
+ * The app ID used to identify the app.
583
+ *
584
+ * If `null`, no app ID is configured.
585
+ *
586
+ * @since 7.4.0
587
+ * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
588
+ */
589
+ appId: string | null;
590
+ /**
591
+ * The auto-update strategy for live updates.
592
+ *
593
+ * @since 7.4.0
594
+ * @example 'background'
595
+ */
596
+ autoUpdateStrategy: 'none' | 'background';
597
+ }
390
598
  /**
391
599
  * @since 6.7.0
392
600
  */
@@ -416,6 +624,17 @@ export interface GetDeviceIdResult {
416
624
  */
417
625
  deviceId: string;
418
626
  }
627
+ /**
628
+ * @since 7.4.0
629
+ */
630
+ export interface IsSyncingResult {
631
+ /**
632
+ * Whether a sync operation is currently in progress.
633
+ *
634
+ * @since 7.4.0
635
+ */
636
+ syncing: boolean;
637
+ }
419
638
  /**
420
639
  * @since 6.7.0
421
640
  */
@@ -473,6 +692,33 @@ export interface GetCustomIdResult {
473
692
  */
474
693
  customId: string | null;
475
694
  }
695
+ /**
696
+ * @since 7.0.0
697
+ */
698
+ export interface ReadyResult {
699
+ /**
700
+ * The identifier of the previous bundle used.
701
+ *
702
+ * If `null`, the default bundle was used.
703
+ *
704
+ * @since 7.0.0
705
+ */
706
+ previousBundleId: string | null;
707
+ /**
708
+ * The identifier of the current bundle used.
709
+ *
710
+ * If `null`, the default bundle is being used.
711
+ *
712
+ * @since 7.0.0
713
+ */
714
+ currentBundleId: string | null;
715
+ /**
716
+ * Whether or not the app was reset to the default bundle.
717
+ *
718
+ * @since 7.0.0
719
+ */
720
+ rollback: boolean;
721
+ }
476
722
  /**
477
723
  * @since 5.0.0
478
724
  */
@@ -498,6 +744,20 @@ export interface SetChannelOptions {
498
744
  */
499
745
  channel: string | null;
500
746
  }
747
+ /**
748
+ * @since 7.4.0
749
+ */
750
+ export interface SetConfigOptions {
751
+ /**
752
+ * The app ID used to identify the app.
753
+ *
754
+ * Set `null` to reset to the value from the Capacitor config file.
755
+ *
756
+ * @since 7.4.0
757
+ * @example '6e351b4f-69a7-415e-a057-4567df7ffe94'
758
+ */
759
+ appId?: string | null;
760
+ }
501
761
  /**
502
762
  * @since 5.0.0
503
763
  */
@@ -549,3 +809,69 @@ export interface SyncResult {
549
809
  */
550
810
  nextBundleId: string | null;
551
811
  }
812
+ /**
813
+ * Listener for the download progress of a bundle.
814
+ *
815
+ * @since 7.0.0
816
+ */
817
+ export type DownloadBundleProgressListener = (event: DownloadBundleProgressEvent) => void;
818
+ /**
819
+ * Event that is triggered when the download progress of a bundle changes.
820
+ *
821
+ * @since 7.0.0
822
+ */
823
+ export interface DownloadBundleProgressEvent {
824
+ /**
825
+ * The unique identifier of the bundle that is being downloaded.
826
+ *
827
+ * @since 7.0.0
828
+ */
829
+ bundleId: string;
830
+ /**
831
+ * The number of bytes that have been downloaded.
832
+ *
833
+ * @since 7.0.0
834
+ */
835
+ downloadedBytes: number;
836
+ /**
837
+ * The progress of the download in percent as a value between `0` and `1`.
838
+ *
839
+ * @since 7.0.0
840
+ * @example 0.5
841
+ */
842
+ progress: number;
843
+ /**
844
+ * The total number of bytes to download.
845
+ *
846
+ * @since 7.0.0
847
+ */
848
+ totalBytes: number;
849
+ }
850
+ /**
851
+ * Listener for when a bundle is set as the next bundle.
852
+ *
853
+ * @since 7.3.0
854
+ */
855
+ export type NextBundleSetListener = (event: NextBundleSetEvent) => void;
856
+ /**
857
+ * Event that is triggered when a bundle is set as the next bundle.
858
+ *
859
+ * @since 7.3.0
860
+ */
861
+ export interface NextBundleSetEvent {
862
+ /**
863
+ * The unique identifier of the bundle that is set as the next bundle.
864
+ *
865
+ * If `null`, the default bundle will be used.
866
+ *
867
+ * @since 7.3.0
868
+ * @example '1.0.0'
869
+ */
870
+ bundleId: string | null;
871
+ }
872
+ /**
873
+ * Listener for when the app is reloaded.
874
+ *
875
+ * @since 7.4.0
876
+ */
877
+ export type ReloadedListener = () => void;