import * as react_jsx_runtime from 'react/jsx-runtime'; import { PropsWithChildren } from 'react'; type CacheStrategy = "cache-first" | "network-first" | "stale-while-revalidate" | "network-only" | "cache-only"; interface PWAIcon { src: string; sizes: string; type: string; purpose?: string; } interface PWAMetadata { name?: string; shortName?: string; description?: string; themeColor?: string; backgroundColor?: string; display?: "standalone" | "fullscreen" | "minimal-ui" | "browser"; startUrl?: string; icons?: PWAIcon[]; } interface RuntimeCachingConfig { pages?: CacheStrategy; images?: CacheStrategy; api?: CacheStrategy; assets?: CacheStrategy; } interface OfflineCallbacks { onReady?: (registration: ServiceWorkerRegistration) => void; onInstalled?: (registration: ServiceWorkerRegistration) => void; onUpdateAvailable?: (registration: ServiceWorkerRegistration) => void; onOffline?: () => void; onOnline?: () => void; onError?: (error: unknown) => void; } interface GoOfflineConfig { enabled?: boolean; debug?: boolean; swPath?: string; scope?: string; version?: string; offlinePage?: string; offlineImage?: string; precache?: string[]; pwa?: boolean | PWAMetadata; runtimeCaching?: RuntimeCachingConfig; callbacks?: OfflineCallbacks; } interface ResolvedGoOfflineConfig { enabled: boolean; debug: boolean; swPath: string; scope: string; version: string; offlinePage: string; offlineImage: string | null; precache: string[]; pwa: false | PWAMetadata; runtimeCaching: Required; callbacks: OfflineCallbacks; } interface GoOfflineController { isOnline(): boolean; getRegistration(): ServiceWorkerRegistration | null; update(): Promise; unregister(): Promise; destroy(): void; } interface OfflineStatusSnapshot { isOnline: boolean; isOffline: boolean; } interface PWAInstallState { isInstallable: boolean; promptInstall: () => Promise; } interface GoOfflineContextValue extends OfflineStatusSnapshot, PWAInstallState { controller: GoOfflineController | null; update: () => Promise; } declare function defineOfflineConfig(config: GoOfflineConfig): GoOfflineConfig; interface ServiceWorkerRegistrationResult { registration: ServiceWorkerRegistration | null; config: ResolvedGoOfflineConfig; } declare function registerServiceWorker(configInput?: GoOfflineConfig | ResolvedGoOfflineConfig): Promise; declare function setupOffline(configInput?: GoOfflineConfig): Promise; interface GoOfflineProviderProps extends PropsWithChildren { config?: GoOfflineConfig; } declare function GoOfflineProvider({ children, config }: GoOfflineProviderProps): react_jsx_runtime.JSX.Element; declare function useGoOffline(): GoOfflineContextValue; declare function useOfflineStatus(): OfflineStatusSnapshot; declare function promptForInstall(): Promise; declare function usePWAInstall(): { isInstallable: boolean; promptInstall: typeof promptForInstall; }; export { type CacheStrategy, type GoOfflineConfig, type GoOfflineContextValue, type GoOfflineController, GoOfflineProvider, type OfflineCallbacks, type OfflineStatusSnapshot, type PWAIcon, type PWAInstallState, type PWAMetadata, type ResolvedGoOfflineConfig, type RuntimeCachingConfig, defineOfflineConfig, registerServiceWorker, setupOffline, useGoOffline, useOfflineStatus, usePWAInstall };