BackgroundSyncPlugin.d.ts 951 B

123456789101112131415161718192021222324252627
  1. import { WorkboxPlugin } from 'workbox-core/types.js';
  2. import { QueueOptions } from './Queue.js';
  3. import './_version.js';
  4. /**
  5. * A class implementing the `fetchDidFail` lifecycle callback. This makes it
  6. * easier to add failed requests to a background sync Queue.
  7. *
  8. * @memberof module:workbox-background-sync
  9. */
  10. declare class BackgroundSyncPlugin implements WorkboxPlugin {
  11. private readonly _queue;
  12. /**
  13. * @param {string} name See the [Queue]{@link module:workbox-background-sync.Queue}
  14. * documentation for parameter details.
  15. * @param {Object} [options] See the
  16. * [Queue]{@link module:workbox-background-sync.Queue} documentation for
  17. * parameter details.
  18. */
  19. constructor(name: string, options: QueueOptions);
  20. /**
  21. * @param {Object} options
  22. * @param {Request} options.request
  23. * @private
  24. */
  25. fetchDidFail: WorkboxPlugin['fetchDidFail'];
  26. }
  27. export { BackgroundSyncPlugin };