import { type CheckForUpdateConfig } from "./checkForUpdate"; export type RunUpdateProcessResponse = { status: "ROLLBACK" | "UPDATE"; shouldForceUpdate: boolean; id: string; } | { status: "UP_TO_DATE"; }; export interface RunUpdateProcessConfig extends CheckForUpdateConfig { /** * If `true`, the app will be reloaded when the downloaded bundle is a force update. * If `false`, shouldForceUpdate will be returned as true but the app won't reload. * @default true */ reloadOnForceUpdate?: boolean; } /** * Manually checks and applies updates for the application. * * @param {RunUpdateProcessConfig} config - Update process configuration * @param {string} config.source - Update server URL * @param {Record} [config.requestHeaders] - Request headers * @param {boolean} [config.reloadOnForceUpdate=true] - Whether to automatically reload on force update * * @example * ```ts * // Auto reload on force update * const result = await CodeUpdater.runUpdateProcess({ * source: "", * requestHeaders: { * // Add necessary headers * }, * reloadOnForceUpdate: true * }); * * // Manually handle reload on force update * const result = await CodeUpdater.runUpdateProcess({ * source: "", * reloadOnForceUpdate: false * }); * * if(result.status !== "UP_TO_DATE" && result.shouldForceUpdate) { * CodeUpdater.reload(); * } * ``` * * @returns {Promise} The result of the update process */ export declare const runUpdateProcess: ({ reloadOnForceUpdate, ...checkForUpdateConfig }: RunUpdateProcessConfig) => Promise;