├── .github ├── dependabot.yml └── workflows │ ├── dart.yml │ ├── no-response.yml │ ├── post_summaries.yaml │ └── publish.yaml ├── .gitignore ├── LICENSE ├── README.md ├── mono_repo.yaml ├── third_party └── mdn │ ├── LICENSE │ ├── README.md │ └── mdn.json ├── tool └── ci.sh ├── web ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── example │ ├── example.dart │ └── index.html ├── lib │ ├── fix_data.yaml │ ├── src │ │ ├── dom.dart │ │ ├── dom │ │ │ ├── accelerometer.dart │ │ │ ├── angle_instanced_arrays.dart │ │ │ ├── attribution_reporting_api.dart │ │ │ ├── background_sync.dart │ │ │ ├── battery_status.dart │ │ │ ├── clipboard_apis.dart │ │ │ ├── compression.dart │ │ │ ├── console.dart │ │ │ ├── cookie_store.dart │ │ │ ├── credential_management.dart │ │ │ ├── csp.dart │ │ │ ├── css_animations.dart │ │ │ ├── css_animations_2.dart │ │ │ ├── css_cascade.dart │ │ │ ├── css_cascade_6.dart │ │ │ ├── css_conditional.dart │ │ │ ├── css_conditional_5.dart │ │ │ ├── css_contain.dart │ │ │ ├── css_counter_styles.dart │ │ │ ├── css_font_loading.dart │ │ │ ├── css_fonts.dart │ │ │ ├── css_fonts_5.dart │ │ │ ├── css_highlight_api.dart │ │ │ ├── css_masking.dart │ │ │ ├── css_nesting.dart │ │ │ ├── css_paint_api.dart │ │ │ ├── css_properties_values_api.dart │ │ │ ├── css_transitions.dart │ │ │ ├── css_transitions_2.dart │ │ │ ├── css_typed_om.dart │ │ │ ├── css_view_transitions.dart │ │ │ ├── css_view_transitions_2.dart │ │ │ ├── cssom.dart │ │ │ ├── cssom_view.dart │ │ │ ├── digital_credentials.dart │ │ │ ├── dom.dart │ │ │ ├── dom_parsing.dart │ │ │ ├── encoding.dart │ │ │ ├── encrypted_media.dart │ │ │ ├── entries_api.dart │ │ │ ├── event_timing.dart │ │ │ ├── ext_blend_minmax.dart │ │ │ ├── ext_color_buffer_float.dart │ │ │ ├── ext_color_buffer_half_float.dart │ │ │ ├── ext_disjoint_timer_query.dart │ │ │ ├── ext_disjoint_timer_query_webgl2.dart │ │ │ ├── ext_float_blend.dart │ │ │ ├── ext_frag_depth.dart │ │ │ ├── ext_shader_texture_lod.dart │ │ │ ├── ext_srgb.dart │ │ │ ├── ext_texture_compression_bptc.dart │ │ │ ├── ext_texture_compression_rgtc.dart │ │ │ ├── ext_texture_filter_anisotropic.dart │ │ │ ├── ext_texture_norm16.dart │ │ │ ├── fedcm.dart │ │ │ ├── fetch.dart │ │ │ ├── fido.dart │ │ │ ├── fileapi.dart │ │ │ ├── filter_effects.dart │ │ │ ├── fs.dart │ │ │ ├── fullscreen.dart │ │ │ ├── gamepad.dart │ │ │ ├── generic_sensor.dart │ │ │ ├── geolocation.dart │ │ │ ├── geometry.dart │ │ │ ├── gyroscope.dart │ │ │ ├── hr_time.dart │ │ │ ├── html.dart │ │ │ ├── image_capture.dart │ │ │ ├── indexeddb.dart │ │ │ ├── intersection_observer.dart │ │ │ ├── khr_parallel_shader_compile.dart │ │ │ ├── largest_contentful_paint.dart │ │ │ ├── mathml_core.dart │ │ │ ├── media_capabilities.dart │ │ │ ├── media_playback_quality.dart │ │ │ ├── media_source.dart │ │ │ ├── mediacapture_fromelement.dart │ │ │ ├── mediacapture_streams.dart │ │ │ ├── mediacapture_transform.dart │ │ │ ├── mediasession.dart │ │ │ ├── mediastream_recording.dart │ │ │ ├── mst_content_hint.dart │ │ │ ├── navigation_timing.dart │ │ │ ├── netinfo.dart │ │ │ ├── notifications.dart │ │ │ ├── oes_draw_buffers_indexed.dart │ │ │ ├── oes_element_index_uint.dart │ │ │ ├── oes_fbo_render_mipmap.dart │ │ │ ├── oes_standard_derivatives.dart │ │ │ ├── oes_texture_float.dart │ │ │ ├── oes_texture_float_linear.dart │ │ │ ├── oes_texture_half_float.dart │ │ │ ├── oes_texture_half_float_linear.dart │ │ │ ├── oes_vertex_array_object.dart │ │ │ ├── orientation_event.dart │ │ │ ├── orientation_sensor.dart │ │ │ ├── ovr_multiview2.dart │ │ │ ├── paint_timing.dart │ │ │ ├── payment_request.dart │ │ │ ├── performance_timeline.dart │ │ │ ├── permissions.dart │ │ │ ├── picture_in_picture.dart │ │ │ ├── pointerevents.dart │ │ │ ├── pointerlock.dart │ │ │ ├── private_network_access.dart │ │ │ ├── push_api.dart │ │ │ ├── referrer_policy.dart │ │ │ ├── remote_playback.dart │ │ │ ├── reporting.dart │ │ │ ├── requestidlecallback.dart │ │ │ ├── resize_observer.dart │ │ │ ├── resource_timing.dart │ │ │ ├── saa_non_cookie_storage.dart │ │ │ ├── scheduling_apis.dart │ │ │ ├── screen_capture.dart │ │ │ ├── screen_orientation.dart │ │ │ ├── screen_wake_lock.dart │ │ │ ├── scroll_to_text_fragment.dart │ │ │ ├── secure_payment_confirmation.dart │ │ │ ├── selection_api.dart │ │ │ ├── server_timing.dart │ │ │ ├── service_workers.dart │ │ │ ├── speech_api.dart │ │ │ ├── storage.dart │ │ │ ├── streams.dart │ │ │ ├── svg.dart │ │ │ ├── svg_animations.dart │ │ │ ├── touch_events.dart │ │ │ ├── trust_token_api.dart │ │ │ ├── trusted_types.dart │ │ │ ├── uievents.dart │ │ │ ├── url.dart │ │ │ ├── user_timing.dart │ │ │ ├── vibration.dart │ │ │ ├── video_rvfc.dart │ │ │ ├── wasm_js_api.dart │ │ │ ├── web_animations.dart │ │ │ ├── web_animations_2.dart │ │ │ ├── web_bluetooth.dart │ │ │ ├── web_locks.dart │ │ │ ├── web_otp.dart │ │ │ ├── web_share.dart │ │ │ ├── webaudio.dart │ │ │ ├── webauthn.dart │ │ │ ├── webcodecs.dart │ │ │ ├── webcodecs_aac_codec_registration.dart │ │ │ ├── webcodecs_av1_codec_registration.dart │ │ │ ├── webcodecs_avc_codec_registration.dart │ │ │ ├── webcodecs_flac_codec_registration.dart │ │ │ ├── webcodecs_hevc_codec_registration.dart │ │ │ ├── webcodecs_opus_codec_registration.dart │ │ │ ├── webcodecs_vp9_codec_registration.dart │ │ │ ├── webcryptoapi.dart │ │ │ ├── webgl1.dart │ │ │ ├── webgl2.dart │ │ │ ├── webgl_color_buffer_float.dart │ │ │ ├── webgl_compressed_texture_astc.dart │ │ │ ├── webgl_compressed_texture_etc.dart │ │ │ ├── webgl_compressed_texture_etc1.dart │ │ │ ├── webgl_compressed_texture_pvrtc.dart │ │ │ ├── webgl_compressed_texture_s3tc.dart │ │ │ ├── webgl_compressed_texture_s3tc_srgb.dart │ │ │ ├── webgl_debug_renderer_info.dart │ │ │ ├── webgl_debug_shaders.dart │ │ │ ├── webgl_depth_texture.dart │ │ │ ├── webgl_draw_buffers.dart │ │ │ ├── webgl_lose_context.dart │ │ │ ├── webgl_multi_draw.dart │ │ │ ├── webgpu.dart │ │ │ ├── webidl.dart │ │ │ ├── webmidi.dart │ │ │ ├── webrtc.dart │ │ │ ├── webrtc_encoded_transform.dart │ │ │ ├── webrtc_identity.dart │ │ │ ├── webrtc_priority.dart │ │ │ ├── websockets.dart │ │ │ ├── webtransport.dart │ │ │ ├── webvtt.dart │ │ │ ├── webxr.dart │ │ │ ├── webxr_hand_input.dart │ │ │ └── xhr.dart │ │ ├── helpers.dart │ │ └── helpers │ │ │ ├── cross_origin.dart │ │ │ ├── enums.dart │ │ │ ├── events │ │ │ ├── events.dart │ │ │ ├── providers.dart │ │ │ └── streams.dart │ │ │ ├── extensions.dart │ │ │ └── lists.dart │ └── web.dart ├── mono_pkg.yaml ├── pubspec.yaml ├── renames.md ├── test │ ├── dart_fix_test.dart │ ├── element_constructor_test.dart │ ├── helpers_test.dart │ └── smoke_test.dart └── test_fixes │ ├── README.md │ ├── analysis_options.yaml │ ├── renames.dart │ └── renames.dart.expect └── web_generator ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── bin ├── gen_interop_bindings.dart ├── scrape_mdn.dart └── update_idl_bindings.dart ├── lib └── src │ ├── banned_names.dart │ ├── bcd.dart │ ├── cli.dart │ ├── dart_main.dart │ ├── doc_provider.dart │ ├── dts │ ├── config.dart │ ├── parser.dart │ └── transform.dart │ ├── formatting.dart │ ├── generate_bindings.dart │ ├── js │ ├── filesystem_api.dart │ ├── webidl_api.dart │ ├── webref_css_api.dart │ ├── webref_elements_api.dart │ └── webref_idl_api.dart │ ├── js_type_supertypes.dart │ ├── main.mjs │ ├── package-lock.json │ ├── package.json │ ├── singletons.dart │ ├── translator.dart │ ├── type_aliases.dart │ ├── type_union.dart │ └── util.dart ├── mono_pkg.yaml ├── pubspec.yaml └── test ├── generate_docs_test.dart ├── scrape_mdn_test.dart ├── ts_bindings_test.dart └── type_union_test.dart /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Dependabot configuration file. 2 | # See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates 3 | 4 | version: 2 5 | 6 | updates: 7 | - package-ecosystem: github-actions 8 | directory: / 9 | schedule: 10 | interval: monthly 11 | labels: 12 | - autosubmit 13 | groups: 14 | github-actions: 15 | patterns: 16 | - "*" 17 | -------------------------------------------------------------------------------- /.github/workflows/no-response.yml: -------------------------------------------------------------------------------- 1 | # A workflow to close issues where the author hasn't responded to a request for 2 | # more information; see https://github.com/actions/stale. 3 | 4 | name: No Response 5 | 6 | # Run as a daily cron. 7 | on: 8 | schedule: 9 | # Every day at 8am 10 | - cron: '0 8 * * *' 11 | 12 | # All permissions not specified are set to 'none'. 13 | permissions: 14 | issues: write 15 | pull-requests: write 16 | 17 | jobs: 18 | no-response: 19 | runs-on: ubuntu-latest 20 | if: ${{ github.repository_owner == 'dart-lang' }} 21 | steps: 22 | - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 23 | with: 24 | days-before-stale: -1 25 | days-before-close: 14 26 | stale-issue-label: "needs-info" 27 | close-issue-message: > 28 | Without additional information we're not able to resolve this issue. 29 | Feel free to add more info or respond to any questions above and we 30 | can reopen the case. Thanks for your contribution! 31 | stale-pr-label: "needs-info" 32 | close-pr-message: > 33 | Without additional information we're not able to resolve this PR. 34 | Feel free to add more info or respond to any questions above. 35 | Thanks for your contribution! 36 | -------------------------------------------------------------------------------- /.github/workflows/post_summaries.yaml: -------------------------------------------------------------------------------- 1 | # A workflow to allow other workflow to comment on PRs. 2 | 3 | name: Comment on the pull request 4 | 5 | on: 6 | # Trigger this workflow after the Health workflow completes. This workflow 7 | # will have permissions to do things like create comments on the PR, even if 8 | # the original workflow couldn't. 9 | workflow_run: 10 | workflows: 11 | - Publish 12 | types: 13 | - completed 14 | 15 | jobs: 16 | upload: 17 | uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main 18 | permissions: 19 | pull-requests: write 20 | -------------------------------------------------------------------------------- /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | # A CI configuration to auto-publish pub packages. 2 | 3 | name: Publish 4 | 5 | on: 6 | pull_request: 7 | branches: [ main ] 8 | push: 9 | tags: [ '[A-z]+-v[0-9]+.[0-9]+.[0-9]+' ] 10 | 11 | jobs: 12 | publish: 13 | if: ${{ github.repository_owner == 'dart-lang' }} 14 | uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main 15 | with: 16 | write-comments: false 17 | permissions: 18 | id-token: write 19 | pull-requests: write 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .dart_tool 2 | doc/api/ 3 | pubspec.lock 4 | 5 | web_generator/lib/src/*.js 6 | web_generator/lib/src/*.js.* 7 | web_generator/lib/src/node_modules/ 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2023, the Dart project authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of Google LLC nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | web/README.md -------------------------------------------------------------------------------- /mono_repo.yaml: -------------------------------------------------------------------------------- 1 | # See https://github.com/google/mono_repo.dart for details on this file 2 | self_validate: analyze_and_format 3 | 4 | github: 5 | cron: "0 0 * * 0" 6 | 7 | merge_stages: 8 | - analyze_and_format 9 | - unit_test 10 | - dart_fixes 11 | - generate_and_analyze 12 | - generate_all_and_analyze 13 | -------------------------------------------------------------------------------- /third_party/mdn/README.md: -------------------------------------------------------------------------------- 1 | ## Contents 2 | 3 | The content of this directory (i.e., [mdn.json](./mdn.json)) is parsed from the 4 | https://github.com/mdn/content.git repository and used to provide API 5 | documentation comments for the generated portion of package:web. 6 | 7 | ## License 8 | 9 | See [LICENSE](./LICENSE) for the license this content is under. 10 | 11 | ## Process 12 | 13 | See [the script](../../web_generator/bin/scrape_mdn.dart) which collects the 14 | documentation information. 15 | -------------------------------------------------------------------------------- /web/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2023, the Dart project authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of Google LLC nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /web/README.md: -------------------------------------------------------------------------------- 1 | [![Dart CI](https://github.com/dart-lang/web/actions/workflows/dart.yml/badge.svg)](https://github.com/dart-lang/web/actions/workflows/dart.yml) 2 | [![pub package](https://img.shields.io/pub/v/web.svg)](https://pub.dev/packages/web) 3 | [![package publisher](https://img.shields.io/pub/publisher/web.svg)](https://pub.dev/packages/web/publisher) 4 | 5 | Lightweight browser API bindings built around 6 | [JS interop](https://dart.dev/interop/js-interop). 7 | 8 | ## What's this? 9 | 10 | This package exposes browser APIs. It's generated from the Web IDL definitions 11 | and uses recent Dart language features for zero-overhead bindings. 12 | 13 | This package is intended to replace 14 | [`dart:html`](https://api.dart.dev/stable/dart-html/dart-html-library.html) and 15 | similar Dart SDK libraries. It will support access to browser APIs from Dart 16 | code compiled to either JavaScript or WebAssembly. 17 | 18 | ## Usage 19 | 20 | ```dart 21 | import 'package:web/web.dart'; 22 | 23 | void main() { 24 | final div = document.querySelector('div')!; 25 | div.text = 'Text set at ${DateTime.now()}'; 26 | } 27 | ``` 28 | 29 | ## Migrating to package:web 30 | 31 | `package:web` is replacing `dart:html` and other web libraries as Dart's 32 | long-term web interop solution. To learn how to migrate from `dart:html` 33 | APIs to `package:web`, see our 34 | [migration guide](https://dart.dev/go/package-web). 35 | 36 | ## Generation 37 | 38 | This package is generated by `web_generator`. See the 39 | [`README`](https://github.com/dart-lang/web/tree/main/web_generator) for more 40 | details on the conventions used to generate this package and how to run the 41 | different tools to generate bindings and update various package dependencies. 42 | -------------------------------------------------------------------------------- /web/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # https://dart.dev/guides/language/analysis-options 2 | include: package:dart_flutter_team_lints/analysis_options.yaml 3 | 4 | analyzer: 5 | language: 6 | strict-casts: true 7 | strict-inference: true 8 | strict-raw-types: true 9 | exclude: 10 | - test_fixes/** 11 | 12 | errors: 13 | # 43 instances in generated code. 14 | camel_case_types: ignore 15 | # 420 instances in the MDN docs. 16 | comment_references: ignore 17 | # 14 instances in the MDN docs. 18 | lines_longer_than_80_chars: ignore 19 | # 1,333 instances in generated code. 20 | non_constant_identifier_names: ignore 21 | # 1,260 instances in generated code. 22 | constant_identifier_names: ignore 23 | 24 | linter: 25 | rules: 26 | - avoid_bool_literals_in_conditional_expressions 27 | - avoid_private_typedef_functions 28 | - avoid_redundant_argument_values 29 | - avoid_returning_this 30 | - avoid_unused_constructor_parameters 31 | - cancel_subscriptions 32 | - join_return_with_assignment 33 | - literal_only_boolean_expressions 34 | - no_adjacent_strings_in_list 35 | - no_runtimeType_toString 36 | - prefer_const_declarations 37 | - prefer_final_locals 38 | - unnecessary_await_in_return 39 | - use_string_buffers 40 | -------------------------------------------------------------------------------- /web/example/example.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:web/web.dart'; 6 | 7 | void main() { 8 | final div = document.querySelector('div')!; 9 | div.textContent = 'Text set at ${DateTime.now()}'; 10 | } 11 | -------------------------------------------------------------------------------- /web/example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
Waiting for code to run...
8 | 9 | 10 | -------------------------------------------------------------------------------- /web/lib/src/dom/accelerometer.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'generic_sensor.dart'; 19 | 20 | typedef AccelerometerLocalCoordinateSystem = String; 21 | extension type AccelerometerSensorOptions._(JSObject _) 22 | implements SensorOptions, JSObject { 23 | external factory AccelerometerSensorOptions({ 24 | num frequency, 25 | AccelerometerLocalCoordinateSystem referenceFrame, 26 | }); 27 | 28 | external AccelerometerLocalCoordinateSystem get referenceFrame; 29 | external set referenceFrame(AccelerometerLocalCoordinateSystem value); 30 | } 31 | 32 | /// The **`LinearAccelerationSensor`** interface of the 33 | /// [Sensor APIs](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs) 34 | /// provides on each reading the acceleration applied to the device along all 35 | /// three axes, but without the contribution of gravity. 36 | /// 37 | /// To use this sensor, the user must grant permission to the `'accelerometer'` 38 | /// device sensor through the 39 | /// [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API). 40 | /// In addition, this feature may be blocked by a 41 | /// [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy) 42 | /// set on your server. 43 | /// 44 | /// --- 45 | /// 46 | /// API documentation sourced from 47 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/LinearAccelerationSensor). 48 | extension type LinearAccelerationSensor._(JSObject _) 49 | implements Sensor, JSObject { 50 | external factory LinearAccelerationSensor( 51 | [AccelerometerSensorOptions options]); 52 | } 53 | 54 | /// The **`GravitySensor`** interface of the 55 | /// [Sensor APIs](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs) 56 | /// provides on each reading the gravity applied to the device along all three 57 | /// axes. 58 | /// 59 | /// To use this sensor, the user must grant permission to the `'accelerometer'` 60 | /// device sensor through the 61 | /// [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API). 62 | /// In addition, this feature may be blocked by a 63 | /// [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy) 64 | /// set on your server. 65 | /// 66 | /// --- 67 | /// 68 | /// API documentation sourced from 69 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/GravitySensor). 70 | extension type GravitySensor._(JSObject _) implements Sensor, JSObject { 71 | external factory GravitySensor([AccelerometerSensorOptions options]); 72 | } 73 | -------------------------------------------------------------------------------- /web/lib/src/dom/attribution_reporting_api.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type AttributionReportingRequestOptions._(JSObject _) 19 | implements JSObject { 20 | external factory AttributionReportingRequestOptions({ 21 | required bool eventSourceEligible, 22 | required bool triggerEligible, 23 | }); 24 | 25 | external bool get eventSourceEligible; 26 | external set eventSourceEligible(bool value); 27 | external bool get triggerEligible; 28 | external set triggerEligible(bool value); 29 | } 30 | -------------------------------------------------------------------------------- /web/lib/src/dom/background_sync.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'service_workers.dart'; 19 | 20 | /// The **`SyncManager`** interface of the [Background Synchronization API] 21 | /// provides an interface for registering and listing sync registrations. 22 | /// 23 | /// --- 24 | /// 25 | /// API documentation sourced from 26 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SyncManager). 27 | extension type SyncManager._(JSObject _) implements JSObject { 28 | /// The **`register()`** method of the [SyncManager] interface registers a 29 | /// synchronization event, triggering a [ServiceWorkerGlobalScope.sync_event] 30 | /// event inside the associated service worker as soon as network connectivity 31 | /// is available. 32 | external JSPromise register(String tag); 33 | 34 | /// The **`getTags()`** method of the 35 | /// [SyncManager] interface returns a list of developer-defined identifiers 36 | /// for 37 | /// `SyncManager` registrations. 38 | external JSPromise> getTags(); 39 | } 40 | 41 | /// @AvailableInWorkers("service") 42 | /// 43 | /// The **`SyncEvent`** interface of the [Background Synchronization API] 44 | /// represents a sync action that is dispatched on the 45 | /// [ServiceWorkerGlobalScope] of a ServiceWorker. 46 | /// 47 | /// This interface inherits from the [ExtendableEvent] interface. 48 | /// 49 | /// --- 50 | /// 51 | /// API documentation sourced from 52 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SyncEvent). 53 | extension type SyncEvent._(JSObject _) implements ExtendableEvent, JSObject { 54 | external factory SyncEvent( 55 | String type, 56 | SyncEventInit init, 57 | ); 58 | 59 | /// @AvailableInWorkers("service") 60 | /// 61 | /// The **`tag`** read-only property of the 62 | /// [SyncEvent] interface returns the developer-defined identifier for 63 | /// this `SyncEvent`. This is the value passed in the `tag` parameter 64 | /// of the [SyncEvent.SyncEvent] constructor. 65 | external String get tag; 66 | 67 | /// @AvailableInWorkers("service") 68 | /// 69 | /// The **`lastChance`** read-only property of the 70 | /// [SyncEvent] interface returns `true` if the user agent will not 71 | /// make further synchronization attempts after the current attempt. This is 72 | /// the value 73 | /// passed in the `lastChance` parameter of the 74 | /// [SyncEvent.SyncEvent] constructor. 75 | external bool get lastChance; 76 | } 77 | extension type SyncEventInit._(JSObject _) 78 | implements ExtendableEventInit, JSObject { 79 | external factory SyncEventInit({ 80 | bool bubbles, 81 | bool cancelable, 82 | bool composed, 83 | required String tag, 84 | bool lastChance, 85 | }); 86 | 87 | external String get tag; 88 | external set tag(String value); 89 | external bool get lastChance; 90 | external set lastChance(bool value); 91 | } 92 | -------------------------------------------------------------------------------- /web/lib/src/dom/compression.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'streams.dart'; 19 | 20 | typedef CompressionFormat = String; 21 | 22 | /// The **`CompressionStream`** interface of the [Compression Streams API] is an 23 | /// API for compressing a stream of data. 24 | /// 25 | /// --- 26 | /// 27 | /// API documentation sourced from 28 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream). 29 | extension type CompressionStream._(JSObject _) implements JSObject { 30 | external factory CompressionStream(CompressionFormat format); 31 | 32 | /// The **`readable`** read-only property of the [CompressionStream] interface 33 | /// returns a [ReadableStream]. 34 | external ReadableStream get readable; 35 | 36 | /// The **`writable`** read-only property of the [CompressionStream] interface 37 | /// returns a [WritableStream]. 38 | external WritableStream get writable; 39 | } 40 | 41 | /// The **`DecompressionStream`** interface of the [Compression Streams API] is 42 | /// an API for decompressing a stream of data. 43 | /// 44 | /// --- 45 | /// 46 | /// API documentation sourced from 47 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream). 48 | extension type DecompressionStream._(JSObject _) implements JSObject { 49 | external factory DecompressionStream(CompressionFormat format); 50 | 51 | /// The **`readable`** read-only property of the [DecompressionStream] 52 | /// interface returns a [ReadableStream]. 53 | external ReadableStream get readable; 54 | 55 | /// The **`writable`** read-only property of the [DecompressionStream] 56 | /// interface returns a [WritableStream]. 57 | external WritableStream get writable; 58 | } 59 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_animations_2.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'web_animations.dart'; 19 | 20 | /// The **`CSSAnimation`** interface of the [Web Animations API] represents an 21 | /// [Animation] object. 22 | /// 23 | /// --- 24 | /// 25 | /// API documentation sourced from 26 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSAnimation). 27 | extension type CSSAnimation._(JSObject _) implements Animation, JSObject { 28 | /// The **`animationName`** property of the 29 | /// [CSSAnimation] interface returns the . This 30 | /// specifies one or more keyframe at-rules which describe the animation 31 | /// applied to the 32 | /// element. 33 | external String get animationName; 34 | } 35 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_cascade.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | 20 | /// The **`CSSLayerBlockRule`** represents a block rule. 21 | /// 22 | /// --- 23 | /// 24 | /// API documentation sourced from 25 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerBlockRule). 26 | extension type CSSLayerBlockRule._(JSObject _) 27 | implements CSSGroupingRule, JSObject { 28 | /// The read-only **`name`** property of the [CSSLayerBlockRule] interface 29 | /// represents the name of the associated cascade layer. 30 | external String get name; 31 | } 32 | 33 | /// The **`CSSLayerStatementRule`** represents a statement rule. Unlike 34 | /// [CSSLayerBlockRule], it doesn't contain other rules and merely defines one 35 | /// or several layers by providing their names. 36 | /// 37 | /// This rule allows to explicitly declare the ordering layer that is in an 38 | /// apparent way at the beginning of a CSS file: the layer order is defined by 39 | /// the order of first occurrence of each layer name. Declaring them with a 40 | /// statement allows the reader to understand the layer order. It also allows 41 | /// inline and imported layers to be interleaved, which is not possible when 42 | /// using the `CSSLayerBlockRule` syntax. 43 | /// 44 | /// --- 45 | /// 46 | /// API documentation sourced from 47 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerStatementRule). 48 | extension type CSSLayerStatementRule._(JSObject _) 49 | implements CSSRule, JSObject { 50 | /// The read-only **`nameList`** property of the [CSSLayerStatementRule] 51 | /// interface return the list of associated cascade layer names. The names 52 | /// can't be modified. 53 | external JSArray get nameList; 54 | } 55 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_cascade_6.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | 20 | /// The **`CSSScopeRule`** interface of the 21 | /// [CSS Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model) 22 | /// represents a CSS at-rule. 23 | /// 24 | /// --- 25 | /// 26 | /// API documentation sourced from 27 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSScopeRule). 28 | extension type CSSScopeRule._(JSObject _) implements CSSGroupingRule, JSObject { 29 | /// The **`start`** property of the [CSSScopeRule] interface returns a string 30 | /// containing the value of the `@scope` at-rule's scope root. 31 | external String? get start; 32 | 33 | /// The **`end`** property of the [CSSScopeRule] interface returns a string 34 | /// containing the value of the `@scope` at-rule's scope limit. 35 | external String? get end; 36 | } 37 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_conditional.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | 20 | /// An object implementing the **`CSSConditionRule`** interface represents a 21 | /// single condition CSS 22 | /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule), 23 | /// which consists of a condition and a statement block. 24 | /// 25 | /// Three objects derive from `CSSConditionRule`: [CSSMediaRule], 26 | /// [CSSContainerRule] and [CSSSupportsRule]. 27 | /// 28 | /// --- 29 | /// 30 | /// API documentation sourced from 31 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSConditionRule). 32 | extension type CSSConditionRule._(JSObject _) 33 | implements CSSGroupingRule, JSObject { 34 | /// The read-only **`conditionText`** property of 35 | /// the [CSSConditionRule] interface returns or sets the text of the CSS 36 | /// rule. 37 | external String get conditionText; 38 | } 39 | 40 | /// The **`CSSMediaRule`** interface represents a single CSS rule. 41 | /// 42 | /// --- 43 | /// 44 | /// API documentation sourced from 45 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule). 46 | extension type CSSMediaRule._(JSObject _) 47 | implements CSSConditionRule, JSObject { 48 | /// The read-only **`media`** property of the 49 | /// [CSSMediaRule] interface returns a [MediaList] representing the intended 50 | /// destination medium for style information. 51 | external MediaList get media; 52 | } 53 | 54 | /// The **`CSSSupportsRule`** interface represents a single CSS 55 | /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule). 56 | /// 57 | /// --- 58 | /// 59 | /// API documentation sourced from 60 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSSupportsRule). 61 | extension type CSSSupportsRule._(JSObject _) 62 | implements CSSConditionRule, JSObject {} 63 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_conditional_5.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'css_conditional.dart'; 19 | 20 | /// The **`CSSContainerRule`** interface represents a single CSS rule. 21 | /// 22 | /// An object of this type can be used to get the query conditions for the , 23 | /// along with the container name if one is defined. 24 | /// Note that the container name and query together define the "condition text", 25 | /// which can be obtained using [CSSConditionRule.conditionText]. 26 | /// 27 | /// --- 28 | /// 29 | /// API documentation sourced from 30 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSContainerRule). 31 | extension type CSSContainerRule._(JSObject _) 32 | implements CSSConditionRule, JSObject { 33 | /// The read-only **`containerName`** property of the [CSSContainerRule] 34 | /// interface represents the container name of the associated CSS at-rule. 35 | /// 36 | /// For example, the value of `containerName` for the below is `sidebar`: 37 | /// 38 | /// ```css 39 | /// @container sidebar (min-width: 700px) { 40 | /// .card { 41 | /// font-size: 2em; 42 | /// } 43 | /// } 44 | /// ``` 45 | external String get containerName; 46 | 47 | /// The read-only **`containerQuery`** property of the [CSSContainerRule] 48 | /// interface returns a string representing the container conditions that are 49 | /// evaluated when the container changes size in order to determine if the 50 | /// styles in the associated are applied. 51 | /// 52 | /// For example, the value of `containerQuery` for the below is `(min-width: 53 | /// 700px)`: 54 | /// 55 | /// ```css 56 | /// @container sidebar (min-width: 700px) { 57 | /// .card { 58 | /// font-size: 2em; 59 | /// } 60 | /// } 61 | /// ``` 62 | external String get containerQuery; 63 | } 64 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_contain.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | 20 | /// The **`ContentVisibilityAutoStateChangeEvent`** interface is the event 21 | /// object for the [element.contentvisibilityautostatechange_event] event, which 22 | /// fires on any element with set on it when it starts or stops being 23 | /// [relevant to the user](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Using_CSS_containment#relevant_to_the_user) 24 | /// and 25 | /// [skipping its contents](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Using_CSS_containment#skips_its_contents). 26 | /// 27 | /// While the element is not relevant (between the start and end events), the 28 | /// user agent skips an element's rendering, including layout and painting. 29 | /// This can significantly improve page rendering speed. 30 | /// The [element.contentvisibilityautostatechange_event] event provides a way 31 | /// for an app's code to also start or stop rendering processes (e.g. drawing on 32 | /// a `canvas`) when they are not needed, thereby conserving processing power. 33 | /// 34 | /// Note that even when hidden from view, element contents will remain 35 | /// semantically relevant (e.g. to assistive technology users), so this signal 36 | /// should not be used to skip significant semantic DOM updates. 37 | /// 38 | /// --- 39 | /// 40 | /// API documentation sourced from 41 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ContentVisibilityAutoStateChangeEvent). 42 | extension type ContentVisibilityAutoStateChangeEvent._(JSObject _) 43 | implements Event, JSObject { 44 | external factory ContentVisibilityAutoStateChangeEvent( 45 | String type, [ 46 | ContentVisibilityAutoStateChangeEventInit eventInitDict, 47 | ]); 48 | 49 | /// The `skipped` read-only property of the 50 | /// [ContentVisibilityAutoStateChangeEvent] interface returns `true` if the 51 | /// user agent [skips the element's 52 | /// contents](/en-US/docs/Web/CSS/CSS_containment/Using_CSS_containment#skips_its_contents), 53 | /// or `false` otherwise. 54 | external bool get skipped; 55 | } 56 | extension type ContentVisibilityAutoStateChangeEventInit._(JSObject _) 57 | implements EventInit, JSObject { 58 | external factory ContentVisibilityAutoStateChangeEventInit({ 59 | bool bubbles, 60 | bool cancelable, 61 | bool composed, 62 | bool skipped, 63 | }); 64 | 65 | external bool get skipped; 66 | external set skipped(bool value); 67 | } 68 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_fonts.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | 20 | /// The **`CSSFontFeatureValuesRule`** interface represents an 21 | /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule), 22 | /// letting developers assign for each font face a common name to specify 23 | /// features indices to be used in . 24 | /// 25 | /// --- 26 | /// 27 | /// API documentation sourced from 28 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFeatureValuesRule). 29 | extension type CSSFontFeatureValuesRule._(JSObject _) 30 | implements CSSRule, JSObject { 31 | /// The **`fontFamily`** property of the [CSSConditionRule] interface 32 | /// represents the name of the font family it applies to. 33 | external String get fontFamily; 34 | external set fontFamily(String value); 35 | } 36 | 37 | /// The **`CSSFontPaletteValuesRule`** interface represents an 38 | /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule). 39 | /// 40 | /// --- 41 | /// 42 | /// API documentation sourced from 43 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontPaletteValuesRule). 44 | extension type CSSFontPaletteValuesRule._(JSObject _) 45 | implements CSSRule, JSObject { 46 | /// The read-only **`name`** property of the [CSSFontPaletteValuesRule] 47 | /// interface represents the name identifying the associated at-rule. A valid 48 | /// name always starts with two dashes, such as `--Alternate`. 49 | external String get name; 50 | 51 | /// The read-only **`fontFamily`** property of the [CSSFontPaletteValuesRule] 52 | /// interface lists the font families the rule can be applied to. The font 53 | /// families must be _named_ families; _generic_ families like `courier` are 54 | /// not valid. 55 | external String get fontFamily; 56 | 57 | /// The read-only **`basePalette`** property of the [CSSFontPaletteValuesRule] 58 | /// interface indicates the base palette associated with the rule. 59 | external String get basePalette; 60 | 61 | /// The read-only **`overrideColors`** property of the 62 | /// [CSSFontPaletteValuesRule] interface is a string containing a list of 63 | /// color index and color pair that are to be used instead. It is specified in 64 | /// the same format as the corresponding descriptor. 65 | external String get overrideColors; 66 | } 67 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_fonts_5.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | 20 | /// The **`CSSFontFaceRule`** interface represents an 21 | /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule). 22 | /// 23 | /// --- 24 | /// 25 | /// API documentation sourced from 26 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFaceRule). 27 | extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject { 28 | /// The read-only **`style`** property of the [CSSFontFaceRule] interface 29 | /// returns the style information from the 30 | /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_syntax/At-rule). 31 | /// This will be in the form of a [CSSStyleDeclaration] object. 32 | external JSObject get style; 33 | } 34 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_nesting.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | 20 | /// The **`CSSNestedDeclarations`** interface of the 21 | /// [CSS Rule API](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule) is 22 | /// used to group nested [CSSRule]s. 23 | /// 24 | /// The interface allows the [CSS Object Model 25 | /// (CSSOM](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model) 26 | /// to mirror the structure of CSS documents with nested CSS rules, and ensure 27 | /// that rules are parsed and evaluated in the order that they are declared. 28 | /// 29 | /// > [!NOTE] > [Browser versions](#browser_compatibility) with implementations 30 | /// > that do not support this interface may parse nested rules in the wrong 31 | /// > order. 32 | /// 33 | /// --- 34 | /// 35 | /// API documentation sourced from 36 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSNestedDeclarations). 37 | extension type CSSNestedDeclarations._(JSObject _) 38 | implements CSSRule, JSObject { 39 | /// The read-only **`style`** property of the [CSSNestedDeclarations] 40 | /// interface represents the styles associated with the nested rules. 41 | external JSObject get style; 42 | } 43 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_properties_values_api.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | 20 | extension type PropertyDefinition._(JSObject _) implements JSObject { 21 | external factory PropertyDefinition({ 22 | required String name, 23 | String syntax, 24 | required bool inherits, 25 | String initialValue, 26 | }); 27 | 28 | external String get name; 29 | external set name(String value); 30 | external String get syntax; 31 | external set syntax(String value); 32 | external bool get inherits; 33 | external set inherits(bool value); 34 | external String get initialValue; 35 | external set initialValue(String value); 36 | } 37 | 38 | /// The **`CSSPropertyRule`** interface of the 39 | /// [CSS Properties and Values API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API) 40 | /// represents a single CSS rule. 41 | /// 42 | /// --- 43 | /// 44 | /// API documentation sourced from 45 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSPropertyRule). 46 | extension type CSSPropertyRule._(JSObject _) implements CSSRule, JSObject { 47 | /// The read-only **`name`** property of the [CSSPropertyRule] interface 48 | /// represents the property name, this being the serialization of the name 49 | /// given to the custom property in the rule's prelude. 50 | external String get name; 51 | 52 | /// The read-only **`syntax`** property of the [CSSPropertyRule] interface 53 | /// returns the literal syntax of the custom property registration represented 54 | /// by the rule, controlling how the property's value is parsed at 55 | /// computed-value time. 56 | external String get syntax; 57 | 58 | /// The read-only **`inherits`** property of the [CSSPropertyRule] interface 59 | /// returns the inherit flag of the custom property registration represented 60 | /// by the rule, a boolean describing whether or not the property inherits by 61 | /// default. 62 | external bool get inherits; 63 | 64 | /// The read-only **`initialValue`** nullable property of the 65 | /// [CSSPropertyRule] interface returns the initial value of the custom 66 | /// property registration represented by the rule, controlling the property's 67 | /// initial value. 68 | external String? get initialValue; 69 | } 70 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_transitions.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | 20 | /// The **`TransitionEvent`** interface represents events providing information 21 | /// related to 22 | /// [transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transitions/Using_CSS_transitions). 23 | /// 24 | /// --- 25 | /// 26 | /// API documentation sourced from 27 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent). 28 | extension type TransitionEvent._(JSObject _) implements Event, JSObject { 29 | external factory TransitionEvent( 30 | String type, [ 31 | TransitionEventInit transitionEventInitDict, 32 | ]); 33 | 34 | /// The **`propertyName`** read-only property of [TransitionEvent] objects is 35 | /// a string containing the name of the CSS property associated with the 36 | /// transition. 37 | external String get propertyName; 38 | 39 | /// The **`TransitionEvent.elapsedTime`** read-only property is a 40 | /// `float` giving the amount of time the animation has been running, in 41 | /// seconds, 42 | /// when this event fired. This value is not affected by the 43 | /// property. 44 | external double get elapsedTime; 45 | 46 | /// The **`TransitionEvent.pseudoElement`** read-only property is a 47 | /// string, starting with `'::'`, containing the name of the 48 | /// [pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements) 49 | /// the animation runs on. 50 | /// If the transition doesn't run on a pseudo-element but on the element, an 51 | /// empty string: 52 | /// `''``.` 53 | external String get pseudoElement; 54 | } 55 | extension type TransitionEventInit._(JSObject _) 56 | implements EventInit, JSObject { 57 | external factory TransitionEventInit({ 58 | bool bubbles, 59 | bool cancelable, 60 | bool composed, 61 | String propertyName, 62 | num elapsedTime, 63 | String pseudoElement, 64 | }); 65 | 66 | external String get propertyName; 67 | external set propertyName(String value); 68 | external double get elapsedTime; 69 | external set elapsedTime(num value); 70 | external String get pseudoElement; 71 | external set pseudoElement(String value); 72 | } 73 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_transitions_2.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'cssom.dart'; 19 | import 'web_animations.dart'; 20 | 21 | /// The **`CSSStartingStyleRule`** interface of the 22 | /// [CSS Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model) 23 | /// represents a CSS at-rule. 24 | /// 25 | /// --- 26 | /// 27 | /// API documentation sourced from 28 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStartingStyleRule). 29 | extension type CSSStartingStyleRule._(JSObject _) 30 | implements CSSGroupingRule, JSObject {} 31 | 32 | /// The **`CSSTransition`** interface of the [Web Animations API] represents an 33 | /// [Animation] object used for a 34 | /// [CSS Transition](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transitions). 35 | /// 36 | /// --- 37 | /// 38 | /// API documentation sourced from 39 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSTransition). 40 | extension type CSSTransition._(JSObject _) implements Animation, JSObject { 41 | /// The **`transitionProperty`** property of the 42 | /// [CSSTransition] interface returns the **expanded transition property 43 | /// name** of the transition. This is the longhand CSS property for which the 44 | /// transition was generated. 45 | external String get transitionProperty; 46 | } 47 | -------------------------------------------------------------------------------- /web/lib/src/dom/css_view_transitions_2.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'css_view_transitions.dart'; 19 | import 'cssom.dart'; 20 | 21 | extension type CSSViewTransitionRule._(JSObject _) 22 | implements CSSRule, JSObject { 23 | external String get navigation; 24 | external JSArray get types; 25 | } 26 | extension type ViewTransitionTypeSet._(JSObject _) implements JSObject {} 27 | extension type StartViewTransitionOptions._(JSObject _) implements JSObject { 28 | external factory StartViewTransitionOptions({ 29 | ViewTransitionUpdateCallback? update, 30 | JSArray? types, 31 | }); 32 | 33 | external ViewTransitionUpdateCallback? get update; 34 | external set update(ViewTransitionUpdateCallback? value); 35 | external JSArray? get types; 36 | external set types(JSArray? value); 37 | } 38 | -------------------------------------------------------------------------------- /web/lib/src/dom/digital_credentials.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type DigitalCredentialRequestOptions._(JSObject _) 19 | implements JSObject { 20 | external factory DigitalCredentialRequestOptions( 21 | {JSArray requests}); 22 | 23 | external JSArray get requests; 24 | external set requests(JSArray value); 25 | } 26 | extension type DigitalCredentialRequest._(JSObject _) implements JSObject { 27 | external factory DigitalCredentialRequest({ 28 | required String protocol, 29 | required JSObject data, 30 | }); 31 | 32 | external String get protocol; 33 | external set protocol(String value); 34 | external JSObject get data; 35 | external set data(JSObject value); 36 | } 37 | -------------------------------------------------------------------------------- /web/lib/src/dom/dom_parsing.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | 20 | /// The `XMLSerializer` interface provides the [XMLSerializer.serializeToString] 21 | /// method to construct an XML string representing a tree. 22 | /// 23 | /// > [!NOTE] 24 | /// > The resulting XML string is not guaranteed to be well-formed XML. 25 | /// 26 | /// --- 27 | /// 28 | /// API documentation sourced from 29 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer). 30 | extension type XMLSerializer._(JSObject _) implements JSObject { 31 | external factory XMLSerializer(); 32 | 33 | /// The [XMLSerializer] method 34 | /// **`serializeToString()`** constructs a string representing the 35 | /// specified tree in form. 36 | external String serializeToString(Node root); 37 | } 38 | -------------------------------------------------------------------------------- /web/lib/src/dom/event_timing.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | import 'performance_timeline.dart'; 20 | 21 | /// The `PerformanceEventTiming` interface of the Event Timing API provides 22 | /// insights into the latency of certain event types triggered by user 23 | /// interaction. 24 | /// 25 | /// --- 26 | /// 27 | /// API documentation sourced from 28 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEventTiming). 29 | extension type PerformanceEventTiming._(JSObject _) 30 | implements PerformanceEntry, JSObject { 31 | /// The **`toJSON()`** method of the [PerformanceEventTiming] interface is a ; 32 | /// it returns a JSON representation of the [PerformanceEventTiming] object. 33 | external JSObject toJSON(); 34 | 35 | /// The read-only **`processingStart`** property returns the time at which 36 | /// event dispatch started. This is when event handlers are about to be 37 | /// executed. 38 | external double get processingStart; 39 | 40 | /// The read-only **`processingEnd`** property returns the time the last event 41 | /// handler finished executing. 42 | /// 43 | /// It's equal to [PerformanceEventTiming.processingStart] when there are no 44 | /// such event handlers. 45 | external double get processingEnd; 46 | 47 | /// The read-only **`cancelable`** property returns the associated event's 48 | /// [`cancelable`](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable) 49 | /// property, indicating whether the event can be canceled. 50 | external bool get cancelable; 51 | 52 | /// The read-only **`target`** property returns the associated event's last 53 | /// [`target`](https://developer.mozilla.org/en-US/docs/Web/API/Event/target) 54 | /// which is the node onto which the event was last dispatched. 55 | external Node? get target; 56 | } 57 | 58 | /// The **`EventCounts`** interface of the 59 | /// [Performance API](https://developer.mozilla.org/en-US/docs/Web/API/Performance_API) 60 | /// provides the number of events that have been dispatched for each event type. 61 | /// 62 | /// An `EventCounts` instance is a read-only 63 | /// [`Map`-like object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#map-like_browser_apis), 64 | /// in which each key is the name string for an event type, and the 65 | /// corresponding value is an integer indicating the number of events that have 66 | /// been dispatched for that event type. 67 | /// 68 | /// --- 69 | /// 70 | /// API documentation sourced from 71 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/EventCounts). 72 | extension type EventCounts._(JSObject _) implements JSObject {} 73 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_blend_minmax.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type EXT_blend_minmax._(JSObject _) implements JSObject { 21 | static const GLenum MIN_EXT = 32775; 22 | 23 | static const GLenum MAX_EXT = 32776; 24 | } 25 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_color_buffer_float.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type EXT_color_buffer_float._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_color_buffer_half_float.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type EXT_color_buffer_half_float._(JSObject _) implements JSObject { 21 | static const GLenum RGBA16F_EXT = 34842; 22 | 23 | static const GLenum RGB16F_EXT = 34843; 24 | 25 | static const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 33297; 26 | 27 | static const GLenum UNSIGNED_NORMALIZED_EXT = 35863; 28 | } 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_disjoint_timer_query.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WebGLTimerQueryEXT._(JSObject _) implements JSObject {} 21 | extension type EXT_disjoint_timer_query._(JSObject _) implements JSObject { 22 | static const GLenum QUERY_COUNTER_BITS_EXT = 34916; 23 | 24 | static const GLenum CURRENT_QUERY_EXT = 34917; 25 | 26 | static const GLenum QUERY_RESULT_EXT = 34918; 27 | 28 | static const GLenum QUERY_RESULT_AVAILABLE_EXT = 34919; 29 | 30 | static const GLenum TIME_ELAPSED_EXT = 35007; 31 | 32 | static const GLenum TIMESTAMP_EXT = 36392; 33 | 34 | static const GLenum GPU_DISJOINT_EXT = 36795; 35 | 36 | external WebGLTimerQueryEXT createQueryEXT(); 37 | external void deleteQueryEXT(WebGLTimerQueryEXT? query); 38 | external bool isQueryEXT(WebGLTimerQueryEXT? query); 39 | external void beginQueryEXT( 40 | GLenum target, 41 | WebGLTimerQueryEXT query, 42 | ); 43 | external void endQueryEXT(GLenum target); 44 | external void queryCounterEXT( 45 | WebGLTimerQueryEXT query, 46 | GLenum target, 47 | ); 48 | external JSAny? getQueryEXT( 49 | GLenum target, 50 | GLenum pname, 51 | ); 52 | external JSAny? getQueryObjectEXT( 53 | WebGLTimerQueryEXT query, 54 | GLenum pname, 55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | import 'webgl2.dart'; 20 | 21 | extension type EXT_disjoint_timer_query_webgl2._(JSObject _) 22 | implements JSObject { 23 | static const GLenum QUERY_COUNTER_BITS_EXT = 34916; 24 | 25 | static const GLenum TIME_ELAPSED_EXT = 35007; 26 | 27 | static const GLenum TIMESTAMP_EXT = 36392; 28 | 29 | static const GLenum GPU_DISJOINT_EXT = 36795; 30 | 31 | external void queryCounterEXT( 32 | WebGLQuery query, 33 | GLenum target, 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_float_blend.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type EXT_float_blend._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_frag_depth.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type EXT_frag_depth._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_shader_texture_lod.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type EXT_shader_texture_lod._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_srgb.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type EXT_sRGB._(JSObject _) implements JSObject { 21 | static const GLenum SRGB_EXT = 35904; 22 | 23 | static const GLenum SRGB_ALPHA_EXT = 35906; 24 | 25 | static const GLenum SRGB8_ALPHA8_EXT = 35907; 26 | 27 | static const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 33296; 28 | } 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_texture_compression_bptc.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type EXT_texture_compression_bptc._(JSObject _) implements JSObject { 21 | static const GLenum COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492; 22 | 23 | static const GLenum COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 36493; 24 | 25 | static const GLenum COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 36494; 26 | 27 | static const GLenum COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 36495; 28 | } 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_texture_compression_rgtc.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type EXT_texture_compression_rgtc._(JSObject _) implements JSObject { 21 | static const GLenum COMPRESSED_RED_RGTC1_EXT = 36283; 22 | 23 | static const GLenum COMPRESSED_SIGNED_RED_RGTC1_EXT = 36284; 24 | 25 | static const GLenum COMPRESSED_RED_GREEN_RGTC2_EXT = 36285; 26 | 27 | static const GLenum COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 36286; 28 | } 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_texture_filter_anisotropic.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type EXT_texture_filter_anisotropic._(JSObject _) 21 | implements JSObject { 22 | static const GLenum TEXTURE_MAX_ANISOTROPY_EXT = 34046; 23 | 24 | static const GLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047; 25 | } 26 | -------------------------------------------------------------------------------- /web/lib/src/dom/ext_texture_norm16.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type EXT_texture_norm16._(JSObject _) implements JSObject { 21 | static const GLenum R16_EXT = 33322; 22 | 23 | static const GLenum RG16_EXT = 33324; 24 | 25 | static const GLenum RGB16_EXT = 32852; 26 | 27 | static const GLenum RGBA16_EXT = 32859; 28 | 29 | static const GLenum R16_SNORM_EXT = 36760; 30 | 31 | static const GLenum RG16_SNORM_EXT = 36761; 32 | 33 | static const GLenum RGB16_SNORM_EXT = 36762; 34 | 35 | static const GLenum RGBA16_SNORM_EXT = 36763; 36 | } 37 | -------------------------------------------------------------------------------- /web/lib/src/dom/fedcm.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef IdentityCredentialRequestOptionsContext = String; 19 | typedef IdentityCredentialRequestOptionsMode = String; 20 | 21 | /// The **`IdentityCredentialRequestOptions`** dictionary represents the object 22 | /// passed to [CredentialsContainer.get] as the value of the `identity` option. 23 | /// 24 | /// It is used to request an [IdentityCredential] provided by a that supports 25 | /// the [Federated Credential Management (FedCM) 26 | /// API](https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API). 27 | /// 28 | /// --- 29 | /// 30 | /// API documentation sourced from 31 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/IdentityCredentialRequestOptions). 32 | extension type IdentityCredentialRequestOptions._(JSObject _) 33 | implements JSObject { 34 | external factory IdentityCredentialRequestOptions({ 35 | required JSArray providers, 36 | IdentityCredentialRequestOptionsContext context, 37 | IdentityCredentialRequestOptionsMode mode, 38 | }); 39 | 40 | external JSArray get providers; 41 | external set providers(JSArray value); 42 | external IdentityCredentialRequestOptionsContext get context; 43 | external set context(IdentityCredentialRequestOptionsContext value); 44 | external IdentityCredentialRequestOptionsMode get mode; 45 | external set mode(IdentityCredentialRequestOptionsMode value); 46 | } 47 | extension type IdentityProviderConfig._(JSObject _) implements JSObject { 48 | external factory IdentityProviderConfig({ 49 | required String configURL, 50 | required String clientId, 51 | }); 52 | 53 | external String get configURL; 54 | external set configURL(String value); 55 | external String get clientId; 56 | external set clientId(String value); 57 | } 58 | extension type IdentityProviderRequestOptions._(JSObject _) 59 | implements IdentityProviderConfig, JSObject { 60 | external factory IdentityProviderRequestOptions({ 61 | required String configURL, 62 | required String clientId, 63 | String nonce, 64 | String loginHint, 65 | String domainHint, 66 | JSArray fields, 67 | JSAny? params, 68 | }); 69 | 70 | external String get nonce; 71 | external set nonce(String value); 72 | external String get loginHint; 73 | external set loginHint(String value); 74 | external String get domainHint; 75 | external set domainHint(String value); 76 | external JSArray get fields; 77 | external set fields(JSArray value); 78 | external JSAny? get params; 79 | external set params(JSAny? value); 80 | } 81 | -------------------------------------------------------------------------------- /web/lib/src/dom/fido.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type HMACGetSecretInput._(JSObject _) implements JSObject { 19 | external factory HMACGetSecretInput({ 20 | required JSArrayBuffer salt1, 21 | JSArrayBuffer salt2, 22 | }); 23 | 24 | external JSArrayBuffer get salt1; 25 | external set salt1(JSArrayBuffer value); 26 | external JSArrayBuffer get salt2; 27 | external set salt2(JSArrayBuffer value); 28 | } 29 | extension type HMACGetSecretOutput._(JSObject _) implements JSObject { 30 | external factory HMACGetSecretOutput({ 31 | required JSArrayBuffer output1, 32 | JSArrayBuffer output2, 33 | }); 34 | 35 | external JSArrayBuffer get output1; 36 | external set output1(JSArrayBuffer value); 37 | external JSArrayBuffer get output2; 38 | external set output2(JSArrayBuffer value); 39 | } 40 | -------------------------------------------------------------------------------- /web/lib/src/dom/fullscreen.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef FullscreenNavigationUI = String; 19 | extension type FullscreenOptions._(JSObject _) implements JSObject { 20 | external factory FullscreenOptions({ 21 | FullscreenNavigationUI navigationUI, 22 | JSObject screen, 23 | }); 24 | 25 | external FullscreenNavigationUI get navigationUI; 26 | external set navigationUI(FullscreenNavigationUI value); 27 | external JSObject get screen; 28 | external set screen(JSObject value); 29 | } 30 | -------------------------------------------------------------------------------- /web/lib/src/dom/gyroscope.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'generic_sensor.dart'; 19 | 20 | typedef GyroscopeLocalCoordinateSystem = String; 21 | 22 | /// The **`Gyroscope`** interface of the 23 | /// [Sensor APIs](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs) 24 | /// provides on each reading the angular velocity of the device along all three 25 | /// axes. 26 | /// 27 | /// To use this sensor, the user must grant permission to the `'gyroscope'` 28 | /// device sensor through the 29 | /// [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API). 30 | /// In addition, this feature may be blocked by a 31 | /// [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy) 32 | /// set on your server. 33 | /// 34 | /// --- 35 | /// 36 | /// API documentation sourced from 37 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope). 38 | extension type Gyroscope._(JSObject _) implements Sensor, JSObject { 39 | external factory Gyroscope([GyroscopeSensorOptions sensorOptions]); 40 | 41 | /// The **`x`** read-only property of the 42 | /// [Gyroscope] interface returns a number specifying the 43 | /// angular velocity of the device along its x-axis. 44 | external double? get x; 45 | 46 | /// The **`y`** read-only property of the [Gyroscope] interface returns a 47 | /// number specifying the angular velocity of the device along its y-axis. 48 | external double? get y; 49 | 50 | /// The **`z`** read-only property of the 51 | /// [Gyroscope] interface returns a number specifying the 52 | /// angular velocity of the device along its z-axis. 53 | external double? get z; 54 | } 55 | extension type GyroscopeSensorOptions._(JSObject _) 56 | implements SensorOptions, JSObject { 57 | external factory GyroscopeSensorOptions({ 58 | num frequency, 59 | GyroscopeLocalCoordinateSystem referenceFrame, 60 | }); 61 | 62 | external GyroscopeLocalCoordinateSystem get referenceFrame; 63 | external set referenceFrame(GyroscopeLocalCoordinateSystem value); 64 | } 65 | -------------------------------------------------------------------------------- /web/lib/src/dom/khr_parallel_shader_compile.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type KHR_parallel_shader_compile._(JSObject _) implements JSObject { 21 | static const GLenum COMPLETION_STATUS_KHR = 37297; 22 | } 23 | -------------------------------------------------------------------------------- /web/lib/src/dom/largest_contentful_paint.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | import 'performance_timeline.dart'; 20 | 21 | /// The `LargestContentfulPaint` interface provides timing information about the 22 | /// largest image or text paint before user input on a web page. 23 | /// 24 | /// --- 25 | /// 26 | /// API documentation sourced from 27 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint). 28 | extension type LargestContentfulPaint._(JSObject _) 29 | implements PerformanceEntry, JSObject { 30 | /// The **`toJSON()`** method of the [LargestContentfulPaint] interface is a ; 31 | /// it returns a JSON representation of the [LargestContentfulPaint] object. 32 | external JSObject toJSON(); 33 | 34 | /// The **`renderTime`** read-only property of the [LargestContentfulPaint] 35 | /// interface represents the time that the element was rendered to the screen. 36 | external double get renderTime; 37 | 38 | /// The **`loadTime`** read-only property of the [LargestContentfulPaint] 39 | /// interface returns the time that the element was loaded. 40 | external double get loadTime; 41 | 42 | /// The **`size`** read-only property of the [LargestContentfulPaint] 43 | /// interface returns the intrinsic size of the element that is the largest 44 | /// contentful paint. 45 | /// 46 | /// The `size` of the element is the `width` times `height` of the 47 | /// [DOMRectReadOnly] that this element creates on the screen. 48 | external int get size; 49 | 50 | /// The **`id`** read-only property of the [LargestContentfulPaint] interface 51 | /// returns the ID of the element that is the largest contentful paint. 52 | external String get id; 53 | 54 | /// The **`url`** read-only property of the [LargestContentfulPaint] interface 55 | /// returns the request URL of the element, if the element is an image. 56 | external String get url; 57 | 58 | /// The **`element`** read-only property of the [LargestContentfulPaint] 59 | /// interface returns an object representing the [Element] that is the largest 60 | /// contentful paint. 61 | external Element? get element; 62 | } 63 | -------------------------------------------------------------------------------- /web/lib/src/dom/media_playback_quality.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | /// A **`VideoPlaybackQuality`** object is returned by the 19 | /// [HTMLVideoElement.getVideoPlaybackQuality] method and contains metrics that 20 | /// can be used to determine the playback quality of a video. 21 | /// 22 | /// --- 23 | /// 24 | /// API documentation sourced from 25 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/VideoPlaybackQuality). 26 | extension type VideoPlaybackQuality._(JSObject _) implements JSObject { 27 | /// The read-only **`creationTime`** property on the 28 | /// [VideoPlaybackQuality] interface reports the number of milliseconds since 29 | /// the browsing context was created this quality sample was recorded. 30 | external double get creationTime; 31 | 32 | /// The read-only **`droppedVideoFrames`** 33 | /// property of the [VideoPlaybackQuality] interface returns the number of 34 | /// video frames which have been dropped rather than being displayed since the 35 | /// last time 36 | /// the media was loaded into the [HTMLVideoElement]. 37 | external int get droppedVideoFrames; 38 | 39 | /// The [VideoPlaybackQuality] interface's 40 | /// **`totalVideoFrames`** read-only property returns the total 41 | /// number of video frames that have been displayed or dropped since the media 42 | /// was 43 | /// loaded. 44 | external int get totalVideoFrames; 45 | 46 | /// The [VideoPlaybackQuality] interface's read-only 47 | /// **`corruptedVideoFrames`** property the number of corrupted 48 | /// video frames that have been received since the `video` element was 49 | /// last loaded or reloaded. 50 | external int get corruptedVideoFrames; 51 | } 52 | -------------------------------------------------------------------------------- /web/lib/src/dom/mediacapture_fromelement.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'html.dart'; 19 | import 'mediacapture_streams.dart'; 20 | 21 | /// The **`CanvasCaptureMediaStreamTrack`** interface of the 22 | /// [Media Capture and Streams API] represents the video track contained in a 23 | /// [MediaStream] being generated from a `canvas` following a call to 24 | /// [HTMLCanvasElement.captureStream]. 25 | /// 26 | /// --- 27 | /// 28 | /// API documentation sourced from 29 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasCaptureMediaStreamTrack). 30 | extension type CanvasCaptureMediaStreamTrack._(JSObject _) 31 | implements MediaStreamTrack, JSObject { 32 | /// The **`requestFrame()`** method of the [CanvasCaptureMediaStreamTrack] 33 | /// interface requests that a frame be captured from the canvas and sent to 34 | /// the stream. 35 | /// 36 | /// Applications that need to carefully control 37 | /// the timing of rendering and frame capture can use `requestFrame()` to 38 | /// directly specify when it's time to capture a frame. 39 | /// 40 | /// To prevent automatic capture of frames, so that frames are only captured 41 | /// when 42 | /// `requestFrame()` is called, specify a value of 0 for the 43 | /// [HTMLCanvasElement.captureStream] method when creating 44 | /// the stream. 45 | external void requestFrame(); 46 | 47 | /// The **`canvas`** read-only property of the [CanvasCaptureMediaStreamTrack] 48 | /// interface returns the [HTMLCanvasElement] from which frames are being 49 | /// captured. 50 | external HTMLCanvasElement get canvas; 51 | } 52 | -------------------------------------------------------------------------------- /web/lib/src/dom/mediacapture_transform.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'mediacapture_streams.dart'; 19 | import 'streams.dart'; 20 | 21 | /// The **`MediaStreamTrackProcessor`** interface of the 22 | /// [Insertable Streams for MediaStreamTrack API](https://developer.mozilla.org/en-US/docs/Web/API/Insertable_Streams_for_MediaStreamTrack_API) 23 | /// consumes a [MediaStreamTrack] object's source and generates a stream of 24 | /// media frames. 25 | /// 26 | /// --- 27 | /// 28 | /// API documentation sourced from 29 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackProcessor). 30 | extension type MediaStreamTrackProcessor._(JSObject _) implements JSObject { 31 | external factory MediaStreamTrackProcessor( 32 | MediaStreamTrackProcessorInit init); 33 | 34 | /// The **`readable`** property of the [MediaStreamTrackProcessor] interface 35 | /// returns a [ReadableStream]. 36 | external ReadableStream get readable; 37 | } 38 | extension type MediaStreamTrackProcessorInit._(JSObject _) implements JSObject { 39 | external factory MediaStreamTrackProcessorInit({ 40 | required MediaStreamTrack track, 41 | int maxBufferSize, 42 | }); 43 | 44 | external MediaStreamTrack get track; 45 | external set track(MediaStreamTrack value); 46 | external int get maxBufferSize; 47 | external set maxBufferSize(int value); 48 | } 49 | -------------------------------------------------------------------------------- /web/lib/src/dom/mst_content_hint.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef RTCDegradationPreference = String; 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/netinfo.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | import 'html.dart'; 20 | 21 | typedef Megabit = num; 22 | typedef Millisecond = int; 23 | typedef EffectiveConnectionType = String; 24 | 25 | /// The **`NetworkInformation`** interface of the 26 | /// [Network Information API](https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API) 27 | /// provides information about the connection a device is using to communicate 28 | /// with the network and provides a means for scripts to be notified if the 29 | /// connection type changes. 30 | /// The `NetworkInformation` interface cannot be instantiated. It is instead 31 | /// accessed through the `connection` property of the [Navigator] interface or 32 | /// the [WorkerNavigator] interface. 33 | /// 34 | /// --- 35 | /// 36 | /// API documentation sourced from 37 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation). 38 | extension type NetworkInformation._(JSObject _) 39 | implements EventTarget, JSObject { 40 | /// The **`effectiveType`** read-only property of the 41 | /// [NetworkInformation] interface returns the effective type of the 42 | /// connection 43 | /// meaning one of `slow-2g`, `2g`, `3g`, or `4g`. This value is determined 44 | /// using a 45 | /// combination of recently observed, round-trip time and downlink values. 46 | external EffectiveConnectionType get effectiveType; 47 | 48 | /// The **`downlink`** read-only property of the 49 | /// [NetworkInformation] interface returns the effective bandwidth estimate in 50 | /// megabits per second, rounded to the nearest multiple of 25 kilobits per 51 | /// seconds. This 52 | /// value is based on recently observed application layer throughput across 53 | /// recently active 54 | /// connections, excluding connections made to a private address space. In the 55 | /// absence of 56 | /// recent bandwidth measurement data, the attribute value is determined by 57 | /// the properties 58 | /// of the underlying connection technology. 59 | external double get downlink; 60 | 61 | /// The **`rtt`** read-only property of the [NetworkInformation] interface 62 | /// returns the estimated effective round-trip time of the current connection, 63 | /// rounded to the nearest multiple of 25 milliseconds. 64 | /// This value is based on recently observed application-layer RTT 65 | /// measurements across recently active connections. 66 | /// It excludes connections made to a private address space. 67 | /// If no recent measurement data is available, the value is based on the 68 | /// properties of the underlying connection technology. 69 | external Millisecond get rtt; 70 | external EventHandler get onchange; 71 | external set onchange(EventHandler value); 72 | 73 | /// The **`saveData`** read-only 74 | /// property of the [NetworkInformation] interface returns `true` if the user 75 | /// has set a reduced data usage option on the user agent. 76 | external bool get saveData; 77 | } 78 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_element_index_uint.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type OES_element_index_uint._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_fbo_render_mipmap.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type OES_fbo_render_mipmap._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_standard_derivatives.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type OES_standard_derivatives._(JSObject _) implements JSObject { 21 | static const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 35723; 22 | } 23 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_texture_float.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type OES_texture_float._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_texture_float_linear.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type OES_texture_float_linear._(JSObject _) implements JSObject {} 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_texture_half_float.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type OES_texture_half_float._(JSObject _) implements JSObject { 21 | static const GLenum HALF_FLOAT_OES = 36193; 22 | } 23 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_texture_half_float_linear.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type OES_texture_half_float_linear._(JSObject _) 19 | implements JSObject {} 20 | -------------------------------------------------------------------------------- /web/lib/src/dom/oes_vertex_array_object.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WebGLVertexArrayObjectOES._(JSObject _) implements JSObject {} 21 | extension type OES_vertex_array_object._(JSObject _) implements JSObject { 22 | static const GLenum VERTEX_ARRAY_BINDING_OES = 34229; 23 | 24 | external WebGLVertexArrayObjectOES createVertexArrayOES(); 25 | external void deleteVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); 26 | external GLboolean isVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); 27 | external void bindVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); 28 | } 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/ovr_multiview2.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type OVR_multiview2._(JSObject _) implements JSObject { 21 | static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 38448; 22 | 23 | static const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 24 | 38450; 25 | 26 | static const GLenum MAX_VIEWS_OVR = 38449; 27 | 28 | static const GLenum FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 38451; 29 | 30 | external void framebufferTextureMultiviewOVR( 31 | GLenum target, 32 | GLenum attachment, 33 | WebGLTexture? texture, 34 | GLint level, 35 | GLint baseViewIndex, 36 | GLsizei numViews, 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /web/lib/src/dom/paint_timing.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'performance_timeline.dart'; 19 | 20 | /// The **`PerformancePaintTiming`** interface provides timing information about 21 | /// "paint" (also called "render") operations during web page construction. 22 | /// "Paint" refers to conversion of the render tree to on-screen pixels. 23 | /// 24 | /// There are two key paint moments this API provides: 25 | /// 26 | /// - (FP): Time when anything is rendered. Note that the marking of the first 27 | /// paint is optional, not all user agents report it. 28 | /// - (FCP): Time when the first bit of DOM text or image content is rendered. 29 | /// 30 | /// A third key paint moment is provided by the [LargestContentfulPaint] API: 31 | /// 32 | /// - (LCP): Render time of the largest image or text block visible within the 33 | /// viewport, recorded from when the page first begins to load. 34 | /// 35 | /// The data this API provides helps you minimize the time that users have to 36 | /// wait before they can see the site's content start to appear. Decreasing the 37 | /// time until these key paint moments make sites feel more responsive, 38 | /// performant, and engaging for your users. 39 | /// 40 | /// Like other Performance APIs, this API extends [PerformanceEntry]. 41 | /// 42 | /// --- 43 | /// 44 | /// API documentation sourced from 45 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PerformancePaintTiming). 46 | extension type PerformancePaintTiming._(JSObject _) 47 | implements PerformanceEntry, JSObject {} 48 | -------------------------------------------------------------------------------- /web/lib/src/dom/picture_in_picture.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | import 'html.dart'; 20 | 21 | /// The **`PictureInPictureWindow`** interface represents an object able to 22 | /// programmatically obtain the **`width`** and **`height`** and **`resize 23 | /// event`** of the floating video window. 24 | /// 25 | /// An object with this interface is obtained using the 26 | /// [HTMLVideoElement.requestPictureInPicture] promise return value. 27 | /// 28 | /// --- 29 | /// 30 | /// API documentation sourced from 31 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PictureInPictureWindow). 32 | extension type PictureInPictureWindow._(JSObject _) 33 | implements EventTarget, JSObject { 34 | /// The read-only **`width`** property of the [PictureInPictureWindow] 35 | /// interface returns the width of the floating video window in pixels. 36 | external int get width; 37 | 38 | /// The read-only **`height`** property of the [PictureInPictureWindow] 39 | /// interface returns the height of the floating video window in pixels. 40 | external int get height; 41 | external EventHandler get onresize; 42 | external set onresize(EventHandler value); 43 | } 44 | 45 | /// The **`PictureInPictureEvent`** interface represents 46 | /// picture-in-picture-related events, including 47 | /// [HTMLVideoElement.enterpictureinpicture_event], 48 | /// [HTMLVideoElement.leavepictureinpicture_event] and 49 | /// [PictureInPictureWindow.resize_event]. 50 | /// 51 | /// --- 52 | /// 53 | /// API documentation sourced from 54 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PictureInPictureEvent). 55 | extension type PictureInPictureEvent._(JSObject _) implements Event, JSObject { 56 | external factory PictureInPictureEvent( 57 | String type, 58 | PictureInPictureEventInit eventInitDict, 59 | ); 60 | 61 | /// The read-only **`pictureInPictureWindow`** property of the 62 | /// [PictureInPictureEvent] interface returns the [PictureInPictureWindow] the 63 | /// event relates to. 64 | external PictureInPictureWindow get pictureInPictureWindow; 65 | } 66 | extension type PictureInPictureEventInit._(JSObject _) 67 | implements EventInit, JSObject { 68 | external factory PictureInPictureEventInit({ 69 | bool bubbles, 70 | bool cancelable, 71 | bool composed, 72 | required PictureInPictureWindow pictureInPictureWindow, 73 | }); 74 | 75 | external PictureInPictureWindow get pictureInPictureWindow; 76 | external set pictureInPictureWindow(PictureInPictureWindow value); 77 | } 78 | -------------------------------------------------------------------------------- /web/lib/src/dom/pointerlock.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type PointerLockOptions._(JSObject _) implements JSObject { 19 | external factory PointerLockOptions({bool unadjustedMovement}); 20 | 21 | external bool get unadjustedMovement; 22 | external set unadjustedMovement(bool value); 23 | } 24 | -------------------------------------------------------------------------------- /web/lib/src/dom/private_network_access.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef IPAddressSpace = String; 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/referrer_policy.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef ReferrerPolicy = String; 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/remote_playback.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | import 'html.dart'; 20 | 21 | typedef RemotePlaybackAvailabilityCallback = JSFunction; 22 | typedef RemotePlaybackState = String; 23 | 24 | /// The **`RemotePlayback`** interface of the [Remote Playback API] allows the 25 | /// page to detect availability of remote playback devices, then connect to and 26 | /// control playing on these devices. 27 | /// 28 | /// --- 29 | /// 30 | /// API documentation sourced from 31 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback). 32 | extension type RemotePlayback._(JSObject _) implements EventTarget, JSObject { 33 | /// The **`watchAvailability()`** method of the [RemotePlayback] interface 34 | /// watches the list of available remote playback devices and returns a 35 | /// `Promise` that resolves with the `callbackId` of a remote playback device. 36 | external JSPromise watchAvailability( 37 | RemotePlaybackAvailabilityCallback callback); 38 | 39 | /// The **`cancelWatchAvailability()`** method of the [RemotePlayback] 40 | /// interface cancels the request to watch for one or all available devices. 41 | external JSPromise cancelWatchAvailability([int id]); 42 | 43 | /// The **`prompt()`** method of the [RemotePlayback] interface prompts the 44 | /// user to select an available remote playback device and give permission for 45 | /// the current media to be played using that device. 46 | /// 47 | /// If the user gives permission, the [RemotePlayback.state] will be set to 48 | /// `connecting` and the user agent will connect to the device to initiate 49 | /// playback. 50 | /// 51 | /// If the user chooses to instead disconnect from the device, the 52 | /// [RemotePlayback.state] will be set to `disconnected` and user agent will 53 | /// disconnect from this device. 54 | external JSPromise prompt(); 55 | 56 | /// The **`state`** read-only property of the [RemotePlayback] interface 57 | /// returns the current state of the `RemotePlayback` connection. 58 | external RemotePlaybackState get state; 59 | external EventHandler get onconnecting; 60 | external set onconnecting(EventHandler value); 61 | external EventHandler get onconnect; 62 | external set onconnect(EventHandler value); 63 | external EventHandler get ondisconnect; 64 | external set ondisconnect(EventHandler value); 65 | } 66 | -------------------------------------------------------------------------------- /web/lib/src/dom/screen_capture.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef SelfCapturePreferenceEnum = String; 19 | typedef SystemAudioPreferenceEnum = String; 20 | typedef SurfaceSwitchingPreferenceEnum = String; 21 | typedef MonitorTypeSurfacesEnum = String; 22 | extension type DisplayMediaStreamOptions._(JSObject _) implements JSObject { 23 | external factory DisplayMediaStreamOptions({ 24 | JSAny video, 25 | JSAny audio, 26 | JSObject controller, 27 | SelfCapturePreferenceEnum selfBrowserSurface, 28 | SystemAudioPreferenceEnum systemAudio, 29 | SurfaceSwitchingPreferenceEnum surfaceSwitching, 30 | MonitorTypeSurfacesEnum monitorTypeSurfaces, 31 | }); 32 | 33 | external JSAny get video; 34 | external set video(JSAny value); 35 | external JSAny get audio; 36 | external set audio(JSAny value); 37 | external JSObject get controller; 38 | external set controller(JSObject value); 39 | external SelfCapturePreferenceEnum get selfBrowserSurface; 40 | external set selfBrowserSurface(SelfCapturePreferenceEnum value); 41 | external SystemAudioPreferenceEnum get systemAudio; 42 | external set systemAudio(SystemAudioPreferenceEnum value); 43 | external SurfaceSwitchingPreferenceEnum get surfaceSwitching; 44 | external set surfaceSwitching(SurfaceSwitchingPreferenceEnum value); 45 | external MonitorTypeSurfacesEnum get monitorTypeSurfaces; 46 | external set monitorTypeSurfaces(MonitorTypeSurfacesEnum value); 47 | } 48 | -------------------------------------------------------------------------------- /web/lib/src/dom/screen_orientation.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'dom.dart'; 19 | import 'html.dart'; 20 | 21 | typedef OrientationLockType = String; 22 | typedef OrientationType = String; 23 | 24 | /// The **`ScreenOrientation`** interface of the 25 | /// [Screen Orientation API](https://developer.mozilla.org/en-US/docs/Web/API/Screen_Orientation_API) 26 | /// provides information about the current orientation of the document. 27 | /// 28 | /// A **`ScreenOrientation`** instance object can be retrieved using the 29 | /// [screen.orientation] property. 30 | /// 31 | /// --- 32 | /// 33 | /// API documentation sourced from 34 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation). 35 | extension type ScreenOrientation._(JSObject _) 36 | implements EventTarget, JSObject { 37 | /// The **`lock()`** method of the [ScreenOrientation] interface locks the 38 | /// orientation of the containing document to the specified orientation. 39 | /// 40 | /// Typically orientation locking is only enabled on mobile devices, and when 41 | /// the browser context is full screen. 42 | /// If locking is supported, then it must work for all the parameter values 43 | /// listed below. 44 | external JSPromise lock(OrientationLockType orientation); 45 | 46 | /// The **`unlock()`** method of the 47 | /// [ScreenOrientation] interface unlocks the orientation of the containing 48 | /// document from its default orientation. 49 | external void unlock(); 50 | 51 | /// The **`type`** read-only property of the 52 | /// [ScreenOrientation] interface returns the document's current orientation 53 | /// type, one of `portrait-primary`, `portrait-secondary`, 54 | /// `landscape-primary`, or 55 | /// `landscape-secondary`. 56 | external OrientationType get type; 57 | 58 | /// The **`angle`** read-only property of the 59 | /// [ScreenOrientation] interface returns the document's current orientation 60 | /// angle. 61 | external int get angle; 62 | external EventHandler get onchange; 63 | external set onchange(EventHandler value); 64 | } 65 | -------------------------------------------------------------------------------- /web/lib/src/dom/scroll_to_text_fragment.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | /// The **`FragmentDirective`** interface is an object exposed to allow code to 19 | /// check whether or not a browser supports 20 | /// [text fragments](https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Fragment/Text_fragments). 21 | /// 22 | /// It is accessed via the [Document.fragmentDirective] property. 23 | /// 24 | /// --- 25 | /// 26 | /// API documentation sourced from 27 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FragmentDirective). 28 | extension type FragmentDirective._(JSObject _) implements JSObject {} 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/secure_payment_confirmation.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'payment_request.dart'; 19 | 20 | extension type AuthenticationExtensionsPaymentInputs._(JSObject _) 21 | implements JSObject { 22 | external factory AuthenticationExtensionsPaymentInputs({ 23 | bool isPayment, 24 | String rpId, 25 | String topOrigin, 26 | String payeeName, 27 | String payeeOrigin, 28 | PaymentCurrencyAmount total, 29 | PaymentCredentialInstrument instrument, 30 | }); 31 | 32 | external bool get isPayment; 33 | external set isPayment(bool value); 34 | external String get rpId; 35 | external set rpId(String value); 36 | external String get topOrigin; 37 | external set topOrigin(String value); 38 | external String get payeeName; 39 | external set payeeName(String value); 40 | external String get payeeOrigin; 41 | external set payeeOrigin(String value); 42 | external PaymentCurrencyAmount get total; 43 | external set total(PaymentCurrencyAmount value); 44 | external PaymentCredentialInstrument get instrument; 45 | external set instrument(PaymentCredentialInstrument value); 46 | } 47 | extension type PaymentCredentialInstrument._(JSObject _) implements JSObject { 48 | external factory PaymentCredentialInstrument({ 49 | required String displayName, 50 | required String icon, 51 | bool iconMustBeShown, 52 | }); 53 | 54 | external String get displayName; 55 | external set displayName(String value); 56 | external String get icon; 57 | external set icon(String value); 58 | external bool get iconMustBeShown; 59 | external set iconMustBeShown(bool value); 60 | } 61 | -------------------------------------------------------------------------------- /web/lib/src/dom/server_timing.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | /// The **`PerformanceServerTiming`** interface surfaces server metrics that are 19 | /// sent with the response in the HTTP header. 20 | /// 21 | /// This interface is restricted to the same origin, but you can use the header 22 | /// to specify the domains that are allowed to access the server metrics. Note 23 | /// that this interface is only available in secure contexts (HTTPS) in some 24 | /// browsers. 25 | /// 26 | /// --- 27 | /// 28 | /// API documentation sourced from 29 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceServerTiming). 30 | extension type PerformanceServerTiming._(JSObject _) implements JSObject { 31 | /// The **`toJSON()`** method of the [PerformanceServerTiming] interface is a 32 | /// ; it returns a JSON representation of the [PerformanceServerTiming] 33 | /// object. 34 | external JSObject toJSON(); 35 | 36 | /// The **`name`** read-only property returns a 37 | /// string value of the server-specified metric name. 38 | external String get name; 39 | 40 | /// The **`duration`** read-only property returns a double that contains the 41 | /// server-specified metric duration, or the value `0.0`. 42 | external double get duration; 43 | 44 | /// The **`description`** read-only property returns a 45 | /// string value of the server-specified metric description, or an empty 46 | /// string. 47 | external String get description; 48 | } 49 | -------------------------------------------------------------------------------- /web/lib/src/dom/trust_token_api.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef RefreshPolicy = String; 19 | typedef TokenVersion = String; 20 | typedef OperationType = String; 21 | extension type PrivateToken._(JSObject _) implements JSObject { 22 | external factory PrivateToken({ 23 | required TokenVersion version, 24 | required OperationType operation, 25 | RefreshPolicy refreshPolicy, 26 | JSArray issuers, 27 | }); 28 | 29 | external TokenVersion get version; 30 | external set version(TokenVersion value); 31 | external OperationType get operation; 32 | external set operation(OperationType value); 33 | external RefreshPolicy get refreshPolicy; 34 | external set refreshPolicy(RefreshPolicy value); 35 | external JSArray get issuers; 36 | external set issuers(JSArray value); 37 | } 38 | -------------------------------------------------------------------------------- /web/lib/src/dom/user_timing.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'hr_time.dart'; 19 | import 'performance_timeline.dart'; 20 | 21 | extension type PerformanceMarkOptions._(JSObject _) implements JSObject { 22 | external factory PerformanceMarkOptions({ 23 | JSAny? detail, 24 | DOMHighResTimeStamp startTime, 25 | }); 26 | 27 | external JSAny? get detail; 28 | external set detail(JSAny? value); 29 | external double get startTime; 30 | external set startTime(DOMHighResTimeStamp value); 31 | } 32 | extension type PerformanceMeasureOptions._(JSObject _) implements JSObject { 33 | external factory PerformanceMeasureOptions({ 34 | JSAny? detail, 35 | JSAny start, 36 | DOMHighResTimeStamp duration, 37 | JSAny end, 38 | }); 39 | 40 | external JSAny? get detail; 41 | external set detail(JSAny? value); 42 | external JSAny get start; 43 | external set start(JSAny value); 44 | external double get duration; 45 | external set duration(DOMHighResTimeStamp value); 46 | external JSAny get end; 47 | external set end(JSAny value); 48 | } 49 | 50 | /// **`PerformanceMark`** is an interface for [PerformanceEntry] objects with an 51 | /// [PerformanceEntry.entryType] of `"mark"`. 52 | /// 53 | /// Entries of this type are typically created by calling [Performance.mark] to 54 | /// add a _named_ [DOMHighResTimeStamp] (the _mark_) to the browser's 55 | /// performance timeline. To create a performance mark that isn't added to the 56 | /// browser's performance timeline, use the constructor. 57 | /// 58 | /// --- 59 | /// 60 | /// API documentation sourced from 61 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark). 62 | extension type PerformanceMark._(JSObject _) 63 | implements PerformanceEntry, JSObject { 64 | external factory PerformanceMark( 65 | String markName, [ 66 | PerformanceMarkOptions markOptions, 67 | ]); 68 | 69 | /// The read-only **`detail`** property returns arbitrary metadata that was 70 | /// included in the mark upon construction (either when using 71 | /// [Performance.mark] or the [PerformanceMark.PerformanceMark] constructor). 72 | external JSAny? get detail; 73 | } 74 | 75 | /// **`PerformanceMeasure`** is an _abstract_ interface for [PerformanceEntry] 76 | /// objects with an [PerformanceEntry.entryType] of `"measure"`. Entries of this 77 | /// type are created by calling [Performance.measure] to add a _named_ 78 | /// [DOMHighResTimeStamp] (the _measure_) between two _marks_ to the browser's 79 | /// _performance timeline_. 80 | /// 81 | /// --- 82 | /// 83 | /// API documentation sourced from 84 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure). 85 | extension type PerformanceMeasure._(JSObject _) 86 | implements PerformanceEntry, JSObject { 87 | /// The read-only **`detail`** property returns arbitrary metadata that was 88 | /// included in the mark upon construction (when using [Performance.measure]. 89 | external JSAny? get detail; 90 | } 91 | -------------------------------------------------------------------------------- /web/lib/src/dom/vibration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef VibratePattern = JSAny; 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/video_rvfc.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef VideoFrameRequestCallback = JSFunction; 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/web_animations_2.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'css_typed_om.dart'; 19 | import 'dom.dart'; 20 | 21 | typedef IterationCompositeOperation = String; 22 | extension type TimelineRangeOffset._(JSObject _) implements JSObject { 23 | external factory TimelineRangeOffset({ 24 | String? rangeName, 25 | CSSNumericValue offset, 26 | }); 27 | 28 | external String? get rangeName; 29 | external set rangeName(String? value); 30 | external CSSNumericValue get offset; 31 | external set offset(CSSNumericValue value); 32 | } 33 | 34 | /// The AnimationPlaybackEvent interface of the 35 | /// [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API) 36 | /// represents animation events. 37 | /// 38 | /// As animations play, they report changes to their [Animation.playState] 39 | /// through animation events. 40 | /// 41 | /// --- 42 | /// 43 | /// API documentation sourced from 44 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/AnimationPlaybackEvent). 45 | extension type AnimationPlaybackEvent._(JSObject _) implements Event, JSObject { 46 | external factory AnimationPlaybackEvent( 47 | String type, [ 48 | AnimationPlaybackEventInit eventInitDict, 49 | ]); 50 | 51 | /// The **`currentTime`** read-only property of the [AnimationPlaybackEvent] 52 | /// interface represents the current time of the animation that generated the 53 | /// event at the moment the event is queued. This will be unresolved if the 54 | /// animation was `idle` at the time the event was generated. 55 | external CSSNumberish? get currentTime; 56 | 57 | /// The **`timelineTime`** read-only property of the [AnimationPlaybackEvent] 58 | /// interface represents the time value of the animation's [AnimationTimeline] 59 | /// at the moment the event is queued. This will be unresolved if the 60 | /// animation was not associated with a timeline at the time the event was 61 | /// generated or if the associated timeline was inactive. 62 | external CSSNumberish? get timelineTime; 63 | } 64 | extension type AnimationPlaybackEventInit._(JSObject _) 65 | implements EventInit, JSObject { 66 | external factory AnimationPlaybackEventInit({ 67 | bool bubbles, 68 | bool cancelable, 69 | bool composed, 70 | CSSNumberish? currentTime, 71 | CSSNumberish? timelineTime, 72 | }); 73 | 74 | external CSSNumberish? get currentTime; 75 | external set currentTime(CSSNumberish? value); 76 | external CSSNumberish? get timelineTime; 77 | external set timelineTime(CSSNumberish? value); 78 | } 79 | -------------------------------------------------------------------------------- /web/lib/src/dom/web_bluetooth.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | /// The **`BluetoothUUID`** interface of the 19 | /// [Web Bluetooth API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API) 20 | /// provides a way to look up Universally Unique Identifier (UUID) values by 21 | /// name in the 22 | /// [registry](https://www.bluetooth.com/specifications/assigned-numbers/) 23 | /// maintained by the Bluetooth SIG. 24 | /// 25 | /// --- 26 | /// 27 | /// API documentation sourced from 28 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothUUID). 29 | extension type BluetoothUUID._(JSObject _) implements JSObject {} 30 | -------------------------------------------------------------------------------- /web/lib/src/dom/web_otp.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef OTPCredentialTransportType = String; 19 | extension type OTPCredentialRequestOptions._(JSObject _) implements JSObject { 20 | external factory OTPCredentialRequestOptions({JSArray transport}); 21 | 22 | external JSArray get transport; 23 | external set transport(JSArray value); 24 | } 25 | -------------------------------------------------------------------------------- /web/lib/src/dom/web_share.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'fileapi.dart'; 19 | 20 | extension type ShareData._(JSObject _) implements JSObject { 21 | external factory ShareData({ 22 | JSArray files, 23 | String title, 24 | String text, 25 | String url, 26 | }); 27 | 28 | external JSArray get files; 29 | external set files(JSArray value); 30 | external String get title; 31 | external set title(String value); 32 | external String get text; 33 | external set text(String value); 34 | external String get url; 35 | external set url(String value); 36 | } 37 | -------------------------------------------------------------------------------- /web/lib/src/dom/webcodecs_aac_codec_registration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef AacBitstreamFormat = String; 19 | extension type AacEncoderConfig._(JSObject _) implements JSObject { 20 | external factory AacEncoderConfig({AacBitstreamFormat format}); 21 | 22 | external AacBitstreamFormat get format; 23 | external set format(AacBitstreamFormat value); 24 | } 25 | -------------------------------------------------------------------------------- /web/lib/src/dom/webcodecs_av1_codec_registration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type VideoEncoderEncodeOptionsForAv1._(JSObject _) 19 | implements JSObject { 20 | external factory VideoEncoderEncodeOptionsForAv1({int? quantizer}); 21 | 22 | external int? get quantizer; 23 | external set quantizer(int? value); 24 | } 25 | -------------------------------------------------------------------------------- /web/lib/src/dom/webcodecs_avc_codec_registration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef AvcBitstreamFormat = String; 19 | extension type AvcEncoderConfig._(JSObject _) implements JSObject { 20 | external factory AvcEncoderConfig({AvcBitstreamFormat format}); 21 | 22 | external AvcBitstreamFormat get format; 23 | external set format(AvcBitstreamFormat value); 24 | } 25 | extension type VideoEncoderEncodeOptionsForAvc._(JSObject _) 26 | implements JSObject { 27 | external factory VideoEncoderEncodeOptionsForAvc({int? quantizer}); 28 | 29 | external int? get quantizer; 30 | external set quantizer(int? value); 31 | } 32 | -------------------------------------------------------------------------------- /web/lib/src/dom/webcodecs_flac_codec_registration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type FlacEncoderConfig._(JSObject _) implements JSObject { 19 | external factory FlacEncoderConfig({ 20 | int blockSize, 21 | int compressLevel, 22 | }); 23 | 24 | external int get blockSize; 25 | external set blockSize(int value); 26 | external int get compressLevel; 27 | external set compressLevel(int value); 28 | } 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/webcodecs_hevc_codec_registration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef HevcBitstreamFormat = String; 19 | extension type HevcEncoderConfig._(JSObject _) implements JSObject { 20 | external factory HevcEncoderConfig({HevcBitstreamFormat format}); 21 | 22 | external HevcBitstreamFormat get format; 23 | external set format(HevcBitstreamFormat value); 24 | } 25 | extension type VideoEncoderEncodeOptionsForHevc._(JSObject _) 26 | implements JSObject { 27 | external factory VideoEncoderEncodeOptionsForHevc({int? quantizer}); 28 | 29 | external int? get quantizer; 30 | external set quantizer(int? value); 31 | } 32 | -------------------------------------------------------------------------------- /web/lib/src/dom/webcodecs_opus_codec_registration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef OpusBitstreamFormat = String; 19 | typedef OpusSignal = String; 20 | typedef OpusApplication = String; 21 | extension type OpusEncoderConfig._(JSObject _) implements JSObject { 22 | external factory OpusEncoderConfig({ 23 | OpusBitstreamFormat format, 24 | OpusSignal signal, 25 | OpusApplication application, 26 | int frameDuration, 27 | int complexity, 28 | int packetlossperc, 29 | bool useinbandfec, 30 | bool usedtx, 31 | }); 32 | 33 | external OpusBitstreamFormat get format; 34 | external set format(OpusBitstreamFormat value); 35 | external OpusSignal get signal; 36 | external set signal(OpusSignal value); 37 | external OpusApplication get application; 38 | external set application(OpusApplication value); 39 | external int get frameDuration; 40 | external set frameDuration(int value); 41 | external int get complexity; 42 | external set complexity(int value); 43 | external int get packetlossperc; 44 | external set packetlossperc(int value); 45 | external bool get useinbandfec; 46 | external set useinbandfec(bool value); 47 | external bool get usedtx; 48 | external set usedtx(bool value); 49 | } 50 | -------------------------------------------------------------------------------- /web/lib/src/dom/webcodecs_vp9_codec_registration.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type VideoEncoderEncodeOptionsForVp9._(JSObject _) 19 | implements JSObject { 20 | external factory VideoEncoderEncodeOptionsForVp9({int? quantizer}); 21 | 22 | external int? get quantizer; 23 | external set quantizer(int? value); 24 | } 25 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_color_buffer_float.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_color_buffer_float._(JSObject _) implements JSObject { 21 | static const GLenum RGBA32F_EXT = 34836; 22 | 23 | static const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 33297; 24 | 25 | static const GLenum UNSIGNED_NORMALIZED_EXT = 35863; 26 | } 27 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_compressed_texture_astc.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_compressed_texture_astc._(JSObject _) implements JSObject { 21 | static const GLenum COMPRESSED_RGBA_ASTC_4x4_KHR = 37808; 22 | 23 | static const GLenum COMPRESSED_RGBA_ASTC_5x4_KHR = 37809; 24 | 25 | static const GLenum COMPRESSED_RGBA_ASTC_5x5_KHR = 37810; 26 | 27 | static const GLenum COMPRESSED_RGBA_ASTC_6x5_KHR = 37811; 28 | 29 | static const GLenum COMPRESSED_RGBA_ASTC_6x6_KHR = 37812; 30 | 31 | static const GLenum COMPRESSED_RGBA_ASTC_8x5_KHR = 37813; 32 | 33 | static const GLenum COMPRESSED_RGBA_ASTC_8x6_KHR = 37814; 34 | 35 | static const GLenum COMPRESSED_RGBA_ASTC_8x8_KHR = 37815; 36 | 37 | static const GLenum COMPRESSED_RGBA_ASTC_10x5_KHR = 37816; 38 | 39 | static const GLenum COMPRESSED_RGBA_ASTC_10x6_KHR = 37817; 40 | 41 | static const GLenum COMPRESSED_RGBA_ASTC_10x8_KHR = 37818; 42 | 43 | static const GLenum COMPRESSED_RGBA_ASTC_10x10_KHR = 37819; 44 | 45 | static const GLenum COMPRESSED_RGBA_ASTC_12x10_KHR = 37820; 46 | 47 | static const GLenum COMPRESSED_RGBA_ASTC_12x12_KHR = 37821; 48 | 49 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 37840; 50 | 51 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 37841; 52 | 53 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 37842; 54 | 55 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 37843; 56 | 57 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 37844; 58 | 59 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 37845; 60 | 61 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 37846; 62 | 63 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 37847; 64 | 65 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 37848; 66 | 67 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 37849; 68 | 69 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 37850; 70 | 71 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 37851; 72 | 73 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 37852; 74 | 75 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 37853; 76 | 77 | external JSArray getSupportedProfiles(); 78 | } 79 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_compressed_texture_etc.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_compressed_texture_etc._(JSObject _) implements JSObject { 21 | static const GLenum COMPRESSED_R11_EAC = 37488; 22 | 23 | static const GLenum COMPRESSED_SIGNED_R11_EAC = 37489; 24 | 25 | static const GLenum COMPRESSED_RG11_EAC = 37490; 26 | 27 | static const GLenum COMPRESSED_SIGNED_RG11_EAC = 37491; 28 | 29 | static const GLenum COMPRESSED_RGB8_ETC2 = 37492; 30 | 31 | static const GLenum COMPRESSED_SRGB8_ETC2 = 37493; 32 | 33 | static const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494; 34 | 35 | static const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495; 36 | 37 | static const GLenum COMPRESSED_RGBA8_ETC2_EAC = 37496; 38 | 39 | static const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497; 40 | } 41 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_compressed_texture_etc1.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_compressed_texture_etc1._(JSObject _) implements JSObject { 21 | static const GLenum COMPRESSED_RGB_ETC1_WEBGL = 36196; 22 | } 23 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_compressed_texture_pvrtc.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_compressed_texture_pvrtc._(JSObject _) 21 | implements JSObject { 22 | static const GLenum COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840; 23 | 24 | static const GLenum COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841; 25 | 26 | static const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842; 27 | 28 | static const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843; 29 | } 30 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_compressed_texture_s3tc.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_compressed_texture_s3tc._(JSObject _) implements JSObject { 21 | static const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT = 33776; 22 | 23 | static const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777; 24 | 25 | static const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778; 26 | 27 | static const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779; 28 | } 29 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_compressed_texture_s3tc_srgb._(JSObject _) 21 | implements JSObject { 22 | static const GLenum COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916; 23 | 24 | static const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917; 25 | 26 | static const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918; 27 | 28 | static const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919; 29 | } 30 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_debug_renderer_info.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_debug_renderer_info._(JSObject _) implements JSObject { 21 | static const GLenum UNMASKED_VENDOR_WEBGL = 37445; 22 | 23 | static const GLenum UNMASKED_RENDERER_WEBGL = 37446; 24 | } 25 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_debug_shaders.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_debug_shaders._(JSObject _) implements JSObject { 21 | external String getTranslatedShaderSource(WebGLShader shader); 22 | } 23 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_depth_texture.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_depth_texture._(JSObject _) implements JSObject { 21 | static const GLenum UNSIGNED_INT_24_8_WEBGL = 34042; 22 | } 23 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_draw_buffers.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_draw_buffers._(JSObject _) implements JSObject { 21 | static const GLenum COLOR_ATTACHMENT0_WEBGL = 36064; 22 | 23 | static const GLenum COLOR_ATTACHMENT1_WEBGL = 36065; 24 | 25 | static const GLenum COLOR_ATTACHMENT2_WEBGL = 36066; 26 | 27 | static const GLenum COLOR_ATTACHMENT3_WEBGL = 36067; 28 | 29 | static const GLenum COLOR_ATTACHMENT4_WEBGL = 36068; 30 | 31 | static const GLenum COLOR_ATTACHMENT5_WEBGL = 36069; 32 | 33 | static const GLenum COLOR_ATTACHMENT6_WEBGL = 36070; 34 | 35 | static const GLenum COLOR_ATTACHMENT7_WEBGL = 36071; 36 | 37 | static const GLenum COLOR_ATTACHMENT8_WEBGL = 36072; 38 | 39 | static const GLenum COLOR_ATTACHMENT9_WEBGL = 36073; 40 | 41 | static const GLenum COLOR_ATTACHMENT10_WEBGL = 36074; 42 | 43 | static const GLenum COLOR_ATTACHMENT11_WEBGL = 36075; 44 | 45 | static const GLenum COLOR_ATTACHMENT12_WEBGL = 36076; 46 | 47 | static const GLenum COLOR_ATTACHMENT13_WEBGL = 36077; 48 | 49 | static const GLenum COLOR_ATTACHMENT14_WEBGL = 36078; 50 | 51 | static const GLenum COLOR_ATTACHMENT15_WEBGL = 36079; 52 | 53 | static const GLenum DRAW_BUFFER0_WEBGL = 34853; 54 | 55 | static const GLenum DRAW_BUFFER1_WEBGL = 34854; 56 | 57 | static const GLenum DRAW_BUFFER2_WEBGL = 34855; 58 | 59 | static const GLenum DRAW_BUFFER3_WEBGL = 34856; 60 | 61 | static const GLenum DRAW_BUFFER4_WEBGL = 34857; 62 | 63 | static const GLenum DRAW_BUFFER5_WEBGL = 34858; 64 | 65 | static const GLenum DRAW_BUFFER6_WEBGL = 34859; 66 | 67 | static const GLenum DRAW_BUFFER7_WEBGL = 34860; 68 | 69 | static const GLenum DRAW_BUFFER8_WEBGL = 34861; 70 | 71 | static const GLenum DRAW_BUFFER9_WEBGL = 34862; 72 | 73 | static const GLenum DRAW_BUFFER10_WEBGL = 34863; 74 | 75 | static const GLenum DRAW_BUFFER11_WEBGL = 34864; 76 | 77 | static const GLenum DRAW_BUFFER12_WEBGL = 34865; 78 | 79 | static const GLenum DRAW_BUFFER13_WEBGL = 34866; 80 | 81 | static const GLenum DRAW_BUFFER14_WEBGL = 34867; 82 | 83 | static const GLenum DRAW_BUFFER15_WEBGL = 34868; 84 | 85 | static const GLenum MAX_COLOR_ATTACHMENTS_WEBGL = 36063; 86 | 87 | static const GLenum MAX_DRAW_BUFFERS_WEBGL = 34852; 88 | 89 | external void drawBuffersWEBGL(JSArray buffers); 90 | } 91 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_lose_context.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type WEBGL_lose_context._(JSObject _) implements JSObject { 19 | external void loseContext(); 20 | external void restoreContext(); 21 | } 22 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgl_multi_draw.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webgl1.dart'; 19 | 20 | extension type WEBGL_multi_draw._(JSObject _) implements JSObject { 21 | external void multiDrawArraysWEBGL( 22 | GLenum mode, 23 | JSObject firstsList, 24 | int firstsOffset, 25 | JSObject countsList, 26 | int countsOffset, 27 | GLsizei drawcount, 28 | ); 29 | external void multiDrawElementsWEBGL( 30 | GLenum mode, 31 | JSObject countsList, 32 | int countsOffset, 33 | GLenum type, 34 | JSObject offsetsList, 35 | int offsetsOffset, 36 | GLsizei drawcount, 37 | ); 38 | external void multiDrawArraysInstancedWEBGL( 39 | GLenum mode, 40 | JSObject firstsList, 41 | int firstsOffset, 42 | JSObject countsList, 43 | int countsOffset, 44 | JSObject instanceCountsList, 45 | int instanceCountsOffset, 46 | GLsizei drawcount, 47 | ); 48 | external void multiDrawElementsInstancedWEBGL( 49 | GLenum mode, 50 | JSObject countsList, 51 | int countsOffset, 52 | GLenum type, 53 | JSObject offsetsList, 54 | int offsetsOffset, 55 | JSObject instanceCountsList, 56 | int instanceCountsOffset, 57 | GLsizei drawcount, 58 | ); 59 | } 60 | -------------------------------------------------------------------------------- /web/lib/src/dom/webgpu.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef GPUFlagsConstant = int; 19 | @JS() 20 | external $GPUBufferUsage get GPUBufferUsage; 21 | @JS('GPUBufferUsage') 22 | extension type $GPUBufferUsage._(JSObject _) implements JSObject { 23 | static const GPUFlagsConstant MAP_READ = 1; 24 | 25 | static const GPUFlagsConstant MAP_WRITE = 2; 26 | 27 | static const GPUFlagsConstant COPY_SRC = 4; 28 | 29 | static const GPUFlagsConstant COPY_DST = 8; 30 | 31 | static const GPUFlagsConstant INDEX = 16; 32 | 33 | static const GPUFlagsConstant VERTEX = 32; 34 | 35 | static const GPUFlagsConstant UNIFORM = 64; 36 | 37 | static const GPUFlagsConstant STORAGE = 128; 38 | 39 | static const GPUFlagsConstant INDIRECT = 256; 40 | 41 | static const GPUFlagsConstant QUERY_RESOLVE = 512; 42 | } 43 | @JS() 44 | external $GPUMapMode get GPUMapMode; 45 | @JS('GPUMapMode') 46 | extension type $GPUMapMode._(JSObject _) implements JSObject { 47 | static const GPUFlagsConstant READ = 1; 48 | 49 | static const GPUFlagsConstant WRITE = 2; 50 | } 51 | @JS() 52 | external $GPUTextureUsage get GPUTextureUsage; 53 | @JS('GPUTextureUsage') 54 | extension type $GPUTextureUsage._(JSObject _) implements JSObject { 55 | static const GPUFlagsConstant COPY_SRC = 1; 56 | 57 | static const GPUFlagsConstant COPY_DST = 2; 58 | 59 | static const GPUFlagsConstant TEXTURE_BINDING = 4; 60 | 61 | static const GPUFlagsConstant STORAGE_BINDING = 8; 62 | 63 | static const GPUFlagsConstant RENDER_ATTACHMENT = 16; 64 | } 65 | @JS() 66 | external $GPUShaderStage get GPUShaderStage; 67 | @JS('GPUShaderStage') 68 | extension type $GPUShaderStage._(JSObject _) implements JSObject { 69 | static const GPUFlagsConstant VERTEX = 1; 70 | 71 | static const GPUFlagsConstant FRAGMENT = 2; 72 | 73 | static const GPUFlagsConstant COMPUTE = 4; 74 | } 75 | @JS() 76 | external $GPUColorWrite get GPUColorWrite; 77 | @JS('GPUColorWrite') 78 | extension type $GPUColorWrite._(JSObject _) implements JSObject { 79 | static const GPUFlagsConstant RED = 1; 80 | 81 | static const GPUFlagsConstant GREEN = 2; 82 | 83 | static const GPUFlagsConstant BLUE = 4; 84 | 85 | static const GPUFlagsConstant ALPHA = 8; 86 | 87 | static const GPUFlagsConstant ALL = 15; 88 | } 89 | -------------------------------------------------------------------------------- /web/lib/src/dom/webrtc_identity.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | extension type RTCIdentityProviderOptions._(JSObject _) implements JSObject { 19 | external factory RTCIdentityProviderOptions({ 20 | String protocol, 21 | String usernameHint, 22 | String peerIdentity, 23 | }); 24 | 25 | external String get protocol; 26 | external set protocol(String value); 27 | external String get usernameHint; 28 | external set usernameHint(String value); 29 | external String get peerIdentity; 30 | external set peerIdentity(String value); 31 | } 32 | -------------------------------------------------------------------------------- /web/lib/src/dom/webrtc_priority.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | typedef RTCPriorityType = String; 19 | -------------------------------------------------------------------------------- /web/lib/src/dom/webxr_hand_input.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | // 5 | // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). 6 | // Attributions and copyright licensing by Mozilla Contributors is licensed 7 | // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. 8 | 9 | // Generated from Web IDL definitions. 10 | 11 | // ignore_for_file: unintended_html_in_doc_comment 12 | 13 | @JS() 14 | library; 15 | 16 | import 'dart:js_interop'; 17 | 18 | import 'webxr.dart'; 19 | 20 | typedef XRHandJoint = String; 21 | 22 | /// The **`XRHand`** interface is pair iterator (an ordered map) with the key 23 | /// being the hand joints and the value being an [XRJointSpace]. 24 | /// 25 | /// `XRHand` is returned by [XRInputSource.hand]. 26 | /// 27 | /// --- 28 | /// 29 | /// API documentation sourced from 30 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XRHand). 31 | extension type XRHand._(JSObject _) implements JSObject {} 32 | 33 | /// The **`XRJointSpace`** interface is an [XRSpace] and represents the position 34 | /// and orientation of an [XRHand] joint. 35 | /// 36 | /// --- 37 | /// 38 | /// API documentation sourced from 39 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XRJointSpace). 40 | extension type XRJointSpace._(JSObject _) implements XRSpace, JSObject { 41 | /// The read-only **`jointName`** property of the [XRJointSpace] interface 42 | /// contains the name of the joint it tracks. 43 | external XRHandJoint get jointName; 44 | } 45 | 46 | /// The **`XRJointPose`** interface is an [XRPose] with additional information 47 | /// about the size of the skeleton joint it represents. 48 | /// 49 | /// --- 50 | /// 51 | /// API documentation sourced from 52 | /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/XRJointPose). 53 | extension type XRJointPose._(JSObject _) implements XRPose, JSObject { 54 | /// The read-only **`radius`** property of the [XRJointPose] interface 55 | /// indicates the radius (distance from skin) for a joint. 56 | external double get radius; 57 | } 58 | -------------------------------------------------------------------------------- /web/lib/src/helpers.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | /// Main entry library for `package:web` helper layer. 6 | /// 7 | /// The helper layer is a collection of libraries with extensions and methods 8 | /// that bring functionality to `package:web` that many Dart developers are used 9 | /// to have from `dart:html`. 10 | /// 11 | /// This helper layer serves two purposes: 12 | /// 13 | /// * provide useful functionality in environments where `dart:html` is not 14 | /// available (like on Wasm). 15 | /// * help bridge the gap in functionality from the past, which may reduce 16 | /// the burden of migrating from code that previously used `dart:html`. 17 | /// 18 | /// The main reason this functionality is provided on the side, is that some of 19 | /// the functionality is expensive, and not always the right match for every 20 | /// developer. Unlike `dart:html`, each developer needs to make a choice for 21 | /// whether to consume some of the APIs provided here. 22 | library; 23 | 24 | export 'helpers/cross_origin.dart' show CrossOriginLocation, CrossOriginWindow; 25 | export 'helpers/enums.dart'; 26 | export 'helpers/events/events.dart'; 27 | export 'helpers/events/providers.dart'; 28 | export 'helpers/events/streams.dart' show ElementStream, EventStreamProvider; 29 | export 'helpers/extensions.dart'; 30 | export 'helpers/lists.dart'; 31 | -------------------------------------------------------------------------------- /web/lib/src/helpers/lists.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:collection'; 6 | import 'dart:js_interop'; 7 | 8 | /// `_JSList` acts as a wrapper around a JS list object providing an interface to 9 | /// access the list items and list length while also allowing us to specify the 10 | /// list item type from outside. 11 | extension type _JSList(JSObject _) implements JSObject { 12 | /// The **`item()`** method returns the [JSObject] 13 | /// at the specified index in the list. 14 | external T item(int index); 15 | 16 | /// The **`length`** read-only property indicates the number of 17 | /// items in a given list. 18 | external int get length; 19 | } 20 | 21 | /// A wrapper to present a JS immutable list of type `T` and list item type `U` as 22 | /// a `List`. 23 | class JSImmutableListWrapper 24 | with ListMixin { 25 | final _JSList _jsList; 26 | 27 | JSImmutableListWrapper(T original) : _jsList = _JSList(original); 28 | 29 | @override 30 | int get length => _jsList.length; 31 | 32 | @override 33 | U operator [](int index) { 34 | if (index > length) { 35 | throw IndexError.withLength(index, length, indexable: this); 36 | } 37 | return _jsList.item(index); 38 | } 39 | 40 | @override 41 | void operator []=(int index, U value) { 42 | throw UnsupportedError('Cannot assign element of immutable List.'); 43 | } 44 | 45 | @override 46 | set length(int value) { 47 | throw UnsupportedError('Cannot resize immutable List.'); 48 | } 49 | 50 | @override 51 | U get first { 52 | if (length > 0) return _jsList.item(0); 53 | throw StateError('No elements'); 54 | } 55 | 56 | @override 57 | U get last { 58 | final len = length; 59 | if (len > 0) return _jsList.item(len - 1); 60 | throw StateError('No elements'); 61 | } 62 | 63 | @override 64 | U get single { 65 | if (length > 1) throw StateError('More than one element'); 66 | return first; 67 | } 68 | 69 | @override 70 | U elementAt(int index) => this[index]; 71 | } 72 | -------------------------------------------------------------------------------- /web/lib/web.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | export 'src/dom.dart'; 6 | export 'src/helpers.dart'; 7 | -------------------------------------------------------------------------------- /web/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - dev 3 | - pubspec 4 | 5 | stages: 6 | - analyze_and_format: 7 | - analyze: --fatal-infos . 8 | - format: 9 | - unit_test: 10 | - test: --test-randomize-ordering-seed=random -p chrome 11 | - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm 12 | - dart_fixes: 13 | - command: dart fix --compare-to-golden test_fixes 14 | sdk: main 15 | -------------------------------------------------------------------------------- /web/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: web 2 | version: 2.0.0-wip 3 | description: Lightweight browser API bindings built around JS interop. 4 | repository: https://github.com/dart-lang/web 5 | 6 | environment: 7 | sdk: ^3.4.0 8 | 9 | dev_dependencies: 10 | dart_flutter_team_lints: ^3.0.0 11 | path: ^1.8.3 12 | test: ^1.24.4 13 | -------------------------------------------------------------------------------- /web/test/dart_fix_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('vm') 6 | library; 7 | 8 | import 'dart:io'; 9 | 10 | import 'package:path/path.dart' as p; 11 | import 'package:test/test.dart'; 12 | 13 | // Used for debugging the test. 14 | const keepTempDir = false; 15 | 16 | void main() { 17 | test("'dart fix' integration", () { 18 | // create temp dir 19 | final tempDir = Directory.systemTemp.createTempSync('test'); 20 | 21 | var sdkVersion = Platform.version; 22 | if (sdkVersion.contains(' ')) { 23 | sdkVersion = sdkVersion.substring(0, sdkVersion.indexOf(' ')); 24 | } 25 | 26 | try { 27 | // set up project 28 | // Convert the current path to a POSIX path to avoid 'path_not_posix' lint. 29 | writeFile(tempDir, 'pubspec.yaml', ''' 30 | name: test_project 31 | environment: 32 | sdk: '^$sdkVersion' 33 | dependencies: 34 | web: 35 | path: ${p.current.replaceAll(r'\', '/')} 36 | '''); 37 | final sourceFile = File(p.join('test_fixes', 'renames.dart')); 38 | writeFile( 39 | tempDir, 40 | p.join('lib', sourceFile.name), 41 | sourceFile.readAsStringSync(), 42 | ); 43 | 44 | // run pub get 45 | pubGet(tempDir); 46 | 47 | // dart fix 48 | dartFix(tempDir); 49 | 50 | // verify no analysis issues 51 | dartAnalyze(tempDir); 52 | } finally { 53 | // ignore: dead_code 54 | if (keepTempDir) { 55 | print('dart fix test temp dir: ${tempDir.path}'); 56 | } else { 57 | tempDir.deleteSync(recursive: true); 58 | } 59 | } 60 | }); 61 | } 62 | 63 | void writeFile(Directory dir, String filePath, String contents) { 64 | final file = File(p.join(dir.path, filePath)); 65 | file.parent.createSync(); 66 | file.writeAsStringSync(contents); 67 | } 68 | 69 | void pubGet(Directory dir) { 70 | exec('pub', ['get'], cwd: dir); 71 | } 72 | 73 | void dartFix(Directory dir) { 74 | exec('fix', ['--apply'], cwd: dir); 75 | } 76 | 77 | void dartAnalyze(Directory dir) { 78 | exec('analyze', [], cwd: dir); 79 | } 80 | 81 | void exec(String command, List args, {required Directory cwd}) { 82 | printOnFailure('dart $command ${args.join(', ')}'); 83 | 84 | final result = Process.runSync( 85 | Platform.resolvedExecutable, 86 | [command, ...args], 87 | workingDirectory: cwd.path, 88 | ); 89 | 90 | var out = result.stdout as String; 91 | if (out.isNotEmpty) printOnFailure(out); 92 | out = result.stderr as String; 93 | if (out.isNotEmpty) printOnFailure(out); 94 | 95 | if (result.exitCode != 0) { 96 | fail('dart $command: exitCode ${result.exitCode}'); 97 | } 98 | } 99 | 100 | extension on File { 101 | String get name => p.basename(path); 102 | } 103 | -------------------------------------------------------------------------------- /web/test/element_constructor_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('browser') 6 | library; 7 | 8 | import 'package:test/test.dart'; 9 | import 'package:web/web.dart'; 10 | 11 | void main() { 12 | test('Element constructors create the expected element', () { 13 | const html = 'http://www.w3.org/1999/xhtml'; 14 | const svg = 'http://www.w3.org/2000/svg'; 15 | const mathML = 'http://www.w3.org/1998/Math/MathML'; 16 | final area = HTMLAreaElement(); 17 | expect(area.tagName, 'AREA'); 18 | expect(area.namespaceURI, html); 19 | final footer = HTMLElement.footer(); 20 | expect(footer.tagName, 'FOOTER'); 21 | expect(footer.namespaceURI, html); 22 | final mpath = SVGMPathElement(); 23 | expect(mpath.tagName, 'mpath'); 24 | expect(mpath.namespaceURI, svg); 25 | final annotation = MathMLElement.annotation(); 26 | expect(annotation.tagName, 'annotation'); 27 | expect(annotation.namespaceURI, mathML); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /web/test/smoke_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('browser') 6 | library; 7 | 8 | import 'dart:js_interop'; 9 | 10 | import 'package:test/test.dart'; 11 | import 'package:web/web.dart'; 12 | 13 | void main() { 14 | test('Basic method', () { 15 | final div = document.createElement('div') as HTMLDivElement; 16 | div.innerText = 'Hello World!'; 17 | div.id = 'foo'; 18 | document.body!.appendChild(div); 19 | final found = document.getElementById('foo') as HTMLDivElement; 20 | expect(found.innerText, equals('Hello World!')); 21 | document.body!.removeChild(div); 22 | expect(document.getElementById('foo'), equals(null)); 23 | }); 24 | 25 | test('Objects inherit from JSObject', () { 26 | final div = document.createElement('div') as HTMLDivElement; 27 | div.innerText = 'Hello World!'; 28 | div.id = 'foo'; 29 | document.body!.append(div as JSObject); 30 | final found = document.getElementById('foo') as HTMLDivElement; 31 | expect(found.innerText, equals('Hello World!')); 32 | document.body!.removeChild(div); 33 | }); 34 | 35 | test('CSS properties work as expected.', () { 36 | final div = document.createElement('div') as HTMLDivElement; 37 | 38 | // Single word property 39 | div.style.color = 'blue'; 40 | expect(div.style.color, equals('blue')); 41 | expect(div.style.getPropertyValue('color'), equals('blue')); 42 | div.style.setProperty('color', 'green'); 43 | expect(div.style.color, equals('green')); 44 | expect(div.style.getPropertyValue('color'), equals('green')); 45 | 46 | // Multi word property 47 | div.style.textOverflow = 'clip'; 48 | expect(div.style.textOverflow, equals('clip')); 49 | expect(div.style.getPropertyValue('text-overflow'), equals('clip')); 50 | div.style.setProperty('text-overflow', 'ellipsis'); 51 | expect(div.style.textOverflow, equals('ellipsis')); 52 | expect(div.style.getPropertyValue('text-overflow'), equals('ellipsis')); 53 | }); 54 | 55 | test('External [] and []= operators work as expected.', () { 56 | // [] 57 | expect(window['document'], window.document); 58 | expect(window.document['body'], window.document.body); 59 | // []= 60 | final select = HTMLSelectElement(); 61 | final option = HTMLOptionElement(); 62 | select[0] = option; 63 | expect(select.item(0), option); 64 | }); 65 | 66 | test('Constant values can be switched over.', () { 67 | final request = XMLHttpRequest(); 68 | switch (request.readyState) { 69 | case XMLHttpRequest.UNSENT: 70 | break; 71 | case XMLHttpRequest.OPENED: 72 | case XMLHttpRequest.HEADERS_RECEIVED: 73 | case XMLHttpRequest.LOADING: 74 | case XMLHttpRequest.DONE: 75 | default: 76 | throw Exception('Expected `readyState`: ${XMLHttpRequest.UNSENT}, but ' 77 | 'got: ${request.readyState}.'); 78 | } 79 | }); 80 | } 81 | -------------------------------------------------------------------------------- /web/test_fixes/README.md: -------------------------------------------------------------------------------- 1 | ## What's here? 2 | 3 | For information about the files in this directory, see 4 | https://github.com/flutter/flutter/wiki/Data-driven-Fixes#testing. 5 | 6 | ## Organization 7 | 8 | The contents of this directory are used to test the `dart fix` refactorings 9 | offered by this package. See `lib/dart_fix.yaml` for the fix definitions. 10 | 11 | Note that files in this directory are excluded from analysis. 12 | 13 | ## Running the dart fix tests 14 | 15 | In order to test the fixes manually: 16 | 17 | ```bash 18 | > cd test_fixes 19 | > dart fix --compare-to-golden 20 | ``` 21 | 22 | ## Symbols excluded from the renames 23 | 24 | Since `lib/src/helpers/http.dart` defines an `HttpRequest` class, 25 | we don't offer a quick fix to rename from `HttpRequest` to `XMLHttpRequest`. 26 | -------------------------------------------------------------------------------- /web/test_fixes/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # https://dart.dev/guides/language/analysis-options 2 | include: package:dart_flutter_team_lints/analysis_options.yaml 3 | -------------------------------------------------------------------------------- /web_generator/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0-wip 2 | 3 | - Initial separation of `web_generator` from `web`. 4 | - New IDL interface `RHL` added. `ExtendedAttribute` idl interface updated to 5 | expose its `rhs` property and `Interfacelike` idl interface updated to expose 6 | `extAttrs` property. The generator now adds a 7 | `JS(LegacyNamespace.$extensionTypeName)` annotation on `JS` objects if 8 | they've an IDL extended attribute `[LegacyNamespace=Foo]` defined in their IDL 9 | description. 10 | - Added `--generate-all` option to generate all bindings, including experimental 11 | and non-standard APIs. 12 | - Adapt paths for different development environments. -------------------------------------------------------------------------------- /web_generator/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024, the Dart project authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of Google LLC nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /web_generator/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # https://dart.dev/guides/language/analysis-options 2 | include: package:dart_flutter_team_lints/analysis_options.yaml 3 | 4 | analyzer: 5 | language: 6 | strict-casts: true 7 | strict-inference: true 8 | strict-raw-types: true 9 | 10 | linter: 11 | rules: 12 | - avoid_bool_literals_in_conditional_expressions 13 | - avoid_private_typedef_functions 14 | - avoid_redundant_argument_values 15 | - avoid_returning_this 16 | - avoid_unused_constructor_parameters 17 | - cancel_subscriptions 18 | - join_return_with_assignment 19 | - literal_only_boolean_expressions 20 | - no_adjacent_strings_in_list 21 | - no_runtimeType_toString 22 | - prefer_const_declarations 23 | - prefer_final_locals 24 | - unnecessary_await_in_return 25 | - use_string_buffers 26 | -------------------------------------------------------------------------------- /web_generator/bin/gen_interop_bindings.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:io'; 6 | 7 | import 'package:args/args.dart'; 8 | import 'package:io/ansi.dart' as ansi; 9 | import 'package:io/io.dart'; 10 | import 'package:path/path.dart' as p; 11 | import 'package:web_generator/src/cli.dart'; 12 | 13 | void main(List arguments) async { 14 | final ArgResults argResult; 15 | 16 | try { 17 | argResult = _parser.parse(arguments); 18 | } on FormatException catch (e) { 19 | print(''' 20 | ${ansi.lightRed.wrap(e.message)} 21 | 22 | $_usage'''); 23 | exitCode = ExitCode.usage.code; 24 | return; 25 | } 26 | 27 | if (argResult['help'] as bool) { 28 | print(_usage); 29 | return; 30 | } 31 | 32 | if (argResult.rest.isEmpty) { 33 | print(''' 34 | ${ansi.lightRed.wrap('At least one argument is needed')} 35 | 36 | $_usage'''); 37 | exitCode = ExitCode.usage.code; 38 | return; 39 | } 40 | 41 | assert(p.fromUri(Platform.script).endsWith(_thisScript.toFilePath())); 42 | 43 | // Run `npm install` or `npm update` as needed. 44 | final update = argResult['update'] as bool; 45 | await runProc( 46 | 'npm', 47 | [update ? 'update' : 'install'], 48 | workingDirectory: bindingsGeneratorPath, 49 | ); 50 | 51 | final contextFile = await createJsTypeSupertypeContext(); 52 | 53 | // Compute JS type supertypes for union calculation in translator. 54 | await generateJsTypeSupertypes(contextFile.path); 55 | 56 | if (argResult['compile'] as bool) { 57 | // Compile Dart to Javascript. 58 | await compileDartMain(); 59 | } 60 | 61 | final inputFile = argResult.rest.first; 62 | final outputFile = argResult['output'] as String? ?? 63 | p.join(p.current, inputFile.replaceAll('.d.ts', '.dart')); 64 | final configFile = 65 | argResult['config'] as String? ?? p.join(p.current, 'webgen.yaml'); 66 | final relativeOutputPath = 67 | p.relative(outputFile, from: bindingsGeneratorPath); 68 | // Run app with `node`. 69 | await runProc( 70 | 'node', 71 | [ 72 | 'main.mjs', 73 | '--declaration', 74 | '--input=${p.relative(inputFile, from: bindingsGeneratorPath)}', 75 | '--output=$relativeOutputPath', 76 | '--config=$configFile' 77 | ], 78 | workingDirectory: bindingsGeneratorPath, 79 | ); 80 | 81 | await contextFile.delete(); 82 | return; 83 | } 84 | 85 | final _thisScript = Uri.parse('bin/gen_interop_bindings.dart'); 86 | 87 | final _usage = ''' 88 | ${ansi.styleBold.wrap('Dart Interop Gen')}: 89 | $_thisScript dts <.d.ts file> [options] 90 | 91 | Usage: 92 | ${_parser.usage}'''; 93 | 94 | final _parser = ArgParser() 95 | ..addFlag('help', negatable: false, help: 'Show help information') 96 | ..addFlag('update', abbr: 'u', help: 'Update npm dependencies') 97 | ..addFlag('compile', defaultsTo: true) 98 | ..addOption('output', 99 | abbr: 'o', help: 'The output path to generate the Dart interface code') 100 | ..addOption('config', 101 | hide: true, 102 | abbr: 'c', 103 | help: 'The configuration file to use for this tool (NOTE: Unimplemented)') 104 | ..addFlag('help', negatable: false); 105 | -------------------------------------------------------------------------------- /web_generator/lib/src/banned_names.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | const bannedNames = { 6 | 'assert', 7 | 'break', 8 | 'catch', 9 | 'continue', 10 | 'default', 11 | 'extends', 12 | 'finally', 13 | 'in', 14 | 'is', 15 | 'var', 16 | }; 17 | 18 | /// Given a [jsName], returns the allowed Dart equivalent accounting for invalid 19 | /// characters and reserved keywords. 20 | String dartRename(String jsName, [bool toSingleForm = false]) { 21 | var dartName = jsName.replaceAll('-', '_'); 22 | if (toSingleForm && dartName.length > 2 && dartName.endsWith('s')) { 23 | dartName = dartName.substring(0, dartName.length - 1); 24 | } 25 | if (bannedNames.contains(dartName)) { 26 | dartName = '${dartName}_'; 27 | } 28 | return dartName; 29 | } 30 | -------------------------------------------------------------------------------- /web_generator/lib/src/doc_provider.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:convert'; 6 | import 'dart:js_interop'; 7 | 8 | import 'package:path/path.dart' as p; 9 | 10 | import 'formatting.dart'; 11 | import 'js/filesystem_api.dart'; 12 | 13 | class DocProvider { 14 | static DocProvider create() { 15 | final content = fs.readFileSync( 16 | p.join('..', '..', '..', 'third_party', 'mdn', 'mdn.json').toJS, 17 | JSReadFileOptions(encoding: 'utf8'.toJS), 18 | ) as JSString; 19 | 20 | return DocProvider(jsonDecode(content.toDart) as Map); 21 | } 22 | 23 | final List interfaces = []; 24 | 25 | DocProvider(Map data) { 26 | for (var key in data.keys) { 27 | if (key.startsWith('__')) continue; 28 | 29 | interfaces.add(MdnInterface(key, data[key] as Map)); 30 | } 31 | } 32 | 33 | MdnInterface? interfaceFor(String name) => 34 | interfaces.where((p) => p.name == name).firstOrNull; 35 | } 36 | 37 | class MdnInterface { 38 | final String name; 39 | late final String docs; 40 | final List properties = []; 41 | 42 | MdnInterface(this.name, Map data) { 43 | docs = data['docs'] as String; 44 | 45 | final propertiesData = data['properties'] as Map?; 46 | if (propertiesData != null) { 47 | for (var key in propertiesData.keys) { 48 | properties.add(MdnProperty(key, propertiesData[key] as String)); 49 | } 50 | } 51 | } 52 | 53 | List get formattedDocs { 54 | final result = formatDocs(docs, 80); 55 | 56 | if (result.isEmpty) { 57 | return result; 58 | } else { 59 | return [ 60 | ...result, 61 | '///', 62 | '/// ---', 63 | '///', 64 | '/// API documentation sourced from', 65 | '/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/$name).', 66 | ]; 67 | } 68 | } 69 | 70 | MdnProperty? propertyFor(String name, {required bool isStatic}) { 71 | name = name.toLowerCase(); 72 | if (isStatic) name = '${name}_static'; 73 | return properties.where((p) => p.name == name).firstOrNull; 74 | } 75 | } 76 | 77 | class MdnProperty { 78 | final String name; 79 | final String docs; 80 | 81 | MdnProperty(this.name, this.docs); 82 | 83 | List get formattedDocs => formatDocs(docs, 78); 84 | } 85 | -------------------------------------------------------------------------------- /web_generator/lib/src/dts/config.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | final class Config {} 6 | -------------------------------------------------------------------------------- /web_generator/lib/src/dts/parser.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | // TODO(nikeokoronkwo): Implement this function 6 | dynamic parseDeclarationFiles(Iterable files) {} 7 | -------------------------------------------------------------------------------- /web_generator/lib/src/dts/transform.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | class DeclarationMap { 6 | String generate() { 7 | throw UnimplementedError(); 8 | } 9 | } 10 | 11 | DeclarationMap transformDeclarations(Object? jsDeclarations) { 12 | throw UnimplementedError(); 13 | } 14 | -------------------------------------------------------------------------------- /web_generator/lib/src/formatting.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | /// Given markdown formatted text [data] and a line [width], return a 6 | /// line-wrapped dartdoc comment accounting for any [leadingWhitespace] the 7 | /// comment should have. 8 | List formatDocs(String data, int width, [int leadingWhitespace = 0]) { 9 | // TODO(devoncarew): Look at combining soft line breaks in the markdown in 10 | // order to better reflow the returned dartdoc comments (i.e., only have line 11 | // breaks for markdown paragraphs). 12 | 13 | final lines = data.split('\n'); 14 | final output = []; 15 | 16 | width -= leadingWhitespace; 17 | width -= '/// '.length; 18 | 19 | var inCodeFence = false; 20 | 21 | for (var line in lines) { 22 | if (inCodeFence) { 23 | output.add(line); 24 | if (line.startsWith('```')) { 25 | inCodeFence = false; 26 | } 27 | } else { 28 | final ltrim = line.trimLeft(); 29 | 30 | if (line.startsWith('> ')) { 31 | final wrapped = _wrap(line.substring(2), width - 2); 32 | output.addAll(wrapped.map((l) => '> $l')); 33 | } else if (line.startsWith('- ')) { 34 | final wrapped = _wrap(line.substring(2), width - 2); 35 | output.add('- ${wrapped.first}'); 36 | output.addAll(wrapped.skip(1).map((l) => ' $l')); 37 | } else if (ltrim.startsWith('- ') || ltrim.startsWith('<')) { 38 | output.add(line); 39 | } else if (ltrim.startsWith('| ')) { 40 | // Don't wrap lines in a markdown table. 41 | output.add(line); 42 | } else { 43 | output.addAll(_wrap(line, width)); 44 | 45 | if (line.startsWith('```')) { 46 | inCodeFence = true; 47 | } 48 | } 49 | } 50 | } 51 | 52 | return output.map((line) => line.isEmpty ? '///' : '/// $line').toList(); 53 | } 54 | 55 | /// Identify `[foo](bar)` and `[foo]` patterns. 56 | final RegExp _linksRegEx = RegExp(r'\[([\w `-]+?)\](\(\S+\))?'); 57 | 58 | /// Wrap the given [line] to [width], breaking at whitespace. 59 | Iterable _wrap(String line, int width) sync* { 60 | if (line.isEmpty) { 61 | yield line; 62 | return; 63 | } 64 | 65 | const markerChar = '\u009e'; 66 | 67 | // handle [foo bar](link) 68 | line = line.replaceAllMapped(_linksRegEx, (match) { 69 | const urlBase = 'https://developer.mozilla.org/'; 70 | 71 | var text = match.group(1)!; 72 | text = text.replaceAll(' ', markerChar); 73 | 74 | final link = match.group(2); 75 | 76 | if (link == null) { 77 | return '[$text]'; 78 | } else { 79 | if (link.startsWith('(/')) { 80 | return '[$text]($urlBase${link.substring(2)}'; 81 | } else { 82 | return '[$text]$link'; 83 | } 84 | } 85 | }); 86 | 87 | final words = line.split(' '); 88 | final buf = StringBuffer(); 89 | 90 | for (var word in words) { 91 | if (buf.isEmpty) { 92 | buf.write(word); 93 | } else { 94 | if (buf.length + 1 + word.length > width) { 95 | yield buf.toString().replaceAll(markerChar, ' '); 96 | buf.clear(); 97 | buf.write(word); 98 | } else { 99 | buf.write(' $word'); 100 | } 101 | } 102 | } 103 | 104 | if (buf.isNotEmpty) { 105 | yield buf.toString().replaceAll(markerChar, ' '); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /web_generator/lib/src/js/filesystem_api.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | // TODO(srujzs): Remove this workaround once we use an SDK version that contains 6 | // https://github.com/dart-lang/sdk/issues/54801. 7 | @JS() 8 | library; 9 | 10 | import 'dart:js_interop'; 11 | 12 | @JS() 13 | external FileSystem get fs; 14 | 15 | extension type JSMkdirOptions._(JSObject _) implements JSObject { 16 | external factory JSMkdirOptions({JSBoolean? recursive}); 17 | } 18 | 19 | extension type JSReadFileOptions._(JSObject _) implements JSObject { 20 | external factory JSReadFileOptions({JSString? encoding}); 21 | } 22 | 23 | extension type FileSystem._(JSObject _) implements JSObject { 24 | external JSBoolean existsSync(JSString path); 25 | 26 | @JS('mkdirSync') 27 | external void mkdirSyncOneArg(JSString path); 28 | 29 | @JS('mkdirSync') 30 | external void mkdirSyncTwoArg(JSString path, JSMkdirOptions options); 31 | 32 | void mkdirSync(JSString path, [JSMkdirOptions? options]) { 33 | if (options == null) { 34 | return mkdirSyncOneArg(path); 35 | } else { 36 | return mkdirSyncTwoArg(path, options); 37 | } 38 | } 39 | 40 | external JSAny readFileSync(JSString path, [JSReadFileOptions options]); 41 | 42 | external void writeFileSync(JSString path, JSString contents); 43 | } 44 | -------------------------------------------------------------------------------- /web_generator/lib/src/js/webref_css_api.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:js_interop'; 6 | 7 | @JS() 8 | external WebRefCSS get css; 9 | 10 | extension type WebRefCSS._(JSObject _) implements JSObject { 11 | external JSPromise listAll(); 12 | } 13 | 14 | extension type CSSEntries._(JSObject _) implements JSObject { 15 | external JSArray? get properties; 16 | } 17 | 18 | extension type CSSEntry._(JSObject _) implements JSObject { 19 | external JSArray? get styleDeclaration; 20 | } 21 | -------------------------------------------------------------------------------- /web_generator/lib/src/js/webref_elements_api.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:js_interop'; 6 | 7 | // Namespace URIs that are needed to construct non-HTML elements. 8 | // https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS#important_namespace_uris 9 | const _svgNamespaceURI = 'http://www.w3.org/2000/svg'; 10 | const _mathMLNamespaceURI = 'http://www.w3.org/1998/Math/MathML'; 11 | 12 | /// Gets the URI needed to create an element of type [elementInterface]. 13 | String? uriForElement(String elementInterface) { 14 | if (elementInterface.startsWith('SVG')) return _svgNamespaceURI; 15 | if (elementInterface.startsWith('MathML')) return _mathMLNamespaceURI; 16 | // URI is not needed for HTML elements as they can just use `createElement`. 17 | assert(elementInterface.startsWith('HTML')); 18 | return null; 19 | } 20 | 21 | // TODO(srujzs): Generalize this. It's a bit difficult as it requires knowing 22 | // what sound a word begins with rather than just if it starts with a vowel or 23 | // not. 24 | /// Determines whether [elementInterface] should use the article 'a' or 'an'. 25 | String singularArticleForElement(String elementInterface) { 26 | if (elementInterface.startsWith('HTML') || 27 | elementInterface.startsWith('SVG')) { 28 | return 'an'; 29 | } 30 | assert(elementInterface.startsWith('MathML')); 31 | return 'a'; 32 | } 33 | 34 | @JS() 35 | external WebRefElements get elements; 36 | 37 | extension type WebRefElements._(JSObject _) implements JSObject { 38 | external JSPromise listAll(); 39 | } 40 | 41 | extension type ElementsEntries._(JSObject _) implements JSObject { 42 | external JSArray? elements; 43 | } 44 | 45 | extension type ElementEntry._(JSObject _) implements JSObject { 46 | external String? get name; 47 | external String? get interface; 48 | } 49 | -------------------------------------------------------------------------------- /web_generator/lib/src/js/webref_idl_api.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:js_interop'; 6 | 7 | @JS() 8 | external WebRefIDL get idl; 9 | 10 | extension type WebRefIDL._(JSObject _) implements JSObject { 11 | external JSPromise parseAll(); 12 | } 13 | -------------------------------------------------------------------------------- /web_generator/lib/src/js_type_supertypes.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | // Do not modify by hand. 6 | 7 | const Map jsTypeSupertypes = { 8 | 'JSAny': null, 9 | 'JSArray': 'JSObject', 10 | 'JSArrayBuffer': 'JSObject', 11 | 'JSBigInt': 'JSAny', 12 | 'JSBoolean': 'JSAny', 13 | 'JSBoxedDartObject': 'JSObject', 14 | 'JSDataView': 'JSObject', 15 | 'JSExportedDartFunction': 'JSFunction', 16 | 'JSFloat32Array': 'JSTypedArray', 17 | 'JSFloat64Array': 'JSTypedArray', 18 | 'JSFunction': 'JSObject', 19 | 'JSInt16Array': 'JSTypedArray', 20 | 'JSInt32Array': 'JSTypedArray', 21 | 'JSInt8Array': 'JSTypedArray', 22 | 'JSNumber': 'JSAny', 23 | 'JSObject': 'JSAny', 24 | 'JSPromise': 'JSObject', 25 | 'JSString': 'JSAny', 26 | 'JSSymbol': 'JSAny', 27 | 'JSTypedArray': 'JSObject', 28 | 'JSUint16Array': 'JSTypedArray', 29 | 'JSUint32Array': 'JSTypedArray', 30 | 'JSUint8Array': 'JSTypedArray', 31 | 'JSUint8ClampedArray': 'JSTypedArray', 32 | }; 33 | -------------------------------------------------------------------------------- /web_generator/lib/src/main.mjs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import * as childProcess from 'child_process'; 6 | import * as fs from 'fs'; 7 | import { createRequire } from 'module'; 8 | import * as css from '@webref/css'; 9 | import * as elements from '@webref/elements'; 10 | import * as idl from '@webref/idl'; 11 | import * as ts from 'typescript'; 12 | 13 | const require = createRequire(import.meta.url); 14 | 15 | // Setup properties for JS interop in Dart. 16 | globalThis.self = globalThis; 17 | globalThis.childProcess = childProcess; 18 | globalThis.css = css; 19 | globalThis.elements = elements; 20 | globalThis.fs = fs; 21 | globalThis.idl = idl; 22 | globalThis.ts = ts; 23 | globalThis.location = { href: `file://${process.cwd()}/` } 24 | 25 | globalThis.dartMainRunner = async function (main, args) { 26 | const dartArgs = process.argv.slice(2); 27 | await main(dartArgs); 28 | } 29 | 30 | async function scriptMain() { 31 | // We have to load `dart_main.js` here so that the `dartMainRunner` 32 | // hook is registered before the IIFE in `dart_main.js` runs. 33 | require('./dart_main.js'); 34 | } 35 | 36 | if (require.main === require.module) { 37 | await scriptMain(); 38 | } 39 | -------------------------------------------------------------------------------- /web_generator/lib/src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dart_web_bindings_generator", 3 | "version": "0.0.1", 4 | "description": "", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "keywords": [], 9 | "author": "Dart project authors", 10 | "license": "BSD 3", 11 | "dependencies": { 12 | "@mdn/browser-compat-data": "^5.5.2", 13 | "@webref/css": "^6.11.0", 14 | "@webref/elements": "^2.2.2", 15 | "@webref/idl": "^3.43.1", 16 | "typescript": "^5.8.3" 17 | }, 18 | "devDependencies": { 19 | "webidl2": "^24.2.2" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /web_generator/lib/src/singletons.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | const singletons = { 6 | 'Window': 'window', 7 | 'Document': 'document', 8 | }; 9 | -------------------------------------------------------------------------------- /web_generator/lib/src/type_aliases.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | const idlOrBuiltinToJsTypeAliases = { 6 | 'any': 'JSAny', 7 | 'bigint': 'JSBigInt', 8 | 'record': 'JSObject', 9 | 'object': 'JSObject', 10 | 'Promise': 'JSPromise', 11 | 'boolean': 'JSBoolean', 12 | // Note that this is a special sentinel that doesn't actually exist in the set 13 | // of JS types today (although this might in the future). 14 | 'undefined': 'JSUndefined', 15 | 'Function': 'JSFunction', 16 | 'SharedArrayBuffer': 'JSObject', 17 | 18 | 'ArrayBuffer': 'JSArrayBuffer', 19 | 'DataView': 'JSDataView', 20 | 'Int8Array': 'JSInt8Array', 21 | 'Int16Array': 'JSInt16Array', 22 | 'Int32Array': 'JSInt32Array', 23 | 'Uint8Array': 'JSUint8Array', 24 | 'Uint16Array': 'JSUint16Array', 25 | 'Uint32Array': 'JSUint32Array', 26 | 'Uint8ClampedArray': 'JSUint8ClampedArray', 27 | 'Float32Array': 'JSFloat32Array', 28 | 'Float64Array': 'JSFloat64Array', 29 | // TODO(srujzs): Change these aliases if we add these as JS types. 30 | 'BigInt64Array': 'JSTypedArray', 31 | 'BigUint64Array': 'JSTypedArray', 32 | 'Float16Array': 'JSTypedArray', 33 | 34 | // Array aliases. 35 | 'sequence': 'JSArray', 36 | 'FrozenArray': 'JSArray', 37 | 'ObservableArray': 'JSArray', 38 | 39 | // Number aliases. Like `JSUndefined`, `JSInteger` and `JSDouble` are special 40 | // sentinels so that we can differentiate between `int` and `double` values 41 | // when we emit Dart types. 42 | 'byte': 'JSInteger', 43 | 'octet': 'JSInteger', 44 | 'short': 'JSInteger', 45 | 'long': 'JSInteger', 46 | 'long long': 'JSInteger', 47 | 'unsigned short': 'JSInteger', 48 | 'unsigned long': 'JSInteger', 49 | 'unsigned long long': 'JSInteger', 50 | 'float': 'JSDouble', 51 | 'double': 'JSDouble', 52 | 'unrestricted double': 'JSDouble', 53 | 'unrestricted float': 'JSDouble', 54 | 55 | // String aliases. 56 | 'DOMString': 'JSString', 57 | 'USVString': 'JSString', 58 | 'ByteString': 'JSString', 59 | 'CSSOMString': 'JSString', 60 | }; 61 | 62 | const jsTypeToDartPrimitiveAliases = { 63 | 'JSBoolean': 'bool', 64 | 'JSString': 'String', 65 | 'JSInteger': 'int', 66 | // Since we want users to be able to be pass integer values for where doubles 67 | // are expected, we keep this as `num`. We handle cases where doubles are 68 | // returned from a browser API differently however. See 69 | // `Translator._typeReference` for more details. 70 | 'JSDouble': 'num', 71 | 'JSNumber': 'num', 72 | 'JSUndefined': 'void', 73 | }; 74 | -------------------------------------------------------------------------------- /web_generator/lib/src/type_union.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'js_type_supertypes.dart'; 6 | 7 | /// Returns the JS type least upper bound given two types. 8 | /// 9 | /// If either type is not a JS type, returns `null`. 10 | String? computeJsTypeUnion(String type1, String type2) { 11 | if (!jsTypeSupertypes.containsKey(type1) || 12 | !jsTypeSupertypes.containsKey(type2)) { 13 | return null; 14 | } 15 | // Compute path from root and find the last type that exists in both paths for 16 | // a least upper bound. 17 | List pathFromRoot(String? type) { 18 | final rootPath = []; 19 | while (type != null) { 20 | rootPath.add(type); 21 | type = jsTypeSupertypes[type]; 22 | } 23 | return rootPath.reversed.toList(); 24 | } 25 | 26 | final t1Path = pathFromRoot(type1); 27 | final t2Path = pathFromRoot(type2); 28 | var t1i = 0; 29 | var t2i = 0; 30 | while (t1i < t1Path.length && t2i < t2Path.length) { 31 | if (t1Path[t1i] != t2Path[t2i]) break; 32 | t1i++; 33 | t2i++; 34 | } 35 | return t1Path[t1i - 1]; 36 | } 37 | -------------------------------------------------------------------------------- /web_generator/lib/src/util.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'dart:js_interop'; 6 | 7 | import 'js/filesystem_api.dart'; 8 | 9 | // TODO(joshualitt): Let's find a better place for these. 10 | @JS('Object.entries') 11 | external JSArray objectEntries(JSObject o); 12 | 13 | void ensureDirectoryExists(String dir) { 14 | if (!fs.existsSync(dir.toJS).toDart) { 15 | fs.mkdirSync(dir.toJS, JSMkdirOptions(recursive: true.toJS)); 16 | } 17 | } 18 | 19 | final int year = DateTime.now().year; 20 | 21 | final List licenseHeader = [ 22 | 'Copyright (c) $year, the Dart project authors. Please see the AUTHORS file', 23 | 'for details. All rights reserved. Use of this source code is governed by a', 24 | 'BSD-style license that can be found in the LICENSE file.', 25 | ]; 26 | 27 | final List mozLicenseHeader = [ 28 | 'API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web).', 29 | 'Attributions and copyright licensing by Mozilla Contributors is licensed', 30 | 'under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/.', 31 | ]; 32 | 33 | const String generatedFileDisclaimer = 'Generated from Web IDL definitions.'; 34 | 35 | extension StringExt on String { 36 | String get kebabToSnake => toLowerCase().replaceAll('-', '_'); 37 | 38 | String get snakeToPascal => replaceAllMapped( 39 | _snakeBit, 40 | (match) => match[0]!.toUpperCase(), 41 | ).replaceAll('_', ''); 42 | } 43 | 44 | final _snakeBit = RegExp('_[a-zA-Z]'); 45 | 46 | const packageRoot = 'package:web'; 47 | 48 | String capitalize(String s) => 49 | s.isEmpty ? '' : '${s[0].toUpperCase()}${s.substring(1)}'; 50 | -------------------------------------------------------------------------------- /web_generator/mono_pkg.yaml: -------------------------------------------------------------------------------- 1 | sdk: 2 | - dev 3 | 4 | stages: 5 | - analyze_and_format: 6 | - analyze: --fatal-infos . 7 | - format: 8 | - unit_test: 9 | - test: --test-randomize-ordering-seed=random -p chrome 10 | - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm 11 | - generate_and_analyze: 12 | - command: 13 | - dart pub -C ../web get 14 | - dart bin/update_idl_bindings.dart 15 | - dart analyze --fatal-infos ../web 16 | - generate_all_and_analyze: 17 | - command: 18 | - dart pub -C ../web get 19 | - dart bin/update_idl_bindings.dart --generate-all 20 | - dart analyze --fatal-infos ../web 21 | -------------------------------------------------------------------------------- /web_generator/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: web_generator 2 | publish_to: none # internal only for now 3 | version: 1.0.0-wip 4 | description: Generator scripts for package:web. 5 | repository: https://github.com/dart-lang/web 6 | 7 | environment: 8 | sdk: ^3.6.0 9 | 10 | dependencies: 11 | analyzer: ^7.4.0 12 | args: ^2.4.0 13 | build_runner: ^2.4.6 14 | build_web_compilers: ^4.0.8 15 | code_builder: ^4.10.0 16 | dart_flutter_team_lints: ^3.0.0 17 | dart_style: ^3.0.0 18 | io: ^1.0.4 19 | package_config: ^2.1.1 20 | path: ^1.8.3 21 | pub_semver: ^2.1.5 22 | test: ^1.24.4 23 | -------------------------------------------------------------------------------- /web_generator/test/ts_bindings_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | @TestOn('vm') 6 | @Tags(['node']) 7 | library; 8 | 9 | import 'dart:io'; 10 | 11 | import 'package:path/path.dart' as p; 12 | import 'package:test/test.dart'; 13 | import 'package:web_generator/src/cli.dart'; 14 | 15 | void main() { 16 | final testGenFolder = p.join('test', 'gen'); 17 | final testGenDTSFiles = p.join(testGenFolder, 'input'); 18 | 19 | group('Web Generator TS Bindings Integration Test', () { 20 | final inputDir = Directory(testGenDTSFiles); 21 | 22 | setUp(() async { 23 | // set up npm 24 | await runProc('npm', ['install'], 25 | workingDirectory: bindingsGeneratorPath, detached: true); 26 | 27 | // compile file 28 | await runProc( 29 | Platform.executable, 30 | [ 31 | 'compile', 32 | 'js', 33 | '--enable-asserts', 34 | '--server-mode', 35 | 'dart_main.dart', 36 | '-o', 37 | 'dart_main.js', 38 | ], 39 | workingDirectory: bindingsGeneratorPath, 40 | detached: true); 41 | }); 42 | 43 | for (final inputFile in inputDir.listSync().whereType()) { 44 | final inputFileName = p.basenameWithoutExtension(inputFile.path); 45 | 46 | final outputActualPath = 47 | p.join('test', 'gen', 'expected', '${inputFileName}_actual.dart'); 48 | final outputExpectedPath = 49 | p.join('test', 'gen', 'expected', '${inputFileName}_expected.dart'); 50 | 51 | test(inputFileName, () async { 52 | final inputFilePath = 53 | p.relative(inputFile.path, from: bindingsGeneratorPath); 54 | final outFilePath = 55 | p.relative(outputActualPath, from: bindingsGeneratorPath); 56 | // run the entrypoint 57 | await runProc( 58 | 'node', 59 | [ 60 | 'main.mjs', 61 | '--input=$inputFilePath', 62 | '--output=$outFilePath', 63 | '--declaration' 64 | ], 65 | workingDirectory: bindingsGeneratorPath, 66 | detached: true); 67 | 68 | // read files 69 | final expectedOutput = await File(outputExpectedPath).readAsString(); 70 | final actualOutput = await File(outputActualPath).readAsString(); 71 | 72 | expect(actualOutput, expectedOutput); 73 | }); 74 | } 75 | }); 76 | } 77 | -------------------------------------------------------------------------------- /web_generator/test/type_union_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | import 'package:test/test.dart'; 6 | 7 | import 'package:web_generator/src/type_union.dart'; 8 | 9 | void main() { 10 | test('Non-JS types', () { 11 | expect(computeJsTypeUnion('Window', 'Document'), null); 12 | expect(computeJsTypeUnion('JSAny', 'Document'), null); 13 | expect(computeJsTypeUnion('Window', 'JSAny'), null); 14 | }); 15 | test('Types are equal', () { 16 | expect(computeJsTypeUnion('JSAny', 'JSAny'), 'JSAny'); 17 | expect(computeJsTypeUnion('JSFloat32Array', 'JSFloat32Array'), 18 | 'JSFloat32Array'); 19 | }); 20 | test('One type is a supertype of the other', () { 21 | expect(computeJsTypeUnion('JSAny', 'JSString'), 'JSAny'); 22 | expect(computeJsTypeUnion('JSUint8Array', 'JSObject'), 'JSObject'); 23 | }); 24 | test('Direct sibling types', () { 25 | expect(computeJsTypeUnion('JSNumber', 'JSString'), 'JSAny'); 26 | expect( 27 | computeJsTypeUnion('JSFloat32Array', 'JSUint8Array'), 'JSTypedArray'); 28 | }); 29 | test('Indirect sibling types', () { 30 | expect(computeJsTypeUnion('JSInt8Array', 'JSArrayBuffer'), 'JSObject'); 31 | expect(computeJsTypeUnion('JSBoolean', 'JSFunction'), 'JSAny'); 32 | expect(computeJsTypeUnion('JSExportedDartFunction', 'JSUint32Array'), 33 | 'JSObject'); 34 | }); 35 | } 36 | --------------------------------------------------------------------------------