forked from vite-pwa/vite-plugin-pwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.d.ts
106 lines (90 loc) · 3.43 KB
/
client.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
declare module 'virtual:pwa-register' {
export type RegisterSWOptions = {
immediate?: boolean
onNeedRefresh?: () => void
onOfflineReady?: () => void
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
onRegisterError?: (error: any) => void
}
export function registerSW(options?: RegisterSWOptions): (reloadPage?: boolean) => Promise<void>
}
declare module 'virtual:pwa-register/vue' {
// @ts-ignore ignore when vue is not installed
import type { Ref } from 'vue'
export type RegisterSWOptions = {
immediate?: boolean
onNeedRefresh?: () => void
onOfflineReady?: () => void
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
onRegisterError?: (error: any) => void
}
export function useRegisterSW(options?: RegisterSWOptions): {
needRefresh: Ref<boolean>
offlineReady: Ref<boolean>
updateServiceWorker: (reloadPage?: boolean) => Promise<void>
}
}
declare module 'virtual:pwa-register/svelte' {
// @ts-ignore ignore when svelte is not installed
import { Writable } from 'svelte/store'
export type RegisterSWOptions = {
immediate?: boolean
onNeedRefresh?: () => void
onOfflineReady?: () => void
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
onRegisterError?: (error: any) => void
}
export function useRegisterSW(options?: RegisterSWOptions): {
needRefresh: Writable<boolean>
offlineReady: Writable<boolean>
updateServiceWorker: (reloadPage?: boolean) => Promise<void>
}
}
declare module 'virtual:pwa-register/react' {
// @ts-ignore ignore when react is not installed
import { Dispatch, SetStateAction } from 'react'
export type RegisterSWOptions = {
immediate?: boolean
onNeedRefresh?: () => void
onOfflineReady?: () => void
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
onRegisterError?: (error: any) => void
}
export function useRegisterSW(options?: RegisterSWOptions): {
needRefresh: [boolean, Dispatch<SetStateAction<boolean>>]
offlineReady: [boolean, Dispatch<SetStateAction<boolean>>]
updateServiceWorker: (reloadPage?: boolean) => Promise<void>
}
}
declare module 'virtual:pwa-register/solid' {
// @ts-ignore ignore when solid-js is not installed
import { Accessor, Setter } from 'solid-js'
export type RegisterSWOptions = {
immediate?: boolean
onNeedRefresh?: () => void
onOfflineReady?: () => void
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
onRegisterError?: (error: any) => void
}
export function useRegisterSW(options?: RegisterSWOptions): {
needRefresh: [Accessor<boolean>, Setter<boolean>]
offlineReady: [Accessor<boolean>, Setter<boolean>]
updateServiceWorker: (reloadPage?: boolean) => Promise<void>
}
}
declare module 'virtual:pwa-register/preact' {
// @ts-ignore ignore when preact/hooks is not installed
import { StateUpdater } from 'preact/hooks'
export type RegisterSWOptions = {
immediate?: boolean
onNeedRefresh?: () => void
onOfflineReady?: () => void
onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void
onRegisterError?: (error: any) => void
}
export function useRegisterSW(options?: RegisterSWOptions): {
needRefresh: [boolean, StateUpdater<boolean>]
offlineReady: [boolean, StateUpdater<boolean>]
updateServiceWorker: (reloadPage?: boolean) => Promise<void>
}
}