@capgo/capacitor-updater 7.43.3 → 7.45.10

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/dist/docs.json CHANGED
@@ -343,7 +343,7 @@
343
343
  },
344
344
  {
345
345
  "name": "link",
346
- "text": "ResetOptions} to control reset behavior. If `toLastSuccessful` is `false` (or omitted), resets to builtin. If `true`, resets to last successful bundle."
346
+ "text": "ResetOptions} to control reset behavior.\nIf `toLastSuccessful` is `false` (or omitted), resets to builtin.\nIf `true`, resets to last successful bundle.\nIf `usePendingBundle` is `true`, applies the pending bundle set via {@link next} and clears it."
347
347
  },
348
348
  {
349
349
  "name": "returns",
@@ -492,14 +492,14 @@
492
492
  },
493
493
  {
494
494
  "name": "throws",
495
- "text": "{Error} Always throws when no new version is available (`error: \"no_new_version_available\"`), or when the request fails."
495
+ "text": "{Error} Throws for failed update checks or transport/request failures."
496
496
  },
497
497
  {
498
498
  "name": "since",
499
499
  "text": "4.0.0"
500
500
  }
501
501
  ],
502
- "docs": "Check the update server for the latest available bundle version.\n\nThis queries your configured update URL (or Capgo backend) to see if a newer bundle\nis available for download. It does NOT download the bundle automatically.\n\nThe response includes:\n- `version`: The latest available version identifier\n- `url`: Download URL for the bundle (if available)\n- `breaking`: Whether this update is marked as incompatible (requires native app update)\n- `message`: Optional message from the server\n- `manifest`: File list for delta updates (if using multi-file downloads)\n\nAfter receiving the latest version info, you can:\n1. Compare it with your current version\n2. Download it using {@link download}\n3. Apply it using {@link next} or {@link set}\n\n**Important: Error handling for \"no new version available\"**\n\nWhen the device's current version matches the latest version on the server (i.e., the device is already\nup-to-date), the server returns a 200 response with `error: \"no_new_version_available\"` and\n`message: \"No new version available\"`. **This causes `getLatest()` to throw an error**, even though\nthis is a normal, expected condition.\n\nYou should catch this specific error to handle it gracefully:\n\n```typescript\ntry {\n const latest = await CapacitorUpdater.getLatest();\n // New version is available, proceed with download\n} catch (error) {\n if (error.message === 'No new version available') {\n // Device is already on the latest version - this is normal\n console.log('Already up to date');\n } else {\n // Actual error occurred\n console.error('Failed to check for updates:', error);\n }\n}\n```\n\nIn this scenario, the server:\n- Logs the request with a \"No new version available\" message\n- Sends a \"noNew\" stat action to track that the device checked for updates but was already current (done on the backend)",
502
+ "docs": "Check the update server for the latest available bundle version.\n\nThis queries your configured update URL (or Capgo backend) to see if a newer bundle\nis available for download. It does NOT download the bundle automatically.\n\nThe response includes:\n- `version`: The latest available version identifier\n- `url`: Download URL for the bundle (if available)\n- `breaking`: Whether this update is marked as incompatible (requires native app update)\n- `message`: Optional message from the server\n- `manifest`: File list for delta updates (if using multi-file downloads)\n\nAfter receiving the latest version info, you can:\n1. Compare it with your current version\n2. Download it using {@link download}\n3. Apply it using {@link next} or {@link set}\n\n**Important: Handling \"no new version available\"**\n\nWhen the device's current version matches the latest version on the server (i.e., the device is already\nup-to-date), the server returns a 200 response with `error: \"no_new_version_available\"` and\n`message: \"No new version available\"`. This is a normal, expected condition and resolves with\n`kind: \"up_to_date\"` when the backend provides that classification.\n\nYou should check `kind` and `error` before attempting to download:\n\n```typescript\nconst latest = await CapacitorUpdater.getLatest();\nif (latest.kind === 'up_to_date') {\n console.log('Already up to date');\n} else if (latest.kind === 'blocked') {\n console.log('Update is blocked:', latest.error);\n} else if (latest.url) {\n // New version is available, proceed with download\n}\n```\n\nIn this scenario, the server:\n- Logs the request with a \"No new version available\" message\n- Sends a \"noNew\" stat action to track that the device checked for updates but was already current (done on the backend)",
503
503
  "complexTypes": [
504
504
  "LatestVersion",
505
505
  "GetLatestOptions"
@@ -765,7 +765,7 @@
765
765
  "text": "1.0.0"
766
766
  }
