index.d.ts 777 B

12345678910111213141516171819202122232425
  1. import { BackgroundSyncPlugin } from './BackgroundSyncPlugin.js';
  2. import { Queue, QueueOptions } from './Queue.js';
  3. import { QueueStore } from './QueueStore.js';
  4. import { StorableRequest } from './StorableRequest.js';
  5. import './_version.js';
  6. interface SyncManager {
  7. getTags(): Promise<string[]>;
  8. register(tag: string): Promise<void>;
  9. }
  10. declare global {
  11. interface ServiceWorkerRegistration {
  12. readonly sync: SyncManager;
  13. }
  14. interface SyncEvent extends ExtendableEvent {
  15. readonly lastChance: boolean;
  16. readonly tag: string;
  17. }
  18. interface ServiceWorkerGlobalScopeEventMap {
  19. sync: SyncEvent;
  20. }
  21. }
  22. /**
  23. * @module workbox-background-sync
  24. */
  25. export { BackgroundSyncPlugin, Queue, QueueOptions, QueueStore, StorableRequest };