Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/NotificationAPI.res
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ type notificationOptions = {
mutable requireInteraction?: bool,
mutable data?: JSON.t,
mutable actions?: array<notificationAction>,
/**
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#vibrate)
*/
mutable vibrate?: array<int>,
}

type getNotificationOptions = {mutable tag?: string}
Expand Down
2 changes: 1 addition & 1 deletion tests/NotificationsAPI/Notification__test.res
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Notification.requestPermission()
| Default => Console.log("Permission default")
}
})
->Promise.done
->Promise.ignore
7 changes: 7 additions & 0 deletions tests/ServiceWorkerAPI/ServiceWorker__test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions tests/ServiceWorkerAPI/ServiceWorker__test.res
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ self->ServiceWorkerGlobalScope.addEventListener(EventAPI.Push, (event: PushAPI.p
actions: [{action: "open", title: "Open"}, {action: "close", title: "Close"}],
// For example the id of a new data entry
data: JSON.Number(17.),
vibrate: [200, 50, 200, 50, 400],
},
)
->Promise.done
->Promise.ignore
})

self->ServiceWorkerGlobalScope.addEventListener(EventAPI.NotificationClick, (
Expand All @@ -51,6 +52,6 @@ self->ServiceWorkerGlobalScope.addEventListener(EventAPI.NotificationClick, (
->Option.forEach(id => {
self.clients
->Clients.openWindow(`https://mywebsite.com/mydata/${id}`)
->Promise.done
->Promise.ignore
})
})
Loading