Victor Porof | 6e09692 | 2022-06-10 13:01:05 +0000 | [diff] [blame] | 1 | // 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)] |
| 7 | interface 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 | |
| 18 | dictionary SensorOptions { |
| 19 | double frequency; |
| 20 | }; |
| 21 | |
| 22 | [SecureContext, Exposed=(DedicatedWorker, Window)] |
| 23 | interface SensorErrorEvent : Event { |
| 24 | constructor(DOMString type, SensorErrorEventInit errorEventInitDict); |
| 25 | readonly attribute DOMException error; |
| 26 | }; |
| 27 | |
| 28 | dictionary SensorErrorEventInit : EventInit { |
| 29 | required DOMException error; |
| 30 | }; |
| 31 | |
| 32 | dictionary MockSensorConfiguration { |
| 33 | required MockSensorType mockSensorType; |
| 34 | boolean connected = true; |
| 35 | double? maxSamplingFrequency; |
| 36 | double? minSamplingFrequency; |
| 37 | }; |
| 38 | |
| 39 | dictionary MockSensor { |
| 40 | double maxSamplingFrequency; |
| 41 | double minSamplingFrequency; |
| 42 | double requestedSamplingFrequency; |
| 43 | }; |
| 44 | |
| 45 | enum 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 | |
| 59 | dictionary MockSensorReadingValues { |
| 60 | }; |