summaryrefslogtreecommitdiff
path: root/ext/webidl
diff options
context:
space:
mode:
authorRichard Carson <Rscarson@rogers.com>2024-06-17 18:07:48 -0400
committerGitHub <noreply@github.com>2024-06-18 00:07:48 +0200
commit257f0273250087bd5080430fe4c780b208d7986c (patch)
treee488fddde3f9eb095700e8e921385e8a71a202be /ext/webidl
parent5dec3fd4b75a59574e5aeed4e927d8e3e0c1c683 (diff)
docs: Add documentation to a subset of available extensions (#24138)
I was able to use my experience with some of the Deno extensions to flesh out their documentation a bit I've provided docs for the following: - web - fetch - net - webidl - url - io - crypto - console --------- Signed-off-by: Richard Carson <Rscarson@rogers.com>
Diffstat (limited to 'ext/webidl')
-rw-r--r--ext/webidl/README.md22
1 files changed, 20 insertions, 2 deletions
diff --git a/ext/webidl/README.md b/ext/webidl/README.md
index cc4ccc6e9..0b52c6fbd 100644
--- a/ext/webidl/README.md
+++ b/ext/webidl/README.md
@@ -1,6 +1,24 @@
# deno_webidl
-This crate implements WebIDL for Deno. It consists of infrastructure to do ECMA
--> WebIDL conversions.
+**This crate implements WebIDL for Deno. It consists of infrastructure to do
+ECMA -> WebIDL conversions.**
Spec: https://webidl.spec.whatwg.org/
+
+## Usage Example
+
+From javascript, include the extension's source, and assign the following to the
+global scope:
+
+```javascript
+import * as webidl from "ext:deno_webidl/00_webidl.js";
+Object.defineProperty(globalThis, webidl.brand, {
+ value: webidl.brand,
+ enumerable: false,
+ configurable: true,
+ writable: true,
+});
+```
+
+Then from rust, provide `init_webidl::init_webidl::init_ops_and_esm()` in the
+`extensions` field of your `RuntimeOptions`