-
-
Notifications
You must be signed in to change notification settings - Fork 201
/
react.d.ts
19 lines (17 loc) · 753 Bytes
/
react.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
declare module 'virtual:pwa-register/react' {
// eslint-disable-next-line ts/prefer-ts-expect-error
// @ts-ignore ignore when react is not installed
import type { Dispatch, SetStateAction } from 'react'
import type { RegisterSWOptions } from 'vite-plugin-pwa/types'
export type { RegisterSWOptions }
export function useRegisterSW(options?: RegisterSWOptions): {
needRefresh: [boolean, Dispatch<SetStateAction<boolean>>]
offlineReady: [boolean, Dispatch<SetStateAction<boolean>>]
/**
* Reloads the current window to allow the service worker take the control.
*
* @param reloadPage From version 0.13.2 this param is not used anymore.
*/
updateServiceWorker: (reloadPage?: boolean) => Promise<void>
}
}