Skip to content

Commit

Permalink
Generate APIs based on standards track and not experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
srujzs committed May 13, 2024
1 parent 7ed6d20 commit 4e9e15b
Show file tree
Hide file tree
Showing 101 changed files with 6,681 additions and 4,624 deletions.
52 changes: 50 additions & 2 deletions lib/src/dom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
// 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.

export 'dom/accelerometer.dart';
export 'dom/angle_instanced_arrays.dart';
export 'dom/attribution_reporting_api.dart';
export 'dom/battery_status.dart';
export 'dom/clipboard_apis.dart';
export 'dom/compression.dart';
export 'dom/console.dart';
export 'dom/cookie_store.dart';
export 'dom/credential_management.dart';
export 'dom/csp.dart';
export 'dom/css_animations.dart';
Expand All @@ -18,46 +22,60 @@ export 'dom/css_font_loading.dart';
export 'dom/css_fonts.dart';
export 'dom/css_highlight_api.dart';
export 'dom/css_masking.dart';
export 'dom/css_paint_api.dart';
export 'dom/css_properties_values_api.dart';
export 'dom/css_transitions.dart';
export 'dom/css_transitions_2.dart';
export 'dom/css_typed_om.dart';
export 'dom/css_view_transitions.dart';
export 'dom/cssom.dart';
export 'dom/cssom_view.dart';
export 'dom/dom.dart';
export 'dom/dom_parsing.dart';
export 'dom/encoding.dart';
export 'dom/encrypted_media.dart';
export 'dom/entries_api.dart';
export 'dom/event_timing.dart';
export 'dom/ext_blend_minmax.dart';
export 'dom/ext_color_buffer_float.dart';
export 'dom/ext_color_buffer_half_float.dart';
export 'dom/ext_disjoint_timer_query.dart';
export 'dom/ext_disjoint_timer_query_webgl2.dart';
export 'dom/ext_float_blend.dart';
export 'dom/ext_frag_depth.dart';
export 'dom/ext_shader_texture_lod.dart';
export 'dom/ext_srgb.dart';
export 'dom/ext_texture_compression_bptc.dart';
export 'dom/ext_texture_compression_rgtc.dart';
export 'dom/ext_texture_filter_anisotropic.dart';
export 'dom/ext_texture_norm16.dart';
export 'dom/fedcm.dart';
export 'dom/fetch.dart';
export 'dom/fido.dart';
export 'dom/fileapi.dart';
export 'dom/filter_effects.dart';
export 'dom/fs.dart';
export 'dom/fullscreen.dart';
export 'dom/gamepad.dart';
export 'dom/generic_sensor.dart';
export 'dom/geolocation.dart';
export 'dom/geometry.dart';
export 'dom/gyroscope.dart';
export 'dom/hr_time.dart';
export 'dom/html.dart';
export 'dom/image_capture.dart';
export 'dom/indexeddb.dart';
export 'dom/intersection_observer.dart';
export 'dom/khr_parallel_shader_compile.dart';
export 'dom/largest_contentful_paint.dart';
export 'dom/mathml_core.dart';
export 'dom/media_capabilities.dart';
export 'dom/media_playback_quality.dart';
export 'dom/media_source.dart';
export 'dom/mediacapture_fromelement.dart';
export 'dom/mediacapture_streams.dart';
export 'dom/mediasession.dart';
export 'dom/mediastream_recording.dart';
export 'dom/mst_content_hint.dart';
export 'dom/navigation_timing.dart';
export 'dom/notifications.dart';
export 'dom/oes_draw_buffers_indexed.dart';
Expand All @@ -70,18 +88,27 @@ export 'dom/oes_texture_half_float.dart';
export 'dom/oes_texture_half_float_linear.dart';
export 'dom/oes_vertex_array_object.dart';
export 'dom/orientation_event.dart';
export 'dom/orientation_sensor.dart';
export 'dom/ovr_multiview2.dart';
export 'dom/paint_timing.dart';
export 'dom/payment_request.dart';
export 'dom/performance_timeline.dart';
export 'dom/permissions.dart';
export 'dom/picture_in_picture.dart';
export 'dom/pointerevents.dart';
export 'dom/private_network_access.dart';
export 'dom/push_api.dart';
export 'dom/referrer_policy.dart';
export 'dom/remote_playback.dart';
export 'dom/reporting.dart';
export 'dom/requestidlecallback.dart';
export 'dom/resize_observer.dart';
export 'dom/resource_timing.dart';
export 'dom/scheduling_apis.dart';
export 'dom/screen_capture.dart';
export 'dom/screen_orientation.dart';
export 'dom/screen_wake_lock.dart';
export 'dom/secure_payment_confirmation.dart';
export 'dom/selection_api.dart';
export 'dom/server_timing.dart';
export 'dom/service_workers.dart';
Expand All @@ -91,32 +118,53 @@ export 'dom/streams.dart';
export 'dom/svg.dart';
export 'dom/svg_animations.dart';
export 'dom/touch_events.dart';
export 'dom/trust_token_api.dart';
export 'dom/trusted_types.dart';
export 'dom/uievents.dart';
export 'dom/url.dart';
export 'dom/user_timing.dart';
export 'dom/vibration.dart';
export 'dom/video_rvfc.dart';
export 'dom/wasm_js_api.dart';
export 'dom/web_animations.dart';
export 'dom/web_animations_2.dart';
export 'dom/web_bluetooth.dart';
export 'dom/web_locks.dart';
export 'dom/web_otp.dart';
export 'dom/web_share.dart';
export 'dom/webaudio.dart';
export 'dom/webauthn.dart';
export 'dom/webcodecs.dart';
export 'dom/webcodecs_av1_codec_registration.dart';
export 'dom/webcodecs_avc_codec_registration.dart';
export 'dom/webcodecs_hevc_codec_registration.dart';
export 'dom/webcodecs_vp9_codec_registration.dart';
export 'dom/webcryptoapi.dart';
export 'dom/webgl1.dart';
export 'dom/webgl2.dart';
export 'dom/webgl_color_buffer_float.dart';
export 'dom/webgl_compressed_texture_astc.dart';
export 'dom/webgl_compressed_texture_etc.dart';
export 'dom/webgl_compressed_texture_etc1.dart';
export 'dom/webgl_compressed_texture_pvrtc.dart';
export 'dom/webgl_compressed_texture_s3tc.dart';
export 'dom/webgl_compressed_texture_s3tc_srgb.dart';
export 'dom/webgl_debug_renderer_info.dart';
export 'dom/webgl_debug_shaders.dart';
export 'dom/webgl_depth_texture.dart';
export 'dom/webgl_draw_buffers.dart';
export 'dom/webgl_lose_context.dart';
export 'dom/webgl_multi_draw.dart';
export 'dom/webgpu.dart';
export 'dom/webidl.dart';
export 'dom/webmidi.dart';
export 'dom/webrtc.dart';
export 'dom/webrtc_encoded_transform.dart';
export 'dom/webrtc_stats.dart';
export 'dom/webrtc_identity.dart';
export 'dom/webrtc_priority.dart';
export 'dom/websockets.dart';
export 'dom/webtransport.dart';
export 'dom/webvtt.dart';
export 'dom/webxr.dart';
export 'dom/webxr_hand_input.dart';
export 'dom/xhr.dart';
70 changes: 70 additions & 0 deletions lib/src/dom/accelerometer.dart
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]);
}
27 changes: 27 additions & 0 deletions lib/src/dom/attribution_reporting_api.dart
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);
}
83 changes: 83 additions & 0 deletions lib/src/dom/battery_status.dart
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);
}
14 changes: 0 additions & 14 deletions lib/src/dom/clipboard_apis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import 'dart:js_interop';
import 'dom.dart';
import 'fileapi.dart';
import 'html.dart';
import 'permissions.dart';

typedef ClipboardItemData = JSPromise<JSAny>;
typedef ClipboardItems = JSArray<ClipboardItem>;
typedef PresentationStyle = String;
extension type ClipboardEventInit._(JSObject _) implements EventInit, JSObject {
Expand Down Expand Up @@ -85,8 +83,6 @@ extension type ClipboardItem._(JSObject _) implements JSObject {
ClipboardItemOptions options,
]);

external static bool supports(String type);

/// The **`getType()`** method of the [ClipboardItem] interface returns a
/// `Promise` that resolves with a [Blob] of the requested or an error if the
/// MIME type is not found.
Expand Down Expand Up @@ -174,13 +170,3 @@ extension type ClipboardUnsanitizedFormats._(JSObject _) implements JSObject {
external JSArray<JSString> get unsanitized;
external set unsanitized(JSArray<JSString> value);
}
extension type ClipboardPermissionDescriptor._(JSObject _)
implements PermissionDescriptor, JSObject {
external factory ClipboardPermissionDescriptor({
required String name,
bool allowWithoutGesture,
});

external bool get allowWithoutGesture;
external set allowWithoutGesture(bool value);
}
Loading

0 comments on commit 4e9e15b

Please sign in to comment.