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,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Deferred class composes Promises in a way that allows for them to be
|
|
3
|
+
* resolved or rejected from outside the constructor. In most cases promises
|
|
4
|
+
* should be used directly, but Deferreds can be necessary when the logic to
|
|
5
|
+
* resolve a promise must be separate.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
declare class Deferred<T> {
|
|
10
|
+
promise: Promise<T>;
|
|
11
|
+
resolve: (value: T) => void;
|
|
12
|
+
reject: (reason?: any) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a promise and exposes its resolve and reject functions as methods.
|
|
15
|
+
*/
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
18
|
+
export { Deferred };
|
|
19
|
+
//# sourceMappingURL=Deferred.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Deferred.d.ts","sourceRoot":"","sources":["../../src/utils/Deferred.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,cAAM,QAAQ,CAAC,CAAC;IACd,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,OAAO,EAAG,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,MAAM,EAAG,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC;;OAEG;;CAOJ;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SerwistPlugin } from "../types.js";
|
|
2
|
+
import type { Serwist } from "../Serwist.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: Serwist;
|
|
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/utils/PrecacheCacheKeyPlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,aAAa,CAAC;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;;;;GAKG;AACH,qBAAa,sBAAuB,YAAW,aAAa;IAC1D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAU;gBAElC,EAAE,kBAAkB,EAAE,EAAE;QAAE,kBAAkB,EAAE,OAAO,CAAA;KAAE;IAInE,kBAAkB,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAOrD;CACH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SerwistPlugin } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A plugin designed to determine the number of assets that were updated (or not updated)
|
|
4
|
+
* during the `install` event.
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
export declare class PrecacheInstallReportPlugin implements SerwistPlugin {
|
|
9
|
+
updatedURLs: string[];
|
|
10
|
+
notUpdatedURLs: string[];
|
|
11
|
+
handlerWillStart: SerwistPlugin["handlerWillStart"];
|
|
12
|
+
cachedResponseWillBeUsed: SerwistPlugin["cachedResponseWillBeUsed"];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=PrecacheInstallReportPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrecacheInstallReportPlugin.d.ts","sourceRoot":"","sources":["../../src/utils/PrecacheInstallReportPlugin.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAA8B,MAAM,aAAa,CAAC;AAE7E;;;;;GAKG;AACH,qBAAa,2BAA4B,YAAW,aAAa;IAC/D,WAAW,EAAE,MAAM,EAAE,CAAM;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAM;IAE9B,gBAAgB,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAKjD;IAEF,wBAAwB,EAAE,aAAa,CAAC,0BAA0B,CAAC,CAkBjE;CACH"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MessageKey } from "../models/messages/messages.js";
|
|
2
|
+
import type { MapLikeObject } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Serwist errors should be thrown with this class.
|
|
5
|
+
* This allows use to ensure the type easily in tests,
|
|
6
|
+
* helps developers identify errors from Serwist
|
|
7
|
+
* easily and allows use to optimise error
|
|
8
|
+
* messages correctly.
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
export declare class SerwistError extends Error {
|
|
13
|
+
details?: MapLikeObject;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param errorCode The error code that
|
|
17
|
+
* identifies this particular error.
|
|
18
|
+
* @param details Any relevant arguments
|
|
19
|
+
* that will help developers identify issues should
|
|
20
|
+
* be added as a key on the context object.
|
|
21
|
+
*/
|
|
22
|
+
constructor(errorCode: MessageKey, details?: MapLikeObject);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=SerwistError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SerwistError.d.ts","sourceRoot":"","sources":["../../src/utils/SerwistError.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;;OAOG;gBACS,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,aAAa;CAQ3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MapLikeObject } from "../types.js";
|
|
2
|
+
declare const finalAssertExports: {
|
|
3
|
+
hasMethod: (object: MapLikeObject, expectedMethod: string, details: MapLikeObject) => void;
|
|
4
|
+
isArray: (value: any[], details: MapLikeObject) => void;
|
|
5
|
+
isInstance: (object: unknown, expectedClass: Function, details: MapLikeObject) => void;
|
|
6
|
+
isOneOf: (value: any, validValues: any[], details: MapLikeObject) => void;
|
|
7
|
+
isType: (object: unknown, expectedType: string, details: MapLikeObject) => void;
|
|
8
|
+
isArrayOfClass: (value: any, expectedClass: Function, details: MapLikeObject) => void;
|
|
9
|
+
} | null;
|
|
10
|
+
export { finalAssertExports as assert };
|
|
11
|
+
//# sourceMappingURL=assert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/utils/assert.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAmEjD,QAAA,MAAM,kBAAkB;wBArDG,aAAa,kBAAkB,MAAM,WAAW,aAAa;qBANhE,GAAG,EAAE,WAAW,aAAa;yBAuB3C,OAAO,iBAEA,QAAQ,WACd,aAAa;qBAQA,GAAG,eAAe,GAAG,EAAE,WAAW,aAAa;qBApB/C,OAAO,gBAAgB,MAAM,WAAW,aAAa;4BA4BpE,GAAG,iBAEK,QAAQ,WACd,aAAa;QAwBjB,CAAC;AAER,OAAO,EAAE,kBAAkB,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matches an item in the cache, ignoring specific URL params. This is similar
|
|
3
|
+
* to the `ignoreSearch` option, but it allows you to ignore just specific
|
|
4
|
+
* params (while continuing to match on the others).
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
* @param cache
|
|
8
|
+
* @param request
|
|
9
|
+
* @param matchOptions
|
|
10
|
+
* @param ignoreParams
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
declare function cacheMatchIgnoreParams(cache: Cache, request: Request, ignoreParams: string[], matchOptions?: CacheQueryOptions): Promise<Response | undefined>;
|
|
14
|
+
export { cacheMatchIgnoreParams };
|
|
15
|
+
//# sourceMappingURL=cacheMatchIgnoreParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheMatchIgnoreParams.d.ts","sourceRoot":"","sources":["../../src/utils/cacheMatchIgnoreParams.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;GAWG;AACH,iBAAe,sBAAsB,CACnC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,CAAC,EAAE,iBAAiB,GAC/B,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAmB/B;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface CacheNameDetails {
|
|
2
|
+
googleAnalytics: string;
|
|
3
|
+
precache: string;
|
|
4
|
+
prefix: string;
|
|
5
|
+
runtime: string;
|
|
6
|
+
suffix: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PartialCacheNameDetails {
|
|
9
|
+
/**
|
|
10
|
+
* The string to add to the beginning of the precache and runtime cache names.
|
|
11
|
+
*/
|
|
12
|
+
prefix?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The string to add to the end of the precache and runtime cache names.
|
|
15
|
+
*/
|
|
16
|
+
suffix?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The cache name to use for precache caching.
|
|
19
|
+
*/
|
|
20
|
+
precache?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The cache name to use for runtime caching.
|
|
23
|
+
*/
|
|
24
|
+
runtime?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The cache name to use for `@serwist/google-analytics` caching.
|
|
27
|
+
*/
|
|
28
|
+
googleAnalytics?: string;
|
|
29
|
+
[propName: string]: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export type CacheNameDetailsProp = "googleAnalytics" | "precache" | "prefix" | "runtime" | "suffix";
|
|
32
|
+
export declare const cacheNames: {
|
|
33
|
+
updateDetails: (details: PartialCacheNameDetails) => void;
|
|
34
|
+
getGoogleAnalyticsName: (userCacheName?: string) => string;
|
|
35
|
+
getPrecacheName: (userCacheName?: string) => string;
|
|
36
|
+
getPrefix: () => string;
|
|
37
|
+
getRuntimeName: (userCacheName?: string) => string;
|
|
38
|
+
getSuffix: () => string;
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=cacheNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheNames.d.ts","sourceRoot":"","sources":["../../src/utils/cacheNames.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAoBpG,eAAO,MAAM,UAAU;6BACI,uBAAuB,KAAG,IAAI;6CAQd,MAAM,KAAG,MAAM;sCAGtB,MAAM,KAAG,MAAM;qBAGlC,MAAM;qCAGY,MAAM,KAAG,MAAM;qBAGjC,MAAM;CAGtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility function that determines whether the current browser supports
|
|
3
|
+
* constructing a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)
|
|
4
|
+
* object.
|
|
5
|
+
*
|
|
6
|
+
* @returns `true`, if the current browser can successfully construct a `ReadableStream`, `false` otherwise.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
declare function canConstructReadableStream(): boolean;
|
|
11
|
+
export { canConstructReadableStream };
|
|
12
|
+
//# sourceMappingURL=canConstructReadableStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canConstructReadableStream.d.ts","sourceRoot":"","sources":["../../src/utils/canConstructReadableStream.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,iBAAS,0BAA0B,IAAI,OAAO,CAY7C;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility function that determines whether the current browser supports
|
|
3
|
+
* constructing a new `Response` from a `response.body` stream.
|
|
4
|
+
*
|
|
5
|
+
* @returns `true`, if the current browser can successfully construct
|
|
6
|
+
* a `Response` from a `response.body` stream, `false` otherwise.
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
declare function canConstructResponseFromBodyStream(): boolean;
|
|
10
|
+
export { canConstructResponseFromBodyStream };
|
|
11
|
+
//# sourceMappingURL=canConstructResponseFromBodyStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canConstructResponseFromBodyStream.d.ts","sourceRoot":"","sources":["../../src/utils/canConstructResponseFromBodyStream.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,iBAAS,kCAAkC,IAAI,OAAO,CAgBrD;AAED,OAAO,EAAE,kCAAkC,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PrecacheEntry } from "../types.js";
|
|
2
|
+
interface CacheKey {
|
|
3
|
+
cacheKey: string;
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Converts a manifest entry into a versioned URL suitable for precaching.
|
|
8
|
+
*
|
|
9
|
+
* @param entry
|
|
10
|
+
* @returns A URL with versioning info.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
export declare const createCacheKey: (entry: PrecacheEntry | string) => CacheKey;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=createCacheKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCacheKey.d.ts","sourceRoot":"","sources":["../../src/utils/createCacheKey.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,UAAU,QAAQ;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAKD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,UAAW,aAAa,GAAG,MAAM,KAAG,QAuC9D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cleans up incompatible precaches that were created by older versions of
|
|
3
|
+
* Serwist, by a service worker registered under the current scope.
|
|
4
|
+
*
|
|
5
|
+
* This is meant to be called as part of the `activate` event.
|
|
6
|
+
*
|
|
7
|
+
* This should be safe to use as long as you don't include `substringToFind`
|
|
8
|
+
* (defaulting to `-precache-`) in your non-precache cache names.
|
|
9
|
+
*
|
|
10
|
+
* @param currentPrecacheName The cache name currently in use for
|
|
11
|
+
* precaching. This cache won't be deleted.
|
|
12
|
+
* @param substringToFind Cache names which include this
|
|
13
|
+
* substring will be deleted (excluding `currentPrecacheName`).
|
|
14
|
+
* @returns A list of all the cache names that were deleted.
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
export declare const deleteOutdatedCaches: (currentPrecacheName: string, substringToFind?: string) => Promise<string[]>;
|
|
18
|
+
//# sourceMappingURL=deleteOutdatedCaches.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteOutdatedCaches.d.ts","sourceRoot":"","sources":["../../src/utils/deleteOutdatedCaches.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,wBAA+B,MAAM,oBAAmB,MAAM,KAAuB,QAAQ,MAAM,EAAE,CAUrI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dontWaitFor.d.ts","sourceRoot":"","sources":["../../src/utils/dontWaitFor.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAGvD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs all of the callback functions, one at a time sequentially, in the order
|
|
3
|
+
* in which they were registered.
|
|
4
|
+
*
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
export declare const executeQuotaErrorCallbacks: () => Promise<void>;
|
|
8
|
+
//# sourceMappingURL=executeQuotaErrorCallbacks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeQuotaErrorCallbacks.d.ts","sourceRoot":"","sources":["../../src/utils/executeQuotaErrorCallbacks.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,QAAa,QAAQ,IAAI,CAe/D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PrecacheRouteOptions } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Generator function that yields possible variations on the original URL to
|
|
4
|
+
* check, one at a time.
|
|
5
|
+
*
|
|
6
|
+
* @param url
|
|
7
|
+
* @param options
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateURLVariations(url: string, { directoryIndex, ignoreURLParametersMatching, cleanURLs, urlManipulation, }?: PrecacheRouteOptions): Generator<string, void, unknown>;
|
|
12
|
+
//# sourceMappingURL=generateURLVariations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateURLVariations.d.ts","sourceRoot":"","sources":["../../src/utils/generateURLVariations.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;;;GAQG;AACH,wBAAiB,qBAAqB,CACpC,GAAG,EAAE,MAAM,EACX,EACE,cAA6B,EAC7B,2BAAmD,EACnD,SAAgB,EAChB,eAAe,GAChB,GAAE,oBAAyB,GAC3B,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CA0BlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFriendlyURL.d.ts","sourceRoot":"","sources":["../../src/utils/getFriendlyURL.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,cAAc,QAAS,GAAG,GAAG,MAAM,KAAG,MAK3C,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface WorkerGlobalScope {
|
|
3
|
+
__WB_DISABLE_DEV_LOGS: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface Window {
|
|
6
|
+
__WB_DISABLE_DEV_LOGS: boolean;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The logger used by Serwist inside of both service workers and the window global scope.
|
|
11
|
+
*
|
|
12
|
+
* Note: This is forcibly `null` in production mode to reduce bundle size. Do check whether
|
|
13
|
+
* you are currently in development mode (by using `process.env.NODE_ENV !== "production"`)
|
|
14
|
+
* before using it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const logger: {
|
|
17
|
+
error: (...args: any[]) => void;
|
|
18
|
+
debug: (...args: any[]) => void;
|
|
19
|
+
log: (...args: any[]) => void;
|
|
20
|
+
warn: (...args: any[]) => void;
|
|
21
|
+
groupCollapsed: (...args: any[]) => void;
|
|
22
|
+
groupEnd: (...args: any[]) => void;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAQA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,iBAAiB;QACzB,qBAAqB,EAAE,OAAO,CAAC;KAChC;IAED,UAAU,MAAM;QACd,qBAAqB,EAAE,OAAO,CAAC;KAChC;CACF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM;qBAmEoC,GAAG,EAAE,KAAK,IAAI;qBAAd,GAAG,EAAE,KAAK,IAAI;mBAAd,GAAG,EAAE,KAAK,IAAI;oBAAd,GAAG,EAAE,KAAK,IAAI;8BAAd,GAAG,EAAE,KAAK,IAAI;wBAAd,GAAG,EAAE,KAAK,IAAI;CAE3D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RouteHandler, RouteHandlerObject } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* @param handler Either a function, or an object with a
|
|
4
|
+
* 'handle' method.
|
|
5
|
+
* @returns An object with a handle method.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export declare const normalizeHandler: (handler: RouteHandler) => RouteHandlerObject;
|
|
10
|
+
//# sourceMappingURL=normalizeHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeHandler.d.ts","sourceRoot":"","sources":["../../src/utils/normalizeHandler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGpE;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,YAAa,YAAY,KAAG,kBAqBxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginUtils.d.ts","sourceRoot":"","sources":["../../src/utils/pluginUtils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,WAAW;sBACJ,aAAa,EAAE,gBAAgB,MAAM,KAAG,aAAa,EAAE;CAG1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printCleanupDetails.d.ts","sourceRoot":"","sources":["../../src/utils/printCleanupDetails.ts"],"names":[],"mappings":"AA0BA;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gBAAiB,MAAM,EAAE,KAAG,IAO3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printInstallDetails.d.ts","sourceRoot":"","sources":["../../src/utils/printInstallDetails.ts"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,mBAAoB,MAAM,EAAE,wBAAwB,MAAM,EAAE,KAAG,IAiB9F,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes any URL search parameters that should be ignored.
|
|
3
|
+
*
|
|
4
|
+
* @param urlObject The original URL.
|
|
5
|
+
* @param ignoreURLParametersMatching RegExps to test against
|
|
6
|
+
* each search parameter name. Matches mean that the search parameter should be
|
|
7
|
+
* ignored.
|
|
8
|
+
* @returns The URL with any ignored search parameters removed.
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export declare const removeIgnoredSearchParams: (urlObject: URL, ignoreURLParametersMatching?: RegExp[]) => URL;
|
|
12
|
+
//# sourceMappingURL=removeIgnoredSearchParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeIgnoredSearchParams.d.ts","sourceRoot":"","sources":["../../src/utils/removeIgnoredSearchParams.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,cAAe,GAAG,gCAA+B,MAAM,EAAE,KAAQ,GAUtG,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a promise that resolves to a window client matching the passed
|
|
3
|
+
* `resultingClientId`. For browsers that don't support `resultingClientId`
|
|
4
|
+
* or if waiting for the resulting client to apper takes too long, resolve to
|
|
5
|
+
* `undefined`.
|
|
6
|
+
*
|
|
7
|
+
* @param resultingClientId
|
|
8
|
+
* @returns
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export declare function resultingClientExists(resultingClientId?: string): Promise<Client | undefined>;
|
|
12
|
+
//# sourceMappingURL=resultingClientExists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resultingClientExists.d.ts","sourceRoot":"","sources":["../../src/utils/resultingClientExists.ts"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAiCnG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a promise that resolves and the passed number of milliseconds.
|
|
3
|
+
* This utility is an async/await-friendly version of `setTimeout`.
|
|
4
|
+
*
|
|
5
|
+
* @param ms
|
|
6
|
+
* @returns
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export declare function timeout(ms: number): Promise<unknown>;
|
|
10
|
+
//# sourceMappingURL=timeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../src/utils/timeout.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AAEH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEpD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility method that makes it easier to use `event.waitUntil` with
|
|
3
|
+
* async functions and return the result.
|
|
4
|
+
*
|
|
5
|
+
* @param event
|
|
6
|
+
* @param asyncFn
|
|
7
|
+
* @returns
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
export declare const waitUntil: <T = any>(event: ExtendableEvent, asyncFn: () => Promise<T>) => Promise<T>;
|
|
11
|
+
//# sourceMappingURL=waitUntil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waitUntil.d.ts","sourceRoot":"","sources":["../../src/utils/waitUntil.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,mBAAoB,eAAe,WAAW,MAAM,QAAQ,CAAC,CAAC,KAAG,QAAQ,CAAC,CAI/F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../src/utils/welcome.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "serwist",
|
|
3
|
+
"version": "9.0.0-preview.24",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A Swiss Army knife for service workers.",
|
|
6
|
+
"files": [
|
|
7
|
+
"src",
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"serwist",
|
|
12
|
+
"serwistjs",
|
|
13
|
+
"service worker",
|
|
14
|
+
"sw"
|
|
15
|
+
],
|
|
16
|
+
"author": "Google's Web DevRel Team, Serwist's Team",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"repository": "https://gitlab.com/serwist/serwist",
|
|
19
|
+
"bugs": "https://gitlab.com/serwist/serwist/issues",
|
|
20
|
+
"homepage": "https://serwist.pages.dev",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
"plugins": [
|
|
26
|
+
"./dist/index.plugins.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"legacy": [
|
|
29
|
+
"./dist/index.legacy.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"internal": [
|
|
32
|
+
"./dist/index.internal.d.ts"
|
|
33
|
+
],
|
|
34
|
+
"strategies": [
|
|
35
|
+
"./dist/index.strategies.d.ts"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"default": "./dist/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./plugins": {
|
|
45
|
+
"types": "./dist/index.plugins.d.ts",
|
|
46
|
+
"default": "./dist/index.plugins.js"
|
|
47
|
+
},
|
|
48
|
+
"./legacy": {
|
|
49
|
+
"types": "./dist/index.legacy.d.ts",
|
|
50
|
+
"default": "./dist/index.legacy.js"
|
|
51
|
+
},
|
|
52
|
+
"./internal": {
|
|
53
|
+
"types": "./dist/index.internal.d.ts",
|
|
54
|
+
"default": "./dist/index.internal.js"
|
|
55
|
+
},
|
|
56
|
+
"./strategies": {
|
|
57
|
+
"types": "./dist/index.strategies.d.ts",
|
|
58
|
+
"default": "./dist/index.strategies.js"
|
|
59
|
+
},
|
|
60
|
+
"./package.json": "./package.json"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"idb": "8.0.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"rollup": "4.14.0",
|
|
67
|
+
"typescript": "5.5.0-dev.20240404",
|
|
68
|
+
"@serwist/constants": "9.0.0-preview.24",
|
|
69
|
+
"@serwist/utils": "9.0.0-preview.24"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"typescript": ">=5.0.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"typescript": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",
|
|
81
|
+
"dev": "rollup --config rollup.config.js --watch",
|
|
82
|
+
"lint": "biome lint ./src",
|
|
83
|
+
"typecheck": "tsc"
|
|
84
|
+
}
|
|
85
|
+
}
|