Skip to main content

Interface: OtaUpdateState

Defined in: types.ts:140

What useOtaUpdate() returns.

Properties​

PropertyTypeDescriptionDefined 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
availableUpdateAvailableUpdate | null-types.ts:151
channelstringthe 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
currentBundleBundleMeta | 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
errorstring | null-types.ts:155
isMandatoryboolean-types.ts:152
markHealthy() => voidmark the running bundle healthy (call once the app is genuinely usable).types.ts:179
nativePolicyNativeVersionPolicy | null-types.ts:153
progressnumber-types.ts:154
rollback() => Promise<void>force a rollback to last-known-good.types.ts:181
statusOtaStatus-types.ts:147
uiOtaUiThe 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