767
767
  ],
768
- "docs": "Remove all event listeners registered for this plugin.\n\nThis unregisters all listeners added via {@link addListener} for all event types:\n- `download`\n- `noNeedUpdate`\n- `updateAvailable`\n- `downloadComplete`\n- `downloadFailed`\n- `breakingAvailable` / `majorAvailable`\n- `updateFailed`\n- `appReloaded`\n- `appReady`\n\nUse this during cleanup (e.g., when unmounting components or closing screens)\nto prevent memory leaks from lingering event listeners.",
768
+ "docs": "Remove all event listeners registered for this plugin.\n\nThis unregisters all listeners added via {@link addListener} for all event types:\n- `download`\n- `noNeedUpdate`\n- `updateCheckResult`\n- `updateAvailable`\n- `downloadComplete`\n- `downloadFailed`\n- `breakingAvailable` / `majorAvailable`\n- `updateFailed`\n- `appReloaded`\n- `appReady`\n\nUse this during cleanup (e.g., when unmounting components or closing screens)\nto prevent memory leaks from lingering event listeners.",
769
769
  "complexTypes": [],
770
770
  "slug": "removealllisteners"
771
771
  },
@@ -827,6 +827,35 @@
827
827
  ],
828
828
  "slug": "addlistenernoneedupdate-"
829
829
  },
830
+ {
831
+ "name": "addListener",
832
+ "signature": "(eventName: 'updateCheckResult', listenerFunc: (state: UpdateCheckResultEvent) => void) => Promise<PluginListenerHandle>",
833
+ "parameters": [
834
+ {
835
+ "name": "eventName",
836
+ "docs": "",
837
+ "type": "'updateCheckResult'"
838
+ },
839
+ {
840
+ "name": "listenerFunc",
841
+ "docs": "",
842
+ "type": "(state: UpdateCheckResultEvent) => void"
843
+ }
844
+ ],
845
+ "returns": "Promise<PluginListenerHandle>",
846
+ "tags": [
847
+ {
848
+ "name": "since",
849
+ "text": "8.45.11"
850
+ }
851
+ ],
852
+ "docs": "Listen for update check results before the updater decides whether to download.\nThe backend can classify the UpdateCheckResultEvent payload as `up_to_date`, `blocked`, or `failed`.\n\nThis event is emitted alongside legacy events. For `up_to_date` and `blocked`, it is emitted before\n`noNeedUpdate` and does not emit `downloadFailed`. For `failed`, it is emitted before the legacy\n`downloadFailed` event and keeps the existing failure stats behavior.",
853
+ "complexTypes": [
854
+ "PluginListenerHandle",
855
+ "UpdateCheckResultEvent"
856
+ ],
857
+ "slug": "addlistenerupdatecheckresult-"
858
+ },
830
859
  {
831
860
  "name": "addListener",
832
861
  "signature": "(eventName: 'updateAvailable', listenerFunc: (state: UpdateAvailableEvent) => void) => Promise<PluginListenerHandle>",
@@ -976,6 +1005,64 @@
976
1005
  ],
977
1006
  "slug": "addlistenerupdatefailed-"
978
1007
  },
