staticResourceCache.d.ts 1.1 KB

123456789101112131415161718192021
  1. import { RouteMatchCallback, WorkboxPlugin } from 'workbox-core/types.js';
  2. import './_version.js';
  3. export interface StaticResourceOptions {
  4. cacheName?: string;
  5. matchCallback?: RouteMatchCallback;
  6. plugins?: Array<WorkboxPlugin>;
  7. warmCache?: Array<string>;
  8. }
  9. /**
  10. * An implementation of the [CSS and JavaScript files recipe]{@link https://developers.google.com/web/tools/workbox/guides/common-recipes#cache_css_and_javascript_files}
  11. *
  12. * @memberof workbox-recipes
  13. *
  14. * @param {Object} [options]
  15. * @param {string} [options.cacheName] Name for cache. Defaults to static-resources
  16. * @param {RouteMatchCallback} [options.matchCallback] Workbox callback function to call to match to. Defaults to request.destination === 'style' || request.destination === 'script' || request.destination === 'worker';
  17. * @param {WorkboxPlugin[]} [options.plugins] Additional plugins to use for this recipe
  18. * @param {string[]} [options.warmCache] Paths to call to use to warm this cache
  19. */
  20. declare function staticResourceCache(options?: StaticResourceOptions): void;
  21. export { staticResourceCache };