precache.d.ts 1000 B

12345678910111213141516171819202122232425262728
  1. import { PrecacheEntry } from './_types.js';
  2. import './_version.js';
  3. declare global {
  4. interface WorkerGlobalScope {
  5. __WB_MANIFEST: Array<PrecacheEntry | string>;
  6. }
  7. }
  8. /**
  9. * Adds items to the precache list, removing any duplicates and
  10. * stores the files in the
  11. * ["precache cache"]{@link module:workbox-core.cacheNames} when the service
  12. * worker installs.
  13. *
  14. * This method can be called multiple times.
  15. *
  16. * Please note: This method **will not** serve any of the cached files for you.
  17. * It only precaches files. To respond to a network request you call
  18. * [addRoute()]{@link module:workbox-precaching.addRoute}.
  19. *
  20. * If you have a single array of files to precache, you can just call
  21. * [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.
  22. *
  23. * @param {Array<Object|string>} [entries=[]] Array of entries to precache.
  24. *
  25. * @memberof module:workbox-precaching
  26. */
  27. declare function precache(entries: Array<PrecacheEntry | string>): void;
  28. export { precache };