123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- import { Strategy } from 'workbox-strategies/Strategy.js';
- import { RouteHandlerCallback, WorkboxPlugin } from 'workbox-core/types.js';
- import { PrecacheEntry, InstallResult, CleanupResult } from './_types.js';
- import './_version.js';
- declare global {
- interface ServiceWorkerGlobalScope {
- __WB_MANIFEST: Array<PrecacheEntry | string>;
- }
- }
- interface PrecacheControllerOptions {
- cacheName?: string;
- plugins?: WorkboxPlugin[];
- fallbackToNetwork?: boolean;
- }
- declare class PrecacheController {
- private _installAndActiveListenersAdded?;
- private readonly _strategy;
- private readonly _urlsToCacheKeys;
- private readonly _urlsToCacheModes;
- private readonly _cacheKeysToIntegrities;
-
- constructor({ cacheName, plugins, fallbackToNetwork, }?: PrecacheControllerOptions);
-
- get strategy(): Strategy;
-
- precache(entries: Array<PrecacheEntry | string>): void;
-
- addToCacheList(entries: Array<PrecacheEntry | string>): void;
-
- install(event: ExtendableEvent): Promise<InstallResult>;
-
- activate(event: ExtendableEvent): Promise<CleanupResult>;
-
- getURLsToCacheKeys(): Map<string, string>;
-
- getCachedURLs(): Array<string>;
-
- getCacheKeyForURL(url: string): string | undefined;
-
- getIntegrityForCacheKey(cacheKey: string): string | undefined;
-
- matchPrecache(request: string | Request): Promise<Response | undefined>;
-
- createHandlerBoundToURL(url: string): RouteHandlerCallback;
- }
- export { PrecacheController };
|