-
Notifications
You must be signed in to change notification settings - Fork 0
/
AmbientLightSensor.cljs
45 lines (31 loc) · 1.7 KB
/
AmbientLightSensor.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
(ns web.ambient.AmbientLightSensor
"The AmbientLightSensor interface of the the Sensor APIs returns
current light level or illuminance of the ambient light around
hosting device."
(:refer-clojure :exclude []))
(def constructor
"Constructor.
The AmbinentLightSensor() constructor creates a new `web.ambient.AmbientLightSensor` object, which returns the current light level or illuminance of the ambient light around the hosting device.
options Optional
Currently only one option is supported:
frequency: The desired number of times per second a sample should be taken, meaning the number of times per second that `sensor.onreading` will be called. A whole number or decimal may be used, the latter for frequencies less than a second. The actual reading frequency depends device hardware and consequently may be less than requested.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/AmbientLightSensor/AmbientLightSensor`"
js/AmbientLightSensor)
(defn illuminance
"Property.
The illuminance property of the `web.ambient.AmbientLightSensor`
returns the current light level in lux of the ambient light level
the hosting device.
`var level = AmbientLightSensor.illuminance`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/AmbientLightSensor/illuminance`"
[this]
(-> this (.-illuminance)))
(defn set-illuminance!
"Property.
The illuminance property of the `web.ambient.AmbientLightSensor`
returns the current light level in lux of the ambient light level
the hosting device.
`var level = AmbientLightSensor.illuminance`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/AmbientLightSensor/illuminance`"
[this val]
(aset this "illuminance" val))