CacheOnly.d.ts 963 B

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