1008
+ {
1009
+ "name": "addListener",
1010
+ "signature": "(eventName: 'set', listenerFunc: (state: SetEvent) => void) => Promise<PluginListenerHandle>",
1011
+ "parameters": [
1012
+ {
1013
+ "name": "eventName",
1014
+ "docs": "",
1015
+ "type": "'set'"
1016
+ },
1017
+ {
1018
+ "name": "listenerFunc",
1019
+ "docs": "",
1020
+ "type": "(state: SetEvent) => void"
1021
+ }
1022
+ ],
1023
+ "returns": "Promise<PluginListenerHandle>",
1024
+ "tags": [
1025
+ {
1026
+ "name": "since",
1027
+ "text": "8.43.12"
1028
+ }
1029
+ ],
1030
+ "docs": "Listen for set event in the App, let you know when a bundle has been applied successfully.\nThis event is retained natively until JavaScript consumes it, so if the app reloads before your\nlistener is attached, the last pending `set` event is delivered once the listener subscribes.",
1031
+ "complexTypes": [
1032
+ "PluginListenerHandle",
1033
+ "SetEvent"
1034
+ ],
1035
+ "slug": "addlistenerset-"
1036
+ },
1037
+ {
1038
+ "name": "addListener",
1039
+ "signature": "(eventName: 'setNext', listenerFunc: (state: SetNextEvent) => void) => Promise<PluginListenerHandle>",
1040
+ "parameters": [
1041
+ {
1042
+ "name": "eventName",
1043
+ "docs": "",
1044
+ "type": "'setNext'"
1045
+ },
1046
+ {
1047
+ "name": "listenerFunc",
1048
+ "docs": "",
1049
+ "type": "(state: SetNextEvent) => void"
1050
+ }
1051
+ ],
1052
+ "returns": "Promise<PluginListenerHandle>",
1053
+ "tags": [
1054
+ {
1055
+ "name": "since",
1056
+ "text": "6.14.0"
1057
+ }
1058
+ ],
1059
+ "docs": "Listen for set next event in the App, let you know when a bundle is queued as the next bundle to install.",
1060
+ "complexTypes": [
1061
+ "PluginListenerHandle",
1062
+ "SetNextEvent"
1063
+ ],
1064
+ "slug": "addlistenersetnext-"
1065
+ },
979
1066
  {
980
1067
  "name": "addListener",
981
1068
  "signature": "(eventName: 'downloadFailed', listenerFunc: (state: DownloadFailedEvent) => void) => Promise<PluginListenerHandle>",
@@ -1055,7 +1142,7 @@
1055
1142
  "text": "5.1.0"
1056
1143
  }
1057
1144
  ],
1058
- "docs": "Listen for app ready event in the App, let you know when app is ready to use, this event is retain till consumed.",
1145
+ "docs": "Listen for app ready event in the App, let you know when app is ready to use.\nThis event is retained natively until JavaScript consumes it, so it can still be delivered after\na reload even if the listener is attached later in app startup.",
1059
1146
  "complexTypes": [
1060
1147
  "PluginListenerHandle",
1061
1148
  "AppReadyEvent"
@@ -1814,10 +1901,27 @@
1814
1901
  "properties": [
1815
1902
  {
1816
1903
  "name": "toLastSuccessful",
1817
- "tags": [],
1818
- "docs": "",
1904
+ "tags": [
1905
+ {
1906
+ "text": "false",
1907
+ "name": "default"
1908
+ }
1909
+ ],
1910
+ "docs": "Reset to the last successfully loaded bundle instead of the builtin one.",
1819
1911
  "complexTypes": [],
1820
- "type": "boolean"
1912
+ "type": "boolean | undefined"
1913
+ },
1914
+ {
1915
+ "name": "usePendingBundle",
1916
+ "tags": [
1917
+ {
1918
+ "text": "false",
1919
+ "name": "default"
1920
+ }
1921
+ ],
1922
+ "docs": "Apply the pending bundle set via {@link next} while resetting.\n\nWhen `true`, the plugin will switch to the pending bundle immediately and clear the pending flag.\nIf no pending bundle exists, the reset will fail.",
1923
+ "complexTypes": [],
1924
+ "type": "boolean | undefined"
1821
1925
  }
1822
1926
  ]
1823
1927
  },
