forked from dart-lang/web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate APIs based on standards track and not experimental
- Loading branch information
Showing
101 changed files
with
6,681 additions
and
4,624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (c) 2024, 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. | ||
|
||
@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]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2024, 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. | ||
|
||
@JS() | ||
library; | ||
|
||
import 'dart:js_interop'; | ||
|
||
extension type AttributionReportingRequestOptions._(JSObject _) | ||
implements JSObject { | ||
external factory AttributionReportingRequestOptions({ | ||
required bool eventSourceEligible, | ||
required bool triggerEligible, | ||
}); | ||
|
||
external bool get eventSourceEligible; | ||
external set eventSourceEligible(bool value); | ||
external bool get triggerEligible; | ||
external set triggerEligible(bool value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright (c) 2024, 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. | ||
|
||
@JS() | ||
library; | ||
|
||
import 'dart:js_interop'; | ||
|
||
import 'dom.dart'; | ||
import 'html.dart'; | ||
|
||
/// The `BatteryManager` interface of the [Battery Status API] provides | ||
/// information about the system's battery charge level. The | ||
/// [navigator.getBattery] method returns a promise that resolves with a | ||
/// `BatteryManager` interface. | ||
/// | ||
/// Since Chrome 103, the `BatteryManager` interface of [Battery Status API] | ||
/// only expose to secure context. | ||
/// | ||
/// --- | ||
/// | ||
/// API documentation sourced from | ||
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager). | ||
extension type BatteryManager._(JSObject _) implements EventTarget, JSObject { | ||
/// The **`BatteryManager.charging`** property is a Boolean value indicating | ||
/// whether or not the device's battery is currently being charged. When its | ||
/// value changes, the [BatteryManager.chargingchange_event] event is fired. | ||
/// | ||
/// If the battery is charging or the user agent is unable to report the | ||
/// battery status information, this value is `true`. Otherwise, it is | ||
/// `false`. | ||
external bool get charging; | ||
|
||
/// The **`BatteryManager.chargingTime`** property indicates the amount of | ||
/// time, in seconds, that remain until the battery is fully charged, or `0` | ||
/// if the battery is already fully charged or the user agent is unable to | ||
/// report the battery status information. | ||
/// If the battery is currently discharging, its value is `Infinity`. | ||
/// When its value changes, the [BatteryManager.chargingtimechange_event] | ||
/// event is fired. | ||
/// | ||
/// > **Note:** Even if the time returned is precise to the second, | ||
/// > browsers round them to a higher interval | ||
/// > (typically to the closest 15 minutes) for privacy reasons. | ||
external num get chargingTime; | ||
|
||
/// The **`BatteryManager.dischargingTime`** property indicates the amount of | ||
/// time, in seconds, that remains until the battery is fully discharged, | ||
/// or `Infinity` if the battery is currently charging rather than discharging | ||
/// or the user agent is unable to report the battery status information. | ||
/// When its value changes, the [BatteryManager.dischargingtimechange_event] | ||
/// event is fired. | ||
/// | ||
/// > **Note:** Even if the time returned is precise to the second, browsers | ||
/// > round them to a higher | ||
/// > interval (typically to the closest 15 minutes) for privacy reasons. | ||
external num get dischargingTime; | ||
|
||
/// The **`BatteryManager.level`** property indicates the current battery | ||
/// charge level as a value between `0.0` and `1.0`. | ||
/// A value of `0.0` means the battery is empty and the system is about to be | ||
/// suspended. | ||
/// A value of `1.0` means the battery is full or the user agent is unable to | ||
/// report the battery status information. | ||
/// When its value changes, the [BatteryManager.levelchange_event] event is | ||
/// fired. | ||
external num get level; | ||
external EventHandler get onchargingchange; | ||
external set onchargingchange(EventHandler value); | ||
external EventHandler get onchargingtimechange; | ||
external set onchargingtimechange(EventHandler value); | ||
external EventHandler get ondischargingtimechange; | ||
external set ondischargingtimechange(EventHandler value); | ||
external EventHandler get onlevelchange; | ||
external set onlevelchange(EventHandler value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.