This is (or should be) a full JavaScript interop package using package:js bindings.
The bindings are generated by machine-reading WebIDL files for types and MDN website for documentation.

Take a look at MediaStream file and check out how nice it is with the awesome MDN documentation.

Usage

import 'package:js_bindings/js_bindings.dart';

void main() {
  var div = document.createElement('div')
    ..innerHTML = 'Hello world =]';
  
  document.body!.appendChild(div);
}

Promise and Future

JS Promises and Dart Futures are not the same thing.
This package addes an easy way to use promises:

import 'package:js_bindings/js_bindings.dart';

Future<void> main() async {
  await window.navigator.mediaDevices.getUserMedia().future;
  // or
  window.navigator.mediaDevices.getUserMedia().then((event) {});
}

What to import

There is a folder called bindings and there is one dart file for each IDL spec.
For example orientation_event:

import 'package:js_bindings/bindings/orientation_event.dart';

Future<void> main() async {
  final permission = await DeviceOrientationEvent.requestPermission().future;

  print('Granted? ${permission == PermissionState.granted}');
}

For a better JS interop

If you wish for a better JS interop in Dart, please, thumbs up the following issues:

Better JS interop in general
Make awaiting a Promise as easy as a Future
Be able to use rename instance members

Donation

I like Dart, so it is not a problem maintaing this package whenever I am able.

Donate

Libraries

