import type { BundleInfo } from '../bundleInfo'; import type { BundleListItem, UpdateCheckResponse } from '../api/types'; import type { DownloadUpdateResult } from '../manager/downloadAndInstall'; import type { ApplyUpdateResult } from '../manager/updateState'; import type { AvailableBundlesPage, GetAvailableBundlesOptions } from '../manager/updateCheck'; import { type BundleDropInitOptions } from './initState'; type BundleDropRuntimeSnapshot = { status: string; isBusy: boolean; isEnabled: boolean; channelName: string; installedInfo: BundleInfo | null; pendingApply: boolean; hasBundle: boolean; availableChannels: string[]; }; type StatusHandler = (status: string) => void; type DownloadAndStageResult = { result: DownloadUpdateResult; status?: string; }; type ApplyAndRefreshResult = { result: ApplyUpdateResult; status?: string; }; type CheckLatestResult = { response: UpdateCheckResponse | null; status?: string; }; /** * Initialize the singleton BundleDrop runtime for the current app process. * * Call this once during app startup, typically from `index.js`, before using * `useBundleDrop()` or any OTA runtime APIs. */ export declare function initBundleDrop(options: BundleDropInitOptions): void; /** * Change the active runtime channel used by singleton OTA actions such as checks, * downloads, and installs triggered through `useBundleDrop()` or named exports. */ export declare function setChannel(channelName: string): void; /** * Read the current active runtime channel. */ export declare function getChannelName(): string; export declare function subscribeBundleDropState(listener: () => void): () => void; export declare function getBundleDropSnapshot(): BundleDropRuntimeSnapshot; export declare function isUpdateFlowActive(): boolean; /** * Resolve update metadata from the server without downloading anything. */ export declare function checkLatest(extraStatusHandler?: StatusHandler): Promise; /** * Resolve, download, and stage the latest compatible update for the active runtime channel. */ export declare function downloadAndStage(extraStatusHandler?: StatusHandler): Promise; /** * Apply a previously staged bundle immediately by restarting the React Native bridge. */ export declare function applyDownloadedUpdate(extraStatusHandler?: StatusHandler): Promise; /** * Mark the currently running OTA candidate healthy for this device. */ export declare function reportHealthy(): Promise; /** * Fetch the list of public channel names available for the configured project. */ export declare function fetchAvailableChannels(): Promise; /** * Fetch a paginated list of bundles for a channel. Defaults to the active runtime channel. */ export declare function fetchAvailableBundles(options?: GetAvailableBundlesOptions): Promise; /** * Download and stage a specific bundle returned by `fetchAvailableBundles()`. */ export declare function installBundleFromListItem(bundle: BundleListItem): Promise; /** * Read locally stored metadata for the currently downloaded or applied bundle. */ export declare function getInstalledBundleInfo(): Promise; export type ObservabilityContext = { source: 'embedded' | 'ota'; dist: string; tags: { bundle_drop_hash: string | null; bundle_drop_channel: string | null; bundle_drop_version: string | null; bundle_drop_runtime_version: string | null; bundle_drop_platform: string | null; }; context: BundleInfo | null; }; /** * Pre-formatted context for error tracking integrations. * * Returns `dist`, `tags`, and `context` shaped for direct use with * Sentry, Bugsnag, Datadog, or any provider. Handles the embedded * fallback automatically: when no OTA bundle is active, `source` * is `'embedded'` and `dist` is `'embedded'`. * * If the installed bundle has `pendingApply: true` it is not yet * executing, so the context falls back to `'embedded'`. */ export declare function getObservabilityContext(): Promise; /** * Read the current local update state from disk. */ export declare function getRuntimeUpdateState(): Promise<{ hasBundle: boolean; info: BundleInfo; pendingApply: boolean; }>; /** * Named-export variant of `useBundleDrop().checkLatest()`. */ export declare function checkForUpdate(onStatusUpdate?: StatusHandler): Promise; /** * Named-export variant of `useBundleDrop().downloadUpdate()`. */ export declare function downloadUpdate(onStatusUpdate?: StatusHandler): Promise; /** * Named-export variant of `useBundleDrop().applyUpdate()`. */ export declare function applyUpdate(onStatusUpdate?: StatusHandler): Promise; /** * Named-export variant of `useBundleDrop().fetchAvailableChannels()`. */ export declare function getAvailableChannels(): Promise; /** * Named-export variant of `useBundleDrop().fetchBundles()`. */ export declare function getAvailableBundles(options?: GetAvailableBundlesOptions): Promise; /** * Download and stage a specific bundle by hash and URL instead of browsing through `fetchBundles()`. */ export declare function installBundle(hash: string, downloadUrl: string, bundleVersion?: number, version?: string, runtimeVersion?: string, onStatusUpdate?: StatusHandler): Promise; export declare function resetBundleDropRuntimeServiceForTests(): void; export declare function waitForBundleDropStartupForTests(): Promise; export {};