-
Notifications
You must be signed in to change notification settings - Fork 0
/
cordova_accelerometer.mli
43 lines (37 loc) · 1.39 KB
/
cordova_accelerometer.mli
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
(* -------------------------------------------------------------------------- *)
(* Class representing sent data by the accelerometer *)
type acceleration = private Ojs.t
val acceleration_x : acceleration -> int
[@@js.get "x"]
val acceleration_y : acceleration -> int
[@@js.get "y"]
val acceleration_z : acceleration -> int
[@@js.get "z"]
val acceleration_timestanp : acceleration -> Js_date.t
[@@js.get "timestamp"]
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
type options = private Ojs.t
val create_options :
?frequency:(int [@js.default 1000]) ->
unit ->
options
[@@js.builder]
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
val get_current_acceleration :
(acceleration -> unit) ->
(unit -> unit) ->
unit
[@@js.global "navigator.accelerometer.getCurrentAcceleration"]
val watch_acceleration :
(acceleration -> unit) ->
(unit -> unit) ->
options ->
int
[@@js.global "navigator.accelerometer.watchAcceleration"]
val clear_watch :
int ->
unit
[@@js.global "navigator.accelerometer.clearWatch"]
(* -------------------------------------------------------------------------- *)