Skip to content

Commit a2ab3fd

Browse files
committed
Add Notification.permission
1 parent de5f7c2 commit a2ab3fd

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/NotificationAPI/Notification.res

+7
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ external requestPermission: (
2323
*/
2424
@send
2525
external close: notification => unit = "close"
26+
27+
/**
28+
[Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Notification/permission_static)
29+
*/
30+
@scope("Notification")
31+
@val
32+
external permission: notificationPermission = "permission"

tests/NotificationsAPI/Notification__test.js

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/NotificationsAPI/Notification__test.res

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
open WebAPI.NotificationAPI
22

3+
let current = Notification.permission
4+
35
Notification.requestPermission()
46
->Promise.thenResolve(notificationPermission => {
57
switch notificationPermission {

0 commit comments

Comments
 (0)