// 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,
    RuntimeEnabled=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;
};