a_n_g_l_e_instanced_arrays
WebGL ANGLE_instanced_arrays Khronos Ratified Extension Specification [...]
accelerometer
Accelerometer [...]
ambient_light
Ambient Light Sensor [...]
anchors
WebXR Anchors Module [...]
audio_output
Audio Output Devices API [...]
background_fetch
Background Fetch [...]
background_sync
Web Background Synchronization [...]
badging
Badging API [...]
battery_status
Battery Status API [...]
beacon
Beacon [...]
callbacks
clipboard_apis
Clipboard API and events [...]
compat
Compatibility Standard [...]
compression
Compression Streams [...]
console
Console Standard [...]
construct_stylesheets
Constructable Stylesheet Objects [...]
contact_api
Contact Picker API [...]
content_index
Content Index [...]
Cookie Store API [...]
crash_reporting
Crash Reporting [...]
credential_management_1
Credential Management Level 1 [...]
csp3
Content Security Policy Level 3 [...]
csp_embedded_enforcement
Content Security Policy: Embedded Enforcement [...]
css_animation_worklet_1
CSS Animation Worklet API [...]
css_animations_1
CSS Animations Level 1 [...]
css_animations_2
CSS Animations Level 2 [...]
css_conditional_3
CSS Conditional Rules Module Level 3 [...]
css_counter_styles_3
CSS Counter Styles Level 3 [...]
css_device_adapt_1
CSS Device Adaptation Module Level 1 [...]
css_font_loading_3
CSS Font Loading Module Level 3 [...]
css_fonts_4
CSS Fonts Module Level 4 [...]
css_highlight_api_1
CSS Custom Highlight API Module Level 1 [...]
css_images_4
CSS Images Module Level 4 [...]
css_layout_api_1
CSS Layout API Level 1 [...]
css_masking_1
CSS Masking Module Level 1 [...]
css_nav_1
CSS Spatial Navigation Level 1 [...]
css_nesting_1
CSS Nesting Module [...]
css_paint_api_1
CSS Painting API Level 1 [...]
css_parser_api
CSS Parser API [...]
css_properties_values_api_1
CSS Properties and Values API Level 1 [...]
css_pseudo_4
CSS Pseudo-Elements Module Level 4 [...]
css_regions_1
CSS Regions Module Level 1 [...]
css_shadow_parts_1
CSS Shadow Parts [...]
css_transitions_1
CSS Transitions [...]
css_transitions_2
CSS Transitions Level 2 [...]
css_typed_om_1
CSS Typed OM Level 1 [...]
cssom_1
CSS Object Model (CSSOM) [...]
cssom_view_1
CSSOM View Module [...]
custom_state_pseudo_class
Custom State Pseudo Class [...]
d_o_m_parsing
DOM Parsing and Serialization [...]
datacue
DataCue API [...]
deprecation_reporting
Deprecation Reporting [...]
depth_sensing
WebXR Depth Sensing Module [...]
device_memory_1
Device Memory 1 [...]
device_posture
Device Posture API [...]
dom
DOM Standard [...]
dom_overlays
WebXR DOM Overlays Module [...]
e_x_t_blend_minmax
WebGL EXT_blend_minmax Khronos Ratified Extension Specification [...]
e_x_t_clip_cull_distance
WebGL EXT_clip_cull_distance Extension Draft Specification [...]
e_x_t_color_buffer_float
WebGL EXT_color_buffer_float Extension Specification [...]
e_x_t_color_buffer_half_float
WebGL EXT_color_buffer_half_float Extension Specification [...]
e_x_t_disjoint_timer_query
WebGL EXT_disjoint_timer_query Extension Specification [...]
e_x_t_disjoint_timer_query_webgl2
WebGL EXT_disjoint_timer_query_webgl2 Extension Specification [...]
e_x_t_float_blend
WebGL EXT_float_blend Extension Specification [...]
e_x_t_frag_depth
WebGL EXT_frag_depth Khronos Ratified Extension Specification [...]
e_x_t_s_r_g_b
WebGL EXT_sRGB Extension Specification [...]
e_x_t_shader_texture_lod
WebGL EXT_shader_texture_lod Khronos Ratified Extension Specification [...]
e_x_t_texture_compression_bptc
WebGL EXT_texture_compression_bptc Extension Specification [...]
e_x_t_texture_compression_rgtc
WebGL EXT_texture_compression_rgtc Extension Specification [...]
e_x_t_texture_filter_anisotropic
WebGL EXT_texture_filter_anisotropic Khronos Ratified Extension Specification [...]
e_x_t_texture_norm16
WebGL EXT_texture_norm16 Extension Specification [...]
element_timing
Element Timing API [...]
encoding
Encoding Standard [...]
encrypted_media
Encrypted Media Extensions [...]
entries_api
File and Directory Entries API [...]
event_timing
Event Timing API [...]
fetch
Fetch Standard [...]
file_a_p_i
File API [...]
file_system_access
File System Access [...]
filter_effects_1
Filter Effects Module Level 1 [...]
floc
Federated Learning of Cohorts [...]
font_metrics_api_1
Font Metrics API Level 1 [...]
frame_timing
Frame Timing [...]
fullscreen
Fullscreen API Standard [...]
gamepad
Gamepad [...]
gamepad_extensions
Gamepad Extensions [...]
generic_sensor
Generic Sensor API [...]
geolocation_a_p_i
Geolocation API [...]
geolocation_sensor
Geolocation Sensor [...]
geometry_1
Geometry Interfaces Module Level 1 [...]
Get Installed Related Apps API [...]
gyroscope
Gyroscope [...]
hit_test
WebXR Hit Test Module [...]
hr_time_3
High Resolution Time [...]
html
HTML Standard [...]
html_media_capture
HTML Media Capture [...]
idle_detection
Idle Detection API [...]
image_capture
MediaStream Image Capture [...]
image_resource
Image Resource [...]
indexed_d_b_3
Indexed Database API 3.0 [...]
input_device_capabilities
Input Device Capabilities [...]
input_events_2
Input Events Level 2 [...]
intersection_observer
Intersection Observer [...]
intervention_reporting
Intervention Reporting [...]
is_input_pending
Early detection of input events [...]
js_bindings
js_self_profiling
JS Self-Profiling API [...]
k_h_r_parallel_shader_compile
WebGL KHR_parallel_shader_compile Extension Specification [...]
keyboard_lock
Keyboard Lock [...]
keyboard_map
Keyboard Map [...]
largest_contentful_paint
Largest Contentful Paint [...]
layout_instability
Layout Instability API [...]
lighting_estimation
WebXR Lighting Estimation API Level 1 [...]
local_font_access
Local Font Access API [...]
longtasks_1
Long Tasks API 1 [...]
magnetometer
Magnetometer [...]
mathml_core
MathML Core [...]
media_capabilities
Media Capabilities [...]
media_playback_quality
Media Playback Quality [...]
media_source
Media Source Extensions™ [...]
mediacapture_automation
Media Capture Automation [...]
mediacapture_depth
Media Capture Depth Stream Extensions [...]
mediacapture_fromelement
Media Capture from DOM Elements [...]
mediacapture_streams
Media Capture and Streams [...]
mediasession
Media Session Standard [...]
mediastream_recording
MediaStream Recording [...]
mst_content_hint
MediaStreamTrack Content Hints [...]
Navigation Timing Level 2 [...]
netinfo
Network Information API [...]
notifications
Notifications API Standard [...]
o_e_s_draw_buffers_indexed
WebGL OES_draw_buffers_indexed Extension Draft Specification [...]
o_e_s_element_index_uint
WebGL OES_element_index_uint Khronos Ratified Extension Specification [...]
o_e_s_fbo_render_mipmap
WebGL OES_fbo_render_mipmap Extension Specification [...]
o_e_s_standard_derivatives
WebGL OES_standard_derivatives Khronos Ratified Extension Specification [...]
o_e_s_texture_float
WebGL OES_texture_float Khronos Ratified Extension Specification [...]
o_e_s_texture_float_linear
WebGL OES_texture_float_linear Khronos Ratified Extension Specification [...]
o_e_s_texture_half_float
WebGL OES_texture_half_float Khronos Ratified Extension Specification [...]
o_e_s_texture_half_float_linear
WebGL OES_texture_half_float_linear Khronos Ratified Extension Specification [...]
o_e_s_vertex_array_object
WebGL OES_vertex_array_object Khronos Ratified Extension Specification [...]
o_v_r_multiview2
WebGL OVR_multiview2 Extension Specification [...]
orientation_event
DeviceOrientation Event Specification [...]
orientation_sensor
Orientation Sensor [...]
origin_policy
Origin Policy [...]
page_lifecycle
Page Lifecycle [...]
page_visibility_2
Page Visibility Level 2 [...]
paint_timing
Paint Timing 1 [...]
payment_handler
Payment Handler API [...]
payment_method_basic_card
Payment Method: Basic Card [...]
payment_request
Payment Request API [...]
performance_measure_memory
Measure Memory API [...]
performance_timeline_2
Performance Timeline Level 2 [...]
periodic_background_sync
Web Periodic Background Synchronization [...]
permissions
Permissions [...]
permissions_policy_1
Permissions Policy [...]
permissions_request
Requesting Permissions [...]
permissions_revoke
Relinquishing Permissions [...]
picture_in_picture
Picture-in-Picture [...]
pointerevents3
Pointer Events [...]
pointerlock_2
Pointer Lock 2.0 [...]
portals
Portals [...]
presentation_api
Presentation API [...]
private_click_measurement
Private Click Measurement [...]
proximity
Proximity Sensor [...]
push_api
Push API [...]
referrer_policy
Referrer Policy [...]
remote_playback
Remote Playback API [...]
reporting_1
Reporting API 1 [...]
requestidlecallback
Cooperative Scheduling of Background Tasks [...]
resize_observer_1
Resize Observer [...]
resource_timing_2
Resource Timing Level 2 [...]
sanitizer_api
HTML Sanitizer API [...]
savedata
Save Data API [...]
scheduling_apis
Prioritized Task Scheduling [...]
screen_capture
Screen Capture [...]
screen_orientation
The Screen Orientation API [...]
screen_wake_lock
Screen Wake Lock API [...]
scroll_animations_1
Scroll-linked Animations [...]
scroll_to_text_fragment
Text Fragments [...]
selection_api
Selection API [...]
serial
Web Serial API [...]
server_timing
Server Timing [...]
service_workers_1
Service Workers Nightly [...]
shape_detection_api
Accelerated Shape Detection in Images [...]
speech_api
Web Speech API [...]
storage
Storage Standard [...]
storage_access
The Storage Access API [...]
streams
Streams Standard [...]
svg2
Scalable Vector Graphics (SVG) 2 [...]
svg11
Scalable Vector Graphics (SVG) 2 [...]
svg_animations
SVG Animations [...]
text_detection_api
Accelerated Text Detection in Images [...]
touch_events
Touch Events - Level 2 [...]
trusted_types
Trusted Types [...]
ua_client_hints
User-Agent Client Hints [...]
uievents
UI Events [...]
url
URL Standard [...]
user_timing_2
User Timing Level 3 [...]
user_timing_3
User Timing Level 3 [...]
vibration
Vibration API (Second Edition) [...]
video_rvfc
HTMLVideoElement.requestVideoFrameCallback() [...]
visual_viewport
Visual Viewport API [...]
w_e_b_g_l_blend_equation_advanced_coherent
WebGL WEBGL_blend_equation_advanced_coherent Extension Draft Specification [...]
w_e_b_g_l_color_buffer_float
WebGL WEBGL_color_buffer_float Extension Specification [...]
w_e_b_g_l_compressed_texture_astc
WebGL WEBGL_compressed_texture_astc Extension Specification [...]
w_e_b_g_l_compressed_texture_etc
WebGL WEBGL_compressed_texture_etc Extension Specification [...]
w_e_b_g_l_compressed_texture_etc1
WebGL WEBGL_compressed_texture_etc1 Extension Specification [...]
w_e_b_g_l_compressed_texture_pvrtc
WebGL WEBGL_compressed_texture_pvrtc Extension Specification [...]
w_e_b_g_l_compressed_texture_s3tc
WebGL WEBGL_compressed_texture_s3tc Khronos Ratified Extension Specification [...]
w_e_b_g_l_compressed_texture_s3tc_srgb
WebGL WEBGL_compressed_texture_s3tc_srgb Extension Specification [...]
w_e_b_g_l_debug_renderer_info
WebGL WEBGL_debug_renderer_info Khronos Ratified Extension Specification [...]
w_e_b_g_l_debug_shaders
WebGL WEBGL_debug_shaders Khronos Ratified Extension Specification [...]
w_e_b_g_l_depth_texture
WebGL WEBGL_depth_texture Khronos Ratified Extension Specification [...]
w_e_b_g_l_draw_buffers
WebGL WEBGL_draw_buffers Khronos Ratified Extension Specification [...]
w_e_b_g_l_draw_instanced_base_vertex_base_instance
WebGL WEBGL_draw_instanced_base_vertex_base_instance Extension Draft Specification [...]
w_e_b_g_l_lose_context
WebGL WEBGL_lose_context Khronos Ratified Extension Specification [...]
w_e_b_g_l_multi_draw
WebGL WEBGL_multi_draw Extension Specification [...]
w_e_b_g_l_multi_draw_instanced_base_vertex_base_instance
WebGL WEBGL_multi_draw_instanced_base_vertex_base_instance Extension Draft Specification [...]
wai_aria_1_2
Accessible Rich Internet Applications (WAI-ARIA) 1.3 [...]
wasm_js_api_1
WebAssembly JavaScript Interface [...]
wasm_web_api_1
WebAssembly Web API [...]
web_animations_1
Web Animations [...]
web_animations_2
Web Animations Level 2 [...]
web_bluetooth
Web Bluetooth [...]
web_crypto_a_p_i
Web Cryptography API [...]
web_i_d_l_1
Web IDL [...]
web_locks
Web Locks API [...]
web_nfc
Web NFC [...]
web_otp
WebOTP API [...]
web_share
Web Share API [...]
web_share_target
Web Share Target API [...]
webaudio
Web Audio API [...]
webauthn_3
Web Authentication: An API for accessing Public Key Credentials - Level 3 [...]
webcodecs
WebCodecs [...]
webdriver2
WebDriver [...]
webgl1
WebGL Specification [...]
webgl2
WebGL 2.0 Specification [...]
webgpu
WebGPU [...]
webhid
WebHID API [...]
webmidi
Web MIDI API [...]
webrtc
WebRTC 1.0: Real-Time Communication Between Browsers [...]
webrtc_encoded_transform
WebRTC Encoded Transform [...]
webrtc_ice
IceTransport Extensions for WebRTC [...]
webrtc_identity
Identity for WebRTC 1.0 [...]
webrtc_priority
WebRTC Priority Control API [...]
webrtc_stats
Identifiers for WebRTC's Statistics API [...]
webrtc_svc
Scalable Video Coding (SVC) Extension for WebRTC [...]
webtransport
WebTransport [...]
webusb
WebUSB API [...]
webvtt1
WebVTT: The Web Video Text Tracks Format [...]
webxr
WebXR Device API [...]
webxr_ar_module_1
WebXR Augmented Reality Module - Level 1 [...]
webxr_gamepads_module_1
WebXR Gamepads Module - Level 1 [...]
webxr_hand_input_1
WebXR Hand Input Module - Level 1 [...]
webxrlayers_1
WebXR Layers API Level 1 [...]
window
xhr
XMLHttpRequest Standard [...]