serwist 9.0.0-preview.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/NavigationRoute.d.ts +57 -0
  4. package/dist/NavigationRoute.d.ts.map +1 -0
  5. package/dist/PrecacheRoute.d.ts +17 -0
  6. package/dist/PrecacheRoute.d.ts.map +1 -0
  7. package/dist/PrecacheStrategy.d.ts +66 -0
  8. package/dist/PrecacheStrategy.d.ts.map +1 -0
  9. package/dist/RegExpRoute.d.ts +24 -0
  10. package/dist/RegExpRoute.d.ts.map +1 -0
  11. package/dist/Route.d.ts +33 -0
  12. package/dist/Route.d.ts.map +1 -0
  13. package/dist/Serwist.d.ts +331 -0
  14. package/dist/Serwist.d.ts.map +1 -0
  15. package/dist/cacheNames.d.ts +20 -0
  16. package/dist/cacheNames.d.ts.map +1 -0
  17. package/dist/chunks/NetworkOnly.js +599 -0
  18. package/dist/chunks/PrecacheFallbackPlugin.js +634 -0
  19. package/dist/chunks/Serwist.js +1034 -0
  20. package/dist/chunks/registerQuotaErrorCallback.js +17 -0
  21. package/dist/chunks/resultingClientExists.js +32 -0
  22. package/dist/chunks/timeout.js +400 -0
  23. package/dist/chunks/waitUntil.js +24 -0
  24. package/dist/cleanupOutdatedCaches.d.ts +6 -0
  25. package/dist/cleanupOutdatedCaches.d.ts.map +1 -0
  26. package/dist/clientsClaim.d.ts +6 -0
  27. package/dist/clientsClaim.d.ts.map +1 -0
  28. package/dist/constants.d.ts +15 -0
  29. package/dist/constants.d.ts.map +1 -0
  30. package/dist/copyResponse.d.ts +20 -0
  31. package/dist/copyResponse.d.ts.map +1 -0
  32. package/dist/disableDevLogs.d.ts +7 -0
  33. package/dist/disableDevLogs.d.ts.map +1 -0
  34. package/dist/index.d.ts +21 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.internal.d.ts +16 -0
  37. package/dist/index.internal.d.ts.map +1 -0
  38. package/dist/index.internal.js +24 -0
  39. package/dist/index.js +27 -0
  40. package/dist/index.legacy.d.ts +32 -0
  41. package/dist/index.legacy.d.ts.map +1 -0
  42. package/dist/index.legacy.js +640 -0
  43. package/dist/index.plugins.d.ts +41 -0
  44. package/dist/index.plugins.d.ts.map +1 -0
  45. package/dist/index.plugins.js +669 -0
  46. package/dist/index.strategies.d.ts +22 -0
  47. package/dist/index.strategies.d.ts.map +1 -0
  48. package/dist/index.strategies.js +144 -0
  49. package/dist/legacy/PrecacheController.d.ts +146 -0
  50. package/dist/legacy/PrecacheController.d.ts.map +1 -0
  51. package/dist/legacy/PrecacheFallbackPlugin.d.ts +62 -0
  52. package/dist/legacy/PrecacheFallbackPlugin.d.ts.map +1 -0
  53. package/dist/legacy/PrecacheRoute.d.ts +19 -0
  54. package/dist/legacy/PrecacheRoute.d.ts.map +1 -0
  55. package/dist/legacy/Router.d.ts +151 -0
  56. package/dist/legacy/Router.d.ts.map +1 -0
  57. package/dist/legacy/addPlugins.d.ts +9 -0
  58. package/dist/legacy/addPlugins.d.ts.map +1 -0
  59. package/dist/legacy/addRoute.d.ts +16 -0
  60. package/dist/legacy/addRoute.d.ts.map +1 -0
  61. package/dist/legacy/createHandlerBoundToURL.d.ts +18 -0
  62. package/dist/legacy/createHandlerBoundToURL.d.ts.map +1 -0
  63. package/dist/legacy/fallbacks.d.ts +59 -0
  64. package/dist/legacy/fallbacks.d.ts.map +1 -0
  65. package/dist/legacy/getCacheKeyForURL.d.ts +20 -0
  66. package/dist/legacy/getCacheKeyForURL.d.ts.map +1 -0
  67. package/dist/legacy/handlePrecaching.d.ts +54 -0
  68. package/dist/legacy/handlePrecaching.d.ts.map +1 -0
  69. package/dist/legacy/installSerwist.d.ts +15 -0
  70. package/dist/legacy/installSerwist.d.ts.map +1 -0
  71. package/dist/legacy/matchPrecache.d.ts +15 -0
  72. package/dist/legacy/matchPrecache.d.ts.map +1 -0
  73. package/dist/legacy/precache.d.ts +20 -0
  74. package/dist/legacy/precache.d.ts.map +1 -0
  75. package/dist/legacy/precacheAndRoute.d.ts +15 -0
  76. package/dist/legacy/precacheAndRoute.d.ts.map +1 -0
  77. package/dist/legacy/registerRoute.d.ts +16 -0
  78. package/dist/legacy/registerRoute.d.ts.map +1 -0
  79. package/dist/legacy/registerRuntimeCaching.d.ts +11 -0
  80. package/dist/legacy/registerRuntimeCaching.d.ts.map +1 -0
  81. package/dist/legacy/setCatchHandler.d.ts +10 -0
  82. package/dist/legacy/setCatchHandler.d.ts.map +1 -0
  83. package/dist/legacy/setDefaultHandler.d.ts +13 -0
  84. package/dist/legacy/setDefaultHandler.d.ts.map +1 -0
  85. package/dist/legacy/singletonPrecacheController.d.ts +34 -0
  86. package/dist/legacy/singletonPrecacheController.d.ts.map +1 -0
  87. package/dist/legacy/singletonRouter.d.ts +41 -0
  88. package/dist/legacy/singletonRouter.d.ts.map +1 -0
  89. package/dist/legacy/unregisterRoute.d.ts +9 -0
  90. package/dist/legacy/unregisterRoute.d.ts.map +1 -0
  91. package/dist/legacy/utils/PrecacheCacheKeyPlugin.d.ts +16 -0
  92. package/dist/legacy/utils/PrecacheCacheKeyPlugin.d.ts.map +1 -0
  93. package/dist/legacy/utils/getCacheKeyForURL.d.ts +14 -0
  94. package/dist/legacy/utils/getCacheKeyForURL.d.ts.map +1 -0
  95. package/dist/models/messages/messageGenerator.d.ts +4 -0
  96. package/dist/models/messages/messageGenerator.d.ts.map +1 -0
  97. package/dist/models/messages/messages.d.ts +44 -0
  98. package/dist/models/messages/messages.d.ts.map +1 -0
  99. package/dist/models/pluginEvents.d.ts +10 -0
  100. package/dist/models/pluginEvents.d.ts.map +1 -0
  101. package/dist/models/quotaErrorCallbacks.d.ts +3 -0
  102. package/dist/models/quotaErrorCallbacks.d.ts.map +1 -0
  103. package/dist/navigationPreload.d.ts +24 -0
  104. package/dist/navigationPreload.d.ts.map +1 -0
  105. package/dist/parseRoute.d.ts +16 -0
  106. package/dist/parseRoute.d.ts.map +1 -0
  107. package/dist/plugins/backgroundSync/BackgroundSyncPlugin.d.ts +23 -0
  108. package/dist/plugins/backgroundSync/BackgroundSyncPlugin.d.ts.map +1 -0
  109. package/dist/plugins/backgroundSync/Queue.d.ts +166 -0
  110. package/dist/plugins/backgroundSync/Queue.d.ts.map +1 -0
  111. package/dist/plugins/backgroundSync/QueueDb.d.ts +90 -0
  112. package/dist/plugins/backgroundSync/QueueDb.d.ts.map +1 -0
  113. package/dist/plugins/backgroundSync/QueueStore.d.ts +75 -0
  114. package/dist/plugins/backgroundSync/QueueStore.d.ts.map +1 -0
  115. package/dist/plugins/backgroundSync/StorableRequest.d.ts +51 -0
  116. package/dist/plugins/backgroundSync/StorableRequest.d.ts.map +1 -0
  117. package/dist/plugins/broadcastUpdate/BroadcastCacheUpdate.d.ts +45 -0
  118. package/dist/plugins/broadcastUpdate/BroadcastCacheUpdate.d.ts.map +1 -0
  119. package/dist/plugins/broadcastUpdate/BroadcastUpdatePlugin.d.ts +27 -0
  120. package/dist/plugins/broadcastUpdate/BroadcastUpdatePlugin.d.ts.map +1 -0
  121. package/dist/plugins/broadcastUpdate/constants.d.ts +5 -0
  122. package/dist/plugins/broadcastUpdate/constants.d.ts.map +1 -0
  123. package/dist/plugins/broadcastUpdate/responsesAreSame.d.ts +11 -0
  124. package/dist/plugins/broadcastUpdate/responsesAreSame.d.ts.map +1 -0
  125. package/dist/plugins/broadcastUpdate/types.d.ts +34 -0
  126. package/dist/plugins/broadcastUpdate/types.d.ts.map +1 -0
  127. package/dist/plugins/cacheableResponse/CacheableResponse.d.ts +40 -0
  128. package/dist/plugins/cacheableResponse/CacheableResponse.d.ts.map +1 -0
  129. package/dist/plugins/cacheableResponse/CacheableResponsePlugin.d.ts +27 -0
  130. package/dist/plugins/cacheableResponse/CacheableResponsePlugin.d.ts.map +1 -0
  131. package/dist/plugins/expiration/CacheExpiration.d.ts +66 -0
  132. package/dist/plugins/expiration/CacheExpiration.d.ts.map +1 -0
  133. package/dist/plugins/expiration/ExpirationPlugin.d.ts +116 -0
  134. package/dist/plugins/expiration/ExpirationPlugin.d.ts.map +1 -0
  135. package/dist/plugins/expiration/models/CacheTimestampsModel.d.ts +73 -0
  136. package/dist/plugins/expiration/models/CacheTimestampsModel.d.ts.map +1 -0
  137. package/dist/plugins/googleAnalytics/constants.d.ts +10 -0
  138. package/dist/plugins/googleAnalytics/constants.d.ts.map +1 -0
  139. package/dist/plugins/googleAnalytics/initialize.d.ts +30 -0
  140. package/dist/plugins/googleAnalytics/initialize.d.ts.map +1 -0
  141. package/dist/plugins/precaching/PrecacheFallbackPlugin.d.ts +53 -0
  142. package/dist/plugins/precaching/PrecacheFallbackPlugin.d.ts.map +1 -0
  143. package/dist/plugins/rangeRequests/RangeRequestsPlugin.d.ts +19 -0
  144. package/dist/plugins/rangeRequests/RangeRequestsPlugin.d.ts.map +1 -0
  145. package/dist/plugins/rangeRequests/createPartialResponse.d.ts +18 -0
  146. package/dist/plugins/rangeRequests/createPartialResponse.d.ts.map +1 -0
  147. package/dist/plugins/rangeRequests/utils/calculateEffectiveBoundaries.d.ts +14 -0
  148. package/dist/plugins/rangeRequests/utils/calculateEffectiveBoundaries.d.ts.map +1 -0
  149. package/dist/plugins/rangeRequests/utils/parseRangeHeader.d.ts +12 -0
  150. package/dist/plugins/rangeRequests/utils/parseRangeHeader.d.ts.map +1 -0
  151. package/dist/registerQuotaErrorCallback.d.ts +8 -0
  152. package/dist/registerQuotaErrorCallback.d.ts.map +1 -0
  153. package/dist/setCacheNameDetails.d.ts +9 -0
  154. package/dist/setCacheNameDetails.d.ts.map +1 -0
  155. package/dist/strategies/CacheFirst.d.ts +23 -0
  156. package/dist/strategies/CacheFirst.d.ts.map +1 -0
  157. package/dist/strategies/CacheOnly.d.ts +20 -0
  158. package/dist/strategies/CacheOnly.d.ts.map +1 -0
  159. package/dist/strategies/NetworkFirst.d.ts +61 -0
  160. package/dist/strategies/NetworkFirst.d.ts.map +1 -0
  161. package/dist/strategies/NetworkOnly.d.ts +32 -0
  162. package/dist/strategies/NetworkOnly.d.ts.map +1 -0
  163. package/dist/strategies/StaleWhileRevalidate.d.ts +35 -0
  164. package/dist/strategies/StaleWhileRevalidate.d.ts.map +1 -0
  165. package/dist/strategies/Strategy.d.ts +83 -0
  166. package/dist/strategies/Strategy.d.ts.map +1 -0
  167. package/dist/strategies/StrategyHandler.d.ts +189 -0
  168. package/dist/strategies/StrategyHandler.d.ts.map +1 -0
  169. package/dist/strategies/plugins/cacheOkAndOpaquePlugin.d.ts +3 -0
  170. package/dist/strategies/plugins/cacheOkAndOpaquePlugin.d.ts.map +1 -0
  171. package/dist/strategies/utils/messages.d.ts +5 -0
  172. package/dist/strategies/utils/messages.d.ts.map +1 -0
  173. package/dist/types.d.ts +317 -0
  174. package/dist/types.d.ts.map +1 -0
  175. package/dist/utils/Deferred.d.ts +19 -0
  176. package/dist/utils/Deferred.d.ts.map +1 -0
  177. package/dist/utils/PrecacheCacheKeyPlugin.d.ts +16 -0
  178. package/dist/utils/PrecacheCacheKeyPlugin.d.ts.map +1 -0
  179. package/dist/utils/PrecacheInstallReportPlugin.d.ts +14 -0
  180. package/dist/utils/PrecacheInstallReportPlugin.d.ts.map +1 -0
  181. package/dist/utils/SerwistError.d.ts +24 -0
  182. package/dist/utils/SerwistError.d.ts.map +1 -0
  183. package/dist/utils/assert.d.ts +11 -0
  184. package/dist/utils/assert.d.ts.map +1 -0
  185. package/dist/utils/cacheMatchIgnoreParams.d.ts +15 -0
  186. package/dist/utils/cacheMatchIgnoreParams.d.ts.map +1 -0
  187. package/dist/utils/cacheNames.d.ts +40 -0
  188. package/dist/utils/cacheNames.d.ts.map +1 -0
  189. package/dist/utils/canConstructReadableStream.d.ts +12 -0
  190. package/dist/utils/canConstructReadableStream.d.ts.map +1 -0
  191. package/dist/utils/canConstructResponseFromBodyStream.d.ts +11 -0
  192. package/dist/utils/canConstructResponseFromBodyStream.d.ts.map +1 -0
  193. package/dist/utils/createCacheKey.d.ts +16 -0
  194. package/dist/utils/createCacheKey.d.ts.map +1 -0
  195. package/dist/utils/deleteOutdatedCaches.d.ts +18 -0
  196. package/dist/utils/deleteOutdatedCaches.d.ts.map +1 -0
  197. package/dist/utils/dontWaitFor.d.ts +7 -0
  198. package/dist/utils/dontWaitFor.d.ts.map +1 -0
  199. package/dist/utils/executeQuotaErrorCallbacks.d.ts +8 -0
  200. package/dist/utils/executeQuotaErrorCallbacks.d.ts.map +1 -0
  201. package/dist/utils/generateURLVariations.d.ts +12 -0
  202. package/dist/utils/generateURLVariations.d.ts.map +1 -0
  203. package/dist/utils/getFriendlyURL.d.ts +3 -0
  204. package/dist/utils/getFriendlyURL.d.ts.map +1 -0
  205. package/dist/utils/logger.d.ts +24 -0
  206. package/dist/utils/logger.d.ts.map +1 -0
  207. package/dist/utils/normalizeHandler.d.ts +10 -0
  208. package/dist/utils/normalizeHandler.d.ts.map +1 -0
  209. package/dist/utils/pluginUtils.d.ts +5 -0
  210. package/dist/utils/pluginUtils.d.ts.map +1 -0
  211. package/dist/utils/printCleanupDetails.d.ts +6 -0
  212. package/dist/utils/printCleanupDetails.d.ts.map +1 -0
  213. package/dist/utils/printInstallDetails.d.ts +7 -0
  214. package/dist/utils/printInstallDetails.d.ts.map +1 -0
  215. package/dist/utils/removeIgnoredSearchParams.d.ts +12 -0
  216. package/dist/utils/removeIgnoredSearchParams.d.ts.map +1 -0
  217. package/dist/utils/resultingClientExists.d.ts +12 -0
  218. package/dist/utils/resultingClientExists.d.ts.map +1 -0
  219. package/dist/utils/timeout.d.ts +10 -0
  220. package/dist/utils/timeout.d.ts.map +1 -0
  221. package/dist/utils/waitUntil.d.ts +11 -0
  222. package/dist/utils/waitUntil.d.ts.map +1 -0
  223. package/dist/utils/welcome.d.ts +2 -0
  224. package/dist/utils/welcome.d.ts.map +1 -0
  225. package/package.json +85 -0
  226. package/src/NavigationRoute.ts +119 -0
  227. package/src/PrecacheRoute.ts +46 -0
  228. package/src/PrecacheStrategy.ts +239 -0
  229. package/src/RegExpRoute.ts +74 -0
  230. package/src/Route.ts +67 -0
  231. package/src/Serwist.ts +920 -0
  232. package/src/cacheNames.ts +39 -0
  233. package/src/cleanupOutdatedCaches.ts +32 -0
  234. package/src/clientsClaim.ts +18 -0
  235. package/src/constants.ts +24 -0
  236. package/src/copyResponse.ts +60 -0
  237. package/src/disableDevLogs.ts +10 -0
  238. package/src/index.internal.ts +33 -0
  239. package/src/index.legacy.ts +66 -0
  240. package/src/index.plugins.ts +95 -0
  241. package/src/index.strategies.ts +26 -0
  242. package/src/index.ts +39 -0
  243. package/src/legacy/PrecacheController.ts +337 -0
  244. package/src/legacy/PrecacheFallbackPlugin.ts +93 -0
  245. package/src/legacy/PrecacheRoute.ts +48 -0
  246. package/src/legacy/Router.ts +484 -0
  247. package/src/legacy/addPlugins.ts +21 -0
  248. package/src/legacy/addRoute.ts +29 -0
  249. package/src/legacy/createHandlerBoundToURL.ts +30 -0
  250. package/src/legacy/fallbacks.ts +94 -0
  251. package/src/legacy/getCacheKeyForURL.ts +32 -0
  252. package/src/legacy/handlePrecaching.ts +86 -0
  253. package/src/legacy/installSerwist.ts +19 -0
  254. package/src/legacy/matchPrecache.ts +26 -0
  255. package/src/legacy/precache.ts +31 -0
  256. package/src/legacy/precacheAndRoute.ts +28 -0
  257. package/src/legacy/registerRoute.ts +27 -0
  258. package/src/legacy/registerRuntimeCaching.ts +17 -0
  259. package/src/legacy/setCatchHandler.ts +21 -0
  260. package/src/legacy/setDefaultHandler.ts +24 -0
  261. package/src/legacy/singletonPrecacheController.ts +53 -0
  262. package/src/legacy/singletonRouter.ts +70 -0
  263. package/src/legacy/unregisterRoute.ts +12 -0
  264. package/src/legacy/utils/PrecacheCacheKeyPlugin.ts +33 -0
  265. package/src/legacy/utils/getCacheKeyForURL.ts +36 -0
  266. package/src/models/messages/messageGenerator.ts +29 -0
  267. package/src/models/messages/messages.ts +233 -0
  268. package/src/models/pluginEvents.ts +17 -0
  269. package/src/models/quotaErrorCallbacks.ts +13 -0
  270. package/src/navigationPreload.ts +68 -0
  271. package/src/parseRoute.ts +78 -0
  272. package/src/plugins/backgroundSync/BackgroundSyncPlugin.ts +38 -0
  273. package/src/plugins/backgroundSync/Queue.ts +440 -0
  274. package/src/plugins/backgroundSync/QueueDb.ts +176 -0
  275. package/src/plugins/backgroundSync/QueueStore.ts +160 -0
  276. package/src/plugins/backgroundSync/StorableRequest.ts +142 -0
  277. package/src/plugins/broadcastUpdate/BroadcastCacheUpdate.ts +161 -0
  278. package/src/plugins/broadcastUpdate/BroadcastUpdatePlugin.ts +42 -0
  279. package/src/plugins/broadcastUpdate/constants.ts +12 -0
  280. package/src/plugins/broadcastUpdate/responsesAreSame.ts +49 -0
  281. package/src/plugins/broadcastUpdate/types.ts +37 -0
  282. package/src/plugins/cacheableResponse/CacheableResponse.ts +144 -0
  283. package/src/plugins/cacheableResponse/CacheableResponsePlugin.ts +45 -0
  284. package/src/plugins/expiration/CacheExpiration.ts +193 -0
  285. package/src/plugins/expiration/ExpirationPlugin.ts +300 -0
  286. package/src/plugins/expiration/models/CacheTimestampsModel.ts +184 -0
  287. package/src/plugins/googleAnalytics/constants.ts +22 -0
  288. package/src/plugins/googleAnalytics/initialize.ts +209 -0
  289. package/src/plugins/precaching/PrecacheFallbackPlugin.ts +83 -0
  290. package/src/plugins/rangeRequests/RangeRequestsPlugin.ts +38 -0
  291. package/src/plugins/rangeRequests/createPartialResponse.ts +93 -0
  292. package/src/plugins/rangeRequests/utils/calculateEffectiveBoundaries.ts +59 -0
  293. package/src/plugins/rangeRequests/utils/parseRangeHeader.ts +55 -0
  294. package/src/registerQuotaErrorCallback.ts +34 -0
  295. package/src/setCacheNameDetails.ts +53 -0
  296. package/src/strategies/CacheFirst.ts +88 -0
  297. package/src/strategies/CacheOnly.ts +59 -0
  298. package/src/strategies/NetworkFirst.ts +229 -0
  299. package/src/strategies/NetworkOnly.ts +98 -0
  300. package/src/strategies/StaleWhileRevalidate.ts +110 -0
  301. package/src/strategies/Strategy.ts +204 -0
  302. package/src/strategies/StrategyHandler.ts +554 -0
  303. package/src/strategies/plugins/cacheOkAndOpaquePlugin.ts +26 -0
  304. package/src/strategies/utils/messages.ts +21 -0
  305. package/src/types.ts +358 -0
  306. package/src/utils/Deferred.ts +33 -0
  307. package/src/utils/PrecacheCacheKeyPlugin.ts +33 -0
  308. package/src/utils/PrecacheInstallReportPlugin.ts +47 -0
  309. package/src/utils/SerwistError.ts +41 -0
  310. package/src/utils/assert.ts +89 -0
  311. package/src/utils/cacheMatchIgnoreParams.ts +54 -0
  312. package/src/utils/cacheNames.ts +87 -0
  313. package/src/utils/canConstructReadableStream.ts +34 -0
  314. package/src/utils/canConstructResponseFromBodyStream.ts +37 -0
  315. package/src/utils/createCacheKey.ts +68 -0
  316. package/src/utils/deleteOutdatedCaches.ts +40 -0
  317. package/src/utils/dontWaitFor.ts +16 -0
  318. package/src/utils/executeQuotaErrorCallbacks.ts +33 -0
  319. package/src/utils/generateURLVariations.ts +55 -0
  320. package/src/utils/getFriendlyURL.ts +16 -0
  321. package/src/utils/logger.ts +95 -0
  322. package/src/utils/normalizeHandler.ts +40 -0
  323. package/src/utils/pluginUtils.ts +15 -0
  324. package/src/utils/printCleanupDetails.ts +38 -0
  325. package/src/utils/printInstallDetails.ts +53 -0
  326. package/src/utils/removeIgnoredSearchParams.ts +29 -0
  327. package/src/utils/resultingClientExists.ts +58 -0
  328. package/src/utils/timeout.ts +19 -0
  329. package/src/utils/waitUntil.ts +21 -0
  330. package/src/utils/welcome.ts +19 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Takes in a URL, and returns the corresponding URL that could be used to
