Interface: OtaUpdateState
Defined in: types.ts:140
What useOtaUpdate() returns.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
applyUpdate | (restart?) => Promise<boolean> | Escape hatch — OtaUi.action already does this at the right time. Apply a staged update on next launch (or restart now). Resolves false when nothing is staged yet — e.g. the download is still running — in which case no restart happens and the status is left alone, so a host UI can keep waiting instead of promising a restart that would discard the partial download. | types.ts:177 |
availableUpdate | AvailableUpdate | null | - | types.ts:151 |
channel | string | the build flavour's channel (dev/uat/prod), embedded natively. | types.ts:149 |
checkNow | () => Promise<void> | manually trigger a check (+ auto-download/stage unless autoStage: false). | types.ts:157 |
currentBundle | BundleMeta | null | - | types.ts:150 |
downloadUpdate | () => Promise<boolean> | Escape hatch — OtaUi.action already does this at the right time. Download + verify + stage the update announced by the last check. Only needed with autoStage: false, where the check stops at 'update-available' so the host can ask the user before spending bandwidth; a mandatory update downloads itself regardless. Resolves false when there is nothing to download (no announced update, or the download material has expired — re-run checkNow()). On success the status ends at 'apply-pending'. | types.ts:168 |
error | string | null | - | types.ts:155 |
isMandatory | boolean | - | types.ts:152 |
markHealthy | () => void | mark the running bundle healthy (call once the app is genuinely usable). | types.ts:179 |
nativePolicy | NativeVersionPolicy | null | - | types.ts:153 |
progress | number | - | types.ts:154 |
rollback | () => Promise<void> | force a rollback to last-known-good. | types.ts:181 |
status | OtaStatus | - | types.ts:147 |
ui | OtaUi | The one thing a host UI should read: a derived, ready-to-render view model with a single OtaUi.action. Prefer this over status — the raw statuses below are for diagnostics and for hosts that need to build a non-standard flow. | types.ts:146 |