@@ -1970,10 +2074,36 @@
1970
2074
  {
1971
2075
  "name": "error",
1972
2076
  "tags": [],
1973
- "docs": "Error code from the server, if any.\nCommon values:\n- `\"no_new_version_available\"`: Device is already on the latest version (not a failure)\n- Other error codes indicate actual failures in the update process",
2077
+ "docs": "Error code from the server, if any. Use `kind` for classification instead of parsing this value.",
1974
2078
  "complexTypes": [],
1975
2079
  "type": "string | undefined"
1976
2080
  },
2081
+ {
2082
+ "name": "kind",
2083
+ "tags": [
2084
+ {
2085
+ "text": "8.45.11",
2086
+ "name": "since"
2087
+ }
2088
+ ],
2089
+ "docs": "Classification for this response, provided by the backend.",
2090
+ "complexTypes": [
2091
+ "UpdateResponseKind"
2092
+ ],
2093
+ "type": "UpdateResponseKind"
2094
+ },
2095
+ {
2096
+ "name": "statusCode",
2097
+ "tags": [
2098
+ {
2099
+ "text": "8.45.11",
2100
+ "name": "since"
2101
+ }
2102
+ ],
2103
+ "docs": "HTTP status code returned by the update server for classified update-check responses.",
2104
+ "complexTypes": [],
2105
+ "type": "number | undefined"
2106
+ },
1977
2107
  {
1978
2108
  "name": "old",
1979
2109
  "tags": [],
@@ -2405,6 +2535,91 @@
2405
2535
  }
2406
2536
  ]
2407
2537
  },
2538
+ {
2539
+ "name": "UpdateCheckResultEvent",
2540
+ "slug": "updatecheckresultevent",
2541
+ "docs": "",
2542
+ "tags": [],
2543
+ "methods": [],
2544
+ "properties": [
2545
+ {
2546
+ "name": "kind",
2547
+ "tags": [
2548
+ {
2549
+ "text": "8.45.11",
2550
+ "name": "since"
2551
+ }
2552
+ ],
2553
+ "docs": "Classification for the update check result, provided by the backend.",
2554
+ "complexTypes": [
2555
+ "UpdateResponseKind"
2556
+ ],
2557
+ "type": "UpdateResponseKind"
2558
+ },
2559
+ {
2560
+ "name": "error",
2561
+ "tags": [
2562
+ {
2563
+ "text": "8.45.11",
2564
+ "name": "since"
2565
+ }
2566
+ ],
2567
+ "docs": "Backend error code, when provided.",
2568
+ "complexTypes": [],
2569
+ "type": "string | undefined"
2570
+ },
2571
+ {
2572
+ "name": "message",
2573
+ "tags": [
2574
+ {
2575
+ "text": "8.45.11",
2576
+ "name": "since"
2577
+ }
2578
+ ],
2579
+ "docs": "Backend message, when provided.",
2580
+ "complexTypes": [],
2581
+ "type": "string | undefined"
2582
+ },
2583
+ {
2584
+ "name": "statusCode",
2585
+ "tags": [
2586
+ {
2587
+ "text": "8.45.11",
2588
+ "name": "since"
2589
+ }
2590
+ ],
2591
+ "docs": "HTTP status code returned by the update endpoint.",
2592
+ "complexTypes": [],
2593
+ "type": "number | undefined"
2594
+ },
2595
+ {
2596
+ "name": "version",
2597
+ "tags": [
2598
+ {
2599
+ "text": "8.45.11",
2600
+ "name": "since"
2601
+ }
2602
+ ],
2603
+ "docs": "Version referenced by the update check result.",
2604
+ "complexTypes": [],
2605
+ "type": "string | undefined"
2606
+ },
2607
+ {
2608
+ "name": "bundle",
2609
+ "tags": [
2610
+ {
2611
+ "text": "8.45.11",
2612
+ "name": "since"
2613
+ }
2614
+ ],
2615
+ "docs": "Current bundle on the device.",
2616
+ "complexTypes": [
2617
+ "BundleInfo"
2618
+ ],
2619
+ "type": "BundleInfo"
2620
+ }
2621
+ ]
2622
+ },
2408
2623
  {
2409
2624
  "name": "UpdateAvailableEvent",
2410
2625
  "slug": "updateavailableevent",
@@ -2499,6 +2714,52 @@
2499
2714
  }
