CacheOnly.d.ts 1.0 KB

123456789101112131415161718192021222324252627
  1. import { Strategy } from './Strategy.js';
  2. import { StrategyHandler } from './StrategyHandler.js';
  3. import './_version.js';
  4. /**
  5. * An implementation of a
  6. * [cache-only]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-only}
  7. * request strategy.
  8. *
  9. * This class is useful if you want to take advantage of any
  10. * [Workbox plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}.
  11. *
  12. * If there is no cache match, this will throw a `WorkboxError` exception.
  13. *
  14. * @extends module:workbox-strategies.Strategy
  15. * @memberof module:workbox-strategies
  16. */
  17. declare class CacheOnly extends Strategy {
  18. /**
  19. * @private
  20. * @param {Request|string} request A request to run this strategy for.
  21. * @param {module:workbox-strategies.StrategyHandler} handler The event that
  22. * triggered the request.
  23. * @return {Promise<Response>}
  24. */
  25. _handle(request: Request, handler: StrategyHandler): Promise<Response>;
  26. }
  27. export { CacheOnly };