-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sensor.cljs
204 lines (135 loc) · 6.15 KB
/
Sensor.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
(ns web.sensors.Sensor
"The Sensor interface of the the Sensor APIs is the base class
all the other sensor interfaces. This interface cannot be used
Instead it provides properties, event handlers, and methods accessed
interfaces that inherit from it."
(:refer-clojure :exclude []))
(defn start
"Method.
The start method activates one of the sensors based on Sensor.
`Sensor.start()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/start`"
[this ]
(-> this (.start)))
(defn stop
"Method.
The stop method of the `web.sensors.Sensor` interface deactivates
current sensor.
`Sensor.stop()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/stop`"
[this ]
(-> this (.stop)))
(defn activated
"Property.
The activated read-only property of the `web.sensors.Sensor`
returns a `js.Boolean` indicating whether the sensor is active.
`var boolean = sensorInstance.activated
Because `web.sensors.Sensor` is a base class, activated may only be read from one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/activated`"
[this]
(-> this (.-activated)))
(defn set-activated!
"Property.
The activated read-only property of the `web.sensors.Sensor`
returns a `js.Boolean` indicating whether the sensor is active.
`var boolean = sensorInstance.activated
Because `web.sensors.Sensor` is a base class, activated may only be read from one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/activated`"
[this val]
(aset this "activated" val))
(defn has-reading
"Property.
The hasReading read-only property of the `web.sensors.Sensor`
returns a `js.Boolean` indicating whether the sensor has a reading.
`var boolean = sensorInstance.hasReading
Because `web.sensors.Sensor` is a base class, hasReading may only be read from one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/hasReading`"
[this]
(-> this (.-hasReading)))
(defn set-has-reading!
"Property.
The hasReading read-only property of the `web.sensors.Sensor`
returns a `js.Boolean` indicating whether the sensor has a reading.
`var boolean = sensorInstance.hasReading
Because `web.sensors.Sensor` is a base class, hasReading may only be read from one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/hasReading`"
[this val]
(aset this "hasReading" val))
(defn timestamp
"Property.
The timestamp read-only property of the `web.sensors.Sensor`
returns the time stamp of the latest sensor reading.
`var timestamp = sensorInstance.timestamp
Because `web.sensors.Sensor` is a base class, timestamp may only be read from one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/timestamp`"
[this]
(-> this (.-timestamp)))
(defn set-timestamp!
"Property.
The timestamp read-only property of the `web.sensors.Sensor`
returns the time stamp of the latest sensor reading.
`var timestamp = sensorInstance.timestamp
Because `web.sensors.Sensor` is a base class, timestamp may only be read from one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/timestamp`"
[this val]
(aset this "timestamp" val))
(defn onerror
"Property.
The onerror `EventHandler` is called when an error occurs on
of the child interfaces of the `web.sensors.Sensor` interface.
`sensorInstance.onerror = function
sensorInstance.addEventListener('error', function() { ... })
Because `web.sensors.Sensor` is a base class, onerror may only be used on one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/onerror`"
[this]
(-> this (.-onerror)))
(defn set-onerror!
"Property.
The onerror `EventHandler` is called when an error occurs on
of the child interfaces of the `web.sensors.Sensor` interface.
`sensorInstance.onerror = function
sensorInstance.addEventListener('error', function() { ... })
Because `web.sensors.Sensor` is a base class, onerror may only be used on one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/onerror`"
[this val]
(aset this "onerror" val))
(defn onreading
"Property.
The onreading `EventHandler` is called when a reading is taken
one of the child interfaces of the `web.sensors.Sensor` interface.
`sensorInstance.onreading = function
sensorInstance.addEventListener('reading', function() { ... })
Because `web.sensors.Sensor` is a base class, onreading may only be used on one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/onreading`"
[this]
(-> this (.-onreading)))
(defn set-onreading!
"Property.
The onreading `EventHandler` is called when a reading is taken
one of the child interfaces of the `web.sensors.Sensor` interface.
`sensorInstance.onreading = function
sensorInstance.addEventListener('reading', function() { ... })
Because `web.sensors.Sensor` is a base class, onreading may only be used on one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/onreading`"
[this val]
(aset this "onreading" val))
(defn onactivate
"Property.
The onactivate `EventHandler` is called when one of the Sensor
child interfaces becomes active.
`sensorInstance.onactivate = function
sensorInstance.addEventListener('activate', function() { ... })
Because `web.sensors.Sensor` is a base class, onactivate may only be used on one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/onactivate`"
[this]
(-> this (.-onactivate)))
(defn set-onactivate!
"Property.
The onactivate `EventHandler` is called when one of the Sensor
child interfaces becomes active.
`sensorInstance.onactivate = function
sensorInstance.addEventListener('activate', function() { ... })
Because `web.sensors.Sensor` is a base class, onactivate may only be used on one of its derived classes.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Sensor/onactivate`"
[this val]
(aset this "onactivate" val))