UNPKG

@3m1/service-worker-updater

Version:

Manage Create React App's Service Worker update

14 lines (13 loc) 733 B
import React from 'react'; import PersistenceService from './PersistenceService/'; export interface ServiceWorkerUpdaterProps { newServiceWorkerDetected: boolean; onLoadNewServiceWorkerAccept: () => void; } export interface WithServiceWorkerUpdaterOptions { message?: unknown; log?: () => void; persistenceService?: PersistenceService; } declare function withServiceWorkerUpdater<P>(WrappedComponent: React.ComponentType<P & ServiceWorkerUpdaterProps>, { message, log, persistenceService }?: WithServiceWorkerUpdaterOptions): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<React.ComponentType<P & ServiceWorkerUpdaterProps>>>; export default withServiceWorkerUpdater;