0 | module Web.Internal.ServiceworkerTypes
11 | namespace ServiceWorkerState
14 | data ServiceWorkerState =
23 | Show ServiceWorkerState where
24 | show Parsed = "parsed"
25 | show Installing = "installing"
26 | show Installed = "installed"
27 | show Activating = "activating"
28 | show Activated = "activated"
29 | show Redundant = "redundant"
32 | Eq ServiceWorkerState where
33 | (==) = (==) `on` show
36 | Ord ServiceWorkerState where
37 | compare = compare `on` show
40 | read : String -> Maybe ServiceWorkerState
41 | read "parsed" = Just Parsed
42 | read "installing" = Just Installing
43 | read "installed" = Just Installed
44 | read "activating" = Just Activating
45 | read "activated" = Just Activated
46 | read "redundant" = Just Redundant
50 | ToFFI ServiceWorkerState String where
54 | FromFFI ServiceWorkerState String where
58 | namespace ServiceWorkerUpdateViaCache
61 | data ServiceWorkerUpdateViaCache = Imports | All | None
64 | Show ServiceWorkerUpdateViaCache where
65 | show Imports = "imports"
70 | Eq ServiceWorkerUpdateViaCache where
71 | (==) = (==) `on` show
74 | Ord ServiceWorkerUpdateViaCache where
75 | compare = compare `on` show
78 | read : String -> Maybe ServiceWorkerUpdateViaCache
79 | read "imports" = Just Imports
80 | read "all" = Just All
81 | read "none" = Just None
85 | ToFFI ServiceWorkerUpdateViaCache String where
89 | FromFFI ServiceWorkerUpdateViaCache String where
96 | data FrameType = Auxiliary | TopLevel | Nested | None
99 | Show FrameType where
100 | show Auxiliary = "auxiliary"
101 | show TopLevel = "top-level"
102 | show Nested = "nested"
107 | (==) = (==) `on` show
110 | Ord FrameType where
111 | compare = compare `on` show
114 | read : String -> Maybe FrameType
115 | read "auxiliary" = Just Auxiliary
116 | read "top-level" = Just TopLevel
117 | read "nested" = Just Nested
118 | read "none" = Just None
122 | ToFFI FrameType String where
126 | FromFFI FrameType String where
130 | namespace ClientType
133 | data ClientType = Window | Worker | Sharedworker | All
136 | Show ClientType where
137 | show Window = "window"
138 | show Worker = "worker"
139 | show Sharedworker = "sharedworker"
143 | Eq ClientType where
144 | (==) = (==) `on` show
147 | Ord ClientType where
148 | compare = compare `on` show
151 | read : String -> Maybe ClientType
152 | read "window" = Just Window
153 | read "worker" = Just Worker
154 | read "sharedworker" = Just Sharedworker
155 | read "all" = Just All
159 | ToFFI ClientType String where
163 | FromFFI ClientType String where
172 | export data Cache : Type where [external]
175 | ToFFI Cache Cache where toFFI = id
178 | FromFFI Cache Cache where fromFFI = Just
181 | SafeCast Cache where
182 | safeCast = unsafeCastOnPrototypeName "Cache"
184 | export data CacheStorage : Type where [external]
187 | ToFFI CacheStorage CacheStorage where toFFI = id
190 | FromFFI CacheStorage CacheStorage where fromFFI = Just
193 | SafeCast CacheStorage where
194 | safeCast = unsafeCastOnPrototypeName "CacheStorage"
196 | export data Client : Type where [external]
199 | ToFFI Client Client where toFFI = id
202 | FromFFI Client Client where fromFFI = Just
205 | SafeCast Client where
206 | safeCast = unsafeCastOnPrototypeName "Client"
208 | export data Clients : Type where [external]
211 | ToFFI Clients Clients where toFFI = id
214 | FromFFI Clients Clients where fromFFI = Just
217 | SafeCast Clients where
218 | safeCast = unsafeCastOnPrototypeName "Clients"
220 | export data ExtendableEvent : Type where [external]
223 | ToFFI ExtendableEvent ExtendableEvent where toFFI = id
226 | FromFFI ExtendableEvent ExtendableEvent where fromFFI = Just
229 | SafeCast ExtendableEvent where
230 | safeCast = unsafeCastOnPrototypeName "ExtendableEvent"
232 | export data ExtendableMessageEvent : Type where [external]
235 | ToFFI ExtendableMessageEvent ExtendableMessageEvent where toFFI = id
238 | FromFFI ExtendableMessageEvent ExtendableMessageEvent where fromFFI = Just
241 | SafeCast ExtendableMessageEvent where
242 | safeCast = unsafeCastOnPrototypeName "ExtendableMessageEvent"
244 | export data FetchEvent : Type where [external]
247 | ToFFI FetchEvent FetchEvent where toFFI = id
250 | FromFFI FetchEvent FetchEvent where fromFFI = Just
253 | SafeCast FetchEvent where
254 | safeCast = unsafeCastOnPrototypeName "FetchEvent"
256 | export data NavigationPreloadManager : Type where [external]
259 | ToFFI NavigationPreloadManager NavigationPreloadManager where toFFI = id
262 | FromFFI NavigationPreloadManager NavigationPreloadManager where fromFFI = Just
265 | SafeCast NavigationPreloadManager where
266 | safeCast = unsafeCastOnPrototypeName "NavigationPreloadManager"
268 | export data ServiceWorker : Type where [external]
271 | ToFFI ServiceWorker ServiceWorker where toFFI = id
274 | FromFFI ServiceWorker ServiceWorker where fromFFI = Just
277 | SafeCast ServiceWorker where
278 | safeCast = unsafeCastOnPrototypeName "ServiceWorker"
280 | export data ServiceWorkerContainer : Type where [external]
283 | ToFFI ServiceWorkerContainer ServiceWorkerContainer where toFFI = id
286 | FromFFI ServiceWorkerContainer ServiceWorkerContainer where fromFFI = Just
289 | SafeCast ServiceWorkerContainer where
290 | safeCast = unsafeCastOnPrototypeName "ServiceWorkerContainer"
292 | export data ServiceWorkerGlobalScope : Type where [external]
295 | ToFFI ServiceWorkerGlobalScope ServiceWorkerGlobalScope where toFFI = id
298 | FromFFI ServiceWorkerGlobalScope ServiceWorkerGlobalScope where fromFFI = Just
301 | SafeCast ServiceWorkerGlobalScope where
302 | safeCast = unsafeCastOnPrototypeName "ServiceWorkerGlobalScope"
304 | export data ServiceWorkerRegistration : Type where [external]
307 | ToFFI ServiceWorkerRegistration ServiceWorkerRegistration where toFFI = id
310 | FromFFI ServiceWorkerRegistration ServiceWorkerRegistration where fromFFI = Just
313 | SafeCast ServiceWorkerRegistration where
314 | safeCast = unsafeCastOnPrototypeName "ServiceWorkerRegistration"
316 | export data WindowClient : Type where [external]
319 | ToFFI WindowClient WindowClient where toFFI = id
322 | FromFFI WindowClient WindowClient where fromFFI = Just
325 | SafeCast WindowClient where
326 | safeCast = unsafeCastOnPrototypeName "WindowClient"
333 | export data CacheQueryOptions : Type where [external]
336 | ToFFI CacheQueryOptions CacheQueryOptions where toFFI = id
339 | FromFFI CacheQueryOptions CacheQueryOptions where fromFFI = Just
341 | export data ClientQueryOptions : Type where [external]
344 | ToFFI ClientQueryOptions ClientQueryOptions where toFFI = id
347 | FromFFI ClientQueryOptions ClientQueryOptions where fromFFI = Just
349 | export data ExtendableEventInit : Type where [external]
352 | ToFFI ExtendableEventInit ExtendableEventInit where toFFI = id
355 | FromFFI ExtendableEventInit ExtendableEventInit where fromFFI = Just
357 | export data ExtendableMessageEventInit : Type where [external]
360 | ToFFI ExtendableMessageEventInit ExtendableMessageEventInit where toFFI = id
363 | FromFFI ExtendableMessageEventInit ExtendableMessageEventInit where fromFFI = Just
365 | export data FetchEventInit : Type where [external]
368 | ToFFI FetchEventInit FetchEventInit where toFFI = id
371 | FromFFI FetchEventInit FetchEventInit where fromFFI = Just
373 | export data MultiCacheQueryOptions : Type where [external]
376 | ToFFI MultiCacheQueryOptions MultiCacheQueryOptions where toFFI = id
379 | FromFFI MultiCacheQueryOptions MultiCacheQueryOptions where fromFFI = Just
381 | export data NavigationPreloadState : Type where [external]
384 | ToFFI NavigationPreloadState NavigationPreloadState where toFFI = id
387 | FromFFI NavigationPreloadState NavigationPreloadState where fromFFI = Just
389 | export data RegistrationOptions : Type where [external]
392 | ToFFI RegistrationOptions RegistrationOptions where toFFI = id
395 | FromFFI RegistrationOptions RegistrationOptions where fromFFI = Just