2500
2715
  ]
2501
2716
  },
2717
+ {
2718
+ "name": "SetEvent",
2719
+ "slug": "setevent",
2720
+ "docs": "",
2721
+ "tags": [],
2722
+ "methods": [],
2723
+ "properties": [
2724
+ {
2725
+ "name": "bundle",
2726
+ "tags": [
2727
+ {
2728
+ "text": "8.43.12",
2729
+ "name": "since"
2730
+ }
2731
+ ],
2732
+ "docs": "Emit when a bundle has been applied successfully.\nThis event uses native `retainUntilConsumed` behavior.",
2733
+ "complexTypes": [
2734
+ "BundleInfo"
2735
+ ],
2736
+ "type": "BundleInfo"
2737
+ }
2738
+ ]
2739
+ },
2740
+ {
2741
+ "name": "SetNextEvent",
2742
+ "slug": "setnextevent",
2743
+ "docs": "",
2744
+ "tags": [],
2745
+ "methods": [],
2746
+ "properties": [
2747
+ {
2748
+ "name": "bundle",
2749
+ "tags": [
2750
+ {
2751
+ "text": "6.14.0",
2752
+ "name": "since"
2753
+ }
2754
+ ],
2755
+ "docs": "Emit when a bundle is queued as the next bundle to install.",
2756
+ "complexTypes": [
2757
+ "BundleInfo"
2758
+ ],
2759
+ "type": "BundleInfo"
2760
+ }
2761
+ ]
2762
+ },
2502
2763
  {
2503
2764
  "name": "DownloadFailedEvent",
2504
2765
  "slug": "downloadfailedevent",
@@ -2535,7 +2796,7 @@
2535
2796
  "name": "since"
2536
2797
  }
2537
2798
  ],
2538
- "docs": "Emitted when the app is ready to use.",
2799
+ "docs": "Emitted when the app is ready to use.\nThis event uses native `retainUntilConsumed` behavior.",
2539
2800
  "complexTypes": [
2540
2801
  "BundleInfo"
2541
2802
  ],
@@ -3172,6 +3433,25 @@
3172
3433
  }
3173
3434
  ]
3174
3435
  },
