-
Notifications
You must be signed in to change notification settings - Fork 0
/
NotificationEvent.cljs
91 lines (70 loc) · 3.45 KB
/
NotificationEvent.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(ns web.service-workers.NotificationEvent
"The parameter passed into the `onnotificationclick` handler,
NotificationEvent interface represents a notification click event
is dispatched on the `web.workers.ServiceWorkerGlobalScope` of
`web.workers.ServiceWorker`."
(:refer-clojure :exclude []))
(def constructor
"Constructor.
The NotificationEvent() constructor creates a new `web.service-workers.NotificationEvent` object.
type
TBD
NotificationEventInit Optional
A dictionary object containing a `web.other.Notification` object to be used as the notification the event is dispatched on. In later drafts of the specification, this parameter is not optional.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/NotificationEvent`"
js/NotificationEvent)
(defn wait-until
"Method.
The extendableEvent.waitUntil() method tells the event dispatcher
work is ongoing. It can also be used to detect whether that work
successful. In service workers, waitUntil() tells the browser
work is ongoing until the promise settles, and it shouldn't terminate
service worker if it wants that work to complete.
`event.waitUntil(promise)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ExtendableEvent/waitUntil`"
[this promise]
(-> this (.waitUntil promise)))
(defn notification
"Property.
The notification read-only property of the `web.service-workers.NotificationEvent`
returns the instance of the `web.other.Notification` that was
to fire the event. The `web.other.Notification` provides read-only
to many properties that were set at the instantiation time of
Notification such as tag and data attributes that allow you to
information for defered use in the notificationclick event.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/notification`"
[this]
(-> this (.-notification)))
(defn set-notification!
"Property.
The notification read-only property of the `web.service-workers.NotificationEvent`
returns the instance of the `web.other.Notification` that was
to fire the event. The `web.other.Notification` provides read-only
to many properties that were set at the instantiation time of
Notification such as tag and data attributes that allow you to
information for defered use in the notificationclick event.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/notification`"
[this val]
(aset this "notification" val))
(defn action
"Property.
Returns the string ID of the notification button the user clicked.
value returns an empty string if the user clicked the notification
other than an action button, or the notification does not have
button. The notification id is set during the creation of the
via the actions array attribute and can't be modified unless
notification is replaced.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/action`"
[this]
(-> this (.-action)))
(defn set-action!
"Property.
Returns the string ID of the notification button the user clicked.
value returns an empty string if the user clicked the notification
other than an action button, or the notification does not have
button. The notification id is set during the creation of the
via the actions array attribute and can't be modified unless
notification is replaced.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NotificationEvent/action`"
[this val]
(aset this "action" val))