1{"version":3,"file":"Updates.types.js","sourceRoot":"","sources":["../src/Updates.types.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,CAAN,IAAY,eAeX;AAfD,WAAY,eAAe;IACzB;;;;OAIG;IACH,uDAAoC,CAAA;IACpC;;OAEG;IACH,4DAAyC,CAAA;IACzC;;OAEG;IACH,kCAAe,CAAA;AACjB,CAAC,EAfW,eAAe,KAAf,eAAe,QAe1B;AAmLD;;GAEG;AACH,MAAM,CAAN,IAAY,mBAWX;AAXD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,kEAA2C,CAAA;IAC3C,+EAAwD,CAAA;IACxD,4EAAqD,CAAA;IACrD,iFAA0D,CAAA;IAC1D,2EAAoD,CAAA;IACpD,mEAA4C,CAAA;IAC5C,mEAA4C,CAAA;IAC5C,0DAAmC,CAAA;IACnC,0CAAmB,CAAA;AACrB,CAAC,EAXW,mBAAmB,KAAnB,mBAAmB,QAW9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,uCAAe,CAAA;IACf,qCAAa,CAAA;IACb,qCAAa,CAAA;IACb,uCAAe,CAAA;IACf,uCAAe,CAAA;AACjB,CAAC,EAPW,oBAAoB,KAApB,oBAAoB,QAO/B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,8BAiBX;AAjBD,WAAY,8BAA8B;IACxC;;OAEG;IACH,qDAAmB,CAAA;IACnB;;OAEG;IACH,yEAAuC,CAAA;IACvC;;OAEG;IACH,yDAAuB,CAAA;IACvB;;OAEG;IACH,iDAAe,CAAA;AACjB,CAAC,EAjBW,8BAA8B,KAA9B,8BAA8B,QAiBzC","sourcesContent":["import { NewManifest, BareManifest } from 'expo-manifests';\n\nexport type Manifest = NewManifest | BareManifest;\n\n/**\n * The types of update-related events.\n */\nexport enum UpdateEventType {\n /**\n * A new update has finished downloading to local storage. If you would like to start using this\n * update at any point before the user closes and restarts the app on their own, you can call\n * [`Updates.reloadAsync()`](#reloadasync) to launch this new update.\n */\n UPDATE_AVAILABLE = 'updateAvailable',\n /**\n * No updates are available, and the most up-to-date update is already running.\n */\n NO_UPDATE_AVAILABLE = 'noUpdateAvailable',\n /**\n * An error occurred trying to fetch the latest update.\n */\n ERROR = 'error',\n}\n\ntype UpdateCheckResultRollBackToEmbedded = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: false;\n /**\n * The manifest of the update when available.\n */\n manifest: undefined;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: true;\n};\n\n/**\n * The successful result of checking for a new update.\n */\nexport type UpdateCheckResultSuccess = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: true;\n /**\n * The manifest of the update when available.\n */\n manifest: Manifest;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The failed result of checking for a new update.\n */\nexport type UpdateCheckResultFailure = {\n /**\n * Whether an update is available. This property is false for a roll back update.\n */\n isAvailable: false;\n /**\n * The manifest of the update when available.\n */\n manifest: undefined;\n /**\n * Whether a roll back to embedded update is available.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The result of checking for a new update.\n */\nexport type UpdateCheckResult =\n | UpdateCheckResultRollBackToEmbedded\n | UpdateCheckResultSuccess\n | UpdateCheckResultFailure;\n\n/**\n * The successful result of fetching a new update.\n */\nexport type UpdateFetchResultSuccess = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * False when roll back to embedded is true.\n */\n isNew: true;\n /**\n * The manifest of the fetched update.\n */\n manifest: Manifest;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The failed result of fetching a new update.\n */\nexport type UpdateFetchResultFailure = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * False when roll back to embedded is true.\n */\n isNew: false;\n /**\n * The manifest of the fetched update.\n */\n manifest: undefined;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: false;\n};\n\n/**\n * The roll back to embedded result of fetching a new update.\n */\ntype UpdateFetchResultRollBackToEmbedded = {\n /**\n * Whether the fetched update is new (that is, a different version than what's currently running).\n * False when roll back to embedded is true.\n */\n isNew: false;\n /**\n * The manifest of the fetched update.\n */\n manifest: undefined;\n /**\n * Whether the fetched update is a roll back to the embedded update.\n */\n isRollBackToEmbedded: true;\n};\n\n/**\n * The result of fetching a new update.\n */\nexport type UpdateFetchResult =\n | UpdateFetchResultSuccess\n | UpdateFetchResultFailure\n | UpdateFetchResultRollBackToEmbedded;\n\n/**\n * An object that is passed into each event listener when an auto-update check occurs.\n */\nexport type UpdateEvent = {\n /**\n * Type of the event.\n */\n type: UpdateEventType;\n /**\n * If `type` is `Updates.UpdateEventType.UPDATE_AVAILABLE`, the manifest of the newly downloaded\n * update, and `undefined` otherwise.\n */\n manifest?: Manifest;\n /**\n * If `type` is `Updates.UpdateEventType.ERROR`, the error message, and `undefined` otherwise.\n */\n message?: string;\n};\n\n/**\n * An object representing a single log entry from expo-updates logging on the client.\n */\nexport type UpdatesLogEntry = {\n /**\n * The time the log was written, in milliseconds since Jan 1 1970 UTC.\n */\n timestamp: number;\n /**\n * The log entry message.\n */\n message: string;\n /**\n * One of the defined code values for expo-updates log entries.\n */\n code: UpdatesLogEntryCode;\n /**\n * One of the defined log level or severity values.\n */\n level: UpdatesLogEntryLevel;\n /**\n * If present, the unique ID of an update associated with this log entry.\n */\n updateId?: string;\n /**\n * If present, the unique ID or hash of an asset associated with this log entry.\n */\n assetId?: string;\n /**\n * If present, an iOS or Android native stack trace associated with this log entry.\n */\n stacktrace?: string[];\n};\n\n/**\n * The possible code values for expo-updates log entries\n */\nexport enum UpdatesLogEntryCode {\n NONE = 'None',\n NO_UPDATES_AVAILABLE = 'NoUpdatesAvailable',\n UPDATE_ASSETS_NOT_AVAILABLE = 'UpdateAssetsNotAvailable',\n UPDATE_SERVER_UNREACHABLE = 'UpdateServerUnreachable',\n UPDATE_HAS_INVALID_SIGNATURE = 'UpdateHasInvalidSignature',\n UPDATE_CODE_SIGNING_ERROR = 'UpdateCodeSigningError',\n UPDATE_FAILED_TO_LOAD = 'UpdateFailedToLoad',\n ASSETS_FAILED_TO_LOAD = 'AssetsFailedToLoad',\n JS_RUNTIME_ERROR = 'JSRuntimeError',\n UNKNOWN = 'Unknown',\n}\n\n/**\n * The possible log levels for expo-updates log entries\n */\nexport enum UpdatesLogEntryLevel {\n TRACE = 'trace',\n DEBUG = 'debug',\n INFO = 'info',\n WARN = 'warn',\n ERROR = 'error',\n FATAL = 'fatal',\n}\n\n/**\n * The possible settings that determine if expo-updates will check for updates on app startup.\n * By default, Expo will check for updates every time the app is loaded. Set this to `ON_ERROR_RECOVERY` to disable automatic checking unless recovering from an error. Set this to `NEVER` to completely disable automatic checking. Must be one of `ON_LOAD` (default value), `ON_ERROR_RECOVERY`, `WIFI_ONLY`, or `NEVER`\n */\nexport enum UpdatesCheckAutomaticallyValue {\n /**\n * Checks for updates whenever the app is loaded. This is the default setting.\n */\n ON_LOAD = 'ON_LOAD',\n /**\n * Only checks for updates when the app starts up after an error recovery.\n */\n ON_ERROR_RECOVERY = 'ON_ERROR_RECOVERY',\n /**\n * Only checks for updates when the app starts and has a WiFi connection.\n */\n WIFI_ONLY = 'WIFI_ONLY',\n /**\n * Automatic update checks are off, and update checks must be done through the JS API.\n */\n NEVER = 'NEVER',\n}\n\n// @docsMissing\n/**\n * @hidden\n */\nexport type LocalAssets = Record<string, string>;\n\n/**\n * @hidden\n */\nexport type UpdatesNativeStateRollback = {\n // ISO date string with the rollback commit time\n commitTime: string;\n};\n\n/**\n * @hidden\n */\nexport type UpdatesNativeStateMachineContext = {\n // The native state machine context, either read directly from a native module method,\n // or received in a state change event. Used internally by this module and not exported publicly.\n isUpdateAvailable: boolean;\n isUpdatePending: boolean;\n isChecking: boolean;\n isDownloading: boolean;\n isRestarting: boolean;\n latestManifest?: Manifest;\n downloadedManifest?: Manifest;\n rollback?: UpdatesNativeStateRollback;\n checkError?: Error;\n downloadError?: Error;\n lastCheckForUpdateTime?: Date;\n};\n\n/**\n * @hidden\n */\nexport type UpdatesNativeStateChangeEvent = {\n // Change event emitted by native\n context: UpdatesNativeStateMachineContext;\n};\n"]}