3436
+ {
3437
+ "name": "UpdateResponseKind",
3438
+ "slug": "updateresponsekind",
3439
+ "docs": "Classification for update-check responses that do not provide a downloadable bundle.\nThe update backend provides this field directly. Missing or unknown values are treated as\nfailed by native clients.",
3440
+ "types": [
3441
+ {
3442
+ "text": "'up_to_date'",
3443
+ "complexTypes": []
3444
+ },
3445
+ {
3446
+ "text": "'blocked'",
3447
+ "complexTypes": []
3448
+ },
3449
+ {
3450
+ "text": "'failed'",
3451
+ "complexTypes": []
3452
+ }
3453
+ ]
3454
+ },
3175
3455
  {
3176
3456
  "name": "BreakingAvailableEvent",
3177
3457
  "slug": "breakingavailableevent",
@@ -568,7 +568,10 @@ export interface CapacitorUpdaterPlugin {
568
568
  * - Testing rollback functionality
569
569
  * - Providing users a "reset to factory" option
570
570
  *
571
- * @param options {@link ResetOptions} to control reset behavior. If `toLastSuccessful` is `false` (or omitted), resets to builtin. If `true`, resets to last successful bundle.
571
+ * @param options {@link ResetOptions} to control reset behavior.
572
+ * If `toLastSuccessful` is `false` (or omitted), resets to builtin.
573
+ * If `true`, resets to last successful bundle.
574
+ * If `usePendingBundle` is `true`, applies the pending bundle set via {@link next} and clears it.
572
575
  * @returns {Promise<void>} A promise that may never resolve because the app will be reloaded.
573
576
  * @throws {Error} If the reset operation fails.
574
577
  */
@@ -692,27 +695,23 @@ export interface CapacitorUpdaterPlugin {
692
695
  * 2. Download it using {@link download}
693
696
  * 3. Apply it using {@link next} or {@link set}
694
697
  *
695
- * **Important: Error handling for "no new version available"**
698
+ * **Important: Handling "no new version available"**
696
699
  *
697
700
  * When the device's current version matches the latest version on the server (i.e., the device is already
698
701
  * up-to-date), the server returns a 200 response with `error: "no_new_version_available"` and
699
- * `message: "No new version available"`. **This causes `getLatest()` to throw an error**, even though
700
- * this is a normal, expected condition.
702
+ * `message: "No new version available"`. This is a normal, expected condition and resolves with
703
+ * `kind: "up_to_date"` when the backend provides that classification.
701
704
  *
702
- * You should catch this specific error to handle it gracefully:
705
+ * You should check `kind` and `error` before attempting to download:
703
706
  *
704
707
  * ```typescript
705
- * try {
706
- * const latest = await CapacitorUpdater.getLatest();
708
+ * const latest = await CapacitorUpdater.getLatest();
709
+ * if (latest.kind === 'up_to_date') {
710
+ * console.log('Already up to date');
711
+ * } else if (latest.kind === 'blocked') {
712
+ * console.log('Update is blocked:', latest.error);
713
+ * } else if (latest.url) {
707
714
  * // New version is available, proceed with download
708
- * } catch (error) {
709
- * if (error.message === 'No new version available') {
710
- * // Device is already on the latest version - this is normal
711
- * console.log('Already up to date');
712
- * } else {
713
- * // Actual error occurred
714
- * console.error('Failed to check for updates:', error);
715
- * }
716
715
  * }
717
716
  * ```
718
717
  *
@@ -722,7 +721,7 @@ export interface CapacitorUpdaterPlugin {
722
721
  *
723
722
  * @param options Optional {@link GetLatestOptions} to specify which channel to check.
724
723
  * @returns {Promise<LatestVersion>} Information about the latest available bundle version.
725
- * @throws {Error} Always throws when no new version is available (`error: "no_new_version_available"`), or when the request fails.
724
+ * @throws {Error} Throws for failed update checks or transport/request failures.
726
725
  * @since 4.0.0
727
726
  */
728
727
  getLatest(options?: GetLatestOptions): Promise<LatestVersion>;
@@ -938,6 +937,7 @@ export interface CapacitorUpdaterPlugin {
938
937
  * This unregisters all listeners added via {@link addListener} for all event types:
939
938
  * - `download`
940
939
  * - `noNeedUpdate`
940
+ * - `updateCheckResult`
941
941
  * - `updateAvailable`
942
942
  * - `downloadComplete`
943
943
  * - `downloadFailed`
@@ -966,6 +966,17 @@ export interface CapacitorUpdaterPlugin {
966
966
  * @since 4.0.0
967
967
  */
968
968
  addListener(eventName: 'noNeedUpdate', listenerFunc: (state: NoNeedEvent) => void): Promise<PluginListenerHandle>;
969
+ /**
970
+ * Listen for update check results before the updater decides whether to download.
971
+ * The backend can classify the UpdateCheckResultEvent payload as `up_to_date`, `blocked`, or `failed`.
972
+ *
973
+ * This event is emitted alongside legacy events. For `up_to_date` and `blocked`, it is emitted before
974
+ * `noNeedUpdate` and does not emit `downloadFailed`. For `failed`, it is emitted before the legacy
975
+ * `downloadFailed` event and keeps the existing failure stats behavior.
976
+ *
977
+ * @since 8.45.11
978
+ */
979
+ addListener(eventName: 'updateCheckResult', listenerFunc: (state: UpdateCheckResultEvent) => void): Promise<PluginListenerHandle>;
969
980
  /**
970
981
  * Listen for available update event, useful when you want to force check every time the app is launched
971
982
  *
@@ -998,6 +1009,20 @@ export interface CapacitorUpdaterPlugin {
998
1009
  * @since 2.3.0
999
1010
  */
1000
1011
  addListener(eventName: 'updateFailed', listenerFunc: (state: UpdateFailedEvent) => void): Promise<PluginListenerHandle>;
1012
+ /**
1013
+ * Listen for set event in the App, let you know when a bundle has been applied successfully.
1014
+ * This event is retained natively until JavaScript consumes it, so if the app reloads before your
1015
+ * listener is attached, the last pending `set` event is delivered once the listener subscribes.
1016
+ *
1017
+ * @since 8.43.12
1018
+ */
1019
+ addListener(eventName: 'set', listenerFunc: (state: SetEvent) => void): Promise<PluginListenerHandle>;
1020
+ /**
1021
+ * Listen for set next event in the App, let you know when a bundle is queued as the next bundle to install.
1022
+ *
1023
+ * @since 6.14.0
1024
+ */
1025
+ addListener(eventName: 'setNext', listenerFunc: (state: SetNextEvent) => void): Promise<PluginListenerHandle>;
1001
1026
  /**
1002
1027
  * Listen for download fail event in the App, let you know when a bundle download has failed
1003
1028
  *
@@ -1011,7 +1036,9 @@ export interface CapacitorUpdaterPlugin {
1011
1036
  */
1012
1037
  addListener(eventName: 'appReloaded', listenerFunc: () => void): Promise<PluginListenerHandle>;
1013
1038
  /**
1014
- * Listen for app ready event in the App, let you know when app is ready to use, this event is retain till consumed.
1039
+ * Listen for app ready event in the App, let you know when app is ready to use.
1040
+ * This event is retained natively until JavaScript consumes it, so it can still be delivered after
1041
+ * a reload even if the listener is attached later in app startup.
1015
1042
  *
1016
1043
  * @since 5.1.0
1017
1044
  */
@@ -1357,6 +1384,14 @@ export interface CapacitorUpdaterPlugin {
1357
1384
  */
1358
1385
  export type BundleStatus = 'success' | 'error' | 'pending' | 'downloading';
1359
1386
  export type DelayUntilNext = 'background' | 'kill' | 'nativeVersion' | 'date';
1387
+ /**
1388
+ * Classification for update-check responses that do not provide a downloadable bundle.
1389
+ * The update backend provides this field directly. Missing or unknown values are treated as
1390
+ * failed by native clients.
1391
+ *
1392
+ * @since 8.45.11
1393
+ */
1394
+ export type UpdateResponseKind = 'up_to_date' | 'blocked' | 'failed';
1360
1395
  export interface NoNeedEvent {
1361
1396
  /**
1362
1397
  * Current status of download, between 0 and 100.
@@ -1365,6 +1400,44 @@ export interface NoNeedEvent {
1365
1400
  */
1366
1401
  bundle: BundleInfo;
1367
1402
  }
1403
+ export interface UpdateCheckResultEvent {
1404
+ /**
1405
+ * Classification for the update check result, provided by the backend.
1406
+ *
1407
+ * @since 8.45.11
1408
+ */
1409
+ kind: UpdateResponseKind;
1410
+ /**
1411
+ * Backend error code, when provided.
1412
+ *
1413
+ * @since 8.45.11
1414
+ */
1415
+ error?: string;
1416
+ /**
1417
+ * Backend message, when provided.
1418
+ *
1419
+ * @since 8.45.11
1420
+ */
1421
+ message?: string;
1422
+ /**
1423
+ * HTTP status code returned by the update endpoint.
1424
+ *
1425
+ * @since 8.45.11
1426
+ */
1427
+ statusCode?: number;
1428
+ /**
1429
+ * Version referenced by the update check result.
1430
+ *
1431
+ * @since 8.45.11
1432
+ */
1433
+ version?: string;
1434
+ /**
1435
+ * Current bundle on the device.
1436
+ *
1437
+ * @since 8.45.11
1438
+ */
1439
+ bundle: BundleInfo;
1440
+ }
1368
1441
  export interface UpdateAvailableEvent {
1369
1442
  /**
1370
1443
  * Current status of download, between 0 and 100.
@@ -1477,9 +1550,27 @@ export interface UpdateFailedEvent {
1477
1550
  */
1478
1551
  bundle: BundleInfo;
1479
1552
  }
1553
+ export interface SetEvent {
1554
+ /**
1555
+ * Emit when a bundle has been applied successfully.
1556
+ * This event uses native `retainUntilConsumed` behavior.
1557
+ *
1558
+ * @since 8.43.12
1559
+ */
1560
+ bundle: BundleInfo;
1561
+ }
1562
+ export interface SetNextEvent {
1563
+ /**
1564
+ * Emit when a bundle is queued as the next bundle to install.
1565
+ *
1566
+ * @since 6.14.0
1567
+ */
1568
+ bundle: BundleInfo;
1569
+ }
1480
1570
  export interface AppReadyEvent {
1481
1571
  /**
1482
1572
  * Emitted when the app is ready to use.
1573
+ * This event uses native `retainUntilConsumed` behavior.
1483
1574
  *
1484
1575
  * @since 5.2.0
1485
1576
  */
@@ -1528,12 +1619,21 @@ export interface LatestVersion {
1528
1619
  message?: string;
1529
1620
  sessionKey?: string;
1530
1621
  /**
1531
- * Error code from the server, if any.
1532
- * Common values:
1533
- * - `"no_new_version_available"`: Device is already on the latest version (not a failure)
1534
- * - Other error codes indicate actual failures in the update process
1622
+ * Error code from the server, if any. Use `kind` for classification instead of parsing this value.
1535
1623
  */
1536
1624
  error?: string;
1625
+ /**
1626
+ * Classification for this response, provided by the backend.
1627
+ *
1628
+ * @since 8.45.11
1629
+ */
1630
+ kind?: UpdateResponseKind;
1631
+ /**
1632
+ * HTTP status code returned by the update server for classified update-check responses.
1633
+ *
1634
+ * @since 8.45.11
1635
+ */
1636
+ statusCode?: number;
1537
1637
  /**
1538
1638
  * The previous/current version name (provided for reference).
1539
1639
  */
@@ -1646,7 +1746,19 @@ export interface BundleListResult {
1646
1746
  bundles: BundleInfo[];
1647
1747
  }
1648
1748
  export interface ResetOptions {
1649
- toLastSuccessful: boolean;
1749
+ /**
1750
+ * Reset to the last successfully loaded bundle instead of the builtin one.
1751
+ * @default false
1752
+ */
1753
+ toLastSuccessful?: boolean;
1754
+ /**
1755
+ * Apply the pending bundle set via {@link next} while resetting.
1756
+ *
1757
+ * When `true`, the plugin will switch to the pending bundle immediately and clear the pending flag.
1758
+ * If no pending bundle exists, the reset will fail.
1759
+ * @default false
1760
+ */
1761
+ usePendingBundle?: boolean;
1650
1762
  }
1651
1763
  export interface ListOptions {
1652
1764
  /**