blob: 157072f6341821aba5403be50ddd5355dbb940d8 [file] [log] [blame]
Victor Porof6e096922022-06-10 13:01:05 +00001// GENERATED CONTENT - DO NOT EDIT
2// Content was automatically extracted by Reffy into webref
3// (https://github.com/w3c/webref)
4// Source: Generic Sensor API (https://w3c.github.io/sensors/)
5
6[SecureContext, Exposed=(DedicatedWorker, Window)]
7interface Sensor : EventTarget {
8 readonly attribute boolean activated;
9 readonly attribute boolean hasReading;
10 readonly attribute DOMHighResTimeStamp? timestamp;
11 undefined start();
12 undefined stop();
13 attribute EventHandler onreading;
14 attribute EventHandler onactivate;
15 attribute EventHandler onerror;
16};
17
18dictionary SensorOptions {
19 double frequency;
20};
21
22[SecureContext, Exposed=(DedicatedWorker, Window)]
23interface SensorErrorEvent : Event {
24 constructor(DOMString type, SensorErrorEventInit errorEventInitDict);
25 readonly attribute DOMException error;
26};
27
28dictionary SensorErrorEventInit : EventInit {
29 required DOMException error;
30};
31
32dictionary MockSensorConfiguration {
33 required MockSensorType mockSensorType;
34 boolean connected = true;
35 double? maxSamplingFrequency;
36 double? minSamplingFrequency;
37};
38
39dictionary MockSensor {
40 double maxSamplingFrequency;
41 double minSamplingFrequency;
42 double requestedSamplingFrequency;
43};
44
45enum MockSensorType {
46 "ambient-light",
47 "accelerometer",
48 "linear-acceleration",
49 "gravity",
50 "gyroscope",
51 "magnetometer",
52 "uncalibrated-magnetometer",
53 "absolute-orientation",
54 "relative-orientation",
55 "geolocation",
56 "proximity",
57};
58
59dictionary MockSensorReadingValues {
60};