3
+ * lookup the entry in the precache.
4
+ *
5
+ * If a relative URL is provided, the location of the service worker file will
6
+ * be used as the base.
7
+ *
8
+ * For precached entries without revision information, the cache key will be the
9
+ * same as the original URL.
10
+ *
11
+ * For precached entries with revision information, the cache key will be the
12
+ * original URL with the addition of a query parameter used for keeping track of
13
+ * the revision info.
14
+ *
15
+ * @param url The URL whose cache key to look up.
16
+ * @returns The cache key that corresponds to that URL.
17
+ * @deprecated
18
+ */
19
+ export declare const getCacheKeyForURL: (url: string) => string | undefined;
20
+ //# sourceMappingURL=getCacheKeyForURL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCacheKeyForURL.d.ts","sourceRoot":"","sources":["../../src/legacy/getCacheKeyForURL.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB,QAAS,MAAM,KAAG,MAAM,GAAG,SAGxD,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { PrecacheEntry, PrecacheRouteOptions } from "../types.js";
2
+ import type { PrecacheController } from "./PrecacheController.js";
3
+ import type { Router } from "./Router.js";
4
+ /**
5
+ * @deprecated
6
+ */
7
+ export interface HandlePrecachingOptions {
8
+ /**
9
+ * An optional `PrecacheController` instance. If not provided, the singleton
10
+ * `PrecacheController` will be used.
11
+ */
12
+ precacheController?: PrecacheController;
13
+ /**
14
+ * An optional `Router` instance. If not provided, the singleton `Router`
15
+ * will be used.
16
+ */
17
+ router?: Router;
18
+ /**
19
+ * A list of URLs that should be cached.
20
+ */
21
+ precacheEntries?: (PrecacheEntry | string)[];
22
+ /**
23
+ * Options to customize how Serwist precaches the URLs.
24
+ */
25
+ precacheOptions?: PrecacheRouteOptions;
26
+ /**
27
+ * Whether outdated caches should be removed.
28
+ *
29
+ * @default false
30
+ */
31
+ cleanupOutdatedCaches?: boolean;
32
+ /**
33
+ * An URL that should point to a HTML file with which navigation requests for URLs that aren't
34
+ * precached will be fulfilled.
35
+ */
36
+ navigateFallback?: string;
37
+ /**
38
+ * URLs that should be allowed to use the `navigateFallback` handler.
39
+ */
40
+ navigateFallbackAllowlist?: RegExp[];
41
+ /**
42
+ * URLs that should not be allowed to use the `navigateFallback` handler. This takes precedence
43
+ * over `navigateFallbackAllowlist`.
44
+ */
45
+ navigateFallbackDenylist?: RegExp[];
46
+ }
47
+ /**
48
+ * Handles a list of precache entries and cleans up outdated caches.
49
+ *
50
+ * @param options
51
+ * @deprecated
52
+ */
53
+ export declare const handlePrecaching: ({ precacheController, router, precacheEntries, precacheOptions, cleanupOutdatedCaches, navigateFallback, navigateFallbackAllowlist, navigateFallbackDenylist, }: HandlePrecachingOptions) => void;
54
+ //# sourceMappingURL=handlePrecaching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handlePrecaching.d.ts","sourceRoot":"","sources":["../../src/legacy/handlePrecaching.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAK1C;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7C;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;IACrC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,oKAS1B,uBAAuB,KAAG,IAgB5B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type SerwistOptions } from "../Serwist.js";
2
+ /**
3
+ * Options for `installSerwist`.
4
+ *
5
+ * @deprecated
6
+ */
7
+ export type InstallSerwistOptions = SerwistOptions;
8
+ /**
9
+ * Abstracts away the core APIs of Serwist.
10
+ *
11
+ * @param options - `installSerwist` options.
12
+ * @deprecated
13
+ */
14
+ export declare const installSerwist: (options: InstallSerwistOptions) => void;
15
+ //# sourceMappingURL=installSerwist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installSerwist.d.ts","sourceRoot":"","sources":["../../src/legacy/installSerwist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,YAAa,qBAAqB,KAAG,IAG/D,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Helper function that calls `PrecacheController#matchPrecache`
3
+ * on the default `PrecacheController` instance.
4
+ *
5
+ * If you are creating your own `PrecacheController`, then call
6
+ * `PrecacheController#matchPrecache` on that instance,
7
+ * instead of using this function.
8
+ *
9
+ * @param request The key (without revisioning parameters)
10
+ * to look up in the precache.
11
+ * @returns
12
+ * @deprecated
13
+ */
14
+ export declare const matchPrecache: (request: string | Request) => Promise<Response | undefined>;
15
+ //# sourceMappingURL=matchPrecache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchPrecache.d.ts","sourceRoot":"","sources":["../../src/legacy/matchPrecache.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,YAAa,MAAM,GAAG,OAAO,KAAG,QAAQ,QAAQ,GAAG,SAAS,CAErF,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { PrecacheEntry } from "../types.js";
2
+ /**
3
+ * Adds items to the precache list, removing any duplicates and
4
+ * stores the files in the precache cache when the service
5
+ * worker installs.
6
+ *
7
+ * This method can be called multiple times.
8
+ *
9
+ * Please note: This method **will not** serve any of the cached files for you.
10
+ * It only precaches files. To respond to a network request you call
11
+ * `serwist/legacy.addRoute`.
12
+ *
13
+ * If you have a single array of files to precache, you can just call
14
+ * `serwist/legacy.precacheAndRoute`.
15
+ *
16
+ * @param entries Array of entries to precache.
17
+ * @deprecated
18
+ */
19
+ export declare const precache: (entries: (PrecacheEntry | string)[]) => void;
20
+ //# sourceMappingURL=precache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"precache.d.ts","sourceRoot":"","sources":["../../src/legacy/precache.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,YAAa,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,KAAG,IAE9D,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { PrecacheEntry, PrecacheRouteOptions } from "../types.js";
2
+ /**
3
+ * This method will add entries to the precache list and add a route to
4
+ * respond to fetch events.
5
+ *
6
+ * This is a convenience method that will call
7
+ * `serwist/legacy.precache` and
8
+ * `serwist/legacy.addRoute` in a single call.
9
+ *
10
+ * @param entries Array of entries to precache.
11
+ * @param options See the `serwist.PrecacheRouteOptions` options.
12
+ * @deprecated
13
+ */
14
+ export declare const precacheAndRoute: (entries: (PrecacheEntry | string)[], options?: PrecacheRouteOptions) => void;
15
+ //# sourceMappingURL=precacheAndRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"precacheAndRoute.d.ts","sourceRoot":"","sources":["../../src/legacy/precacheAndRoute.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAIvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,YAAa,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,YAAY,oBAAoB,KAAG,IAGtG,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { RouteHandler, RouteMatchCallback } from "../types.js";
2
+ import type { Route } from "../Route.js";
3
+ import type { HTTPMethod } from "../constants.js";
4
+ /**
5
+ * Registers a `RegExp`, string, or function with a caching
6
+ * strategy to a singleton `Router` instance.
7
+ *
8
+ * @param capture If the capture param is a `Route`, all other arguments will be ignored.
9
+ * @param handler A callback function that returns a `Promise` resulting in a `Response`.
10
+ * This parameter is required if `capture` is not a `Route` object.
11
+ * @param method The HTTP method to match the `Route` against. Defaults to `'GET'`.
12
+ * @returns The generated `Route`, which can then be provided to `unregisterRoute` if needed.
13
+ * @deprecated
14
+ */
15
+ export declare const registerRoute: (capture: RegExp | string | RouteMatchCallback | Route, handler?: RouteHandler, method?: HTTPMethod) => Route;
16
+ //# sourceMappingURL=registerRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerRoute.d.ts","sourceRoot":"","sources":["../../src/legacy/registerRoute.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,YAAa,MAAM,GAAG,MAAM,GAAG,kBAAkB,GAAG,KAAK,YAAY,YAAY,WAAW,UAAU,KAAG,KAElI,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { RuntimeCaching } from "../types.js";
2
+ /**
3
+ * Registers caching strategies to a singleton Router instance. It is a simple
4
+ * syntatic sugar for `serwist/legacy.registerRoute`.
5
+ *
6
+ * @param runtimeCachingList
7
+ * @returns
8
+ * @deprecated
9
+ */
10
+ export declare const registerRuntimeCaching: (...runtimeCachingList: RuntimeCaching[]) => void;
11
+ //# sourceMappingURL=registerRuntimeCaching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerRuntimeCaching.d.ts","sourceRoot":"","sources":["../../src/legacy/registerRuntimeCaching.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,0BAA2B,cAAc,EAAE,KAAG,IAIhF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { RouteHandler } from "../types.js";
2
+ /**
3
+ * If a `Route` throws an error while handling a request, this `handler`
4
+ * will be called and given a chance to provide a response.
5
+ *
6
+ * @param handler A callback function that returns a Promise resulting in a Response.
7
+ * @deprecated
8
+ */
9
+ export declare const setCatchHandler: (handler: RouteHandler) => void;
10
+ //# sourceMappingURL=setCatchHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setCatchHandler.d.ts","sourceRoot":"","sources":["../../src/legacy/setCatchHandler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,YAAa,YAAY,KAAG,IAEvD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { RouteHandler } from "../types.js";
2
+ /**
3
+ * Defines a default `handler` that's called when no routes explicitly
4
+ * match the incoming request.
5
+ *
6
+ * Without a default `handler`, unmatched requests will go against the
7
+ * network as if there were no service worker present.
8
+ *
9
+ * @param handler A callback function that returns a Promise resulting in a Response.
10
+ * @deprecated
11
+ */
12
+ export declare const setDefaultHandler: (handler: RouteHandler) => void;
13
+ //# sourceMappingURL=setDefaultHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setDefaultHandler.d.ts","sourceRoot":"","sources":["../../src/legacy/setDefaultHandler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,YAAa,YAAY,KAAG,IAEzD,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { PrecacheController } from "./PrecacheController.js";
2
+ /**
3
+ * Creates a new, singleton `PrecacheController` if one does not exist. If one does
4
+ * already exist, that instance is returned. This instance is used by Serwist's
5
+ * `PrecacheController`-dependent functions and classes unless you provide a different
6
+ * `Router` to them.
7
+ *
8
+ * @returns The singleton `PrecacheController`.
9
+ * @deprecated
10
+ */
11
+ export declare const getSingletonPrecacheController: () => PrecacheController;
12
+ /**
13
+ * Changes the singleton `PrecacheController` to a different instance. This is meant for when you do not
14
+ * want to pass your own `PrecacheController` to every one of Serwist's `PrecacheController`-dependent
15
+ * functions and classes.
16
+ *
17
+ * It is highly recommended that you call this before anything else, if you plan on doing so.
18
+ *
19
+ * @example
20
+ * ```js
21
+ * import { PrecacheController, setSingletonPrecacheController } from "serwist/legacy";
22
+ *
23
+ * const controller = new PrecacheController();
24
+ *
25
+ * setSingletonPrecacheController(controller);
26
+ *
27
+ * // Do something with your controller...
28
+ * ```
29
+ * @param router
30
+ * @returns The new singleton `PrecacheController`.
31
+ * @deprecated
32
+ */
33
+ export declare const setSingletonPrecacheController: (precacheController: PrecacheController) => PrecacheController;
34
+ //# sourceMappingURL=singletonPrecacheController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singletonPrecacheController.d.ts","sourceRoot":"","sources":["../../src/legacy/singletonPrecacheController.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,QAAO,kBAKjD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,8BAA8B,uBAAwB,kBAAkB,KAAG,kBAGvF,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { Router } from "./Router.js";
2
+ /**
3
+ * Creates a new, singleton `Router` if one does not exist. If one does
4
+ * already exist, that instance is returned. This instance is used by
5
+ * Serwist's `Router`-dependent functions and classes unless you provide
6
+ * a different `Router` to them.
7
+ *
8
+ * @returns The singleton `Router`.
9
+ * @deprecated
10
+ */
11
+ export declare const getSingletonRouter: () => Router;
12
+ /**
13
+ * Changes the singleton `Router` to a different instance. This is meant for when you do not
14
+ * want to pass your own `Router` to every one of Serwist's `Router`-dependent functions and classes.
15
+ * If this or `getSingletonRouter` has been called before, it removes the listeners of the
16
+ * previous singleton `Router`. It also adds those of the new one, so you need not do that yourself.
17
+ *
18
+ * It is highly recommended that you call this before anything else, if you plan on doing so.
19
+ *
20
+ * @example
21
+ * ```js
22
+ * import { Router, setSingletonRouter } from "serwist/legacy";
23
+ *
24
+ * const router = new Router();
25
+ *
26
+ * setSingletonRouter(router);
27
+ *
28
+ * router.registerRoute(
29
+ * new Route(
30
+ * /\/api\/.*\/*.json/,
31
+ * new NetworkOnly(),
32
+ * "POST",
33
+ * ),
34
+ * );
35
+ * ```
36
+ * @param router
37
+ * @returns The new singleton `Router`.
38
+ * @deprecated
39
+ */
40
+ export declare const setSingletonRouter: (router: Router) => Router;
41
+ //# sourceMappingURL=singletonRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singletonRouter.d.ts","sourceRoot":"","sources":["../../src/legacy/singletonRouter.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,QAAO,MASrC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,kBAAkB,WAAY,MAAM,KAAG,MASnD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Route } from "../Route.js";
2
+ /**
3
+ * Unregisters a route from the singleton `Router` instance.
4
+ *
5
+ * @param route The route to unregister.
6
+ * @deprecated
7
+ */
8
+ export declare const unregisterRoute: (route: Route) => void;
9
+ //# sourceMappingURL=unregisterRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unregisterRoute.d.ts","sourceRoot":"","sources":["../../src/legacy/unregisterRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UAAW,KAAK,KAAG,IAE9C,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { SerwistPlugin } from "../../types.js";
2
+ import type { PrecacheController } from "../PrecacheController.js";
3
+ /**
4
+ * A plugin, designed to be used with PrecacheController, to translate URLs into
5
+ * the corresponding cache key, based on the current revision info.
6
+ *
7
+ * @private
8
+ */
9
+ export declare class PrecacheCacheKeyPlugin implements SerwistPlugin {
10
+ private readonly _precacheController;
11
+ constructor({ precacheController }: {
12
+ precacheController: PrecacheController;
13
+ });
14
+ cacheKeyWillBeUsed: SerwistPlugin["cacheKeyWillBeUsed"];
15
+ }
16
+ //# sourceMappingURL=PrecacheCacheKeyPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrecacheCacheKeyPlugin.d.ts","sourceRoot":"","sources":["../../../src/legacy/utils/PrecacheCacheKeyPlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;;GAKG;AACH,qBAAa,sBAAuB,YAAW,aAAa;IAC1D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAqB;gBAE7C,EAAE,kBAAkB,EAAE,EAAE;QAAE,kBAAkB,EAAE,kBAAkB,CAAA;KAAE;IAI9E,kBAAkB,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAOrD;CACH"}
@@ -0,0 +1,14 @@
1
+ import type { PrecacheRouteOptions } from "../../types.js";
2
+ /**
3
+ * This function will take the request URL and manipulate it based on the
4
+ * configuration options.
5
+ *
6
+ * @param url
7
+ * @param options
8
+ * @returns Returns the URL in the cache that matches the request,
9
+ * if possible.
10
+ *
11
+ * @private
12
+ */
13
+ export declare const getCacheKeyForURL: (url: string, options: PrecacheRouteOptions) => string | undefined;
14
+ //# sourceMappingURL=getCacheKeyForURL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCacheKeyForURL.d.ts","sourceRoot":"","sources":["../../../src/legacy/utils/getCacheKeyForURL.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAI3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,QAAS,MAAM,WAAW,oBAAoB,KAAG,MAAM,GAAG,SAYvF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { MapLikeObject } from "../../types.js";
2
+ import { type MessageKey } from "./messages.js";
3
+ export declare const messageGenerator: ((code: string, ...args: any[]) => string) | ((code: MessageKey, details?: MapLikeObject) => string);
4
+ //# sourceMappingURL=messageGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageGenerator.d.ts","sourceRoot":"","sources":["../../../src/models/messages/messageGenerator.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,eAAe,CAAC;AAmB1D,eAAO,MAAM,gBAAgB,UAjBL,MAAM,WAAW,GAAG,EAAE,uBAQb,UAAU,YAAW,aAAa,YASiC,CAAC"}
@@ -0,0 +1,44 @@
1
+ interface LoggableObject {
2
+ [key: string]: string | number;
3
+ }
4
+ export declare const messages: {
5
+ "invalid-value": ({ paramName, validValueDescription, value }: LoggableObject) => string;
6
+ "not-an-array": ({ moduleName, className, funcName, paramName }: LoggableObject) => string;
7
+ "incorrect-type": ({ expectedType, paramName, moduleName, className, funcName }: LoggableObject) => string;
8
+ "incorrect-class": ({ expectedClassName, paramName, moduleName, className, funcName, isReturnValueProblem }: LoggableObject) => string;
9
+ "missing-a-method": ({ expectedMethod, paramName, moduleName, className, funcName }: LoggableObject) => string;
10
+ "add-to-cache-list-unexpected-type": ({ entry }: LoggableObject) => string;
11
+ "add-to-cache-list-conflicting-entries": ({ firstEntry, secondEntry }: LoggableObject) => string;
12
+ "plugin-error-request-will-fetch": ({ thrownErrorMessage }: LoggableObject) => string;
13
+ "invalid-cache-name": ({ cacheNameId, value }: LoggableObject) => string;
14
+ "unregister-route-but-not-found-with-method": ({ method }: LoggableObject) => string;
15
+ "unregister-route-route-not-registered": () => string;
16
+ "queue-replay-failed": ({ name }: LoggableObject) => string;
17
+ "duplicate-queue-name": ({ name }: LoggableObject) => string;
18
+ "expired-test-without-max-age": ({ methodName, paramName }: LoggableObject) => string;
19
+ "unsupported-route-type": ({ moduleName, className, funcName, paramName }: LoggableObject) => string;
20
+ "not-array-of-class": ({ value, expectedClass, moduleName, className, funcName, paramName }: LoggableObject) => string;
21
+ "max-entries-or-age-required": ({ moduleName, className, funcName }: LoggableObject) => string;
22
+ "statuses-or-headers-required": ({ moduleName, className, funcName }: LoggableObject) => string;
23
+ "invalid-string": ({ moduleName, funcName, paramName }: LoggableObject) => string;
24
+ "channel-name-required": () => string;
25
+ "invalid-responses-are-same-args": () => string;
26
+ "expire-custom-caches-only": () => string;
27
+ "unit-must-be-bytes": ({ normalizedRangeHeader }: LoggableObject) => string;
28
+ "single-range-only": ({ normalizedRangeHeader }: LoggableObject) => string;
29
+ "invalid-range-values": ({ normalizedRangeHeader }: LoggableObject) => string;
30
+ "no-range-header": () => string;
31
+ "range-not-satisfiable": ({ size, start, end }: LoggableObject) => string;
32
+ "attempt-to-cache-non-get-request": ({ url, method }: LoggableObject) => string;
33
+ "cache-put-with-no-response": ({ url }: LoggableObject) => string;
34
+ "no-response": ({ url, error }: LoggableObject) => string;
35
+ "bad-precaching-response": ({ url, status }: LoggableObject) => string;
36
+ "non-precached-url": ({ url }: LoggableObject) => string;
37
+ "add-to-cache-list-conflicting-integrities": ({ url }: LoggableObject) => string;
38
+ "missing-precache-entry": ({ cacheName, url }: LoggableObject) => string;
39
+ "cross-origin-copy-response": ({ origin }: LoggableObject) => string;
40
+ "opaque-streams-source": ({ type }: LoggableObject) => string;
41
+ };
42
+ export type MessageKey = keyof typeof messages;
43
+ export {};
44
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/models/messages/messages.ts"],"names":[],"mappings":"AAQA,UAAU,cAAc;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAChC;AAKD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuNC,CAAC;AAEvB,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,QAAQ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare enum pluginEvents {
2
+ CACHE_DID_UPDATE = "cacheDidUpdate",
3
+ CACHE_KEY_WILL_BE_USED = "cacheKeyWillBeUsed",
4
+ CACHE_WILL_UPDATE = "cacheWillUpdate",
5
+ CACHED_RESPONSE_WILL_BE_USED = "cachedResponseWillBeUsed",
6
+ FETCH_DID_FAIL = "fetchDidFail",
7
+ FETCH_DID_SUCCEED = "fetchDidSucceed",
8
+ REQUEST_WILL_FETCH = "requestWillFetch"
9
+ }
10
+ //# sourceMappingURL=pluginEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginEvents.d.ts","sourceRoot":"","sources":["../../src/models/pluginEvents.ts"],"names":[],"mappings":"AAQA,oBAAY,YAAY;IACtB,gBAAgB,mBAAmB;IACnC,sBAAsB,uBAAuB;IAC7C,iBAAiB,oBAAoB;IACrC,4BAA4B,6BAA6B;IACzD,cAAc,iBAAiB;IAC/B,iBAAiB,oBAAoB;IACrC,kBAAkB,qBAAqB;CACxC"}
@@ -0,0 +1,3 @@
1
+ declare const quotaErrorCallbacks: Set<Function>;
2
+ export { quotaErrorCallbacks };
3
+ //# sourceMappingURL=quotaErrorCallbacks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotaErrorCallbacks.d.ts","sourceRoot":"","sources":["../../src/models/quotaErrorCallbacks.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,mBAAmB,EAAE,GAAG,CAAC,QAAQ,CAAa,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Checks whether the current browser supports
3
+ * navigation preloading.
4
+ *
5
+ * @returns
6
+ * @see https://serwist.pages.dev/docs/sw/navigation-preloading/is-navigation-preload-supported
7
+ */
8
+ export declare const isNavigationPreloadSupported: () => boolean;
9
+ /**
10
+ * If the browser supports navigation preloading, then this will enable it.
11
+ *
12
+ * @param headerValue Optional. Allows developers to override the value of
13
+ * the `Service-Worker-Navigation-Preload` header which will be sent to the
14
+ * server when making the navigation request.
15
+ * @see https://serwist.pages.dev/docs/sw/navigation-preloading/enable-navigation-preload
16
+ */
17
+ export declare const enableNavigationPreload: (headerValue?: string) => void;
18
+ /**
19
+ * If the browser supports navigation preloading, then this will disable it.
20
+ *
21
+ * @see https://serwist.pages.dev/docs/sw/navigation-preloading/disable-navigation-preload
22
+ */
23
+ export declare const disableNavigationPreload: () => void;
24
+ //# sourceMappingURL=navigationPreload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationPreload.d.ts","sourceRoot":"","sources":["../src/navigationPreload.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,QAAO,OAE/C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,KAAG,IAqB9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAO,IAgB3C,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { RouteHandler, RouteMatchCallback } from "./types.js";
2
+ import { Route } from "./Route.js";
3
+ import type { HTTPMethod } from "./constants.js";
4
+ /**
5
+ * Parses a `RegExp`, string, or function with a caching strategy into a `Route`. This is for
6
+ * when you want to create a `Route`, but you don't want to register it just yet: sometimes
7
+ * you want to call `setCatchHandler` first, for example.
8
+ *
9
+ * @param capture If the capture param is a `Route`, all other arguments will be ignored.
10
+ * @param handler A callback function that returns a `Promise` resulting in a `Response`.
11
+ * This parameter is required if `capture` is not a `Route` object.
12
+ * @param method The HTTP method to match the `Route` against. Defaults to `'GET'`.
13
+ * @returns The generated `Route`.
14
+ */
15
+ export declare const parseRoute: (capture: RegExp | string | RouteMatchCallback | Route, handler?: RouteHandler, method?: HTTPMethod) => Route;
16
+ //# sourceMappingURL=parseRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseRoute.d.ts","sourceRoot":"","sources":["../src/parseRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAInE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,YAAa,MAAM,GAAG,MAAM,GAAG,kBAAkB,GAAG,KAAK,YAAY,YAAY,WAAW,UAAU,KAAG,KA2D/H,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { FetchDidFailCallbackParam, SerwistPlugin } from "../../types.js";
2
+ import type { QueueOptions } from "./Queue.js";
3
+ /**
4
+ * A class implementing the `fetchDidFail` lifecycle callback. This makes it
5
+ * easier to add failed requests to a background sync Queue.
6
+ */
7
+ export declare class BackgroundSyncPlugin implements SerwistPlugin {
8
+ private readonly _queue;
9
+ /**
10
+ * @param name See the `serwist/plugins.BackgroundSyncQueue`
11
+ * documentation for parameter details.
12
+ * @param options See the `serwist/plugins.BackgroundSyncQueue`
13
+ * documentation for parameter details.
14
+ * @see https://serwist.pages.dev/docs/background-sync/queue
15
+ */
16
+ constructor(name: string, options?: QueueOptions);
17
+ /**
18
+ * @param options
19
+ * @private
20
+ */
21
+ fetchDidFail({ request }: FetchDidFailCallbackParam): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=BackgroundSyncPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackgroundSyncPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/backgroundSync/BackgroundSyncPlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,aAAa;IACxD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAE/B;;;;;;OAMG;gBACS,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;IAIhD;;;OAGG;IACG,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,yBAAyB;CAG1D"}