From b62e9e8e2fbb9401081b15d470b4b3279e931a68 Mon Sep 17 00:00:00 2001 From: Cap-go Date: Tue, 19 Mar 2024 00:21:42 +0000 Subject: [PATCH] Update from https://github.com/Cap-go/capacitor-updater/commit/a7a5868d07916f7bf816e095983b4c0eb233b4e7 --- src/content/docs/docs/plugin/api.md | 510 ++++++++++++++++------------ 1 file changed, 284 insertions(+), 226 deletions(-) diff --git a/src/content/docs/docs/plugin/api.md b/src/content/docs/docs/plugin/api.md index 19a73ea8..37793a1b 100644 --- a/src/content/docs/docs/plugin/api.md +++ b/src/content/docs/docs/plugin/api.md @@ -12,7 +12,7 @@ See the Github [Readme](https://github.com/Cap-go/capacitor-updater) for more in -CapacitorUpdater can be configured with this options: +CapacitorUpdater can be configured with these options: | Prop | Type | Description | Default | Since | | ------------------------ | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------- | @@ -127,6 +127,11 @@ export default config; * [`unsetChannel(...)`](#unsetchannel) * [`getChannel()`](#getchannel) * [`setCustomId(...)`](#setcustomid) +* [`getBuiltinVersion()`](#getbuiltinversion) +* [`getDeviceId()`](#getdeviceid) +* [`getPluginVersion()`](#getpluginversion) +* [`isAutoUpdateEnabled()`](#isautoupdateenabled) +* [`removeAllListeners()`](#removealllisteners) * [`addListener('download', ...)`](#addlistenerdownload) * [`addListener('noNeedUpdate', ...)`](#addlistenernoneedupdate) * [`addListener('updateAvailable', ...)`](#addlistenerupdateavailable) @@ -136,11 +141,6 @@ export default config; * [`addListener('downloadFailed', ...)`](#addlistenerdownloadfailed) * [`addListener('appReloaded', ...)`](#addlistenerappreloaded) * [`addListener('appReady', ...)`](#addlistenerappready) -* [`getBuiltinVersion()`](#getbuiltinversion) -* [`getDeviceId()`](#getdeviceid) -* [`getPluginVersion()`](#getpluginversion) -* [`isAutoUpdateEnabled()`](#isautoupdateenabled) -* [`removeAllListeners()`](#removealllisteners) * [Interfaces](#interfaces) * [Type Aliases](#type-aliases) @@ -154,14 +154,14 @@ export default config; ## notifyAppReady() ```typescript -notifyAppReady() => Promise<{ bundle: BundleInfo; }> +notifyAppReady() => Promise ``` Notify Capacitor Updater that the current bundle is working (a rollback will occur if this method is not called on every app launch) By default this method should be called in the first 10 sec after app launch, otherwise a rollback will occur. Change this behaviour with {@link appReadyTimeout} -**Returns:** Promise<{ bundle: BundleInfo; }> +**Returns:** Promise<AppReadyResult> -------------------- @@ -169,14 +169,14 @@ Change this behaviour with {@link appReadyTimeout} ## setUpdateUrl(...) ```typescript -setUpdateUrl(options: { url: string; }) => Promise +setUpdateUrl(options: UpdateUrl) => Promise ``` Set the updateUrl for the app, this will be used to check for updates. -| Param | Type | -| ------------- | ----------------------------- | -| **`options`** | { url: string; } | +| Param | Type | Description | +| ------------- | ----------------------------------------------- | ------------------------------------------------- | +| **`options`** | UpdateUrl | contains the URL to use for checking for updates. | **Since:** 5.4.0 @@ -186,14 +186,14 @@ Set the updateUrl for the app, this will be used to check for updates. ## setStatsUrl(...) ```typescript -setStatsUrl(options: { url: string; }) => Promise +setStatsUrl(options: StatsUrl) => Promise ``` -Set the statsUrl for the app, this will be used to send statistics. +Set the statsUrl for the app, this will be used to send statistics. Passing an empty string will disable statistics gathering. -| Param | Type | -| ------------- | ----------------------------- | -| **`options`** | { url: string; } | +| Param | Type | Description | +| ------------- | --------------------------------------------- | ----------------------------------------------- | +| **`options`** | StatsUrl | contains the URL to use for sending statistics. | **Since:** 5.4.0 @@ -203,14 +203,14 @@ Set the statsUrl for the app, this will be used to send statistics. ## setChannelUrl(...) ```typescript -setChannelUrl(options: { url: string; }) => Promise +setChannelUrl(options: ChannelUrl) => Promise ``` Set the channelUrl for the app, this will be used to set the channel. -| Param | Type | -| ------------- | ----------------------------- | -| **`options`** | { url: string; } | +| Param | Type | Description | +| ------------- | ------------------------------------------------- | ------------------------------------------------ | +| **`options`** | ChannelUrl | contains the URL to use for setting the channel. | **Since:** 5.4.0 @@ -220,14 +220,14 @@ Set the channelUrl for the app, this will be used to set the channel. ## download(...) ```typescript -download(options: { url: string; version: string; sessionKey?: string; checksum?: string; }) => Promise +download(options: DownloadOptions) => Promise ``` Download a new bundle from the provided URL, it should be a zip file, with files inside or with a unique id inside with all your files -| Param | Type | -| ------------- | -------------------------------------------------------------------------------------- | -| **`options`** | { url: string; version: string; sessionKey?: string; checksum?: string; } | +| Param | Type | Description | +| ------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| **`options`** | DownloadOptions | The {@link DownloadOptions} for downloading a new bundle zip. | **Returns:** Promise<BundleInfo> @@ -237,14 +237,14 @@ Download a new bundle from the provided URL, it should be a zip file, with files ## next(...) ```typescript -next(options: { id: string; }) => Promise +next(options: BundleId) => Promise ``` Set the next bundle to be used when the app is reloaded. -| Param | Type | -| ------------- | ---------------------------- | -| **`options`** | { id: string; } | +| Param | Type | Description | +| ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| **`options`** | BundleId | Contains the ID of the next Bundle to set on next app launch. {@link BundleInfo.id} | **Returns:** Promise<BundleInfo> @@ -254,14 +254,14 @@ Set the next bundle to be used when the app is reloaded. ## set(...) ```typescript -set(options: { id: string; }) => Promise +set(options: BundleId) => Promise ``` Set the current bundle and immediately reloads the app. -| Param | Type | -| ------------- | ---------------------------- | -| **`options`** | { id: string; } | +| Param | Type | Description | +| ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| **`options`** | BundleId | A {@link BundleId} object containing the new bundle id to set as current. | -------------------- @@ -269,14 +269,14 @@ Set the current bundle and immediately reloads the app. ## delete(...) ```typescript -delete(options: { id: string; }) => Promise +delete(options: BundleId) => Promise ``` -Delete bundle in storage +Deletes the specified bundle from the native app storage. Use with {@link list} to get the stored Bundle IDs. -| Param | Type | -| ------------- | ---------------------------- | -| **`options`** | { id: string; } | +| Param | Type | Description | +| ------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| **`options`** | BundleId | A {@link BundleId} object containing the ID of a bundle to delete (note, this is the bundle id, NOT the version name) | -------------------- @@ -284,12 +284,12 @@ Delete bundle in storage ## list() ```typescript -list() => Promise<{ bundles: BundleInfo[]; }> +list() => Promise ``` Get all locally downloaded bundles in your app -**Returns:** Promise<{ bundles: BundleInfo[]; }> +**Returns:** Promise<BundleListResult> -------------------- @@ -297,14 +297,14 @@ Get all locally downloaded bundles in your app ## reset(...) ```typescript -reset(options?: { toLastSuccessful?: boolean | undefined; } | undefined) => Promise +reset(options?: ResetOptions | undefined) => Promise ``` -Set the `builtin` bundle (the one sent to Apple store / Google play store ) as current bundle +Reset the app to the `builtin` bundle (the one sent to Apple App Store / Google Play Store ) or the last successfully loaded bundle. -| Param | Type | -| ------------- | -------------------------------------------- | -| **`options`** | { toLastSuccessful?: boolean; } | +| Param | Type | Description | +| ------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`options`** | ResetOptions | Containing {@link ResetOptions.toLastSuccessful}, `true` resets to the builtin bundle and `false` will reset to the last successfully loaded bundle. | -------------------- @@ -312,12 +312,12 @@ Set the `builtin` bundle (the one sent to Apple store / Google play store ) as c ## current() ```typescript -current() => Promise<{ bundle: BundleInfo; native: string; }> +current() => Promise ``` -Get the current bundle, if none are set it returns `builtin`, currentNative is the original bundle installed on the device +Get the current bundle, if none are set it returns `builtin`. currentNative is the original bundle installed on the device -**Returns:** Promise<{ bundle: BundleInfo; native: string; }> +**Returns:** Promise<CurrentBundleResult> -------------------- @@ -336,14 +336,14 @@ Reload the view ## setMultiDelay(...) ```typescript -setMultiDelay(options: { delayConditions: DelayCondition[]; }) => Promise +setMultiDelay(options: MultiDelayConditions) => Promise ``` -Set DelayCondition, skip updates until one of the conditions is met +Sets a {@link DelayCondition} array containing conditions that the Plugin will use to determine when to install updates. -| Param | Type | Description | -| ------------- | --------------------------------------------------- | ------------------------------------------------------------------------ | -| **`options`** | { delayConditions: DelayCondition[]; } | are the {@link DelayCondition} list to set | +| Param | Type | Description | +| ------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| **`options`** | MultiDelayConditions | Containing the {@link MultiDelayConditions} array of conditions to set | **Since:** 4.3.0 @@ -356,7 +356,7 @@ Set DelayCondition, skip updates until one of the cancelDelay() => Promise ``` -Cancel delay to updates as usual +Cancels a {@link DelayCondition} to process an update immediately. **Since:** 4.0.0 @@ -366,12 +366,12 @@ Cancel delay to updates as usual ## getLatest() ```typescript -getLatest() => Promise +getLatest() => Promise ``` Get Latest bundle available from update Url -**Returns:** Promise<latestVersion> +**Returns:** Promise<LatestVersion> **Since:** 4.0.0 @@ -381,17 +381,18 @@ Get Latest bundle available from update Url ## setChannel(...) ```typescript -setChannel(options: SetChannelOptions) => Promise +setChannel(options: SetChannelOptions) => Promise ``` -Set Channel for this device, the channel have to allow self assignement to make this work -Do not use this method to set the channel at boot when autoUpdate is enabled, this method is made to set the channel after the app is ready when user click on a button for example +Sets the channel for this device. The channel has to allow for self assignment for this to work. +Do not use this method to set the channel at boot when `autoUpdate` is enabled in the {@link PluginsConfig}. +This method is to set the channel after the app is ready. | Param | Type | Description | | ------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| **`options`** | SetChannelOptions | is the {@link SetChannelOptions} channel to set | +| **`options`** | SetChannelOptions | Is the {@link SetChannelOptions} channel to set | -**Returns:** Promise<channelRes> +**Returns:** Promise<ChannelRes> **Since:** 4.7.0 @@ -404,7 +405,7 @@ Do not use this method to set the channel at boot when autoUpdate is enabled, th unsetChannel(options: UnsetChannelOptions) => Promise ``` -Unset Channel for this device, the device will return to the default channel +Unset the channel for this device. The device will then return to the default channel | Param | Type | | ------------- | ------------------------------------------------------------------- | @@ -418,12 +419,12 @@ Unset Channel for this device, the device will return to the default channel ## getChannel() ```typescript -getChannel() => Promise +getChannel() => Promise ``` -get Channel for this device +Get the channel for this device -**Returns:** Promise<getChannelRes> +**Returns:** Promise<GetChannelRes> **Since:** 4.8.0 @@ -436,7 +437,7 @@ get Channel for this device setCustomId(options: SetCustomIdOptions) => Promise ``` -Set Channel for this device +Set a custom ID for this device | Param | Type | Description | | ------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------- | @@ -447,18 +448,85 @@ Set Channel for this device -------------------- +## getBuiltinVersion() + +```typescript +getBuiltinVersion() => Promise +``` + +Get the native app version or the builtin version if set in config + +**Returns:** Promise<BuiltinVersion> + +**Since:** 5.2.0 + +-------------------- + + +## getDeviceId() + +```typescript +getDeviceId() => Promise +``` + +Get unique ID used to identify device (sent to auto update server) + +**Returns:** Promise<DeviceId> + +-------------------- + + +## getPluginVersion() + +```typescript +getPluginVersion() => Promise +``` + +Get the native Capacitor Updater plugin version (sent to auto update server) + +**Returns:** Promise<PluginVersion> + +-------------------- + + +## isAutoUpdateEnabled() + +```typescript +isAutoUpdateEnabled() => Promise +``` + +Get the state of auto update config. + +**Returns:** Promise<AutoUpdateEnabled> + +-------------------- + + +## removeAllListeners() + +```typescript +removeAllListeners() => Promise +``` + +Remove all listeners for this plugin. + +**Since:** 1.0.0 + +-------------------- + + ## addListener('download', ...) ```typescript -addListener(eventName: "download", listenerFunc: DownloadChangeListener) => Promise & PluginListenerHandle +addListener(eventName: "download", listenerFunc: (state: DownloadEvent) => void) => Promise & PluginListenerHandle ``` -Listen for download event in the App, let you know when the download is started, loading and finished, with a percent value +Listen for bundle download event in the App. Fires once a download has started, during downloading and when finished. -| Param | Type | -| ------------------ | ------------------------------------------------------------------------- | -| **`eventName`** | 'download' | -| **`listenerFunc`** | DownloadChangeListener | +| Param | Type | +| ------------------ | --------------------------------------------------------------------------- | +| **`eventName`** | 'download' | +| **`listenerFunc`** | (state: DownloadEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -470,15 +538,15 @@ Listen for download event in the App, let you know when the download is started, ## addListener('noNeedUpdate', ...) ```typescript -addListener(eventName: "noNeedUpdate", listenerFunc: NoNeedListener) => Promise & PluginListenerHandle +addListener(eventName: "noNeedUpdate", listenerFunc: (state: NoNeedEvent) => void) => Promise & PluginListenerHandle ``` -Listen for no need to update event, usefull when you want force check every time the app is launched +Listen for no need to update event, useful when you want force check every time the app is launched -| Param | Type | -| ------------------ | --------------------------------------------------------- | -| **`eventName`** | 'noNeedUpdate' | -| **`listenerFunc`** | NoNeedListener | +| Param | Type | +| ------------------ | ----------------------------------------------------------------------- | +| **`eventName`** | 'noNeedUpdate' | +| **`listenerFunc`** | (state: NoNeedEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -490,15 +558,15 @@ Listen for no need to update event, usefull when you want force check every time ## addListener('updateAvailable', ...) ```typescript -addListener(eventName: "updateAvailable", listenerFunc: UpdateAvailabledListener) => Promise & PluginListenerHandle +addListener(eventName: "updateAvailable", listenerFunc: (state: UpdateAvailableEvent) => void) => Promise & PluginListenerHandle ``` -Listen for availbale update event, usefull when you want to force check every time the app is launched +Listen for available update event, useful when you want to force check every time the app is launched -| Param | Type | -| ------------------ | ----------------------------------------------------------------------------- | -| **`eventName`** | 'updateAvailable' | -| **`listenerFunc`** | UpdateAvailabledListener | +| Param | Type | +| ------------------ | ----------------------------------------------------------------------------------------- | +| **`eventName`** | 'updateAvailable' | +| **`listenerFunc`** | (state: UpdateAvailableEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -510,15 +578,15 @@ Listen for availbale update event, usefull when you want to force check every ti ## addListener('downloadComplete', ...) ```typescript -addListener(eventName: "downloadComplete", listenerFunc: DownloadCompleteListener) => Promise & PluginListenerHandle +addListener(eventName: "downloadComplete", listenerFunc: (state: DownloadCompleteEvent) => void) => Promise & PluginListenerHandle ``` -Listen for download event in the App, let you know when the download is started, loading and finished +Listen for downloadComplete events. -| Param | Type | -| ------------------ | ----------------------------------------------------------------------------- | -| **`eventName`** | 'downloadComplete' | -| **`listenerFunc`** | DownloadCompleteListener | +| Param | Type | +| ------------------ | ------------------------------------------------------------------------------------------- | +| **`eventName`** | 'downloadComplete' | +| **`listenerFunc`** | (state: DownloadCompleteEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -530,15 +598,15 @@ Listen for download event in the App, let you know when the download is started, ## addListener('majorAvailable', ...) ```typescript -addListener(eventName: "majorAvailable", listenerFunc: MajorAvailableListener) => Promise & PluginListenerHandle +addListener(eventName: "majorAvailable", listenerFunc: (state: MajorAvailableEvent) => void) => Promise & PluginListenerHandle ``` Listen for Major update event in the App, let you know when major update is blocked by setting disableAutoUpdateBreaking -| Param | Type | -| ------------------ | ------------------------------------------------------------------------- | -| **`eventName`** | 'majorAvailable' | -| **`listenerFunc`** | MajorAvailableListener | +| Param | Type | +| ------------------ | --------------------------------------------------------------------------------------- | +| **`eventName`** | 'majorAvailable' | +| **`listenerFunc`** | (state: MajorAvailableEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -550,15 +618,15 @@ Listen for Major update event in the App, let you know when major update is bloc ## addListener('updateFailed', ...) ```typescript -addListener(eventName: "updateFailed", listenerFunc: UpdateFailedListener) => Promise & PluginListenerHandle +addListener(eventName: "updateFailed", listenerFunc: (state: UpdateFailedEvent) => void) => Promise & PluginListenerHandle ``` Listen for update fail event in the App, let you know when update has fail to install at next app start -| Param | Type | -| ------------------ | --------------------------------------------------------------------- | -| **`eventName`** | 'updateFailed' | -| **`listenerFunc`** | UpdateFailedListener | +| Param | Type | +| ------------------ | ----------------------------------------------------------------------------------- | +| **`eventName`** | 'updateFailed' | +| **`listenerFunc`** | (state: UpdateFailedEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -570,15 +638,15 @@ Listen for update fail event in the App, let you know when update has fail to in ## addListener('downloadFailed', ...) ```typescript -addListener(eventName: "downloadFailed", listenerFunc: DownloadFailedListener) => Promise & PluginListenerHandle +addListener(eventName: "downloadFailed", listenerFunc: (state: DownloadFailedEvent) => void) => Promise & PluginListenerHandle ``` -Listen for download fail event in the App, let you know when download has fail finished +Listen for download fail event in the App, let you know when a bundle download has failed -| Param | Type | -| ------------------ | ------------------------------------------------------------------------- | -| **`eventName`** | 'downloadFailed' | -| **`listenerFunc`** | DownloadFailedListener | +| Param | Type | +| ------------------ | --------------------------------------------------------------------------------------- | +| **`eventName`** | 'downloadFailed' | +| **`listenerFunc`** | (state: DownloadFailedEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -590,15 +658,15 @@ Listen for download fail event in the App, let you know when download has fail f ## addListener('appReloaded', ...) ```typescript -addListener(eventName: "appReloaded", listenerFunc: AppReloadedListener) => Promise & PluginListenerHandle +addListener(eventName: "appReloaded", listenerFunc: () => void) => Promise & PluginListenerHandle ``` -Listen for reload event in the App, let you know when reload has happend +Listen for reload event in the App, let you know when reload has happened -| Param | Type | -| ------------------ | ------------------------------------------------------------------- | -| **`eventName`** | 'appReloaded' | -| **`listenerFunc`** | AppReloadedListener | +| Param | Type | +| ------------------ | -------------------------- | +| **`eventName`** | 'appReloaded' | +| **`listenerFunc`** | () => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -610,15 +678,15 @@ Listen for reload event in the App, let you know when reload has happend ## addListener('appReady', ...) ```typescript -addListener(eventName: "appReady", listenerFunc: AppReadyListener) => Promise & PluginListenerHandle +addListener(eventName: "appReady", listenerFunc: (state: AppReadyEvent) => void) => Promise & PluginListenerHandle ``` Listen for app ready event in the App, let you know when app is ready to use -| Param | Type | -| ------------------ | ------------------------------------------------------------- | -| **`eventName`** | 'appReady' | -| **`listenerFunc`** | AppReadyListener | +| Param | Type | +| ------------------ | --------------------------------------------------------------------------- | +| **`eventName`** | 'appReady' | +| **`listenerFunc`** | (state: AppReadyEvent) => void | **Returns:** Promise<PluginListenerHandle> & PluginListenerHandle @@ -627,85 +695,92 @@ Listen for app ready event in the App, let you know when app is ready to use -------------------- -## getBuiltinVersion() - -```typescript -getBuiltinVersion() => Promise<{ version: string; }> -``` +## Interfaces -Get the native app version or the builtin version if set in config -**Returns:** Promise<{ version: string; }> +### AppReadyResult -**Since:** 5.2.0 +| Prop | Type | +| ------------ | ------------------------------------------------- | +| **`bundle`** | BundleInfo | --------------------- +### BundleInfo -## getDeviceId() +| Prop | Type | +| ---------------- | ----------------------------------------------------- | +| **`id`** | string | +| **`version`** | string | +| **`downloaded`** | string | +| **`checksum`** | string | +| **`status`** | BundleStatus | -```typescript -getDeviceId() => Promise<{ deviceId: string; }> -``` -Get unique ID used to identify device (sent to auto update server) +### UpdateUrl -**Returns:** Promise<{ deviceId: string; }> +| Prop | Type | +| --------- | ------------------- | +| **`url`** | string | --------------------- +### StatsUrl -## getPluginVersion() +| Prop | Type | +| --------- | ------------------- | +| **`url`** | string | -```typescript -getPluginVersion() => Promise<{ version: string; }> -``` -Get the native Capacitor Updater plugin version (sent to auto update server) +### ChannelUrl -**Returns:** Promise<{ version: string; }> +| Prop | Type | +| --------- | ------------------- | +| **`url`** | string | --------------------- +### DownloadOptions -## isAutoUpdateEnabled() +| Prop | Type | Description | +| ---------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`url`** | string | The URL of the bundle zip file (e.g: dist.zip) to be downloaded. (This can be any URL. E.g: Amazon S3, a GitHub tag, any other place you've hosted your bundle.) | +| **`version`** | string | The version code/name of this bundle/version | +| **`sessionKey`** | string | | +| **`checksum`** | string | | -```typescript -isAutoUpdateEnabled() => Promise<{ enabled: boolean; }> -``` -Get the state of auto update config. This will return `false` in manual mode. +### BundleId -**Returns:** Promise<{ enabled: boolean; }> +| Prop | Type | +| -------- | ------------------- | +| **`id`** | string | --------------------- +### BundleListResult -## removeAllListeners() +| Prop | Type | +| ------------- | ------------------------- | +| **`bundles`** | BundleInfo[] | -```typescript -removeAllListeners() => Promise -``` -Remove all listeners for this plugin. +### ResetOptions -**Since:** 1.0.0 +| Prop | Type | +| ---------------------- | -------------------- | +| **`toLastSuccessful`** | boolean | --------------------- +### CurrentBundleResult -## Interfaces +| Prop | Type | +| ------------ | ------------------------------------------------- | +| **`bundle`** | BundleInfo | +| **`native`** | string | -### BundleInfo +### MultiDelayConditions -| Prop | Type | -| ---------------- | ----------------------------------------------------- | -| **`id`** | string | -| **`version`** | string | -| **`downloaded`** | string | -| **`checksum`** | string | -| **`status`** | BundleStatus | +| Prop | Type | +| --------------------- | ----------------------------- | +| **`delayConditions`** | DelayCondition[] | ### DelayCondition @@ -716,20 +791,20 @@ Remove all listeners for this plugin. | **`value`** | string | | -### latestVersion +### LatestVersion -| Prop | Type | Description | Since | -| ---------------- | -------------------- | ----------------------- | ----- | -| **`version`** | string | Res of getLatest method | 4.0.0 | -| **`major`** | boolean | | | -| **`message`** | string | | | -| **`sessionKey`** | string | | | -| **`error`** | string | | | -| **`old`** | string | | | -| **`url`** | string | | | +| Prop | Type | Description | Since | +| ---------------- | -------------------- | -------------------------- | ----- | +| **`version`** | string | Result of getLatest method | 4.0.0 | +| **`major`** | boolean | | | +| **`message`** | string | | | +| **`sessionKey`** | string | | | +| **`error`** | string | | | +| **`old`** | string | | | +| **`url`** | string | | | -### channelRes +### ChannelRes | Prop | Type | Description | Since | | ------------- | ------------------- | ----------------------------- | ----- | @@ -753,7 +828,7 @@ Remove all listeners for this plugin. | **`triggerAutoUpdate`** | boolean | -### getChannelRes +### GetChannelRes | Prop | Type | Description | Since | | -------------- | -------------------- | ----------------------------- | ----- | @@ -771,6 +846,34 @@ Remove all listeners for this plugin. | **`customId`** | string | +### BuiltinVersion + +| Prop | Type | +| ------------- | ------------------- | +| **`version`** | string | + + +### DeviceId + +| Prop | Type | +| -------------- | ------------------- | +| **`deviceId`** | string | + + +### PluginVersion + +| Prop | Type | +| ------------- | ------------------- | +| **`version`** | string | + + +### AutoUpdateEnabled + +| Prop | Type | +| ------------- | -------------------- | +| **`enabled`** | boolean | + + ### PluginListenerHandle | Prop | Type | @@ -786,14 +889,14 @@ Remove all listeners for this plugin. | **`bundle`** | BundleInfo | | | -### noNeedEvent +### NoNeedEvent | Prop | Type | Description | Since | | ------------ | ------------------------------------------------- | ---------------------------------------------- | ----- | | **`bundle`** | BundleInfo | Current status of download, between 0 and 100. | 4.0.0 | -### updateAvailableEvent +### UpdateAvailableEvent | Prop | Type | Description | Since | | ------------ | ------------------------------------------------- | ---------------------------------------------- | ----- | @@ -830,10 +933,10 @@ Remove all listeners for this plugin. ### AppReadyEvent -| Prop | Type | Description | Since | -| ------------ | ------------------------------------------------- | -------------------------------- | ----- | -| **`bundle`** | BundleInfo | Emit when a app is ready to use. | 5.2.0 | -| **`status`** | string | | | +| Prop | Type | Description | Since | +| ------------ | ------------------------------------------------- | ------------------------------------- | ----- | +| **`bundle`** | BundleInfo | Emitted when the app is ready to use. | 5.2.0 | +| **`status`** | string | | | ## Type Aliases @@ -848,49 +951,4 @@ Remove all listeners for this plugin. "background" | "kill" | "nativeVersion" | "date" - -### DownloadChangeListener - -(state: DownloadEvent): void - - -### NoNeedListener - -(state: noNeedEvent): void - - -### UpdateAvailabledListener - -(state: updateAvailableEvent): void - - -### DownloadCompleteListener - -(state: DownloadCompleteEvent): void - - -### MajorAvailableListener - -(state: MajorAvailableEvent): void - - -### UpdateFailedListener - -(state: UpdateFailedEvent): void - - -### DownloadFailedListener - -(state: DownloadFailedEvent): void - - -### AppReloadedListener - -(state: void): void - - -### AppReadyListener - -(state: AppReadyEvent): void -