import type { UpdatePolicy } from '../types'; import type { RuntimeDeliveryDiagnosticEvent } from '../runtime-delivery/diagnostics'; export declare const BUNDLE_DROP_NOT_INITIALIZED_MESSAGE = "BundleDrop has not been initialized. Call BundleDrop.init({ environment, ... }) before using OTA APIs or useBundleDrop()."; export declare const BUNDLE_DROP_DISABLED_MESSAGE = "BundleDrop is disabled. OTA APIs are running in no-op mode because BundleDrop.init({ enabled: false, ... }) was used."; /** * Runtime options for `BundleDrop.init(...)`. */ export type BundleDropInitOptions = { /** Customer app environment shown in analytics, for example `production`, `staging`, or `development`. */ environment: string; /** Defaults to `true`. Set to `false` to keep BundleDrop configured but fully no-op for the current app process. */ enabled?: boolean; /** Initial OTA channel for this app process. Defaults to the static `defaultChannel` from `bundle.drop.config.js`. */ channelName?: string; /** Startup behavior after local state hydration. Defaults to `manual`. */ policy?: UpdatePolicy; /** Optional listener for human-readable status messages emitted during checks, downloads, and apply flow. */ onStatusUpdate?: (status: string) => void; /** Optional sink for structured runtime-delivery diagnostic counter events. */ onRuntimeDeliveryDiagnostic?: (event: RuntimeDeliveryDiagnosticEvent) => void; /** When `true`, startup performs only a resolve/check and skips download/apply even if policy would normally do more. */ checkOnly?: boolean; }; /** * Resolved runtime configuration currently active inside the singleton service. */ export type BundleDropRuntimeConfig = { /** Customer app environment sent to BundleDrop analytics and resolve payloads. */ environment: string; /** Whether BundleDrop is active or running in disabled no-op mode. */ enabled: boolean; /** Current active OTA channel used by singleton update actions. */ channelName: string; /** Effective startup policy after defaults are applied. */ policy: UpdatePolicy; /** Optional listener receiving status messages from runtime actions. */ onStatusUpdate?: (status: string) => void; /** Optional sink receiving structured runtime-delivery diagnostic counter events. */ onRuntimeDeliveryDiagnostic?: (event: RuntimeDeliveryDiagnosticEvent) => void; /** Whether startup is limited to a resolve/check without downloading or applying. */ checkOnly: boolean; }; export declare function resolveBundleDropRuntimeConfig(options: BundleDropInitOptions): BundleDropRuntimeConfig; export declare function initializeBundleDropRuntime(options: BundleDropInitOptions): { config: BundleDropRuntimeConfig; alreadyInitialized: boolean; }; export declare function getBundleDropRuntimeConfig(): BundleDropRuntimeConfig | null; export declare function getBundleDropRuntimeConfigOrWarn(): BundleDropRuntimeConfig | null; export declare function assertBundleDropInitialized(): BundleDropRuntimeConfig; export declare function hasBundleDropBeenInitialized(): boolean; export declare function setBundleDropChannel(channelName: string): BundleDropRuntimeConfig; export declare function resetBundleDropRuntimeForTests(): void;