Skip to content

Commit

Permalink
IDL
Browse files Browse the repository at this point in the history
  • Loading branch information
beverloo committed Mar 26, 2019
0 parents commit 5e6498e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions WebIDL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Proposed WebIDL

## Definition of the interface
```webidl
partial interface ServiceWorkerRegistration {
readonly attribute PeriodicSyncManager periodicSync;
};
[SecureContext, Exposed=(Window,Worker)]
interface PeriodicSyncManager {
Promise<void> register(DOMString tag, BackgroundSyncOptions options);
Promise<void> unregister(DOMString tag);
Promise<sequence<DOMString>> getTags();
};
```

## Definition of the Service Worker event
```webidl
partial interface ServiceWorkerGlobalScope {
attribute EventHandler onperiodicsync;
};
[Constructor(DOMString type, PeriodicSyncEventInit init), Exposed=ServiceWorker]
interface SyncEvent : ExtendableEvent {
readonly attribute DOMString tag;
};
dictionary PeriodicSyncEventInit : ExtendableEventInit {
required DOMString tag;
};
```

## Extensions to the Background Sync API
```webidl
dictionary BackgroundSyncOptions {
// …existing properties…
unsigned long long minInterval;
};
```

0 comments on commit 5e6498e

Please sign in to comment.