-
Notifications
You must be signed in to change notification settings - Fork 0
/
PermissionStatus.cljs
76 lines (55 loc) · 2.21 KB
/
PermissionStatus.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
(ns web.permissions.PermissionStatus
"The PermissionStatus interface of the Permissions API provides
state of an object and an event handler for monitoring changes
said state."
(:refer-clojure :exclude []))
(defn state
"Property.
The state read-only property of the `web.permissions.PermissionStatus`
returns the state of a requested permission. This property returns
of 'granted', 'denied', or 'prompt'.
`var permission = PermissionStatus.state;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state`"
[this]
(-> this (.-state)))
(defn set-state!
"Property.
The state read-only property of the `web.permissions.PermissionStatus`
returns the state of a requested permission. This property returns
of 'granted', 'denied', or 'prompt'.
`var permission = PermissionStatus.state;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state`"
[this val]
(aset this "state" val))
(defn status
"Property.
Returns the state of a requested permission; one of 'granted',
or 'prompt'. Later versions of the specification replace this
PermissionStatus.state."
[this]
(-> this (.-status)))
(defn set-status!
"Property.
Returns the state of a requested permission; one of 'granted',
or 'prompt'. Later versions of the specification replace this
PermissionStatus.state."
[this val]
(aset this "status" val))
(defn onchange
"Property.
The onchange event handler of the `web.permissions.PermissionStatus`
is called whenever the `PermissionStatus.state` property changes.
`PermissionStatus.onchange = function() { ... }
PermissionStatus.addEventListener('change', function() { ... })`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/onchange`"
[this]
(-> this (.-onchange)))
(defn set-onchange!
"Property.
The onchange event handler of the `web.permissions.PermissionStatus`
is called whenever the `PermissionStatus.state` property changes.
`PermissionStatus.onchange = function() { ... }
PermissionStatus.addEventListener('change', function() { ... })`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/onchange`"
[this val]
(aset this "onchange" val))