commit | d96c01d2252372c9e0fa7ffa52d2d1df331c248b | [log] [tgz] |
---|---|---|
author | Srujan Gaddam <58529443+srujzs@users.noreply.github.com> | Fri Feb 23 13:05:37 2024 -0800 |
committer | GitHub <noreply@github.com> | Fri Feb 23 13:05:37 2024 -0800 |
tree | 5b9e9d121a235362d02e5d2bd06734bd60b6ad3a | |
parent | 975e55cbe4ac683c33d5256a91f4133fa97b4c34 [diff] |
Use extension types and generics internally (#184) Migrate @staticInterop to extension types, which enables us to use generic arguments to JSArray and JSPromise.
Lightweight browser API bindings built around JS static interop.
This package exposes browser APIs. It's generated from the Web IDL definitions and uses recent Dart language features for zero-overhead bindings.
This package is intended to replace dart:html
and similar Dart SDK libraries. It will support access to browser APIs from Dart code compiled to either JavaScript or WebAssembly.
import 'package:web/web.dart'; void main() { final div = document.querySelector('div')!; div.text = 'Text set at ${DateTime.now()}'; }
The generator scripts use a number of conventions to consistently handle Web IDL definitions:
JSObject
.implements
between extension types.JSArray
and JSPromise
.String
.JSFunction
.String
instead of JSString
.JSAny?
.JSObject
.Based on:
For instructions on re-generating the DOM bindings, see the generator docs.