commit | 044780752414a8e11981c29ab4193fdf23a44455 | [log] [tgz] |
---|---|---|
author | Srujan Gaddam <58529443+srujzs@users.noreply.github.com> | Thu Feb 15 10:24:26 2024 -0800 |
committer | GitHub <noreply@github.com> | Thu Feb 15 10:24:26 2024 -0800 |
tree | 4bd536651d4bb99084f268a88d877853c6e3491c | |
parent | a54a1f0447979f9a3ea220199eca849ffb214e91 [diff] |
Add info on generation conventions (#171) This makes it easier for users to determine why some APIs are emitted the way they are.
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.