forked from dart-lang/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccelerometer.dart
72 lines (63 loc) · 2.81 KB
/
accelerometer.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web).
// Attributions and copyright licensing by Mozilla Contributors is licensed
// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/.
// Generated from Web IDL definitions.
// ignore_for_file: unintended_html_in_doc_comment
@JS()
library;
import 'dart:js_interop';
import 'generic_sensor.dart';
typedef AccelerometerLocalCoordinateSystem = String;
extension type AccelerometerSensorOptions._(JSObject _)
implements SensorOptions, JSObject {
external factory AccelerometerSensorOptions({
num frequency,
AccelerometerLocalCoordinateSystem referenceFrame,
});
external AccelerometerLocalCoordinateSystem get referenceFrame;
external set referenceFrame(AccelerometerLocalCoordinateSystem value);
}
/// The **`LinearAccelerationSensor`** interface of the
/// [Sensor APIs](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs)
/// provides on each reading the acceleration applied to the device along all
/// three axes, but without the contribution of gravity.
///
/// To use this sensor, the user must grant permission to the `'accelerometer'`
/// device sensor through the
/// [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API).
/// In addition, this feature may be blocked by a
/// [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy)
/// set on your server.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/LinearAccelerationSensor).
extension type LinearAccelerationSensor._(JSObject _)
implements Sensor, JSObject {
external factory LinearAccelerationSensor(
[AccelerometerSensorOptions options]);
}
/// The **`GravitySensor`** interface of the
/// [Sensor APIs](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs)
/// provides on each reading the gravity applied to the device along all three
/// axes.
///
/// To use this sensor, the user must grant permission to the `'accelerometer'`
/// device sensor through the
/// [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API).
/// In addition, this feature may be blocked by a
/// [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy)
/// set on your server.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/GravitySensor).
extension type GravitySensor._(JSObject _) implements Sensor, JSObject {
external factory GravitySensor([AccelerometerSensorOptions options]);
}