@hot-updater/react-native
Version:
React Native OTA solution for self-hosted
30 lines • 1.15 kB
TypeScript
import type { AppUpdateInfo } from "@hot-updater/core";
import type { HotUpdaterResolver } from "./types";
export interface CheckForUpdateOptions {
/**
* Update strategy
* - "fingerprint": Use fingerprint hash to check for updates
* - "appVersion": Use app version to check for updates
* - Can override the strategy set in HotUpdater.wrap()
*/
updateStrategy: "appVersion" | "fingerprint";
requestHeaders?: Record<string, string>;
onError?: (error: Error) => void;
/**
* The timeout duration for the request.
* @default 5000
*/
requestTimeout?: number;
}
export type CheckForUpdateResult = AppUpdateInfo & {
/**
* Updates the bundle.
* This method is equivalent to `HotUpdater.updateBundle()` but with all required arguments pre-filled.
*/
updateBundle: () => Promise<boolean>;
};
export interface InternalCheckForUpdateOptions extends CheckForUpdateOptions {
resolver: HotUpdaterResolver;
}
export declare function checkForUpdate(options: InternalCheckForUpdateOptions): Promise<CheckForUpdateResult | null>;
//# sourceMappingURL=checkForUpdate.d.ts.map