pageCache.d.ts 1.0 KB

1234567891011121314151617181920212223
  1. import { RouteMatchCallback, WorkboxPlugin } from 'workbox-core/types.js';
  2. import './_version.js';
  3. export interface PageCacheOptions {
  4. cacheName?: string;
  5. matchCallback?: RouteMatchCallback;
  6. networkTimeoutSeconds?: number;
  7. plugins?: Array<WorkboxPlugin>;
  8. warmCache?: Array<string>;
  9. }
  10. /**
  11. * An implementation of a page caching recipe with a network timeout
  12. *
  13. * @memberof workbox-recipes
  14. *
  15. * @param {Object} [options]
  16. * @param {string} [options.cacheName] Name for cache. Defaults to pages
  17. * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.mode === 'navigate';
  18. * @param {number} [options.networkTimoutSeconds] Maximum amount of time, in seconds, to wait on the network before falling back to cache. Defaults to 3
  19. * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
  20. * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
  21. */
  22. declare function pageCache(options?: PageCacheOptions): void;
  23. export { pageCache };