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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/NavigationRoute.d.ts +57 -0
- package/dist/NavigationRoute.d.ts.map +1 -0
- package/dist/PrecacheRoute.d.ts +17 -0
- package/dist/PrecacheRoute.d.ts.map +1 -0
- package/dist/PrecacheStrategy.d.ts +66 -0
- package/dist/PrecacheStrategy.d.ts.map +1 -0
- package/dist/RegExpRoute.d.ts +24 -0
- package/dist/RegExpRoute.d.ts.map +1 -0
- package/dist/Route.d.ts +33 -0
- package/dist/Route.d.ts.map +1 -0
- package/dist/Serwist.d.ts +331 -0
- package/dist/Serwist.d.ts.map +1 -0
- package/dist/cacheNames.d.ts +20 -0
- package/dist/cacheNames.d.ts.map +1 -0
- package/dist/chunks/NetworkOnly.js +599 -0
- package/dist/chunks/PrecacheFallbackPlugin.js +634 -0
- package/dist/chunks/Serwist.js +1034 -0
- package/dist/chunks/registerQuotaErrorCallback.js +17 -0
- package/dist/chunks/resultingClientExists.js +32 -0
- package/dist/chunks/timeout.js +400 -0
- package/dist/chunks/waitUntil.js +24 -0
- package/dist/cleanupOutdatedCaches.d.ts +6 -0
- package/dist/cleanupOutdatedCaches.d.ts.map +1 -0
- package/dist/clientsClaim.d.ts +6 -0
- package/dist/clientsClaim.d.ts.map +1 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/copyResponse.d.ts +20 -0
- package/dist/copyResponse.d.ts.map +1 -0
- package/dist/disableDevLogs.d.ts +7 -0
- package/dist/disableDevLogs.d.ts.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.internal.d.ts +16 -0
- package/dist/index.internal.d.ts.map +1 -0
- package/dist/index.internal.js +24 -0
- package/dist/index.js +27 -0
- package/dist/index.legacy.d.ts +32 -0
- package/dist/index.legacy.d.ts.map +1 -0
- package/dist/index.legacy.js +640 -0
- package/dist/index.plugins.d.ts +41 -0
- package/dist/index.plugins.d.ts.map +1 -0
- package/dist/index.plugins.js +669 -0
- package/dist/index.strategies.d.ts +22 -0
- package/dist/index.strategies.d.ts.map +1 -0
- package/dist/index.strategies.js +144 -0
- package/dist/legacy/PrecacheController.d.ts +146 -0
- package/dist/legacy/PrecacheController.d.ts.map +1 -0
- package/dist/legacy/PrecacheFallbackPlugin.d.ts +62 -0
- package/dist/legacy/PrecacheFallbackPlugin.d.ts.map +1 -0
- package/dist/legacy/PrecacheRoute.d.ts +19 -0
- package/dist/legacy/PrecacheRoute.d.ts.map +1 -0
- package/dist/legacy/Router.d.ts +151 -0
- package/dist/legacy/Router.d.ts.map +1 -0
- package/dist/legacy/addPlugins.d.ts +9 -0
- package/dist/legacy/addPlugins.d.ts.map +1 -0
- package/dist/legacy/addRoute.d.ts +16 -0
- package/dist/legacy/addRoute.d.ts.map +1 -0
- package/dist/legacy/createHandlerBoundToURL.d.ts +18 -0
- package/dist/legacy/createHandlerBoundToURL.d.ts.map +1 -0
- package/dist/legacy/fallbacks.d.ts +59 -0
- package/dist/legacy/fallbacks.d.ts.map +1 -0
- package/dist/legacy/getCacheKeyForURL.d.ts +20 -0
- package/dist/legacy/getCacheKeyForURL.d.ts.map +1 -0
- package/dist/legacy/handlePrecaching.d.ts +54 -0
- package/dist/legacy/handlePrecaching.d.ts.map +1 -0
- package/dist/legacy/installSerwist.d.ts +15 -0
- package/dist/legacy/installSerwist.d.ts.map +1 -0
- package/dist/legacy/matchPrecache.d.ts +15 -0
- package/dist/legacy/matchPrecache.d.ts.map +1 -0
- package/dist/legacy/precache.d.ts +20 -0
- package/dist/legacy/precache.d.ts.map +1 -0
- package/dist/legacy/precacheAndRoute.d.ts +15 -0
- package/dist/legacy/precacheAndRoute.d.ts.map +1 -0
- package/dist/legacy/registerRoute.d.ts +16 -0
- package/dist/legacy/registerRoute.d.ts.map +1 -0
- package/dist/legacy/registerRuntimeCaching.d.ts +11 -0
- package/dist/legacy/registerRuntimeCaching.d.ts.map +1 -0
- package/dist/legacy/setCatchHandler.d.ts +10 -0
- package/dist/legacy/setCatchHandler.d.ts.map +1 -0
- package/dist/legacy/setDefaultHandler.d.ts +13 -0
- package/dist/legacy/setDefaultHandler.d.ts.map +1 -0
- package/dist/legacy/singletonPrecacheController.d.ts +34 -0
- package/dist/legacy/singletonPrecacheController.d.ts.map +1 -0
- package/dist/legacy/singletonRouter.d.ts +41 -0
- package/dist/legacy/singletonRouter.d.ts.map +1 -0
- package/dist/legacy/unregisterRoute.d.ts +9 -0
- package/dist/legacy/unregisterRoute.d.ts.map +1 -0
- package/dist/legacy/utils/PrecacheCacheKeyPlugin.d.ts +16 -0
- package/dist/legacy/utils/PrecacheCacheKeyPlugin.d.ts.map +1 -0
- package/dist/legacy/utils/getCacheKeyForURL.d.ts +14 -0
- package/dist/legacy/utils/getCacheKeyForURL.d.ts.map +1 -0
- package/dist/models/messages/messageGenerator.d.ts +4 -0
- package/dist/models/messages/messageGenerator.d.ts.map +1 -0
- package/dist/models/messages/messages.d.ts +44 -0
- package/dist/models/messages/messages.d.ts.map +1 -0
- package/dist/models/pluginEvents.d.ts +10 -0
- package/dist/models/pluginEvents.d.ts.map +1 -0
- package/dist/models/quotaErrorCallbacks.d.ts +3 -0
- package/dist/models/quotaErrorCallbacks.d.ts.map +1 -0
- package/dist/navigationPreload.d.ts +24 -0
- package/dist/navigationPreload.d.ts.map +1 -0
- package/dist/parseRoute.d.ts +16 -0
- package/dist/parseRoute.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/BackgroundSyncPlugin.d.ts +23 -0
- package/dist/plugins/backgroundSync/BackgroundSyncPlugin.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/Queue.d.ts +166 -0
- package/dist/plugins/backgroundSync/Queue.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/QueueDb.d.ts +90 -0
- package/dist/plugins/backgroundSync/QueueDb.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/QueueStore.d.ts +75 -0
- package/dist/plugins/backgroundSync/QueueStore.d.ts.map +1 -0
- package/dist/plugins/backgroundSync/StorableRequest.d.ts +51 -0
- package/dist/plugins/backgroundSync/StorableRequest.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/BroadcastCacheUpdate.d.ts +45 -0
- package/dist/plugins/broadcastUpdate/BroadcastCacheUpdate.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/BroadcastUpdatePlugin.d.ts +27 -0
- package/dist/plugins/broadcastUpdate/BroadcastUpdatePlugin.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/constants.d.ts +5 -0
- package/dist/plugins/broadcastUpdate/constants.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/responsesAreSame.d.ts +11 -0
- package/dist/plugins/broadcastUpdate/responsesAreSame.d.ts.map +1 -0
- package/dist/plugins/broadcastUpdate/types.d.ts +34 -0
- package/dist/plugins/broadcastUpdate/types.d.ts.map +1 -0
- package/dist/plugins/cacheableResponse/CacheableResponse.d.ts +40 -0
- package/dist/plugins/cacheableResponse/CacheableResponse.d.ts.map +1 -0
- package/dist/plugins/cacheableResponse/CacheableResponsePlugin.d.ts +27 -0
- package/dist/plugins/cacheableResponse/CacheableResponsePlugin.d.ts.map +1 -0
- package/dist/plugins/expiration/CacheExpiration.d.ts +66 -0
- package/dist/plugins/expiration/CacheExpiration.d.ts.map +1 -0
- package/dist/plugins/expiration/ExpirationPlugin.d.ts +116 -0
- package/dist/plugins/expiration/ExpirationPlugin.d.ts.map +1 -0
- package/dist/plugins/expiration/models/CacheTimestampsModel.d.ts +73 -0
- package/dist/plugins/expiration/models/CacheTimestampsModel.d.ts.map +1 -0
- package/dist/plugins/googleAnalytics/constants.d.ts +10 -0
- package/dist/plugins/googleAnalytics/constants.d.ts.map +1 -0
- package/dist/plugins/googleAnalytics/initialize.d.ts +30 -0
- package/dist/plugins/googleAnalytics/initialize.d.ts.map +1 -0
- package/dist/plugins/precaching/PrecacheFallbackPlugin.d.ts +53 -0
- package/dist/plugins/precaching/PrecacheFallbackPlugin.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/RangeRequestsPlugin.d.ts +19 -0
- package/dist/plugins/rangeRequests/RangeRequestsPlugin.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/createPartialResponse.d.ts +18 -0
- package/dist/plugins/rangeRequests/createPartialResponse.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/utils/calculateEffectiveBoundaries.d.ts +14 -0
- package/dist/plugins/rangeRequests/utils/calculateEffectiveBoundaries.d.ts.map +1 -0
- package/dist/plugins/rangeRequests/utils/parseRangeHeader.d.ts +12 -0
- package/dist/plugins/rangeRequests/utils/parseRangeHeader.d.ts.map +1 -0
- package/dist/registerQuotaErrorCallback.d.ts +8 -0
- package/dist/registerQuotaErrorCallback.d.ts.map +1 -0
- package/dist/setCacheNameDetails.d.ts +9 -0
- package/dist/setCacheNameDetails.d.ts.map +1 -0
- package/dist/strategies/CacheFirst.d.ts +23 -0
- package/dist/strategies/CacheFirst.d.ts.map +1 -0
- package/dist/strategies/CacheOnly.d.ts +20 -0
- package/dist/strategies/CacheOnly.d.ts.map +1 -0
- package/dist/strategies/NetworkFirst.d.ts +61 -0
- package/dist/strategies/NetworkFirst.d.ts.map +1 -0
- package/dist/strategies/NetworkOnly.d.ts +32 -0
- package/dist/strategies/NetworkOnly.d.ts.map +1 -0
- package/dist/strategies/StaleWhileRevalidate.d.ts +35 -0
- package/dist/strategies/StaleWhileRevalidate.d.ts.map +1 -0
- package/dist/strategies/Strategy.d.ts +83 -0
- package/dist/strategies/Strategy.d.ts.map +1 -0
- package/dist/strategies/StrategyHandler.d.ts +189 -0
- package/dist/strategies/StrategyHandler.d.ts.map +1 -0
- package/dist/strategies/plugins/cacheOkAndOpaquePlugin.d.ts +3 -0
- package/dist/strategies/plugins/cacheOkAndOpaquePlugin.d.ts.map +1 -0
- package/dist/strategies/utils/messages.d.ts +5 -0
- package/dist/strategies/utils/messages.d.ts.map +1 -0
- package/dist/types.d.ts +317 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/Deferred.d.ts +19 -0
- package/dist/utils/Deferred.d.ts.map +1 -0
- package/dist/utils/PrecacheCacheKeyPlugin.d.ts +16 -0
- package/dist/utils/PrecacheCacheKeyPlugin.d.ts.map +1 -0
- package/dist/utils/PrecacheInstallReportPlugin.d.ts +14 -0
- package/dist/utils/PrecacheInstallReportPlugin.d.ts.map +1 -0
- package/dist/utils/SerwistError.d.ts +24 -0
- package/dist/utils/SerwistError.d.ts.map +1 -0
- package/dist/utils/assert.d.ts +11 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/cacheMatchIgnoreParams.d.ts +15 -0
- package/dist/utils/cacheMatchIgnoreParams.d.ts.map +1 -0
- package/dist/utils/cacheNames.d.ts +40 -0
- package/dist/utils/cacheNames.d.ts.map +1 -0
- package/dist/utils/canConstructReadableStream.d.ts +12 -0
- package/dist/utils/canConstructReadableStream.d.ts.map +1 -0
- package/dist/utils/canConstructResponseFromBodyStream.d.ts +11 -0
- package/dist/utils/canConstructResponseFromBodyStream.d.ts.map +1 -0
- package/dist/utils/createCacheKey.d.ts +16 -0
- package/dist/utils/createCacheKey.d.ts.map +1 -0
- package/dist/utils/deleteOutdatedCaches.d.ts +18 -0
- package/dist/utils/deleteOutdatedCaches.d.ts.map +1 -0
- package/dist/utils/dontWaitFor.d.ts +7 -0
- package/dist/utils/dontWaitFor.d.ts.map +1 -0
- package/dist/utils/executeQuotaErrorCallbacks.d.ts +8 -0
- package/dist/utils/executeQuotaErrorCallbacks.d.ts.map +1 -0
- package/dist/utils/generateURLVariations.d.ts +12 -0
- package/dist/utils/generateURLVariations.d.ts.map +1 -0
- package/dist/utils/getFriendlyURL.d.ts +3 -0
- package/dist/utils/getFriendlyURL.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +24 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/normalizeHandler.d.ts +10 -0
- package/dist/utils/normalizeHandler.d.ts.map +1 -0
- package/dist/utils/pluginUtils.d.ts +5 -0
- package/dist/utils/pluginUtils.d.ts.map +1 -0
- package/dist/utils/printCleanupDetails.d.ts +6 -0
- package/dist/utils/printCleanupDetails.d.ts.map +1 -0
- package/dist/utils/printInstallDetails.d.ts +7 -0
- package/dist/utils/printInstallDetails.d.ts.map +1 -0
- package/dist/utils/removeIgnoredSearchParams.d.ts +12 -0
- package/dist/utils/removeIgnoredSearchParams.d.ts.map +1 -0
- package/dist/utils/resultingClientExists.d.ts +12 -0
- package/dist/utils/resultingClientExists.d.ts.map +1 -0
- package/dist/utils/timeout.d.ts +10 -0
- package/dist/utils/timeout.d.ts.map +1 -0
- package/dist/utils/waitUntil.d.ts +11 -0
- package/dist/utils/waitUntil.d.ts.map +1 -0
- package/dist/utils/welcome.d.ts +2 -0
- package/dist/utils/welcome.d.ts.map +1 -0
- package/package.json +85 -0
- package/src/NavigationRoute.ts +119 -0
- package/src/PrecacheRoute.ts +46 -0
- package/src/PrecacheStrategy.ts +239 -0
- package/src/RegExpRoute.ts +74 -0
- package/src/Route.ts +67 -0
- package/src/Serwist.ts +920 -0
- package/src/cacheNames.ts +39 -0
- package/src/cleanupOutdatedCaches.ts +32 -0
- package/src/clientsClaim.ts +18 -0
- package/src/constants.ts +24 -0
- package/src/copyResponse.ts +60 -0
- package/src/disableDevLogs.ts +10 -0
- package/src/index.internal.ts +33 -0
- package/src/index.legacy.ts +66 -0
- package/src/index.plugins.ts +95 -0
- package/src/index.strategies.ts +26 -0
- package/src/index.ts +39 -0
- package/src/legacy/PrecacheController.ts +337 -0
- package/src/legacy/PrecacheFallbackPlugin.ts +93 -0
- package/src/legacy/PrecacheRoute.ts +48 -0
- package/src/legacy/Router.ts +484 -0
- package/src/legacy/addPlugins.ts +21 -0
- package/src/legacy/addRoute.ts +29 -0
- package/src/legacy/createHandlerBoundToURL.ts +30 -0
- package/src/legacy/fallbacks.ts +94 -0
- package/src/legacy/getCacheKeyForURL.ts +32 -0
- package/src/legacy/handlePrecaching.ts +86 -0
- package/src/legacy/installSerwist.ts +19 -0
- package/src/legacy/matchPrecache.ts +26 -0
- package/src/legacy/precache.ts +31 -0
- package/src/legacy/precacheAndRoute.ts +28 -0
- package/src/legacy/registerRoute.ts +27 -0
- package/src/legacy/registerRuntimeCaching.ts +17 -0
- package/src/legacy/setCatchHandler.ts +21 -0
- package/src/legacy/setDefaultHandler.ts +24 -0
- package/src/legacy/singletonPrecacheController.ts +53 -0
- package/src/legacy/singletonRouter.ts +70 -0
- package/src/legacy/unregisterRoute.ts +12 -0
- package/src/legacy/utils/PrecacheCacheKeyPlugin.ts +33 -0
- package/src/legacy/utils/getCacheKeyForURL.ts +36 -0
- package/src/models/messages/messageGenerator.ts +29 -0
- package/src/models/messages/messages.ts +233 -0
- package/src/models/pluginEvents.ts +17 -0
- package/src/models/quotaErrorCallbacks.ts +13 -0
- package/src/navigationPreload.ts +68 -0
- package/src/parseRoute.ts +78 -0
- package/src/plugins/backgroundSync/BackgroundSyncPlugin.ts +38 -0
- package/src/plugins/backgroundSync/Queue.ts +440 -0
- package/src/plugins/backgroundSync/QueueDb.ts +176 -0
- package/src/plugins/backgroundSync/QueueStore.ts +160 -0
- package/src/plugins/backgroundSync/StorableRequest.ts +142 -0
- package/src/plugins/broadcastUpdate/BroadcastCacheUpdate.ts +161 -0
- package/src/plugins/broadcastUpdate/BroadcastUpdatePlugin.ts +42 -0
- package/src/plugins/broadcastUpdate/constants.ts +12 -0
- package/src/plugins/broadcastUpdate/responsesAreSame.ts +49 -0
- package/src/plugins/broadcastUpdate/types.ts +37 -0
- package/src/plugins/cacheableResponse/CacheableResponse.ts +144 -0
- package/src/plugins/cacheableResponse/CacheableResponsePlugin.ts +45 -0
- package/src/plugins/expiration/CacheExpiration.ts +193 -0
- package/src/plugins/expiration/ExpirationPlugin.ts +300 -0
- package/src/plugins/expiration/models/CacheTimestampsModel.ts +184 -0
- package/src/plugins/googleAnalytics/constants.ts +22 -0
- package/src/plugins/googleAnalytics/initialize.ts +209 -0
- package/src/plugins/precaching/PrecacheFallbackPlugin.ts +83 -0
- package/src/plugins/rangeRequests/RangeRequestsPlugin.ts +38 -0
- package/src/plugins/rangeRequests/createPartialResponse.ts +93 -0
- package/src/plugins/rangeRequests/utils/calculateEffectiveBoundaries.ts +59 -0
- package/src/plugins/rangeRequests/utils/parseRangeHeader.ts +55 -0
- package/src/registerQuotaErrorCallback.ts +34 -0
- package/src/setCacheNameDetails.ts +53 -0
- package/src/strategies/CacheFirst.ts +88 -0
- package/src/strategies/CacheOnly.ts +59 -0
- package/src/strategies/NetworkFirst.ts +229 -0
- package/src/strategies/NetworkOnly.ts +98 -0
- package/src/strategies/StaleWhileRevalidate.ts +110 -0
- package/src/strategies/Strategy.ts +204 -0
- package/src/strategies/StrategyHandler.ts +554 -0
- package/src/strategies/plugins/cacheOkAndOpaquePlugin.ts +26 -0
- package/src/strategies/utils/messages.ts +21 -0
- package/src/types.ts +358 -0
- package/src/utils/Deferred.ts +33 -0
- package/src/utils/PrecacheCacheKeyPlugin.ts +33 -0
- package/src/utils/PrecacheInstallReportPlugin.ts +47 -0
- package/src/utils/SerwistError.ts +41 -0
- package/src/utils/assert.ts +89 -0
- package/src/utils/cacheMatchIgnoreParams.ts +54 -0
- package/src/utils/cacheNames.ts +87 -0
- package/src/utils/canConstructReadableStream.ts +34 -0
- package/src/utils/canConstructResponseFromBodyStream.ts +37 -0
- package/src/utils/createCacheKey.ts +68 -0
- package/src/utils/deleteOutdatedCaches.ts +40 -0
- package/src/utils/dontWaitFor.ts +16 -0
- package/src/utils/executeQuotaErrorCallbacks.ts +33 -0
- package/src/utils/generateURLVariations.ts +55 -0
- package/src/utils/getFriendlyURL.ts +16 -0
- package/src/utils/logger.ts +95 -0
- package/src/utils/normalizeHandler.ts +40 -0
- package/src/utils/pluginUtils.ts +15 -0
- package/src/utils/printCleanupDetails.ts +38 -0
- package/src/utils/printInstallDetails.ts +53 -0
- package/src/utils/removeIgnoredSearchParams.ts +29 -0
- package/src/utils/resultingClientExists.ts +58 -0
- package/src/utils/timeout.ts +19 -0
- package/src/utils/waitUntil.ts +21 -0
- package/src/utils/welcome.ts +19 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { cacheNames as privateCacheNames } from "./utils/cacheNames.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get the current cache names and prefix/suffix used by Serwist.
|
|
13
|
+
*
|
|
14
|
+
* `cacheNames.precache` is used for precached assets,
|
|
15
|
+
* `cacheNames.googleAnalytics` is used by `@serwist/google-analytics` to
|
|
16
|
+
* store `analytics.js`, and `cacheNames.runtime` is used for everything else.
|
|
17
|
+
*
|
|
18
|
+
* `cacheNames.prefix` can be used to retrieve just the current prefix value.
|
|
19
|
+
* `cacheNames.suffix` can be used to retrieve just the current suffix value.
|
|
20
|
+
*
|
|
21
|
+
* @returns An object with `precache`, `runtime`, `prefix`, and `googleAnalytics` properties.
|
|
22
|
+
*/
|
|
23
|
+
export const cacheNames = {
|
|
24
|
+
get googleAnalytics(): string {
|
|
25
|
+
return privateCacheNames.getGoogleAnalyticsName();
|
|
26
|
+
},
|
|
27
|
+
get precache(): string {
|
|
28
|
+
return privateCacheNames.getPrecacheName();
|
|
29
|
+
},
|
|
30
|
+
get prefix(): string {
|
|
31
|
+
return privateCacheNames.getPrefix();
|
|
32
|
+
},
|
|
33
|
+
get runtime(): string {
|
|
34
|
+
return privateCacheNames.getRuntimeName();
|
|
35
|
+
},
|
|
36
|
+
get suffix(): string {
|
|
37
|
+
return privateCacheNames.getSuffix();
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { logger } from "./utils/logger.js";
|
|
10
|
+
import { cacheNames as privateCacheNames } from "./utils/cacheNames.js";
|
|
11
|
+
|
|
12
|
+
import { deleteOutdatedCaches } from "./utils/deleteOutdatedCaches.js";
|
|
13
|
+
|
|
14
|
+
declare const self: ServiceWorkerGlobalScope;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Adds an `activate` event listener which will clean up incompatible
|
|
18
|
+
* precaches that were created by older versions of Serwist.
|
|
19
|
+
*/
|
|
20
|
+
export const cleanupOutdatedCaches = (cacheName?: string): void => {
|
|
21
|
+
self.addEventListener("activate", (event: ExtendableEvent) => {
|
|
22
|
+
event.waitUntil(
|
|
23
|
+
deleteOutdatedCaches(privateCacheNames.getPrecacheName(cacheName)).then((cachesDeleted) => {
|
|
24
|
+
if (process.env.NODE_ENV !== "production") {
|
|
25
|
+
if (cachesDeleted.length > 0) {
|
|
26
|
+
logger.log("The following out-of-date precaches were cleaned up automatically:", cachesDeleted);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Give TypeScript the correct global.
|
|
10
|
+
declare let self: ServiceWorkerGlobalScope;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Claims any currently available clients once the service worker
|
|
14
|
+
* becomes active. This is normally used in conjunction with `skipWaiting()`.
|
|
15
|
+
*/
|
|
16
|
+
export const clientsClaim = (): void => {
|
|
17
|
+
self.addEventListener("activate", () => self.clients.claim());
|
|
18
|
+
};
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2018 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type HTTPMethod = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The default HTTP method, 'GET', used when there's no specific method
|
|
13
|
+
* configured for a route.
|
|
14
|
+
*
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
export const defaultMethod = "GET" satisfies HTTPMethod;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The list of valid HTTP methods associated with requests that could be routed.
|
|
21
|
+
*
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
export const validMethods = ["DELETE", "GET", "HEAD", "PATCH", "POST", "PUT"] satisfies HTTPMethod[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Google LLC
|
|
3
|
+
|
|
4
|
+
Use of this source code is governed by an MIT-style
|
|
5
|
+
license that can be found in the LICENSE file or at
|
|
6
|
+
https://opensource.org/licenses/MIT.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { SerwistError } from "./utils/SerwistError.js";
|
|
10
|
+
import { canConstructResponseFromBodyStream } from "./utils/canConstructResponseFromBodyStream.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Allows developers to copy a response and modify its `headers`, `status`,
|
|
14
|
+
* or `statusText` values (the values settable via a
|
|
15
|
+
* [`ResponseInit`](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax)
|
|
16
|
+
* object in the constructor).
|
|
17
|
+
* To modify these values, pass a function as the second argument. That
|
|
18
|
+
* function will be invoked with a single object with the response properties
|
|
19
|
+
* `{headers, status, statusText}`. The return value of this function will
|
|
20
|
+
* be used as the `ResponseInit` for the new `Response`. To change the values
|
|
21
|
+
* either modify the passed parameter(s) and return it, or return a totally
|
|
22
|
+
* new object.
|
|
23
|
+
*
|
|
24
|
+
* This method is intentionally limited to same-origin responses, regardless of
|
|
25
|
+
* whether CORS was used or not.
|
|
26
|
+
*
|
|
27
|
+
* @param response
|
|
28
|
+
* @param modifier
|
|
29
|
+
*/
|
|
30
|
+
export const copyResponse = async (response: Response, modifier?: (responseInit: ResponseInit) => ResponseInit): Promise<Response> => {
|
|
31
|
+
let origin = null;
|
|
32
|
+
// If response.url isn't set, assume it's cross-origin and keep origin null.
|
|
33
|
+
if (response.url) {
|
|
34
|
+
const responseURL = new URL(response.url);
|
|
35
|
+
origin = responseURL.origin;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (origin !== self.location.origin) {
|
|
39
|
+
throw new SerwistError("cross-origin-copy-response", { origin });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const clonedResponse = response.clone();
|
|
43
|
+
|
|
44
|
+
// Create a fresh `ResponseInit` object by cloning the headers.
|
|
45
|
+
const responseInit: ResponseInit = {
|
|
46
|
+
headers: new Headers(clonedResponse.headers),
|
|
47
|
+
status: clonedResponse.status,
|
|
48
|
+
statusText: clonedResponse.statusText,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Apply any user modifications.
|
|
52
|
+
const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;
|
|
53
|
+
|
|
54
|
+
// Create the new response from the body stream and `ResponseInit`
|
|
55
|
+
// modifications. Note: not all browsers support the Response.body stream,
|
|
56
|
+
// so fall back to reading the entire body into memory as a blob.
|
|
57
|
+
const body = canConstructResponseFromBodyStream() ? clonedResponse.body : await clonedResponse.blob();
|
|
58
|
+
|
|
59
|
+
return new Response(body, modifiedResponseInit);
|
|
60
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const self: ServiceWorkerGlobalScope;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Disables Serwist's logging in development mode.
|
|
5
|
+
*
|
|
6
|
+
* @see https://serwist.pages.dev/docs/sw/abstractions/disable-dev-logs
|
|
7
|
+
*/
|
|
8
|
+
export const disableDevLogs = (): void => {
|
|
9
|
+
self.__WB_DISABLE_DEV_LOGS = true;
|
|
10
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Deferred } from "./utils/Deferred.js";
|
|
2
|
+
import { SerwistError } from "./utils/SerwistError.js";
|
|
3
|
+
import { assert } from "./utils/assert.js";
|
|
4
|
+
import { cacheMatchIgnoreParams } from "./utils/cacheMatchIgnoreParams.js";
|
|
5
|
+
import { cacheNames as privateCacheNames } from "./utils/cacheNames.js";
|
|
6
|
+
import { canConstructReadableStream } from "./utils/canConstructReadableStream.js";
|
|
7
|
+
import { canConstructResponseFromBodyStream } from "./utils/canConstructResponseFromBodyStream.js";
|
|
8
|
+
import { dontWaitFor } from "./utils/dontWaitFor.js";
|
|
9
|
+
import { executeQuotaErrorCallbacks } from "./utils/executeQuotaErrorCallbacks.js";
|
|
10
|
+
import { getFriendlyURL } from "./utils/getFriendlyURL.js";
|
|
11
|
+
import { logger } from "./utils/logger.js";
|
|
12
|
+
import { resultingClientExists } from "./utils/resultingClientExists.js";
|
|
13
|
+
import { timeout } from "./utils/timeout.js";
|
|
14
|
+
import { waitUntil } from "./utils/waitUntil.js";
|
|
15
|
+
|
|
16
|
+
// Serwist's internal functions, classes, variables, and more. Feel free to use them,
|
|
17
|
+
// but they are not documented. Note: they do follow semver.
|
|
18
|
+
export {
|
|
19
|
+
Deferred,
|
|
20
|
+
SerwistError,
|
|
21
|
+
assert,
|
|
22
|
+
cacheMatchIgnoreParams,
|
|
23
|
+
privateCacheNames,
|
|
24
|
+
canConstructReadableStream,
|
|
25
|
+
canConstructResponseFromBodyStream,
|
|
26
|
+
dontWaitFor,
|
|
27
|
+
executeQuotaErrorCallbacks,
|
|
28
|
+
getFriendlyURL,
|
|
29
|
+
logger,
|
|
30
|
+
resultingClientExists,
|
|
31
|
+
timeout,
|
|
32
|
+
waitUntil,
|
|
33
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { NavigationRoute } from "./NavigationRoute.js";
|
|
2
|
+
import { PrecacheStrategy } from "./PrecacheStrategy.js";
|
|
3
|
+
import { RegExpRoute } from "./RegExpRoute.js";
|
|
4
|
+
import { Route } from "./Route.js";
|
|
5
|
+
import { cleanupOutdatedCaches } from "./cleanupOutdatedCaches.js";
|
|
6
|
+
import { PrecacheController } from "./legacy/PrecacheController.js";
|
|
7
|
+
import { PrecacheFallbackPlugin } from "./legacy/PrecacheFallbackPlugin.js";
|
|
8
|
+
import type { PrecacheFallbackEntry, PrecacheFallbackPluginOptions } from "./legacy/PrecacheFallbackPlugin.js";
|
|
9
|
+
import { PrecacheRoute } from "./legacy/PrecacheRoute.js";
|
|
10
|
+
import { Router } from "./legacy/Router.js";
|
|
11
|
+
import { addPlugins } from "./legacy/addPlugins.js";
|
|
12
|
+
import { addRoute } from "./legacy/addRoute.js";
|
|
13
|
+
import { createHandlerBoundToURL } from "./legacy/createHandlerBoundToURL.js";
|
|
14
|
+
import type { FallbackEntry, FallbacksOptions } from "./legacy/fallbacks.js";
|
|
15
|
+
import { fallbacks } from "./legacy/fallbacks.js";
|
|
16
|
+
import { getCacheKeyForURL } from "./legacy/getCacheKeyForURL.js";
|
|
17
|
+
import { type HandlePrecachingOptions, handlePrecaching } from "./legacy/handlePrecaching.js";
|
|
18
|
+
import { type InstallSerwistOptions, installSerwist } from "./legacy/installSerwist.js";
|
|
19
|
+
import { matchPrecache } from "./legacy/matchPrecache.js";
|
|
20
|
+
import { precache } from "./legacy/precache.js";
|
|
21
|
+
import { precacheAndRoute } from "./legacy/precacheAndRoute.js";
|
|
22
|
+
import { registerRoute } from "./legacy/registerRoute.js";
|
|
23
|
+
import { registerRuntimeCaching } from "./legacy/registerRuntimeCaching.js";
|
|
24
|
+
import { setCatchHandler } from "./legacy/setCatchHandler.js";
|
|
25
|
+
import { setDefaultHandler } from "./legacy/setDefaultHandler.js";
|
|
26
|
+
import { getSingletonPrecacheController, setSingletonPrecacheController } from "./legacy/singletonPrecacheController.js";
|
|
27
|
+
import { getSingletonRouter, setSingletonRouter } from "./legacy/singletonRouter.js";
|
|
28
|
+
import { unregisterRoute } from "./legacy/unregisterRoute.js";
|
|
29
|
+
import { parseRoute } from "./parseRoute.js";
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
// These are not deprecated, but we export them so legacy packages
|
|
33
|
+
// can re-export them without having to import both the normal and legacy
|
|
34
|
+
// import paths.
|
|
35
|
+
NavigationRoute,
|
|
36
|
+
PrecacheStrategy,
|
|
37
|
+
RegExpRoute,
|
|
38
|
+
Route,
|
|
39
|
+
cleanupOutdatedCaches,
|
|
40
|
+
parseRoute,
|
|
41
|
+
// Actual deprecated modules start here
|
|
42
|
+
addPlugins,
|
|
43
|
+
addRoute,
|
|
44
|
+
createHandlerBoundToURL,
|
|
45
|
+
getCacheKeyForURL,
|
|
46
|
+
fallbacks,
|
|
47
|
+
matchPrecache,
|
|
48
|
+
precache,
|
|
49
|
+
precacheAndRoute,
|
|
50
|
+
PrecacheController,
|
|
51
|
+
PrecacheFallbackPlugin,
|
|
52
|
+
PrecacheRoute,
|
|
53
|
+
getSingletonPrecacheController,
|
|
54
|
+
setSingletonPrecacheController,
|
|
55
|
+
handlePrecaching,
|
|
56
|
+
installSerwist,
|
|
57
|
+
registerRuntimeCaching,
|
|
58
|
+
registerRoute,
|
|
59
|
+
Router,
|
|
60
|
+
setCatchHandler,
|
|
61
|
+
setDefaultHandler,
|
|
62
|
+
getSingletonRouter,
|
|
63
|
+
setSingletonRouter,
|
|
64
|
+
unregisterRoute,
|
|
65
|
+
};
|
|
66
|
+
export type { HandlePrecachingOptions, InstallSerwistOptions, FallbackEntry, FallbacksOptions, PrecacheFallbackEntry, PrecacheFallbackPluginOptions };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { BackgroundSyncPlugin } from "./plugins/backgroundSync/BackgroundSyncPlugin.js";
|
|
2
|
+
import type { QueueEntry as BackgroundSyncQueueEntry, QueueOptions as BackgroundSyncQueueOptions } from "./plugins/backgroundSync/Queue.js";
|
|
3
|
+
import { Queue as BackgroundSyncQueue } from "./plugins/backgroundSync/Queue.js";
|
|
4
|
+
import { QueueStore as BackgroundSyncQueueStore } from "./plugins/backgroundSync/QueueStore.js";
|
|
5
|
+
import { StorableRequest } from "./plugins/backgroundSync/StorableRequest.js";
|
|
6
|
+
import { BroadcastCacheUpdate } from "./plugins/broadcastUpdate/BroadcastCacheUpdate.js";
|
|
7
|
+
import { BroadcastUpdatePlugin } from "./plugins/broadcastUpdate/BroadcastUpdatePlugin.js";
|
|
8
|
+
import {
|
|
9
|
+
CACHE_UPDATED_MESSAGE_META as BROADCAST_UPDATE_MESSAGE_META,
|
|
10
|
+
CACHE_UPDATED_MESSAGE_TYPE as BROADCAST_UPDATE_MESSAGE_TYPE,
|
|
11
|
+
defaultHeadersToCheck as BROADCAST_UPDATE_DEFAULT_HEADERS,
|
|
12
|
+
} from "./plugins/broadcastUpdate/constants.js";
|
|
13
|
+
import { responsesAreSame } from "./plugins/broadcastUpdate/responsesAreSame.js";
|
|
14
|
+
import type { BroadcastCacheUpdateOptions, BroadcastMessage, BroadcastPayload, BroadcastPayloadGenerator } from "./plugins/broadcastUpdate/types.js";
|
|
15
|
+
import type { CacheableResponseOptions } from "./plugins/cacheableResponse/CacheableResponse.js";
|
|
16
|
+
import { CacheableResponse } from "./plugins/cacheableResponse/CacheableResponse.js";
|
|
17
|
+
import { CacheableResponsePlugin } from "./plugins/cacheableResponse/CacheableResponsePlugin.js";
|
|
18
|
+
import { CacheExpiration } from "./plugins/expiration/CacheExpiration.js";
|
|
19
|
+
import type { ExpirationPluginOptions } from "./plugins/expiration/ExpirationPlugin.js";
|
|
20
|
+
import { ExpirationPlugin } from "./plugins/expiration/ExpirationPlugin.js";
|
|
21
|
+
import type { GoogleAnalyticsInitializeOptions } from "./plugins/googleAnalytics/initialize.js";
|
|
22
|
+
import { initialize as initializeGoogleAnalytics } from "./plugins/googleAnalytics/initialize.js";
|
|
23
|
+
import type { PrecacheFallbackEntry, PrecacheFallbackPluginOptions } from "./plugins/precaching/PrecacheFallbackPlugin.js";
|
|
24
|
+
import { PrecacheFallbackPlugin } from "./plugins/precaching/PrecacheFallbackPlugin.js";
|
|
25
|
+
import { RangeRequestsPlugin } from "./plugins/rangeRequests/RangeRequestsPlugin.js";
|
|
26
|
+
import { createPartialResponse } from "./plugins/rangeRequests/createPartialResponse.js";
|
|
27
|
+
|
|
28
|
+
// See https://github.com/GoogleChrome/workbox/issues/2946
|
|
29
|
+
interface SyncManager {
|
|
30
|
+
getTags(): Promise<string[]>;
|
|
31
|
+
register(tag: string): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare global {
|
|
35
|
+
interface ServiceWorkerRegistration {
|
|
36
|
+
readonly sync: SyncManager;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface SyncEvent extends ExtendableEvent {
|
|
40
|
+
readonly lastChance: boolean;
|
|
41
|
+
readonly tag: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface ServiceWorkerGlobalScopeEventMap {
|
|
45
|
+
sync: SyncEvent;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
// Background synchronization
|
|
51
|
+
BackgroundSyncPlugin,
|
|
52
|
+
BackgroundSyncQueue,
|
|
53
|
+
BackgroundSyncQueueStore,
|
|
54
|
+
StorableRequest,
|
|
55
|
+
// Update broadcasting
|
|
56
|
+
BroadcastCacheUpdate,
|
|
57
|
+
BroadcastUpdatePlugin,
|
|
58
|
+
responsesAreSame,
|
|
59
|
+
BROADCAST_UPDATE_MESSAGE_META,
|
|
60
|
+
BROADCAST_UPDATE_MESSAGE_TYPE,
|
|
61
|
+
BROADCAST_UPDATE_DEFAULT_HEADERS,
|
|
62
|
+
// Cacheable responses
|
|
63
|
+
CacheableResponse,
|
|
64
|
+
CacheableResponsePlugin,
|
|
65
|
+
// Expiration
|
|
66
|
+
CacheExpiration,
|
|
67
|
+
ExpirationPlugin,
|
|
68
|
+
// Precaching
|
|
69
|
+
PrecacheFallbackPlugin,
|
|
70
|
+
// Range requests
|
|
71
|
+
createPartialResponse,
|
|
72
|
+
RangeRequestsPlugin,
|
|
73
|
+
// Google Analytics
|
|
74
|
+
initializeGoogleAnalytics,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type {
|
|
78
|
+
// Background synchronization
|
|
79
|
+
BackgroundSyncQueueOptions,
|
|
80
|
+
BackgroundSyncQueueEntry,
|
|
81
|
+
// Update broadcasting
|
|
82
|
+
BroadcastCacheUpdateOptions,
|
|
83
|
+
BroadcastPayload,
|
|
84
|
+
BroadcastPayloadGenerator,
|
|
85
|
+
BroadcastMessage,
|
|
86
|
+
// Cacheable responses
|
|
87
|
+
CacheableResponseOptions,
|
|
88
|
+
// Expiration
|
|
89
|
+
ExpirationPluginOptions,
|
|
90
|
+
// Precaching
|
|
91
|
+
PrecacheFallbackEntry,
|
|
92
|
+
PrecacheFallbackPluginOptions,
|
|
93
|
+
// Google Analytics
|
|
94
|
+
GoogleAnalyticsInitializeOptions,
|
|
95
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CacheFirst } from "./strategies/CacheFirst.js";
|
|
2
|
+
import { CacheOnly } from "./strategies/CacheOnly.js";
|
|
3
|
+
import type { NetworkFirstOptions } from "./strategies/NetworkFirst.js";
|
|
4
|
+
import { NetworkFirst } from "./strategies/NetworkFirst.js";
|
|
5
|
+
import type { NetworkOnlyOptions } from "./strategies/NetworkOnly.js";
|
|
6
|
+
import { NetworkOnly } from "./strategies/NetworkOnly.js";
|
|
7
|
+
import { StaleWhileRevalidate } from "./strategies/StaleWhileRevalidate.js";
|
|
8
|
+
import type { StrategyOptions } from "./strategies/Strategy.js";
|
|
9
|
+
import { Strategy } from "./strategies/Strategy.js";
|
|
10
|
+
import { StrategyHandler } from "./strategies/StrategyHandler.js";
|
|
11
|
+
|
|
12
|
+
// See https://github.com/GoogleChrome/workbox/issues/2946
|
|
13
|
+
declare global {
|
|
14
|
+
interface FetchEvent {
|
|
15
|
+
// See https://github.com/GoogleChrome/workbox/issues/2974
|
|
16
|
+
readonly preloadResponse: Promise<any>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* There are common caching strategies that most service workers will need
|
|
22
|
+
* and use. This module provides simple implementations of these strategies.
|
|
23
|
+
*/
|
|
24
|
+
export { CacheFirst, CacheOnly, NetworkFirst, NetworkOnly, StaleWhileRevalidate, Strategy, StrategyHandler };
|
|
25
|
+
|
|
26
|
+
export type { NetworkFirstOptions, NetworkOnlyOptions, StrategyOptions };
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HTTPMethod } from "./constants.js";
|
|
2
|
+
import { cacheNames } from "./cacheNames.js";
|
|
3
|
+
import { cleanupOutdatedCaches } from "./cleanupOutdatedCaches.js";
|
|
4
|
+
import { clientsClaim } from "./clientsClaim.js";
|
|
5
|
+
import { copyResponse } from "./copyResponse.js";
|
|
6
|
+
import { disableDevLogs } from "./disableDevLogs.js";
|
|
7
|
+
import { disableNavigationPreload, enableNavigationPreload, isNavigationPreloadSupported } from "./navigationPreload.js";
|
|
8
|
+
import type { NavigationRouteMatchOptions } from "./NavigationRoute.js";
|
|
9
|
+
import { NavigationRoute } from "./NavigationRoute.js";
|
|
10
|
+
import { parseRoute } from "./parseRoute.js";
|
|
11
|
+
import { PrecacheRoute } from "./PrecacheRoute.js";
|
|
12
|
+
import { PrecacheStrategy } from "./PrecacheStrategy.js";
|
|
13
|
+
import { RegExpRoute } from "./RegExpRoute.js";
|
|
14
|
+
import { registerQuotaErrorCallback } from "./registerQuotaErrorCallback.js";
|
|
15
|
+
import { Route } from "./Route.js";
|
|
16
|
+
import { Serwist, type SerwistOptions } from "./Serwist.js";
|
|
17
|
+
import { setCacheNameDetails } from "./setCacheNameDetails.js";
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
NavigationRoute,
|
|
21
|
+
cacheNames,
|
|
22
|
+
cleanupOutdatedCaches,
|
|
23
|
+
clientsClaim,
|
|
24
|
+
copyResponse,
|
|
25
|
+
disableDevLogs,
|
|
26
|
+
disableNavigationPreload,
|
|
27
|
+
enableNavigationPreload,
|
|
28
|
+
isNavigationPreloadSupported,
|
|
29
|
+
parseRoute,
|
|
30
|
+
PrecacheRoute,
|
|
31
|
+
PrecacheStrategy,
|
|
32
|
+
RegExpRoute,
|
|
33
|
+
registerQuotaErrorCallback,
|
|
34
|
+
Route,
|
|
35
|
+
Serwist,
|
|
36
|
+
setCacheNameDetails,
|
|
37
|
+
};
|
|
38
|
+
export type { HTTPMethod, NavigationRouteMatchOptions, SerwistOptions };
|
|
39
|
+
export type * from "./types.js";
|