blob: 889fd1cc5e5e90f1ef8c05c4de1c37fa90fedc4d [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Specification at:
// https://w3c.github.io/sensors/#the-sensor-interface
[
ActiveScriptWrappable,
DependentLifetime,
OriginTrialEnabled=Sensor
] interface Sensor : EventTarget {
[MeasureAs=GenericSensorActivated] readonly attribute boolean activated;
[CallWith=ScriptState] readonly attribute DOMHighResTimeStamp? timestamp;
[MeasureAs=GenericSensorStart] void start();
[MeasureAs=GenericSensorStop] void stop();
[MeasureAs=GenericSensorOnError] attribute EventHandler onerror;
[MeasureAs=GenericSensorOnChange] attribute EventHandler onreading;
[MeasureAs=GenericSensorOnActivate] attribute EventHandler onactivate;
};