import type React from "react"; import { type CheckForUpdateConfig } from "./checkForUpdate"; import { CodeUpdaterError } from "./error"; import type { RunUpdateProcessResponse } from "./runUpdateProcess"; type UpdateStatus = "CHECK_FOR_UPDATE" | "UPDATING" | "UPDATE_PROCESS_COMPLETED"; export interface CodeUpdaterConfig extends CheckForUpdateConfig { /** * Component to show while downloading a new bundle update. * * When an update exists and the bundle is being downloaded, this component will block access * to the entry point and show download progress. * * @see {@link https://mstfmedeni.github.io/code-updater/guide/code-updater/wrap.html#fallback-component} * * ```tsx * CodeUpdater.wrap({ * source: "", * fallbackComponent: ({ progress = 0 }) => ( * * Updating... {progress}% * * ) * })(App) * ``` * * If not defined, the bundle will download in the background without blocking the screen. */ fallbackComponent?: React.FC<{ status: Exclude; progress: number; }>; onError?: (error: CodeUpdaterError) => void; onProgress?: (progress: number) => void; /** * When a force update exists, the app will automatically reload. * If `false`, When a force update exists, the app will not reload. `shouldForceUpdate` will be returned as `true` in `onUpdateProcessCompleted`. * If `true`, When a force update exists, the app will automatically reload. * @default true */ reloadOnForceUpdate?: boolean; /** * Callback function that is called when the update process is completed. * * @see {@link https://mstfmedeni.github.io/code-updater/guide/code-updater/wrap.html#onupdateprocesscompleted} */ onUpdateProcessCompleted?: (response: RunUpdateProcessResponse) => void; } export declare function wrap

(config: CodeUpdaterConfig): (WrappedComponent: React.ComponentType) => React.ComponentType

; export {};