forked from vite-pwa/vite-plugin-pwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
solid.d.ts
19 lines (17 loc) · 735 Bytes
/
solid.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/solid' {
// eslint-disable-next-line ts/prefer-ts-expect-error
// @ts-ignore ignore when solid-js is not installed
import type { Accessor, Setter } from 'solid-js'
import type { RegisterSWOptions } from 'vite-plugin-pwa/types'
export type { RegisterSWOptions }
export function useRegisterSW(options?: RegisterSWOptions): {
needRefresh: [Accessor<boolean>, Setter<boolean>]
offlineReady: [Accessor<boolean>, Setter<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>
}
}