interface Event { }; interface Error { }; dictionary EventInit { }; interface EventTarget { }; interface EventHandler { };
[SecureContext] interface Sensor : EventTarget { readonly attribute boolean activated; readonly attribute DOMHighResTimeStamp? timestamp; void start(); void stop(); attribute EventHandler onchange; attribute EventHandler onactivate; attribute EventHandler onerror; }; dictionary SensorOptions { double? frequency; }; [SecureContext, Constructor(DOMString type, SensorErrorEventInit errorEventInitDict)] interface SensorErrorEvent : Event { readonly attribute Error error; }; dictionary SensorErrorEventInit : EventInit { required Error error; };
[Constructor(optional SensorOptions sensorOptions)] interface AmbientLightSensor : Sensor { readonly attribute unrestricted double? illuminance; };