diff --git a/docs/content/docs/api-surface.mdx b/docs/content/docs/api-surface.mdx
index 3dc6ee15..07e14f39 100644
--- a/docs/content/docs/api-surface.mdx
+++ b/docs/content/docs/api-surface.mdx
@@ -241,6 +241,7 @@ let redirect = WebAPI.Response.redirect(~url="/login", ~status=302)
## DOM
DOM values are operated on through public interface modules.
+`WebAPI.Element` is the method module for element values. When you need to name the element type explicitly, use `WebAPI.DOM.element`; most examples can rely on inference from `Document.createElement`, `Document.querySelector`, and related DOM helpers.
```ReScript
let document = WebAPI.Window.current->WebAPI.Window.document
@@ -262,8 +263,8 @@ switch maybeButton {
Use conversion helpers when moving between related DOM interface types.
```ReScript
-let element = document->WebAPI.Document.createElement("div")
-let node = element->WebAPI.Element.asNode
+let element: WebAPI.DOM.element = document->WebAPI.Document.createElement("div")
+let node: WebAPI.DOM.node = element->WebAPI.Element.asNode
```
## Visual Viewport
diff --git a/docs/content/docs/contributing/api-module-structure.mdx b/docs/content/docs/contributing/api-module-structure.mdx
index 45781e8c..3545862c 100644
--- a/docs/content/docs/contributing/api-module-structure.mdx
+++ b/docs/content/docs/contributing/api-module-structure.mdx
@@ -61,13 +61,11 @@ type rec node = {
// ... more properties
}
-and element = {
- // duplicated property from node
- nodeName: string
- // ... more properties
-}
+and element = Base.element
```
+For shared DOM base interfaces such as `Element`, the structural record can live in a Base-owned module such as `Base__Element.res`. The DOM API module then keeps the familiar `DOM.element` alias while method modules use `DomTypes.element`.
+
## Auxiliary Types
Auxiliary types are used to represent types that are not directly related to the Web API but are used in the bindings.
diff --git a/docs/content/docs/contributing/module-type-structure.mdx b/docs/content/docs/contributing/module-type-structure.mdx
index bb5b58fc..f1d224d1 100644
--- a/docs/content/docs/contributing/module-type-structure.mdx
+++ b/docs/content/docs/contributing/module-type-structure.mdx
@@ -75,3 +75,30 @@ external checkValidity: htmlButtonElement => bool = "checkValidity"
`;
+
+## Shared element base
+
+`Element.res` is a method module. It does not define the `element` record type directly. The shared DOM element type is owned by Base and threaded back into DOM through aliases:
+
+```ReScript
+// Base.res
+type element = Base__Element.element
+
+// DomTypes.res
+type element = Base.element
+
+// Element.res
+include Impl({type t = DomTypes.element})
+```
+
+This keeps `Element.Impl` reusable for element subtypes while giving the package one shared base element type. Subtype modules should continue to include the nearest base method implementation:
+
+```ReScript
+// HTMLElement.res
+include Element.Impl({type t = DomTypes.htmlElement})
+
+// HTMLButtonElement.res
+include HTMLElement.Impl({type t = DomTypes.htmlButtonElement})
+```
+
+Use `asElement` when a subtype needs to be passed to a function that expects the shared element type.
diff --git a/docs/content/docs/philosophy.mdx b/docs/content/docs/philosophy.mdx
index 2b52fa65..c2c6a4cc 100644
--- a/docs/content/docs/philosophy.mdx
+++ b/docs/content/docs/philosophy.mdx
@@ -21,7 +21,8 @@ The bindings are exposed under the `WebAPI` namespace with the same flat module
```ReScript
open WebAPI.DOM
-let myElement: WebAPI.Element.t = document->WebAPI.Document.createElement("div")
+let myElement: WebAPI.DOM.element = document->WebAPI.Document.createElement("div")
+let id = myElement.id
```
## Interfaces
@@ -34,6 +35,8 @@ Methods are modeled as functions in a separate module. The idea is that these wi
Inherited methods are duplicated in the inheriting module to eliminate the need to cast the type to the base type.
+For DOM elements, `WebAPI.Element` is the method module. The element type itself is exposed as `WebAPI.DOM.element`. Most code does not need to annotate the type because functions such as `Document.createElement` and `Document.querySelector` already return it.
+
### Overloads
JavaScript supports function overloads, where a function can have multiple signatures. In ReScript, this is not possible, and a method can have multiple bindings with slightly different names. By entering the correct name, tooling should detect all variations of the method.
@@ -45,8 +48,8 @@ In some cases, type conversion will be required. Subtypes can safely be cast to
```ReScript
open WebAPI.DOM
-let element: WebAPI.Element.t = document->WebAPI.Document.createElement("div")
-let node: WebAPI.Node.t = element->WebAPI.Element.asNode
+let element: WebAPI.DOM.element = document->WebAPI.Document.createElement("div")
+let node: WebAPI.DOM.node = element->WebAPI.Element.asNode
```
Any other conversions should be treated as unsafe casts and used with caution, because the type system cannot guarantee they are valid at runtime.
diff --git a/docs/superpowers/specs/2026-04-22-unmonorepo-webapi-design.md b/docs/superpowers/specs/2026-04-22-unmonorepo-webapi-design.md
index 5cb468f6..f20b41b6 100644
--- a/docs/superpowers/specs/2026-04-22-unmonorepo-webapi-design.md
+++ b/docs/superpowers/specs/2026-04-22-unmonorepo-webapi-design.md
@@ -97,7 +97,7 @@ Example:
```json
{
- "dependencies": ["@plain/dep", { "name": "@other/heavy", "features": ["WebAPI.WebCrypto"] }]
+ "dependencies": ["@plain/dep", { "name": "@other/heavy", "features": ["WebAPI.Crypto"] }]
}
```
@@ -114,7 +114,7 @@ The build remains feature-oriented:
- `WebAPI.Base`
- `WebAPI.DOM`
- `WebAPI.Fetch`
-- `WebAPI.WebCrypto`
+- `WebAPI.Crypto`
- and the rest of the former package surfaces
The unified build keeps the original flat module surface instead of adding generated feature entry modules. For example, consumers should use modules such as:
@@ -124,7 +124,7 @@ The unified build keeps the original flat module surface instead of adding gener
- `WebAPI.Headers`
- `WebAPI.URL`
-Shared DOM base types should be owned by `DOM`, so common references stay short, for example `DOM.element` instead of `BaseDOM.element` or `Base.DOM.element`.
+Shared DOM base types can be owned by `Base` when they are needed across feature boundaries, while `DOM` can keep short public aliases such as `DOM.element`. For example, `Base__Element.element` is exposed through `Base.element`, then reused as `DomTypes.element` and `DOM.element`.
## Internal Module Naming
diff --git a/docs/superpowers/specs/2026-05-20-global-singleton-access-design.md b/docs/superpowers/specs/2026-05-20-global-singleton-access-design.md
new file mode 100644
index 00000000..8f2495a2
--- /dev/null
+++ b/docs/superpowers/specs/2026-05-20-global-singleton-access-design.md
@@ -0,0 +1,1051 @@
+# Global Singleton Access Design
+
+**Date:** 2026-05-20
+**Status:** Draft plan for review before implementation
+
+## Context
+
+Many Web APIs in this package are currently modeled as instance methods on an explicit browser-owned receiver. For APIs such as `Crypto`, that forces users to first obtain a global object and then pipe it into the API module:
+
+```rescript
+let id = DomGlobal.crypto->Crypto.randomUUID
+```
+
+In actual usage, these APIs are almost always accessed through singleton host objects that already exist on the global object or on `navigator`. The preferred public API should make that common case direct:
+
+```rescript
+let id = Crypto.randomUUID()
+```
+
+The `Crypto` module has already been manually adjusted toward this model:
+
+```rescript
+@scope("globalThis.crypto")
+external randomUUID: unit => string = "randomUUID"
+```
+
+This plan identifies the rest of the API surface that should follow the same rule, while preserving receiver-based APIs for true instance objects such as `Element`, `Document`, `Request`, `Response`, `MediaStream`, `AudioContext`, and canvas contexts.
+
+All direct singleton bindings should scope through `globalThis`, not through bare globals such as `crypto`, `navigator`, or `performance`.
+
+## Goals
+
+- Replace explicit singleton receivers with direct scoped bindings for browser-owned singleton objects.
+- Preserve receiver-based `@send` bindings for real instance APIs.
+- Make the common browser usage path concise and hard to misuse.
+- Keep API modules aligned with Web platform object names where possible.
+- Add tests that compile the intended direct usage style.
+- Avoid introducing broad global wrappers that hide whether an API is global, navigator-owned, or instance-owned.
+- Use `globalThis` as the root for global and nested singleton scopes.
+- Remove redundant singleton accessors from `DomGlobal`, `Window`, and `Document` once direct scoped APIs make those values unnecessary.
+
+## Non-Goals
+
+- This change does not convert all `@send` bindings.
+- This change does not redesign unrelated type modeling.
+- This change does not introduce runtime polyfills or availability checks.
+- This change does not attempt to solve stricter typed-array typing for `Crypto.getRandomValues`.
+- This change does not remove useful raw instance values when users still need the value itself, rather than just the singleton's methods.
+
+## Core Rule
+
+Convert a binding from receiver-based `@send` to direct `@scope` only when the receiver is a singleton host object that users should not normally need to pass around.
+
+Every converted singleton binding should use a `globalThis`-rooted scope:
+
+```rescript
+@scope("globalThis.crypto")
+external randomUUID: unit => string = "randomUUID"
+```
+
+Avoid bare scopes:
+
+```rescript
+@scope("crypto")
+external randomUUID: unit => string = "randomUUID"
+```
+
+The `globalThis` form is preferred because it is explicit about which global object is being read, works better across windows and worker-like globals, and is easier for tests or consumers to mock by replacing `globalThis.`.
+
+Keep `@send` when:
+
+- The receiver is a user-created instance.
+- The receiver can naturally come from many places.
+- The same module is intended to work with arbitrary instances of that Web API object.
+- The operation is inherited from a generic protocol such as `EventTarget` and the direct singleton shape has not been deliberately designed yet.
+
+## Binding Patterns
+
+### Direct Global Singleton
+
+Use this when the object is a direct global such as `globalThis.crypto`, `globalThis.performance`, `globalThis.history`, `globalThis.indexedDB`, or `globalThis.caches`.
+
+Before:
+
+```rescript
+@send
+external now: PerformanceTypes.performance => float = "now"
+```
+
+After:
+
+```rescript
+@scope("globalThis.performance")
+external now: unit => float = "now"
+```
+
+Target usage:
+
+```rescript
+let timestamp = Performance.now()
+```
+
+### Nested Singleton
+
+Use this when the object is a singleton property under another singleton, most commonly `globalThis.navigator`.
+
+Before:
+
+```rescript
+@send
+external readText: ClipboardTypes.clipboard => promise = "readText"
+```
+
+After:
+
+```rescript
+@scope("globalThis.navigator.clipboard")
+external readText: unit => promise = "readText"
+```
+
+Target usage:
+
+```rescript
+let text = await Clipboard.readText()
+```
+
+### Singleton Property Access
+
+Use this when a global singleton exposes another object that is useful as a value, such as `globalThis.crypto.subtle`.
+
+```rescript
+@scope("globalThis.crypto")
+external subtle: WebCryptoTypes.subtleCrypto = "subtle"
+```
+
+This can remain available even if `SubtleCrypto` also exposes direct scoped operations.
+
+### Static Constructor Or Static Class Method
+
+Do not change existing static bindings that are already modeled with class or constructor scopes.
+Do apply the `globalThis` root to those scopes when they are touched by this migration.
+
+Examples that should remain conceptually unchanged:
+
+```rescript
+@scope("globalThis.URL")
+external createObjectURL: unknown => string = "createObjectURL"
+
+@scope("globalThis.Response")
+external error: unit => Response.t = "error"
+```
+
+These are not singleton object methods. They are static methods on constructors.
+
+## Candidate Modules
+
+### WebCrypto
+
+Current singleton:
+
+- `DomGlobal.crypto`
+
+Target direct API:
+
+```rescript
+Crypto.randomUUID()
+Crypto.getRandomValues(values)
+Crypto.subtle
+```
+
+Already changed:
+
+- `Crypto.getRandomValues`
+- `Crypto.randomUUID`
+- `Crypto.subtle`
+
+Likely next change:
+
+- Convert `SubtleCrypto` methods to `@scope("globalThis.crypto.subtle")`.
+
+Target direct API:
+
+```rescript
+SubtleCrypto.digest(~algorithm, ~data)
+SubtleCrypto.encrypt(~algorithm, ~key, ~data)
+SubtleCrypto.importKey(...)
+```
+
+Open question:
+
+- Keep `Crypto.subtle->SubtleCrypto.digest(...)` compatibility temporarily, or make `SubtleCrypto` direct-only?
+
+Recommended approach:
+
+- Convert `SubtleCrypto` to direct scoped bindings.
+- Keep `Crypto.subtle` as a value accessor for users who need the raw `subtleCrypto` value.
+- Do not add duplicate receiver-based wrappers unless compatibility becomes a release requirement.
+
+### Performance
+
+Current singleton:
+
+- `DomGlobal.performance`
+
+Current usage shape:
+
+```rescript
+DomGlobal.performance->Performance.now()
+DomGlobal.performance->Performance.mark(~markName="start")
+```
+
+Target direct API:
+
+```rescript
+Performance.now()
+Performance.mark(~markName="start")
+Performance.getEntries()
+Performance.clearMarks()
+```
+
+Implementation:
+
+- Convert `Performance.res` methods from `@send` to `@scope("globalThis.performance")`.
+- Remove the explicit `PerformanceTypes.performance` receiver from function signatures.
+
+Special handling:
+
+- `Performance` currently includes `EventTarget.Impl`.
+- Decide separately whether singleton `Performance.addEventListener(...)` wrappers are needed.
+- Do not let generic event-target support block the method conversion.
+
+### History
+
+Current singleton:
+
+- `DomGlobal.history`
+
+Target direct API:
+
+```rescript
+History.back()
+History.forward()
+History.go(~delta=-1)
+History.pushState(~data, ~unused="", ~url="?page=2")
+History.replaceState(~data, ~unused="", ~url="?page=3")
+```
+
+Implementation:
+
+- Convert all `History.res` methods to `@scope("globalThis.history")`.
+
+### IndexedDB
+
+Current singleton:
+
+- `DomGlobal.indexedDB`
+
+Target direct API:
+
+```rescript
+IDBFactory.open_(~name="app-db")
+IDBFactory.deleteDatabase("app-db")
+IDBFactory.databases()
+IDBFactory.cmp(~first, ~second)
+```
+
+Implementation:
+
+- Convert `IDBFactory.res` from `@send` to `@scope("globalThis.indexedDB")`.
+
+Keep receiver-based:
+
+- `IDBDatabase`
+- `IDBObjectStore`
+- `IDBIndex`
+- `IDBTransaction`
+
+Those are real IndexedDB instances and should remain pipe-friendly.
+
+### CacheStorage
+
+Current singleton:
+
+- `DomGlobal.caches`
+
+Target direct API:
+
+```rescript
+CacheStorage.open_("assets")
+CacheStorage.keys()
+CacheStorage.has("assets")
+CacheStorage.delete("assets")
+```
+
+Implementation:
+
+- Convert `WebWorkers/CacheStorage.res` methods to `@scope("globalThis.caches")`.
+
+Keep receiver-based:
+
+- `ServiceWorker/Cache.res`
+
+`Cache` instances returned by `CacheStorage.open_` should remain instance APIs.
+
+### WebSpeech
+
+Current singleton:
+
+- `DomGlobal.speechSynthesis`
+
+Target direct API:
+
+```rescript
+SpeechSynthesis.speak(utterance)
+SpeechSynthesis.cancel()
+SpeechSynthesis.pause()
+SpeechSynthesis.resume()
+SpeechSynthesis.getVoices()
+```
+
+Implementation:
+
+- Convert methods in `SpeechSynthesis.res` to `@scope("globalThis.speechSynthesis")`.
+
+Special handling:
+
+- `SpeechSynthesis` currently includes `EventTarget.Impl`.
+- Decide whether to add direct event listener wrappers for `speechSynthesis` events.
+
+### CustomElementRegistry
+
+Current singleton:
+
+- `DomGlobal.customElements`
+
+Target direct API:
+
+```rescript
+CustomElementRegistry.define(~name, ~constructor, ~options=?)
+CustomElementRegistry.whenDefined("my-element")
+CustomElementRegistry.getName(constructor)
+CustomElementRegistry.upgrade(node)
+```
+
+Implementation:
+
+- Convert `CustomElementRegistry.res` to `@scope("globalThis.customElements")`.
+
+Open naming question:
+
+- The module name is technically the interface name, but user-facing usage may read better as `CustomElements.define(...)`.
+- Recommended for now: keep `CustomElementRegistry` to avoid a public module rename in the same change.
+
+## Navigator-Owned Candidate Modules
+
+These modules currently require this general shape:
+
+```rescript
+DomGlobal.navigator->Navigator.someProperty->SomeModule.someMethod(...)
+```
+
+They should be converted to nested scopes where the Web API object is a singleton property of `globalThis.navigator`.
+
+### Clipboard
+
+Current singleton path:
+
+- `navigator.clipboard`
+
+Target direct API:
+
+```rescript
+Clipboard.read()
+Clipboard.readText()
+Clipboard.write(items)
+Clipboard.writeText("text")
+```
+
+Implementation:
+
+- Convert `Clipboard.res` methods to `@scope("globalThis.navigator.clipboard")`.
+
+Keep receiver-based:
+
+- `ClipboardItem.res`
+
+### CredentialsContainer
+
+Current singleton path:
+
+- `navigator.credentials`
+
+Target direct API:
+
+```rescript
+CredentialsContainer.get(~options)
+CredentialsContainer.create(~options)
+CredentialsContainer.store(credential)
+CredentialsContainer.preventSilentAccess()
+```
+
+Implementation:
+
+- Convert `CredentialsContainer.res` to `@scope("globalThis.navigator.credentials")`.
+
+### Geolocation
+
+Current singleton path:
+
+- `navigator.geolocation`
+
+Target direct API:
+
+```rescript
+Geolocation.getCurrentPosition(~successCallback, ~errorCallback=?, ~options=?)
+Geolocation.watchPosition(~successCallback, ~errorCallback=?, ~options=?)
+Geolocation.clearWatch(id)
+```
+
+Implementation:
+
+- Convert `Geolocation.res` to `@scope("globalThis.navigator.geolocation")`.
+
+Keep receiver-based:
+
+- `GeolocationCoordinates`
+- `GeolocationPosition`
+
+### MediaCapabilities
+
+Current singleton path:
+
+- `navigator.mediaCapabilities`
+
+Target direct API:
+
+```rescript
+MediaCapabilities.decodingInfo(configuration)
+MediaCapabilities.encodingInfo(configuration)
+```
+
+Implementation:
+
+- Convert `MediaCapabilities.res` to `@scope("globalThis.navigator.mediaCapabilities")`.
+
+### MediaDevices
+
+Current singleton path:
+
+- `navigator.mediaDevices`
+
+Target direct API:
+
+```rescript
+MediaDevices.enumerateDevices()
+MediaDevices.getSupportedConstraints()
+MediaDevices.getUserMedia(~constraints)
+MediaDevices.getDisplayMedia(~options)
+```
+
+Implementation:
+
+- Convert `MediaDevices.res` methods to `@scope("globalThis.navigator.mediaDevices")`.
+
+Special handling:
+
+- `MediaDevices` currently includes `EventTarget.Impl`.
+- Decide whether to add direct singleton event wrappers.
+
+Keep receiver-based:
+
+- `MediaStream`
+- `MediaStreamTrack`
+- `MediaDeviceInfo`
+
+### MediaSession
+
+Current singleton path:
+
+- `navigator.mediaSession`
+
+Target direct API:
+
+```rescript
+MediaSession.setActionHandler(~action, ~handler)
+MediaSession.setPositionState(~state)
+```
+
+Implementation:
+
+- Convert `MediaSession.res` to `@scope("globalThis.navigator.mediaSession")`.
+
+### Permissions
+
+Current singleton path:
+
+- `navigator.permissions`
+
+Target direct API:
+
+```rescript
+Permissions.query(descriptor)
+```
+
+Implementation:
+
+- Convert `Permissions.res` to `@scope("globalThis.navigator.permissions")`.
+
+### ScreenWakeLock
+
+Current singleton path:
+
+- `navigator.wakeLock`
+
+Target direct API:
+
+```rescript
+WakeLock.request(~type_=Screen)
+```
+
+Implementation:
+
+- Convert `WakeLock.res` to `@scope("globalThis.navigator.wakeLock")`.
+
+Keep receiver-based:
+
+- `WakeLockSentinel.release`
+
+### ServiceWorkerContainer
+
+Current singleton path:
+
+- `navigator.serviceWorker`
+
+Target direct API:
+
+```rescript
+ServiceWorkerContainer.register("/sw.js")
+ServiceWorkerContainer.getRegistration()
+ServiceWorkerContainer.getRegistrations()
+ServiceWorkerContainer.startMessages()
+```
+
+Implementation:
+
+- Convert `ServiceWorkerContainer.res` to `@scope("globalThis.navigator.serviceWorker")`.
+
+Special handling:
+
+- `ServiceWorkerContainer` currently includes `EventTarget.Impl`.
+- Decide whether direct event listener wrappers are needed.
+
+Keep receiver-based:
+
+- `ServiceWorker`
+- `ServiceWorkerRegistration`
+- `NavigationPreloadManager`
+- `Clients`
+- `Cache`
+
+### StorageManager
+
+Current singleton path:
+
+- `navigator.storage`
+
+Target direct API:
+
+```rescript
+StorageManager.persisted()
+StorageManager.persist()
+StorageManager.estimate()
+StorageManager.getDirectory()
+```
+
+Implementation:
+
+- Convert `StorageManager.res` to `@scope("globalThis.navigator.storage")`.
+
+### LockManager
+
+Current singleton path:
+
+- `navigator.locks`
+
+Target direct API:
+
+```rescript
+LockManager.request(~name, ~callback)
+LockManager.request2(~name, ~options, ~callback)
+LockManager.query()
+```
+
+Implementation:
+
+- Convert `LockManager.res` to `@scope("globalThis.navigator.locks")`.
+
+## WebStorage Decision
+
+`Storage` is a special case because there are two common singleton instances:
+
+- `localStorage`
+- `sessionStorage`
+
+Current usage:
+
+```rescript
+DomGlobal.localStorage->Storage.getItem("key")
+DomGlobal.sessionStorage->Storage.setItem(~key="key", ~value="value")
+```
+
+A single direct `Storage.getItem("key")` would be ambiguous.
+
+Recommended design:
+
+- Keep `Storage.res` receiver-based for arbitrary `Storage` instances.
+- Add separate singleton modules:
+ - `LocalStorage`
+ - `SessionStorage`
+
+Target direct API:
+
+```rescript
+LocalStorage.getItem("key")
+LocalStorage.setItem(~key="key", ~value="value")
+LocalStorage.clear()
+
+SessionStorage.getItem("key")
+SessionStorage.setItem(~key="key", ~value="value")
+SessionStorage.clear()
+```
+
+Potential implementation:
+
+```rescript
+@scope("globalThis.localStorage")
+external getItem: string => Null.t = "getItem"
+
+@scope("globalThis.sessionStorage")
+external getItem: string => Null.t = "getItem"
+```
+
+Length access needs special handling because `length` is a property, not a method.
+
+Possible shape:
+
+```rescript
+@scope("globalThis.localStorage") @val
+external length: int = "length"
+```
+
+Open questions:
+
+- Should `LocalStorage` and `SessionStorage` be public modules in `rescript.json`?
+- Should their implementations duplicate bindings or share an internal functor/helper?
+- Should `Storage` retain all current tests while new tests cover the singleton modules?
+
+## Navigator Module Itself
+
+`Navigator.res` has two categories of bindings:
+
+- Property accessors such as `clipboard`, `permissions`, `mediaDevices`, and `storage`.
+- Methods on the singleton `navigator` such as `sendBeacon`, `getGamepads`, `requestMediaKeySystemAccess`, and `requestMIDIAccess`.
+
+Recommended design:
+
+- Keep property accessors receiver-based for users who have an explicit navigator value from a non-standard context.
+- Add or convert direct methods for the singleton `navigator` methods.
+
+Target direct API:
+
+```rescript
+Navigator.sendBeacon(~url, ~data=?)
+Navigator.getGamepads()
+Navigator.requestMediaKeySystemAccess(~keySystem, ~supportedConfigurations)
+Navigator.requestMIDIAccess(~options=?)
+```
+
+Open question:
+
+- Should global navigator property reads also be exposed directly, for example `Navigator.userAgent` or `Navigator.language`?
+
+Recommended approach:
+
+- Convert singleton methods first.
+- Defer direct property reads until there is a clear naming convention for property values versus functions.
+
+## Modules To Leave Receiver-Based
+
+These modules should not be converted wholesale because they model normal instances:
+
+- `Document`
+- `Element`
+- `Node`
+- `Event`
+- `EventTarget`
+- `Request`
+- `Response`
+- `Headers`
+- `FormData`
+- `URLSearchParams`
+- `MediaStream`
+- `MediaStreamTrack`
+- `IDBDatabase`
+- `IDBObjectStore`
+- `IDBIndex`
+- `IDBTransaction`
+- `Cache`
+- `ServiceWorker`
+- `ServiceWorkerRegistration`
+- `AudioContext`
+- `BaseAudioContext`
+- `AudioNode`
+- `AudioParam`
+- `CanvasRenderingContext2D`
+- `HTMLCanvasElement`
+- `MutationObserver`
+- `ResizeObserver`
+- `IntersectionObserver`
+
+This list is intentionally conservative. A module should move out of this category only when there is a single browser-owned global object that clearly owns its methods.
+
+## EventTarget Handling
+
+Some singleton objects are also event targets:
+
+- `SpeechSynthesis`
+- `Clipboard`
+- `MediaDevices`
+- `ServiceWorkerContainer`
+- possibly `Performance`
+
+Current modules often include:
+
+```rescript
+include EventTarget.Impl({type t = SomeTypes.someSingleton})
+```
+
+That exposes receiver-based event target methods such as:
+
+```rescript
+someSingleton->SomeModule.addEventListener(...)
+```
+
+There are three possible approaches:
+
+1. Leave event target methods receiver-based and only convert API-specific methods.
+2. Add scoped singleton wrappers for event target methods in each singleton module.
+3. Generalize `EventTarget.Impl` so it can generate both receiver-based and scoped singleton bindings.
+
+Recommended first implementation:
+
+- Use option 1.
+- Convert only API-specific methods first.
+- Add direct event target wrappers later if tests or docs show a strong need.
+
+Rationale:
+
+- It avoids duplicating a large event target surface in the first migration.
+- It keeps the main access-shape change small enough to review.
+- It preserves a path for explicit event target values.
+
+## Compatibility Strategy
+
+This is a breaking public API change for converted modules because functions lose their receiver argument.
+
+Possible compatibility options:
+
+1. Direct replacement only.
+2. Keep deprecated receiver-based functions under old names.
+3. Keep receiver-based variants under explicit names such as `nowOn`, `openOn`, or `readTextOn`.
+
+Recommended approach:
+
+- Use direct replacement for modules where the receiver was only exposed through a singleton global.
+- Add compatibility wrappers only when there is evidence that arbitrary instances are useful or tests require them.
+- Document the migration pattern in release notes:
+
+```rescript
+// Before
+DomGlobal.performance->Performance.now()
+
+// After
+Performance.now()
+```
+
+## Implementation Phases
+
+### Phase 1: Confirm Scope Syntax
+
+Before changing the full surface, add or temporarily compile a small set of representative scoped bindings:
+
+- `@scope("globalThis.crypto")`
+- `@scope("globalThis.performance")`
+- `@scope("globalThis.navigator.clipboard")`
+- `@scope("globalThis.crypto.subtle")`
+- property access through `@scope("globalThis.localStorage")` if `LocalStorage` is approved
+
+Verification:
+
+- `npm run build`
+- inspect generated JavaScript for representative modules
+- confirm generated JavaScript reads from `globalThis.`, not from a bare global
+
+### Phase 2: Convert Direct Global Singletons
+
+Convert the lowest-risk direct globals:
+
+- `Crypto`
+- `Performance`
+- `History`
+- `IDBFactory`
+- `CacheStorage`
+- `SpeechSynthesis`
+- `CustomElementRegistry`
+
+Update tests or add compile-only test coverage for intended usage.
+
+### Phase 3: Convert Navigator-Owned Singletons
+
+Convert nested navigator-owned modules:
+
+- `Clipboard`
+- `CredentialsContainer`
+- `Geolocation`
+- `MediaCapabilities`
+- `MediaDevices`
+- `MediaSession`
+- `Permissions`
+- `WakeLock`
+- `ServiceWorkerContainer`
+- `StorageManager`
+- `LockManager`
+
+Update tests with direct `Module.method(...)` calls.
+
+### Phase 4: Resolve WebStorage
+
+After agreeing on the public shape:
+
+- Add `LocalStorage.res`
+- Add `SessionStorage.res`
+- Add both modules to the `WebAPI.Storage` public list in `rescript.json`
+- Keep `Storage.res` receiver-based
+- Update WebStorage tests to cover direct singleton usage and generic receiver usage
+
+### Phase 5: Documentation And Migration Notes
+
+Update docs and examples:
+
+- Replace `DomGlobal.->Module.method(...)` examples.
+- Add a short migration note for singleton access.
+- Document the `globalThis` scoping policy and the reason for it.
+- Keep examples for instance APIs unchanged.
+
+### Phase 6: Global Accessor Cleanup
+
+After all conversions:
+
+- Search for stale `DomGlobal.->` usages in tests and docs.
+- Search for singleton modules still accepting their singleton receiver as the first argument.
+- Remove redundant singleton values from `DomGlobal` when the direct module now covers the intended usage.
+- Audit `Window` and remove redundant singleton accessors that only duplicate global singleton module access.
+- Audit `Document` and remove redundant paths to singleton APIs if any exist.
+- Keep raw values only when there is a concrete multi-instance use case or the value itself is useful.
+- If a raw value is kept, document why it remains receiver-based or value-based.
+
+The cleanup bias should be removal. `DomGlobal`, `Window`, and `Document` should not remain as alternate routes to APIs that now have direct `globalThis`-scoped modules.
+
+Likely `DomGlobal` removal candidates after conversion:
+
+- `crypto`
+- `performance`
+- `history`
+- `indexedDB`
+- `caches`
+- `speechSynthesis`
+- `customElements`
+- `localStorage`, if `LocalStorage` is added
+- `sessionStorage`, if `SessionStorage` is added
+
+Likely `Window` removal candidates mirror the same singleton properties when they only provide another route to the current realm's singleton:
+
+- `window->Window.crypto`
+- `window->Window.performance`
+- `window->Window.history`
+- `window->Window.indexedDB`
+- `window->Window.caches`
+- `window->Window.speechSynthesis`
+- `window->Window.customElements`
+- `window->Window.localStorage`, if `LocalStorage` is added
+- `window->Window.sessionStorage`, if `SessionStorage` is added
+
+Keep a `Window` accessor only when supporting explicit alternate `Window` values is a deliberate use case, for example an iframe or popup window. Do not keep it solely as a compatibility path to the current global singleton.
+
+`Document` should stay mostly receiver-based because documents are real instances. The cleanup pass should only remove `Document` shortcuts that exist to reach the current global document or another singleton indirectly. Any direct global-document convenience should use `globalThis.document` explicitly and should be documented as current-document-only.
+
+Likely `Navigator` property cleanup candidates depend on whether explicit navigator values remain supported:
+
+- `clipboard`
+- `credentials`
+- `geolocation`
+- `mediaCapabilities`
+- `mediaDevices`
+- `mediaSession`
+- `permissions`
+- `wakeLock`
+- `serviceWorker`
+- `storage`
+- `locks`
+
+## Testing Plan
+
+Add or update tests to compile these representative usages:
+
+```rescript
+Crypto.randomUUID()
+Crypto.getRandomValues([1, 2, 3])
+
+Performance.now()
+Performance.mark(~markName="start")
+Performance.clearMarks()
+
+History.back()
+History.pushState(~data=JSON.Encode.null, ~unused="")
+
+IDBFactory.open_(~name="test-db")
+IDBFactory.databases()
+
+CacheStorage.open_("test-cache")
+CacheStorage.keys()
+
+Clipboard.readText()
+Clipboard.writeText("hello")
+
+Permissions.query(descriptor)
+
+MediaDevices.enumerateDevices()
+StorageManager.estimate()
+LockManager.query()
+```
+
+Where runtime availability is unreliable in the test environment, prefer compile-only tests or guard runtime calls behind feature checks.
+
+Existing WebStorage tests should be updated after the `LocalStorage` and `SessionStorage` decision.
+
+## Verification Commands
+
+Run after each phase:
+
+```sh
+npm run build
+npm test
+```
+
+Run before finalizing:
+
+```sh
+npm run format:check
+```
+
+If formatting is expected to rewrite generated or hand-written files, run:
+
+```sh
+npm run format
+```
+
+## Search Checklist
+
+Use these searches to find remaining old-style singleton usage:
+
+```sh
+grep -RIn "DomGlobal.crypto->" src tests docs
+grep -RIn "DomGlobal.performance->" src tests docs
+grep -RIn "DomGlobal.history->" src tests docs
+grep -RIn "DomGlobal.indexedDB->" src tests docs
+grep -RIn "DomGlobal.caches->" src tests docs
+grep -RIn "DomGlobal.speechSynthesis->" src tests docs
+grep -RIn "DomGlobal.navigator->Navigator" src tests docs
+```
+
+Use these searches to find singleton modules that still take explicit receivers:
+
+```sh
+grep -RIn "external .*PerformanceTypes.performance" src/Performance
+grep -RIn "external .*HistoryTypes.history" src/History
+grep -RIn "external .*IndexedDbTypes.idbFactory" src/IndexedDB
+grep -RIn "external .*WebWorkersTypes.cacheStorage" src/WebWorkers
+grep -RIn "external .*WebSpeechTypes.speechSynthesis" src/WebSpeech
+grep -RIn "external .*ClipboardTypes.clipboard" src/Clipboard
+grep -RIn "external .*PermissionsTypes.permissions" src/Permissions
+```
+
+Use these searches to catch bare singleton scopes that should be rooted at `globalThis`:
+
+```sh
+grep -RIn '@scope("crypto")' src tests docs
+grep -RIn '@scope("performance")' src tests docs
+grep -RIn '@scope("history")' src tests docs
+grep -RIn '@scope("indexedDB")' src tests docs
+grep -RIn '@scope("caches")' src tests docs
+grep -RIn '@scope(("navigator"' src tests docs
+```
+
+Use these searches during the cleanup pass:
+
+```sh
+grep -RIn "external crypto:" src/DOM
+grep -RIn "external performance:" src/DOM
+grep -RIn "external history:" src/DOM
+grep -RIn "external indexedDB:" src/DOM
+grep -RIn "external caches:" src/DOM
+grep -RIn "external speechSynthesis:" src/DOM
+grep -RIn "external customElements:" src/DOM
+grep -RIn "external localStorage:" src/DOM
+grep -RIn "external sessionStorage:" src/DOM
+```
+
+## Risks
+
+- Over-converting instance APIs would remove useful pipe-based usage.
+- `globalThis`-rooted `@scope` syntax must be verified against generated JavaScript before large-scale conversion.
+- Event target support may feel inconsistent if API methods become direct but event methods remain receiver-based.
+- WebStorage can become confusing if `Storage` is made direct without distinguishing `localStorage` from `sessionStorage`.
+- Removing raw `Window`, `Document`, or `DomGlobal` accessors too aggressively could break legitimate multi-window or explicit-value use cases.
+- Some APIs may not exist in all runtimes used by tests, so runtime tests need guards.
+
+## Open Decisions
+
+- Should `SubtleCrypto` become direct-only or keep receiver-based compatibility?
+- Should singleton event target methods get direct wrappers in this migration?
+- Should `Navigator` expose direct global property reads such as `Navigator.userAgent`?
+- Should `CustomElementRegistry` keep its current module name or gain a `CustomElements` alias?
+- Should WebStorage add public `LocalStorage` and `SessionStorage` modules?
+- Should compatibility wrappers exist for any converted modules?
+- Which `DomGlobal`, `Window`, and `Document` singleton accessors have a concrete reason to remain after direct `globalThis`-scoped modules exist?
+
+## Recommended Initial Scope
+
+The first implementation should convert only:
+
+- `Crypto`
+- `SubtleCrypto`
+- `Performance`
+- `History`
+- `IDBFactory`
+- `CacheStorage`
+- `Clipboard`
+- `Permissions`
+
+This covers direct globals and one nested navigator-owned API without touching the more ambiguous WebStorage and event-heavy surfaces. Once this compiles and tests cleanly, continue with the remaining navigator-owned modules.
diff --git a/package-lock.json b/package-lock.json
index e9f50187..bd7e5e9e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,16 +1,13 @@
{
- "name": "experimental-rescript-webapi",
+ "name": "@rescript/webapi",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
- "name": "experimental-rescript-webapi",
+ "name": "@rescript/webapi",
"version": "0.1.0",
"license": "MIT",
- "workspaces": [
- "packages/*"
- ],
"devDependencies": {
"@astrojs/starlight": "0.37.7",
"astro": "^5.10.1",
@@ -18,11 +15,11 @@
"oxfmt": "^0.47.0",
"prettier": "^3.8.3",
"prettier-plugin-astro": "^0.14.1",
- "rescript": ">=12.0.0 <13",
+ "rescript": "^13.0.0-alpha.4",
"sharp": "^0.34.0"
},
"peerDependencies": {
- "rescript": ">=12.0.0 <13"
+ "rescript": ">=13"
}
},
"node_modules/@astrojs/compiler": {
@@ -1614,189 +1611,15 @@
"win32"
]
},
- "node_modules/@rescript-webapi/base": {
- "resolved": "packages/Base",
- "link": true
- },
- "node_modules/@rescript-webapi/canvas": {
- "resolved": "packages/Canvas",
- "link": true
- },
- "node_modules/@rescript-webapi/channel-messaging": {
- "resolved": "packages/ChannelMessaging",
- "link": true
- },
- "node_modules/@rescript-webapi/clipboard": {
- "resolved": "packages/Clipboard",
- "link": true
- },
- "node_modules/@rescript-webapi/credential-management": {
- "resolved": "packages/CredentialManagement",
- "link": true
- },
- "node_modules/@rescript-webapi/css-font-loading": {
- "resolved": "packages/CSSFontLoading",
- "link": true
- },
- "node_modules/@rescript-webapi/dom": {
- "resolved": "packages/DOM",
- "link": true
- },
- "node_modules/@rescript-webapi/encrypted-media-extensions": {
- "resolved": "packages/EncryptedMediaExtensions",
- "link": true
- },
- "node_modules/@rescript-webapi/event": {
- "resolved": "packages/Event",
- "link": true
- },
- "node_modules/@rescript-webapi/fetch": {
- "resolved": "packages/Fetch",
- "link": true
- },
- "node_modules/@rescript-webapi/file": {
- "resolved": "packages/File",
- "link": true
- },
- "node_modules/@rescript-webapi/file-and-directory-entries": {
- "resolved": "packages/FileAndDirectoryEntries",
- "link": true
- },
- "node_modules/@rescript-webapi/gamepad": {
- "resolved": "packages/Gamepad",
- "link": true
- },
- "node_modules/@rescript-webapi/geolocation": {
- "resolved": "packages/Geolocation",
- "link": true
- },
- "node_modules/@rescript-webapi/history": {
- "resolved": "packages/History",
- "link": true
- },
- "node_modules/@rescript-webapi/indexed-db": {
- "resolved": "packages/IndexedDB",
- "link": true
- },
- "node_modules/@rescript-webapi/intersection-observer": {
- "resolved": "packages/IntersectionObserver",
- "link": true
- },
- "node_modules/@rescript-webapi/media-capabilities": {
- "resolved": "packages/MediaCapabilities",
- "link": true
- },
- "node_modules/@rescript-webapi/media-capture-and-streams": {
- "resolved": "packages/MediaCaptureAndStreams",
- "link": true
- },
- "node_modules/@rescript-webapi/media-session": {
- "resolved": "packages/MediaSession",
- "link": true
- },
- "node_modules/@rescript-webapi/mutation-observer": {
- "resolved": "packages/MutationObserver",
- "link": true
- },
- "node_modules/@rescript-webapi/notification": {
- "resolved": "packages/Notification",
- "link": true
- },
- "node_modules/@rescript-webapi/performance": {
- "resolved": "packages/Performance",
- "link": true
- },
- "node_modules/@rescript-webapi/permissions": {
- "resolved": "packages/Permissions",
- "link": true
- },
- "node_modules/@rescript-webapi/picture-in-picture": {
- "resolved": "packages/PictureInPicture",
- "link": true
- },
- "node_modules/@rescript-webapi/push": {
- "resolved": "packages/Push",
- "link": true
- },
- "node_modules/@rescript-webapi/remote-playback": {
- "resolved": "packages/RemotePlayback",
- "link": true
- },
- "node_modules/@rescript-webapi/resize-observer": {
- "resolved": "packages/ResizeObserver",
- "link": true
- },
- "node_modules/@rescript-webapi/screen-wake-lock": {
- "resolved": "packages/ScreenWakeLock",
- "link": true
- },
- "node_modules/@rescript-webapi/service-worker": {
- "resolved": "packages/ServiceWorker",
- "link": true
- },
- "node_modules/@rescript-webapi/storage": {
- "resolved": "packages/Storage",
- "link": true
- },
- "node_modules/@rescript-webapi/ui-events": {
- "resolved": "packages/UIEvents",
- "link": true
- },
- "node_modules/@rescript-webapi/url": {
- "resolved": "packages/URL",
- "link": true
- },
- "node_modules/@rescript-webapi/view-transitions": {
- "resolved": "packages/ViewTransitions",
- "link": true
- },
- "node_modules/@rescript-webapi/visual-viewport": {
- "resolved": "packages/VisualViewport",
- "link": true
- },
- "node_modules/@rescript-webapi/web-audio": {
- "resolved": "packages/WebAudio",
- "link": true
- },
- "node_modules/@rescript-webapi/web-crypto": {
- "resolved": "packages/WebCrypto",
- "link": true
- },
- "node_modules/@rescript-webapi/web-locks": {
- "resolved": "packages/WebLocks",
- "link": true
- },
- "node_modules/@rescript-webapi/web-midi": {
- "resolved": "packages/WebMIDI",
- "link": true
- },
- "node_modules/@rescript-webapi/web-sockets": {
- "resolved": "packages/WebSockets",
- "link": true
- },
- "node_modules/@rescript-webapi/web-speech": {
- "resolved": "packages/WebSpeech",
- "link": true
- },
- "node_modules/@rescript-webapi/web-storage": {
- "resolved": "packages/WebStorage",
- "link": true
- },
- "node_modules/@rescript-webapi/web-vtt": {
- "resolved": "packages/WebVTT",
- "link": true
- },
- "node_modules/@rescript-webapi/web-workers": {
- "resolved": "packages/WebWorkers",
- "link": true
- },
"node_modules/@rescript/darwin-arm64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/darwin-arm64/-/darwin-arm64-12.2.0.tgz",
- "integrity": "sha512-xc3K/J7Ujl1vPiFY2009mRf3kWRlUe/VZyJWprseKxlcEtUQv89ter7r6pY+YFbtYvA/fcaEncL9CVGEdattAg==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/darwin-arm64/-/darwin-arm64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-3+uPQvuPoweXQ2MatnADRa6PgXhRI/LtkdWkoy8DFSKN7lhtF3Pg+eVjKxY4x4OCECNvHYWLWBKaiVRa22tocA==",
"cpu": [
"arm64"
],
+ "dev": true,
+ "license": "(LGPL-3.0-or-later AND MIT)",
"optional": true,
"os": [
"darwin"
@@ -1806,12 +1629,14 @@
}
},
"node_modules/@rescript/darwin-x64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/darwin-x64/-/darwin-x64-12.2.0.tgz",
- "integrity": "sha512-qqcTvnlSeoKkywLjG7cXfYvKZ1e4Gz2kUKcD6SiqDgCqm8TF+spwlFAiM6sloRUOFsc0bpC/0R0B3yr01FCB1A==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/darwin-x64/-/darwin-x64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-L71KY+BfSgrMYPUEGMDmrtbrqgBnoYJ/2nJZQNhPV0FP9oQ23rHw8pPVO8+/OzHYPr/OklnB5RbaBphzMBnaxg==",
"cpu": [
"x64"
],
+ "dev": true,
+ "license": "(LGPL-3.0-or-later AND MIT)",
"optional": true,
"os": [
"darwin"
@@ -1821,12 +1646,14 @@
}
},
"node_modules/@rescript/linux-arm64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/linux-arm64/-/linux-arm64-12.2.0.tgz",
- "integrity": "sha512-ODmpG3ji+Nj/8d5yvXkeHlfKkmbw1Q4t1iIjVuNwtmFpz7TiEa7n/sQqoYdE+WzbDX3DoJfmJNbp3Ob7qCUoOg==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/linux-arm64/-/linux-arm64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-2sJ4+Ali2PHhNRwIW53jYSuRSbMoioawl1WKAKoH7sQ++1+bIzdMuB3TQpi9oOqTUGlm/5l6bK2Amf8nUiJQ7Q==",
"cpu": [
"arm64"
],
+ "dev": true,
+ "license": "(LGPL-3.0-or-later AND MIT)",
"optional": true,
"os": [
"linux"
@@ -1836,12 +1663,14 @@
}
},
"node_modules/@rescript/linux-x64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/linux-x64/-/linux-x64-12.2.0.tgz",
- "integrity": "sha512-2W9Y9/g19Y4F/subl8yV3T8QBG2oRaP+HciNRcBjptyEdw9LmCKH8+rhWO6sp3E+nZLwoE2IAkwH0WKV3wqlxQ==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/linux-x64/-/linux-x64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-Gbmk44xkW4+1qG5g2iAATwx/Y6fZvGgEGUFZw1wK1sDpn2DKblmXIV3JLcWROgpmQv4Mfp4RHPSzZdmcBdPUoQ==",
"cpu": [
"x64"
],
+ "dev": true,
+ "license": "(LGPL-3.0-or-later AND MIT)",
"optional": true,
"os": [
"linux"
@@ -1851,17 +1680,21 @@
}
},
"node_modules/@rescript/runtime": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/runtime/-/runtime-12.2.0.tgz",
- "integrity": "sha512-NwfljDRq1rjFPHUaca1nzFz13xsa9ZGkBkLvMhvVgavJT5+A4rMcLu8XAaVTi/oAhO/tlHf9ZDoOTF1AfyAk9Q=="
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/runtime/-/runtime-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-pOGJdN0R3+PeB+tvxqmJB9qWPLTgitHmQY89lBbF3Ddtcbu/aUra9gEeFiX5gXGznEUcS1SVU24Zjr3GBqfy8w==",
+ "dev": true,
+ "license": "MIT"
},
"node_modules/@rescript/win32-x64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/win32-x64/-/win32-x64-12.2.0.tgz",
- "integrity": "sha512-fhf8CBj3p1lkIXPeNko3mVTKQfXXm4BoxJtR1xAXxUn43wDpd8Lox4w8/EPBbbW6C/YFQW6H7rtpY+2AKuNaDA==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/win32-x64/-/win32-x64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-NadOoXUe4ek9ZMdHp1hvfc6U11HAOV4VKczCZuM13MvNM0RsmiFUG6jsSNt37ZQuC3iY6I/v3qeKglVv/LG11g==",
"cpu": [
"x64"
],
+ "dev": true,
+ "license": "(LGPL-3.0-or-later AND MIT)",
"optional": true,
"os": [
"win32"
@@ -6673,28 +6506,39 @@
}
},
"node_modules/rescript": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.2.0.tgz",
- "integrity": "sha512-1Jf2cmNhyx5Mj2vwZ4XXPcXvNSjGj9D1jPBUcoqIOqRpLPo1ch2Ta/7eWh23xAHWHK5ow7BCDyYFjvZSjyjLzg==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-bkUiLFWxwwQ2cEjA9j3h0xQSgVk5ZngmhAhoB8oTyGrrzYzWoFaF0IEJhT0ZV0bqc+sen2xJtfqF1V8kyMql/A==",
+ "dev": true,
+ "license": "(LGPL-3.0-or-later AND MIT)",
+ "workspaces": [
+ "packages/playground",
+ "packages/@rescript/*",
+ "tests/dependencies/**",
+ "tests/analysis_tests/**",
+ "tests/docstring_tests",
+ "tests/gentype_tests/**",
+ "tests/tools_tests",
+ "tests/commonjs_tests",
+ "scripts/res"
+ ],
"dependencies": {
- "@rescript/runtime": "12.2.0"
+ "@rescript/runtime": "13.0.0-alpha.4"
},
"bin": {
"bsc": "cli/bsc.js",
- "bstracing": "cli/bstracing.js",
"rescript": "cli/rescript.js",
- "rescript-legacy": "cli/rescript-legacy.js",
"rescript-tools": "cli/rescript-tools.js"
},
"engines": {
"node": ">=20.11.0"
},
"optionalDependencies": {
- "@rescript/darwin-arm64": "12.2.0",
- "@rescript/darwin-x64": "12.2.0",
- "@rescript/linux-arm64": "12.2.0",
- "@rescript/linux-x64": "12.2.0",
- "@rescript/win32-x64": "12.2.0"
+ "@rescript/darwin-arm64": "13.0.0-alpha.4",
+ "@rescript/darwin-x64": "13.0.0-alpha.4",
+ "@rescript/linux-arm64": "13.0.0-alpha.4",
+ "@rescript/linux-x64": "13.0.0-alpha.4",
+ "@rescript/win32-x64": "13.0.0-alpha.4"
}
},
"node_modules/retext": {
@@ -7668,6 +7512,7 @@
"packages/Base": {
"name": "@rescript-webapi/base",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"peerDependencies": {
"rescript": ">=12.0.0 <13"
@@ -7676,6 +7521,7 @@
"packages/Canvas": {
"name": "@rescript-webapi/canvas",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -7691,6 +7537,7 @@
"packages/ChannelMessaging": {
"name": "@rescript-webapi/channel-messaging",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7702,6 +7549,7 @@
"packages/Clipboard": {
"name": "@rescript-webapi/clipboard",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0",
@@ -7714,6 +7562,7 @@
"packages/CredentialManagement": {
"name": "@rescript-webapi/credential-management",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -7726,6 +7575,7 @@
"packages/CSSFontLoading": {
"name": "@rescript-webapi/css-font-loading",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7737,6 +7587,7 @@
"packages/DOM": {
"name": "@rescript-webapi/dom",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -7780,6 +7631,7 @@
"packages/EncryptedMediaExtensions": {
"name": "@rescript-webapi/encrypted-media-extensions",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -7793,6 +7645,7 @@
"packages/Event": {
"name": "@rescript-webapi/event",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/dom": "0.1.0"
@@ -7804,6 +7657,7 @@
"packages/Fetch": {
"name": "@rescript-webapi/fetch",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -7818,6 +7672,7 @@
"packages/File": {
"name": "@rescript-webapi/file",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7829,6 +7684,7 @@
"packages/FileAndDirectoryEntries": {
"name": "@rescript-webapi/file-and-directory-entries",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0"
@@ -7840,6 +7696,7 @@
"packages/Gamepad": {
"name": "@rescript-webapi/gamepad",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0"
@@ -7851,6 +7708,7 @@
"packages/Geolocation": {
"name": "@rescript-webapi/geolocation",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"peerDependencies": {
"rescript": ">=12.0.0 <13"
@@ -7859,6 +7717,7 @@
"packages/History": {
"name": "@rescript-webapi/history",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"peerDependencies": {
"rescript": ">=12.0.0 <13"
@@ -7867,6 +7726,7 @@
"packages/IndexedDB": {
"name": "@rescript-webapi/indexed-db",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -7879,6 +7739,7 @@
"packages/IntersectionObserver": {
"name": "@rescript-webapi/intersection-observer",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/dom": "0.1.0"
@@ -7890,6 +7751,7 @@
"packages/MediaCapabilities": {
"name": "@rescript-webapi/media-capabilities",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"peerDependencies": {
"rescript": ">=12.0.0 <13"
@@ -7898,6 +7760,7 @@
"packages/MediaCaptureAndStreams": {
"name": "@rescript-webapi/media-capture-and-streams",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7909,6 +7772,7 @@
"packages/MediaSession": {
"name": "@rescript-webapi/media-session",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"peerDependencies": {
"rescript": ">=12.0.0 <13"
@@ -7917,6 +7781,7 @@
"packages/MutationObserver": {
"name": "@rescript-webapi/mutation-observer",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/dom": "0.1.0"
@@ -7928,6 +7793,7 @@
"packages/Notification": {
"name": "@rescript-webapi/notification",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7939,6 +7805,7 @@
"packages/Performance": {
"name": "@rescript-webapi/performance",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7950,6 +7817,7 @@
"packages/Permissions": {
"name": "@rescript-webapi/permissions",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7961,6 +7829,7 @@
"packages/PictureInPicture": {
"name": "@rescript-webapi/picture-in-picture",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7972,6 +7841,7 @@
"packages/Push": {
"name": "@rescript-webapi/push",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7983,6 +7853,7 @@
"packages/RemotePlayback": {
"name": "@rescript-webapi/remote-playback",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -7994,6 +7865,7 @@
"packages/ResizeObserver": {
"name": "@rescript-webapi/resize-observer",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/dom": "0.1.0"
@@ -8005,6 +7877,7 @@
"packages/ScreenWakeLock": {
"name": "@rescript-webapi/screen-wake-lock",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -8016,6 +7889,7 @@
"packages/ServiceWorker": {
"name": "@rescript-webapi/service-worker",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -8033,6 +7907,7 @@
"packages/Storage": {
"name": "@rescript-webapi/storage",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/file": "0.1.0"
@@ -8044,6 +7919,7 @@
"packages/UIEvents": {
"name": "@rescript-webapi/ui-events",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -8059,6 +7935,7 @@
"packages/URL": {
"name": "@rescript-webapi/url",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"peerDependencies": {
"rescript": ">=12.0.0 <13"
@@ -8067,6 +7944,7 @@
"packages/ViewTransitions": {
"name": "@rescript-webapi/view-transitions",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"peerDependencies": {
"rescript": ">=12.0.0 <13"
@@ -8075,6 +7953,7 @@
"packages/VisualViewport": {
"name": "@rescript-webapi/visual-viewport",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -8086,6 +7965,7 @@
"packages/WebAudio": {
"name": "@rescript-webapi/web-audio",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -8101,6 +7981,7 @@
"packages/WebCrypto": {
"name": "@rescript-webapi/web-crypto",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0"
@@ -8112,6 +7993,7 @@
"packages/WebLocks": {
"name": "@rescript-webapi/web-locks",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -8123,6 +8005,7 @@
"packages/WebMIDI": {
"name": "@rescript-webapi/web-midi",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/base": "0.1.0",
@@ -8135,6 +8018,7 @@
"packages/WebSockets": {
"name": "@rescript-webapi/web-sockets",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/channel-messaging": "0.1.0",
@@ -8148,6 +8032,7 @@
"packages/WebSpeech": {
"name": "@rescript-webapi/web-speech",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -8159,6 +8044,7 @@
"packages/WebStorage": {
"name": "@rescript-webapi/web-storage",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -8170,6 +8056,7 @@
"packages/WebVTT": {
"name": "@rescript-webapi/web-vtt",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/event": "0.1.0"
@@ -8181,6 +8068,7 @@
"packages/WebWorkers": {
"name": "@rescript-webapi/web-workers",
"version": "0.1.0",
+ "extraneous": true,
"license": "MIT",
"dependencies": {
"@rescript-webapi/channel-messaging": "0.1.0",
@@ -9035,353 +8923,45 @@
"dev": true,
"optional": true
},
- "@rescript-webapi/base": {
- "version": "file:packages/Base",
- "requires": {}
- },
- "@rescript-webapi/canvas": {
- "version": "file:packages/Canvas",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/dom": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/file": "0.1.0",
- "@rescript-webapi/media-capture-and-streams": "0.1.0"
- }
- },
- "@rescript-webapi/channel-messaging": {
- "version": "file:packages/ChannelMessaging",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/clipboard": {
- "version": "file:packages/Clipboard",
- "requires": {
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/file": "0.1.0"
- }
- },
- "@rescript-webapi/credential-management": {
- "version": "file:packages/CredentialManagement",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/css-font-loading": {
- "version": "file:packages/CSSFontLoading",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/dom": {
- "version": "file:packages/DOM",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/channel-messaging": "0.1.0",
- "@rescript-webapi/clipboard": "0.1.0",
- "@rescript-webapi/credential-management": "0.1.0",
- "@rescript-webapi/css-font-loading": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/fetch": "0.1.0",
- "@rescript-webapi/file": "0.1.0",
- "@rescript-webapi/file-and-directory-entries": "0.1.0",
- "@rescript-webapi/gamepad": "0.1.0",
- "@rescript-webapi/geolocation": "0.1.0",
- "@rescript-webapi/history": "0.1.0",
- "@rescript-webapi/indexed-db": "0.1.0",
- "@rescript-webapi/media-capabilities": "0.1.0",
- "@rescript-webapi/media-capture-and-streams": "0.1.0",
- "@rescript-webapi/media-session": "0.1.0",
- "@rescript-webapi/performance": "0.1.0",
- "@rescript-webapi/permissions": "0.1.0",
- "@rescript-webapi/picture-in-picture": "0.1.0",
- "@rescript-webapi/remote-playback": "0.1.0",
- "@rescript-webapi/screen-wake-lock": "0.1.0",
- "@rescript-webapi/service-worker": "0.1.0",
- "@rescript-webapi/storage": "0.1.0",
- "@rescript-webapi/url": "0.1.0",
- "@rescript-webapi/view-transitions": "0.1.0",
- "@rescript-webapi/visual-viewport": "0.1.0",
- "@rescript-webapi/web-crypto": "0.1.0",
- "@rescript-webapi/web-locks": "0.1.0",
- "@rescript-webapi/web-midi": "0.1.0",
- "@rescript-webapi/web-speech": "0.1.0",
- "@rescript-webapi/web-storage": "0.1.0",
- "@rescript-webapi/web-vtt": "0.1.0",
- "@rescript-webapi/web-workers": "0.1.0"
- }
- },
- "@rescript-webapi/encrypted-media-extensions": {
- "version": "file:packages/EncryptedMediaExtensions",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/dom": "0.1.0",
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/event": {
- "version": "file:packages/Event",
- "requires": {
- "@rescript-webapi/dom": "0.1.0"
- }
- },
- "@rescript-webapi/fetch": {
- "version": "file:packages/Fetch",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/file": "0.1.0",
- "@rescript-webapi/url": "0.1.0"
- }
- },
- "@rescript-webapi/file": {
- "version": "file:packages/File",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/file-and-directory-entries": {
- "version": "file:packages/FileAndDirectoryEntries",
- "requires": {
- "@rescript-webapi/base": "0.1.0"
- }
- },
- "@rescript-webapi/gamepad": {
- "version": "file:packages/Gamepad",
- "requires": {
- "@rescript-webapi/base": "0.1.0"
- }
- },
- "@rescript-webapi/geolocation": {
- "version": "file:packages/Geolocation",
- "requires": {}
- },
- "@rescript-webapi/history": {
- "version": "file:packages/History",
- "requires": {}
- },
- "@rescript-webapi/indexed-db": {
- "version": "file:packages/IndexedDB",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/intersection-observer": {
- "version": "file:packages/IntersectionObserver",
- "requires": {
- "@rescript-webapi/dom": "0.1.0"
- }
- },
- "@rescript-webapi/media-capabilities": {
- "version": "file:packages/MediaCapabilities",
- "requires": {}
- },
- "@rescript-webapi/media-capture-and-streams": {
- "version": "file:packages/MediaCaptureAndStreams",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/media-session": {
- "version": "file:packages/MediaSession",
- "requires": {}
- },
- "@rescript-webapi/mutation-observer": {
- "version": "file:packages/MutationObserver",
- "requires": {
- "@rescript-webapi/dom": "0.1.0"
- }
- },
- "@rescript-webapi/notification": {
- "version": "file:packages/Notification",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/performance": {
- "version": "file:packages/Performance",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/permissions": {
- "version": "file:packages/Permissions",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/picture-in-picture": {
- "version": "file:packages/PictureInPicture",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/push": {
- "version": "file:packages/Push",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/remote-playback": {
- "version": "file:packages/RemotePlayback",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/resize-observer": {
- "version": "file:packages/ResizeObserver",
- "requires": {
- "@rescript-webapi/dom": "0.1.0"
- }
- },
- "@rescript-webapi/screen-wake-lock": {
- "version": "file:packages/ScreenWakeLock",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/service-worker": {
- "version": "file:packages/ServiceWorker",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/channel-messaging": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/fetch": "0.1.0",
- "@rescript-webapi/notification": "0.1.0",
- "@rescript-webapi/push": "0.1.0",
- "@rescript-webapi/web-workers": "0.1.0"
- }
- },
- "@rescript-webapi/storage": {
- "version": "file:packages/Storage",
- "requires": {
- "@rescript-webapi/file": "0.1.0"
- }
- },
- "@rescript-webapi/ui-events": {
- "version": "file:packages/UIEvents",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/dom": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/file": "0.1.0",
- "@rescript-webapi/file-and-directory-entries": "0.1.0"
- }
- },
- "@rescript-webapi/url": {
- "version": "file:packages/URL",
- "requires": {}
- },
- "@rescript-webapi/view-transitions": {
- "version": "file:packages/ViewTransitions",
- "requires": {}
- },
- "@rescript-webapi/visual-viewport": {
- "version": "file:packages/VisualViewport",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/web-audio": {
- "version": "file:packages/WebAudio",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/channel-messaging": "0.1.0",
- "@rescript-webapi/dom": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/media-capture-and-streams": "0.1.0"
- }
- },
- "@rescript-webapi/web-crypto": {
- "version": "file:packages/WebCrypto",
- "requires": {
- "@rescript-webapi/base": "0.1.0"
- }
- },
- "@rescript-webapi/web-locks": {
- "version": "file:packages/WebLocks",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/web-midi": {
- "version": "file:packages/WebMIDI",
- "requires": {
- "@rescript-webapi/base": "0.1.0",
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/web-sockets": {
- "version": "file:packages/WebSockets",
- "requires": {
- "@rescript-webapi/channel-messaging": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/file": "0.1.0"
- }
- },
- "@rescript-webapi/web-speech": {
- "version": "file:packages/WebSpeech",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/web-storage": {
- "version": "file:packages/WebStorage",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/web-vtt": {
- "version": "file:packages/WebVTT",
- "requires": {
- "@rescript-webapi/event": "0.1.0"
- }
- },
- "@rescript-webapi/web-workers": {
- "version": "file:packages/WebWorkers",
- "requires": {
- "@rescript-webapi/channel-messaging": "0.1.0",
- "@rescript-webapi/event": "0.1.0",
- "@rescript-webapi/fetch": "0.1.0",
- "@rescript-webapi/url": "0.1.0"
- }
- },
"@rescript/darwin-arm64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/darwin-arm64/-/darwin-arm64-12.2.0.tgz",
- "integrity": "sha512-xc3K/J7Ujl1vPiFY2009mRf3kWRlUe/VZyJWprseKxlcEtUQv89ter7r6pY+YFbtYvA/fcaEncL9CVGEdattAg==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/darwin-arm64/-/darwin-arm64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-3+uPQvuPoweXQ2MatnADRa6PgXhRI/LtkdWkoy8DFSKN7lhtF3Pg+eVjKxY4x4OCECNvHYWLWBKaiVRa22tocA==",
+ "dev": true,
"optional": true
},
"@rescript/darwin-x64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/darwin-x64/-/darwin-x64-12.2.0.tgz",
- "integrity": "sha512-qqcTvnlSeoKkywLjG7cXfYvKZ1e4Gz2kUKcD6SiqDgCqm8TF+spwlFAiM6sloRUOFsc0bpC/0R0B3yr01FCB1A==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/darwin-x64/-/darwin-x64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-L71KY+BfSgrMYPUEGMDmrtbrqgBnoYJ/2nJZQNhPV0FP9oQ23rHw8pPVO8+/OzHYPr/OklnB5RbaBphzMBnaxg==",
+ "dev": true,
"optional": true
},
"@rescript/linux-arm64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/linux-arm64/-/linux-arm64-12.2.0.tgz",
- "integrity": "sha512-ODmpG3ji+Nj/8d5yvXkeHlfKkmbw1Q4t1iIjVuNwtmFpz7TiEa7n/sQqoYdE+WzbDX3DoJfmJNbp3Ob7qCUoOg==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/linux-arm64/-/linux-arm64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-2sJ4+Ali2PHhNRwIW53jYSuRSbMoioawl1WKAKoH7sQ++1+bIzdMuB3TQpi9oOqTUGlm/5l6bK2Amf8nUiJQ7Q==",
+ "dev": true,
"optional": true
},
"@rescript/linux-x64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/linux-x64/-/linux-x64-12.2.0.tgz",
- "integrity": "sha512-2W9Y9/g19Y4F/subl8yV3T8QBG2oRaP+HciNRcBjptyEdw9LmCKH8+rhWO6sp3E+nZLwoE2IAkwH0WKV3wqlxQ==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/linux-x64/-/linux-x64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-Gbmk44xkW4+1qG5g2iAATwx/Y6fZvGgEGUFZw1wK1sDpn2DKblmXIV3JLcWROgpmQv4Mfp4RHPSzZdmcBdPUoQ==",
+ "dev": true,
"optional": true
},
"@rescript/runtime": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/runtime/-/runtime-12.2.0.tgz",
- "integrity": "sha512-NwfljDRq1rjFPHUaca1nzFz13xsa9ZGkBkLvMhvVgavJT5+A4rMcLu8XAaVTi/oAhO/tlHf9ZDoOTF1AfyAk9Q=="
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/runtime/-/runtime-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-pOGJdN0R3+PeB+tvxqmJB9qWPLTgitHmQY89lBbF3Ddtcbu/aUra9gEeFiX5gXGznEUcS1SVU24Zjr3GBqfy8w==",
+ "dev": true
},
"@rescript/win32-x64": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/@rescript/win32-x64/-/win32-x64-12.2.0.tgz",
- "integrity": "sha512-fhf8CBj3p1lkIXPeNko3mVTKQfXXm4BoxJtR1xAXxUn43wDpd8Lox4w8/EPBbbW6C/YFQW6H7rtpY+2AKuNaDA==",
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/@rescript/win32-x64/-/win32-x64-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-NadOoXUe4ek9ZMdHp1hvfc6U11HAOV4VKczCZuM13MvNM0RsmiFUG6jsSNt37ZQuC3iY6I/v3qeKglVv/LG11g==",
+ "dev": true,
"optional": true
},
"@rollup/pluginutils": {
@@ -12629,16 +12209,17 @@
}
},
"rescript": {
- "version": "12.2.0",
- "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.2.0.tgz",
- "integrity": "sha512-1Jf2cmNhyx5Mj2vwZ4XXPcXvNSjGj9D1jPBUcoqIOqRpLPo1ch2Ta/7eWh23xAHWHK5ow7BCDyYFjvZSjyjLzg==",
- "requires": {
- "@rescript/darwin-arm64": "12.2.0",
- "@rescript/darwin-x64": "12.2.0",
- "@rescript/linux-arm64": "12.2.0",
- "@rescript/linux-x64": "12.2.0",
- "@rescript/runtime": "12.2.0",
- "@rescript/win32-x64": "12.2.0"
+ "version": "13.0.0-alpha.4",
+ "resolved": "https://registry.npmjs.org/rescript/-/rescript-13.0.0-alpha.4.tgz",
+ "integrity": "sha512-bkUiLFWxwwQ2cEjA9j3h0xQSgVk5ZngmhAhoB8oTyGrrzYzWoFaF0IEJhT0ZV0bqc+sen2xJtfqF1V8kyMql/A==",
+ "dev": true,
+ "requires": {
+ "@rescript/darwin-arm64": "13.0.0-alpha.4",
+ "@rescript/darwin-x64": "13.0.0-alpha.4",
+ "@rescript/linux-arm64": "13.0.0-alpha.4",
+ "@rescript/linux-x64": "13.0.0-alpha.4",
+ "@rescript/runtime": "13.0.0-alpha.4",
+ "@rescript/win32-x64": "13.0.0-alpha.4"
}
},
"retext": {
diff --git a/package.json b/package.json
index 785c0a23..f7fae1d7 100644
--- a/package.json
+++ b/package.json
@@ -49,10 +49,10 @@
"oxfmt": "^0.47.0",
"prettier": "^3.8.3",
"prettier-plugin-astro": "^0.14.1",
- "rescript": ">=12.0.0 <13",
+ "rescript": "^13.0.0-alpha.4",
"sharp": "^0.34.0"
},
"peerDependencies": {
- "rescript": ">=12.0.0 <13"
+ "rescript": ">=13"
}
}
diff --git a/rescript.json b/rescript.json
index 965cdcf7..3d07b120 100644
--- a/rescript.json
+++ b/rescript.json
@@ -1,5 +1,96 @@
{
"name": "@rescript/webapi",
+ "features": {
+ "WebAPI.Base": ["WebAPI.Location"],
+ "WebAPI.DOM": [
+ "WebAPI.Base",
+ "WebAPI.CSSFontLoading",
+ "WebAPI.ChannelMessaging",
+ "WebAPI.CSSTypedOM",
+ "WebAPI.DOMException",
+ "WebAPI.DOMStringList",
+ "WebAPI.Event",
+ "WebAPI.File",
+ "WebAPI.FileAndDirectoryEntries",
+ "WebAPI.FileList",
+ "WebAPI.Geometry",
+ "WebAPI.IdleDeadline",
+ "WebAPI.Location",
+ "WebAPI.RemotePlayback",
+ "WebAPI.ScreenOrientation",
+ "WebAPI.VTT",
+ "WebAPI.ViewTransitions",
+ "WebAPI.VisualViewport"
+ ],
+ "WebAPI.Canvas": [
+ "WebAPI.DOM",
+ "WebAPI.Event",
+ "WebAPI.File",
+ "WebAPI.HTML",
+ "WebAPI.MediaCaptureAndStreams"
+ ],
+ "WebAPI.CSSOM": ["WebAPI.DOM", "WebAPI.Event"],
+ "WebAPI.CustomElements": ["WebAPI.DOM"],
+ "WebAPI.Event": ["WebAPI.Base"],
+ "WebAPI.Fetch": ["WebAPI.Event", "WebAPI.File", "WebAPI.URL"],
+ "WebAPI.File": ["WebAPI.Base", "WebAPI.Event"],
+ "WebAPI.FileAndDirectoryEntries": [
+ "WebAPI.Base",
+ "WebAPI.DOMException"
+ ],
+ "WebAPI.FileList": ["WebAPI.File"],
+ "WebAPI.IndexedDB": [
+ "WebAPI.DOMException",
+ "WebAPI.DOMStringList",
+ "WebAPI.Event"
+ ],
+ "WebAPI.Location": ["WebAPI.DOMStringList"],
+ "WebAPI.HTML": ["WebAPI.DOM", "WebAPI.PictureInPicture", "WebAPI.VTT"],
+ "WebAPI.Navigator": [
+ "WebAPI.Base",
+ "WebAPI.Event",
+ "WebAPI.File",
+ "WebAPI.Fetch",
+ "WebAPI.Gamepad",
+ "WebAPI.URL",
+ "WebAPI.MIDI"
+ ],
+ "WebAPI.ScreenOrientation": ["WebAPI.Event"],
+ "WebAPI.SVG": ["WebAPI.DOM", "WebAPI.Geometry"],
+ "WebAPI.Animations": ["WebAPI.DOM", "WebAPI.Event"],
+ "WebAPI.Audio": [
+ "WebAPI.ChannelMessaging",
+ "WebAPI.DOMException",
+ "WebAPI.DOM",
+ "WebAPI.Event",
+ "WebAPI.HTML",
+ "WebAPI.MediaCaptureAndStreams"
+ ],
+ "WebAPI.Locks": ["WebAPI.Event"],
+ "WebAPI.MIDI": ["WebAPI.Event"],
+ "WebAPI.Sockets": [
+ "WebAPI.ChannelMessaging",
+ "WebAPI.Event",
+ "WebAPI.File"
+ ],
+ "WebAPI.Speech": ["WebAPI.Event"],
+ "WebAPI.Storage": ["WebAPI.Event"],
+ "WebAPI.StorageManager": ["WebAPI.File"],
+ "WebAPI.VTT": ["WebAPI.Event"],
+ "WebAPI.Workers": [
+ "WebAPI.ChannelMessaging",
+ "WebAPI.Event",
+ "WebAPI.Fetch"
+ ],
+ "WebAPI.Window": [
+ "WebAPI.ChannelMessaging",
+ "WebAPI.DOM",
+ "WebAPI.Event",
+ "WebAPI.IdleDeadline",
+ "WebAPI.Location"
+ ],
+ "WebAPI.XPath": ["WebAPI.DOM"]
+ },
"sources": [
{
"dir": "src/Base",
@@ -11,18 +102,14 @@
"BaseEncryptedMediaExtensions",
"BaseEvent",
"BaseFile",
- "BaseFileAndDirectoryEntries",
- "DOM"
+ "BaseFileAndDirectoryEntries"
]
},
{
"dir": "src/CSSFontLoading",
"subdirs": true,
"feature": "WebAPI.CSSFontLoading",
- "public": [
- "FontFace",
- "FontFaceSet"
- ]
+ "public": ["FontFace", "FontFaceSet"]
},
{
"dir": "src/Canvas",
@@ -37,8 +124,10 @@
"HTMLCanvasElement",
"ImageBitmap",
"ImageBitmapRenderingContext",
+ "ImageData",
"OffscreenCanvas",
"Path2D",
+ "VideoColorSpace",
"VideoFrame"
]
},
@@ -46,154 +135,87 @@
"dir": "src/ChannelMessaging",
"subdirs": true,
"feature": "WebAPI.ChannelMessaging",
- "public": [
- "MessagePort"
- ]
+ "public": ["MessagePort"]
},
{
"dir": "src/Clipboard",
"subdirs": true,
"feature": "WebAPI.Clipboard",
- "public": [
- "Clipboard",
- "ClipboardItem"
- ]
+ "public": ["Clipboard", "ClipboardItem"]
},
{
"dir": "src/CredentialManagement",
"subdirs": true,
"feature": "WebAPI.CredentialManagement",
- "public": [
- "CredentialsContainer"
- ]
+ "public": ["CredentialsContainer"]
},
{
"dir": "src/DOM",
"subdirs": true,
"feature": "WebAPI.DOM",
"public": [
- "Animation",
- "AnimationEffect",
- "CSSRuleList",
- "CSSStyleDeclaration",
- "CSSStyleSheet",
- "CSSStyleValue",
"CaretPosition",
"CharacterData",
"Comment",
- "CustomElementRegistry",
- "DOMException",
+ "DOM",
"DOMImplementation",
- "DOMMatrix",
- "DOMMatrixReadOnly",
- "DOMPoint",
- "DOMPointReadOnly",
- "DOMRect",
- "DOMRectList",
- "DOMRectReadOnly",
- "DOMStringList",
"DOMTokenList",
"Document",
"DocumentFragment",
- "DocumentTimeline",
- "DomHTMLMediaElement",
"Element",
- "ElementInternals",
- "FileList",
- "HTMLAnchorElement",
- "HTMLAreaElement",
- "HTMLAudioElement",
- "HTMLBRElement",
- "HTMLBaseElement",
- "HTMLBodyElement",
- "HTMLButtonElement",
- "HTMLCollection",
- "HTMLDListElement",
- "HTMLDataElement",
- "HTMLDataListElement",
- "HTMLDialogElement",
- "HTMLDivElement",
- "HTMLElement",
- "HTMLEmbedElement",
- "HTMLFieldSetElement",
- "HTMLFormControlsCollection",
- "HTMLFormElement",
- "HTMLFrameSetElement",
- "HTMLHRElement",
- "HTMLHeadElement",
- "HTMLHeadingElement",
- "HTMLHtmlElement",
- "HTMLIFrameElement",
- "HTMLImageElement",
- "HTMLInputElement",
- "HTMLLIElement",
- "HTMLLabelElement",
- "HTMLLegendElement",
- "HTMLLinkElement",
- "HTMLMapElement",
- "HTMLMenuElement",
- "HTMLMetaElement",
- "HTMLMeterElement",
- "HTMLModElement",
- "HTMLOListElement",
- "HTMLObjectElement",
- "HTMLOptGroupElement",
- "HTMLOptionElement",
- "HTMLOptionsCollection",
- "HTMLOutputElement",
- "HTMLParagraphElement",
- "HTMLPictureElement",
- "HTMLPreElement",
- "HTMLProgressElement",
- "HTMLQuoteElement",
- "HTMLScriptElement",
- "HTMLSelectElement",
- "HTMLSlotElement",
- "HTMLSourceElement",
- "HTMLSpanElement",
- "HTMLStyleElement",
- "HTMLTableCaptionElement",
- "HTMLTableCellElement",
- "HTMLTableElement",
- "HTMLTableRowElement",
- "HTMLTableSectionElement",
- "HTMLTemplateElement",
- "HTMLTextAreaElement",
- "HTMLTimeElement",
- "HTMLTitleElement",
- "HTMLTrackElement",
- "HTMLUListElement",
- "HTMLVideoElement",
- "IdleDeadline",
- "ImageData",
- "Location",
- "MediaList",
- "MediaQueryList",
"NamedNodeMap",
- "Navigator",
"Node",
"NodeFilter",
"NodeIterator",
"NodeList",
"Range",
- "SVGGraphicsElement",
- "SVGLength",
- "ScreenOrientation",
"Selection",
"ShadowRoot",
- "StylePropertyMap",
- "StylePropertyMapReadOnly",
- "StyleSheetList",
"Text",
- "TextTrackList",
- "TimeRanges",
- "TreeWalker",
- "VideoColorSpace",
- "Window",
- "XPathExpression",
- "XPathResult"
+ "TreeWalker"
+ ]
+ },
+ {
+ "dir": "src/DOMException",
+ "subdirs": true,
+ "feature": "WebAPI.DOMException",
+ "public": ["DOMException"]
+ },
+ {
+ "dir": "src/DOMStringList",
+ "subdirs": true,
+ "feature": "WebAPI.DOMStringList",
+ "public": ["DOMStringList"]
+ },
+ {
+ "dir": "src/CSSOM",
+ "subdirs": true,
+ "feature": "WebAPI.CSSOM",
+ "public": [
+ "CSSRuleList",
+ "CSSStyleDeclaration",
+ "CSSStyleSheet",
+ "MediaList",
+ "MediaQueryList",
+ "StyleSheetList"
]
},
+ {
+ "dir": "src/CSSTypedOM",
+ "subdirs": true,
+ "feature": "WebAPI.CSSTypedOM",
+ "public": [
+ "CSSStyleValue",
+ "StylePropertyMap",
+ "StylePropertyMapReadOnly"
+ ]
+ },
+ {
+ "dir": "src/CustomElements",
+ "subdirs": true,
+ "feature": "WebAPI.CustomElements",
+ "public": ["CustomElementRegistry", "ElementInternals"]
+ },
{
"dir": "src/EncryptedMediaExtensions",
"subdirs": true,
@@ -249,6 +271,12 @@
"WritableStreamDefaultController"
]
},
+ {
+ "dir": "src/FileList",
+ "subdirs": true,
+ "feature": "WebAPI.FileList",
+ "public": ["FileList"]
+ },
{
"dir": "src/FileAndDirectoryEntries",
"subdirs": true,
@@ -263,28 +291,119 @@
"dir": "src/Gamepad",
"subdirs": true,
"feature": "WebAPI.Gamepad",
- "public": [
- "GamepadHapticActuator"
- ]
+ "public": ["GamepadHapticActuator"]
},
{
"dir": "src/Geolocation",
"subdirs": true,
"feature": "WebAPI.Geolocation",
+ "public": ["Geolocation", "GeolocationCoordinates", "GeolocationPosition"]
+ },
+ {
+ "dir": "src/Geometry",
+ "subdirs": true,
+ "feature": "WebAPI.Geometry",
"public": [
- "Geolocation",
- "GeolocationCoordinates",
- "GeolocationPosition"
+ "DOMMatrix",
+ "DOMMatrixReadOnly",
+ "DOMPoint",
+ "DOMPointReadOnly",
+ "DOMRect",
+ "DOMRectList",
+ "DOMRectReadOnly"
]
},
{
"dir": "src/History",
"subdirs": true,
"feature": "WebAPI.History",
+ "public": ["History"]
+ },
+ {
+ "dir": "src/IdleDeadline",
+ "subdirs": true,
+ "feature": "WebAPI.IdleDeadline",
+ "public": ["IdleDeadline"]
+ },
+ {
+ "dir": "src/HTML",
+ "subdirs": true,
+ "feature": "WebAPI.HTML",
"public": [
- "History"
+ "DomHTMLMediaElement",
+ "HTMLAnchorElement",
+ "HTMLAreaElement",
+ "HTMLAudioElement",
+ "HTMLBRElement",
+ "HTMLBaseElement",
+ "HTMLBodyElement",
+ "HTMLButtonElement",
+ "HTMLCollection",
+ "HTMLDListElement",
+ "HTMLDataElement",
+ "HTMLDataListElement",
+ "HTMLDialogElement",
+ "HTMLDivElement",
+ "HTMLElement",
+ "HTMLEmbedElement",
+ "HTMLFieldSetElement",
+ "HTMLFormControlsCollection",
+ "HTMLFormElement",
+ "HTMLFrameSetElement",
+ "HTMLHRElement",
+ "HTMLHeadElement",
+ "HTMLHeadingElement",
+ "HTMLHtmlElement",
+ "HTMLIFrameElement",
+ "HTMLImageElement",
+ "HTMLInputElement",
+ "HTMLLIElement",
+ "HTMLLabelElement",
+ "HTMLLegendElement",
+ "HTMLLinkElement",
+ "HTMLMapElement",
+ "HTMLMenuElement",
+ "HTMLMetaElement",
+ "HTMLMeterElement",
+ "HTMLModElement",
+ "HTMLOListElement",
+ "HTMLObjectElement",
+ "HTMLOptGroupElement",
+ "HTMLOptionElement",
+ "HTMLOptionsCollection",
+ "HTMLOutputElement",
+ "HTMLParagraphElement",
+ "HTMLPictureElement",
+ "HTMLPreElement",
+ "HTMLProgressElement",
+ "HTMLQuoteElement",
+ "HTMLScriptElement",
+ "HTMLSelectElement",
+ "HTMLSlotElement",
+ "HTMLSourceElement",
+ "HTMLSpanElement",
+ "HTMLStyleElement",
+ "HTMLTableCaptionElement",
+ "HTMLTableCellElement",
+ "HTMLTableElement",
+ "HTMLTableRowElement",
+ "HTMLTableSectionElement",
+ "HTMLTemplateElement",
+ "HTMLTextAreaElement",
+ "HTMLTimeElement",
+ "HTMLTitleElement",
+ "HTMLTrackElement",
+ "HTMLUListElement",
+ "HTMLVideoElement",
+ "TimeRanges"
]
},
+ {
+ "dir": "src/Location",
+ "subdirs": true,
+ "feature": "WebAPI.Location",
+ "public": ["Location"]
+ },
{
"dir": "src/IndexedDB",
"subdirs": true,
@@ -301,18 +420,13 @@
"dir": "src/IntersectionObserver",
"subdirs": true,
"feature": "WebAPI.IntersectionObserver",
- "public": [
- "IntersectionObserver",
- "IntersectionObserverRoot"
- ]
+ "public": ["IntersectionObserver", "IntersectionObserverRoot"]
},
{
"dir": "src/MediaCapabilities",
"subdirs": true,
"feature": "WebAPI.MediaCapabilities",
- "public": [
- "MediaCapabilities"
- ]
+ "public": ["MediaCapabilities"]
},
{
"dir": "src/MediaCaptureAndStreams",
@@ -329,52 +443,43 @@
"dir": "src/MediaSession",
"subdirs": true,
"feature": "WebAPI.MediaSession",
- "public": [
- "MediaMetadata",
- "MediaSession"
- ]
+ "public": ["MediaMetadata", "MediaSession"]
},
{
"dir": "src/MutationObserver",
"subdirs": true,
"feature": "WebAPI.MutationObserver",
- "public": [
- "MutationObserver"
- ]
+ "public": ["MutationObserver"]
+ },
+ {
+ "dir": "src/Navigator",
+ "subdirs": true,
+ "feature": "WebAPI.Navigator",
+ "public": ["Navigator"]
},
{
"dir": "src/Notification",
"subdirs": true,
"feature": "WebAPI.Notification",
- "public": [
- "Notification"
- ]
+ "public": ["Notification"]
},
{
"dir": "src/Performance",
"subdirs": true,
"feature": "WebAPI.Performance",
- "public": [
- "Performance",
- "PerformanceEntry",
- "PerformanceMark"
- ]
+ "public": ["Performance", "PerformanceEntry", "PerformanceMark"]
},
{
"dir": "src/Permissions",
"subdirs": true,
"feature": "WebAPI.Permissions",
- "public": [
- "Permissions"
- ]
+ "public": ["Permissions"]
},
{
"dir": "src/PictureInPicture",
"subdirs": true,
"feature": "WebAPI.PictureInPicture",
- "public": [
- "PictureInPicture"
- ]
+ "public": ["PictureInPicture"]
},
{
"dir": "src/Push",
@@ -392,26 +497,25 @@
"dir": "src/RemotePlayback",
"subdirs": true,
"feature": "WebAPI.RemotePlayback",
- "public": [
- "RemotePlayback"
- ]
+ "public": ["RemotePlayback"]
},
{
"dir": "src/ResizeObserver",
"subdirs": true,
"feature": "WebAPI.ResizeObserver",
- "public": [
- "ResizeObserver"
- ]
+ "public": ["ResizeObserver"]
+ },
+ {
+ "dir": "src/ScreenOrientation",
+ "subdirs": true,
+ "feature": "WebAPI.ScreenOrientation",
+ "public": ["ScreenOrientation"]
},
{
"dir": "src/ScreenWakeLock",
"subdirs": true,
"feature": "WebAPI.ScreenWakeLock",
- "public": [
- "WakeLock",
- "WakeLockSentinel"
- ]
+ "public": ["WakeLock", "WakeLockSentinel"]
},
{
"dir": "src/ServiceWorker",
@@ -430,10 +534,14 @@
{
"dir": "src/Storage",
"subdirs": true,
- "feature": "WebAPI.Storage",
- "public": [
- "StorageManager"
- ]
+ "feature": "WebAPI.StorageManager",
+ "public": ["StorageManager"]
+ },
+ {
+ "dir": "src/SVG",
+ "subdirs": true,
+ "feature": "WebAPI.SVG",
+ "public": ["SVGGraphicsElement", "SVGLength"]
},
{
"dir": "src/UIEvents",
@@ -460,31 +568,30 @@
"dir": "src/URL",
"subdirs": true,
"feature": "WebAPI.URL",
- "public": [
- "URL",
- "URLSearchParams"
- ]
+ "public": ["URL", "URLSearchParams"]
},
{
"dir": "src/ViewTransitions",
"subdirs": true,
"feature": "WebAPI.ViewTransitions",
- "public": [
- "ViewTransition"
- ]
+ "public": ["ViewTransition"]
},
{
"dir": "src/VisualViewport",
"subdirs": true,
"feature": "WebAPI.VisualViewport",
- "public": [
- "VisualViewport"
- ]
+ "public": ["VisualViewport"]
+ },
+ {
+ "dir": "src/WebAnimations",
+ "subdirs": true,
+ "feature": "WebAPI.Animations",
+ "public": ["Animation", "AnimationEffect", "DocumentTimeline"]
},
{
"dir": "src/WebAudio",
"subdirs": true,
- "feature": "WebAPI.WebAudio",
+ "feature": "WebAPI.Audio",
"public": [
"AnalyserNode",
"AudioBuffer",
@@ -522,75 +629,62 @@
{
"dir": "src/WebCrypto",
"subdirs": true,
- "feature": "WebAPI.WebCrypto",
- "public": [
- "Crypto",
- "SubtleCrypto"
- ]
+ "feature": "WebAPI.Crypto",
+ "public": ["Crypto", "SubtleCrypto"]
},
{
"dir": "src/WebLocks",
"subdirs": true,
- "feature": "WebAPI.WebLocks",
- "public": [
- "LockManager"
- ]
+ "feature": "WebAPI.Locks",
+ "public": ["LockManager"]
},
{
"dir": "src/WebMIDI",
"subdirs": true,
- "feature": "WebAPI.WebMIDI",
- "public": [
- "WebMIDI"
- ]
+ "feature": "WebAPI.MIDI",
+ "public": ["WebMIDI"]
},
{
"dir": "src/WebSockets",
"subdirs": true,
- "feature": "WebAPI.WebSockets",
- "public": [
- "CloseEvent",
- "MessageEvent",
- "WebSocket"
- ]
+ "feature": "WebAPI.Sockets",
+ "public": ["CloseEvent", "MessageEvent", "WebSocket"]
},
{
"dir": "src/WebSpeech",
"subdirs": true,
- "feature": "WebAPI.WebSpeech",
- "public": [
- "SpeechSynthesis",
- "SpeechSynthesisUtterance"
- ]
+ "feature": "WebAPI.Speech",
+ "public": ["SpeechSynthesis", "SpeechSynthesisUtterance"]
},
{
"dir": "src/WebStorage",
"subdirs": true,
- "feature": "WebAPI.WebStorage",
- "public": [
- "Storage",
- "StorageEvent"
- ]
+ "feature": "WebAPI.Storage",
+ "public": ["LocalStorage", "SessionStorage", "Storage", "StorageEvent"]
},
{
"dir": "src/WebVTT",
"subdirs": true,
- "feature": "WebAPI.WebVTT",
- "public": [
- "TextTrack",
- "TextTrackCueList"
- ]
+ "feature": "WebAPI.VTT",
+ "public": ["TextTrack", "TextTrackCueList", "TextTrackList"]
},
{
"dir": "src/WebWorkers",
"subdirs": true,
- "feature": "WebAPI.WebWorkers",
- "public": [
- "CacheStorage",
- "SharedWorker",
- "SharedWorkerScope",
- "Worker"
- ]
+ "feature": "WebAPI.Workers",
+ "public": ["CacheStorage", "SharedWorker", "SharedWorkerScope", "Worker"]
+ },
+ {
+ "dir": "src/Window",
+ "subdirs": true,
+ "feature": "WebAPI.Window",
+ "public": ["Window"]
+ },
+ {
+ "dir": "src/XPath",
+ "subdirs": true,
+ "feature": "WebAPI.XPath",
+ "public": ["XPathExpression", "XPathResult"]
},
{
"dir": "tests",
diff --git a/src/Base/Base.res b/src/Base/Base.res
new file mode 100644
index 00000000..c3f5e49d
--- /dev/null
+++ b/src/Base/Base.res
@@ -0,0 +1,2 @@
+type element = Base__Element.element
+type document = Base__Document.document
diff --git a/src/Base/Base__Document.res b/src/Base/Base__Document.res
new file mode 100644
index 00000000..9384ca80
--- /dev/null
+++ b/src/Base/Base__Document.res
@@ -0,0 +1,329 @@
+@@warning("-30")
+
+type node
+type htmlElement
+type nodeList<'tNode>
+type domImplementation
+type documentType
+type element = Base__Element.element
+
+/**
+The location (WebApiURL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively.
+[See Location on MDN](https://developer.mozilla.org/docs/Web/API/Location)
+TODO: mark as private once mutating fields of private records is allowed
+*/
+@editor.completeFrom(Location)
+type location = Location.t
+type documentReadyState
+type htmlHeadElement
+type htmlCollection<'t>
+type htmlImageElement
+type htmlEmbedElement
+type htmlFormElement
+type htmlScriptElement
+type window
+type documentVisibilityState
+type fragmentDirective
+type documentTimeline
+type styleSheetList
+type cssStyleSheet
+
+/**
+Any web page loaded in the browser and serves as an entry point into the web page's content, which is the WebApiDOM tree.
+[See Document on MDN](https://developer.mozilla.org/docs/Web/API/Document)
+TODO: mark as private once mutating fields of private records is allowed
+*/
+@editor.completeFrom(DOM.Document)
+type rec document = {
+ // Base properties from Nodea
+ /**
+ Returns the type of node.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeType)
+ */
+ nodeType: int,
+ /**
+ Returns a string appropriate for the type of node.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
+ */
+ nodeName: string,
+ /**
+ Returns node's node document's document base URL.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/baseURI)
+ */
+ baseURI: string,
+ /**
+ Returns true if node is connected and false otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isConnected)
+ */
+ isConnected: bool,
+ /**
+ Returns the node document. Returns null for documents.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)
+ */
+ ownerDocument: Null.t,
+ /**
+ Returns the parent.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentNode)
+ */
+ parentNode: Null.t,
+ /**
+ Returns the parent element.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentElement)
+ */
+ parentElement: Null.t,
+ /**
+ Returns the children.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
+ */
+ childNodes: nodeList,
+ /**
+ Returns the first child.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
+ */
+ firstChild: Null.t,
+ /**
+ Returns the last child.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lastChild)
+ */
+ lastChild: Null.t,
+ /**
+ Returns the previous sibling.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)
+ */
+ previousSibling: Null.t,
+ /**
+ Returns the next sibling.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)
+ */
+ nextSibling: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)
+ */
+ mutable nodeValue: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/textContent)
+ */
+ mutable textContent: Null.t,
+ // End base properties from Node
+
+ /**
+ Gets the implementation object of the current document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/implementation)
+ */
+ implementation: domImplementation,
+ /**
+ Sets or gets the URL for the current document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/URL)
+ */
+ @as("URL")
+ url: string,
+ /**
+ Returns document's URL.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/documentURI)
+ */
+ documentURI: string,
+ /**
+ Gets a value that indicates whether standards-compliant mode is switched on for the object.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/compatMode)
+ */
+ compatMode: string,
+ /**
+ Returns document's encoding.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/characterSet)
+ */
+ characterSet: string,
+ /**
+ Returns document's content type.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/contentType)
+ */
+ contentType: string,
+ /**
+ Gets an object representing the document type declaration associated with the current document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/doctype)
+ */
+ doctype: Null.t,
+ /**
+ Gets a reference to the root node of the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/documentElement)
+ */
+ documentElement: htmlElement,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/scrollingElement)
+ */
+ scrollingElement: Null.t,
+ /**
+ Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fullscreenEnabled)
+ */
+ fullscreenEnabled: bool,
+ /**
+ Contains information about the current URL.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/location)
+ */
+ mutable location: location,
+ /**
+ Gets the WebApiURL of the location that referred the user to the current page.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/referrer)
+ */
+ referrer: string,
+ /**
+ Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.
+
+Can be set, to add a new cookie to the element's set of HTTP cookies.
+
+If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/cookie)
+ */
+ mutable cookie: string,
+ /**
+ Gets the date that the page was last modified, if the page supplies one.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/lastModified)
+ */
+ lastModified: string,
+ /**
+ Retrieves a value that indicates the current state of the object.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/readyState)
+ */
+ readyState: documentReadyState,
+ /**
+ Contains the title of the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/title)
+ */
+ mutable title: string,
+ /**
+ Sets or retrieves a value that indicates the reading order of the object.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/dir)
+ */
+ mutable dir: string,
+ /**
+ Specifies the beginning and end of the document body.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/body)
+ */
+ mutable body: htmlElement,
+ /**
+ Returns the head element.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/head)
+ */
+ head: htmlHeadElement,
+ /**
+ Retrieves a collection, in source order, of img objects in the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/images)
+ */
+ images: htmlCollection,
+ /**
+ Retrieves a collection of all embed objects in the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/embeds)
+ */
+ embeds: htmlCollection,
+ /**
+ Return an HTMLCollection of the embed elements in the Document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/plugins)
+ */
+ plugins: htmlCollection,
+ /**
+ Retrieves a collection of all a objects that specify the href property and all area objects in the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/links)
+ */
+ links: htmlCollection,
+ /**
+ Retrieves a collection, in source order, of all form objects in the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/forms)
+ */
+ forms: htmlCollection,
+ /**
+ Retrieves a collection of all script objects in the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/scripts)
+ */
+ scripts: htmlCollection,
+ /**
+ Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.
+
+Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/currentScript)
+ */
+ currentScript: Null.t,
+ /**
+ Returns the Window object of the active document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/defaultView)
+ */
+ defaultView: Null.t,
+ /**
+ Sets or gets a value that indicates whether the document can be edited.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/designMode)
+ */
+ mutable designMode: string,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/hidden)
+ */
+ hidden: bool,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/visibilityState)
+ */
+ visibilityState: documentVisibilityState,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureEnabled)
+ */
+ pictureInPictureEnabled: bool,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fragmentDirective)
+ */
+ fragmentDirective: fragmentDirective,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/timeline)
+ */
+ timeline: documentTimeline,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fonts)
+ */
+ fonts: BaseCSSFontLoading.fontFaceSet,
+ /**
+ Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/styleSheets)
+ */
+ styleSheets: styleSheetList,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets)
+ */
+ mutable adoptedStyleSheets: array,
+ /**
+ Returns document's fullscreen element.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fullscreenElement)
+ */
+ fullscreenElement: Null.t,
+ /**
+ Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document.
+
+For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document.
+
+Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/activeElement)
+ */
+ activeElement: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureElement)
+ */
+ pictureInPictureElement: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/pointerLockElement)
+ */
+ pointerLockElement: Null.t,
+ /**
+ Returns the child elements.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children)
+ */
+ children: htmlCollection,
+ /**
+ Returns the first child that is an element, and null otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild)
+ */
+ firstElementChild: Null.t,
+ /**
+ Returns the last child that is an element, and null otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/lastElementChild)
+ */
+ lastElementChild: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/childElementCount)
+ */
+ childElementCount: int,
+}
diff --git a/src/Base/Base__Element.res b/src/Base/Base__Element.res
new file mode 100644
index 00000000..7a705e55
--- /dev/null
+++ b/src/Base/Base__Element.res
@@ -0,0 +1,385 @@
+@@warning("-30")
+
+type document
+type node
+type htmlElement
+type nodeList<'tNode>
+type domTokenList
+type namedNodeMap
+type shadowRoot
+type htmlCollection<'t>
+type htmlSlotElement
+
+/**
+Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.
+[See Element on MDN](https://developer.mozilla.org/docs/Web/API/Element)
+TODO: mark as private once mutating fields of private records is allowed
+*/
+@editor.completeFrom(DOM.Element)
+type rec element = {
+ // Base properties from Node
+ /**
+ Returns the type of node.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeType)
+ */
+ nodeType: int,
+ /**
+ Returns a string appropriate for the type of node.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
+ */
+ nodeName: string,
+ /**
+ Returns node's node document's document base URL.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/baseURI)
+ */
+ baseURI: string,
+ /**
+ Returns true if node is connected and false otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isConnected)
+ */
+ isConnected: bool,
+ /**
+ Returns the node document. Returns null for documents.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)
+ */
+ ownerDocument: Null.t,
+ /**
+ Returns the parent.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentNode)
+ */
+ parentNode: Null.t,
+ /**
+ Returns the parent element.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentElement)
+ */
+ parentElement: Null.t,
+ /**
+ Returns the children.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
+ */
+ childNodes: nodeList,
+ /**
+ Returns the first child.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
+ */
+ firstChild: Null.t,
+ /**
+ Returns the last child.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lastChild)
+ */
+ lastChild: Null.t,
+ /**
+ Returns the previous sibling.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)
+ */
+ previousSibling: Null.t,
+ /**
+ Returns the next sibling.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)
+ */
+ nextSibling: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)
+ */
+ mutable nodeValue: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/textContent)
+ */
+ mutable textContent: Null.t,
+ // End base properties from Node
+
+ /**
+ Returns the namespace.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/namespaceURI)
+ */
+ namespaceURI: Null.t,
+ /**
+ Returns the namespace prefix.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/prefix)
+ */
+ prefix: Null.t,
+ /**
+ Returns the local name.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/localName)
+ */
+ localName: string,
+ /**
+ Returns the HTML-uppercased qualified name.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/tagName)
+ */
+ tagName: string,
+ /**
+ Returns the value of element's id content attribute. Can be set to change it.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/id)
+ */
+ mutable id: string,
+ /**
+ Returns the value of element's class content attribute. Can be set to change it.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/className)
+ */
+ mutable className: string,
+ /**
+ Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/classList)
+ */
+ classList: domTokenList,
+ /**
+ Returns the value of element's slot content attribute. Can be set to change it.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/slot)
+ */
+ mutable slot: string,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attributes)
+ */
+ attributes: namedNodeMap,
+ /**
+ Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/shadowRoot)
+ */
+ shadowRoot: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/part)
+ */
+ part: domTokenList,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTop)
+ */
+ mutable scrollTop: float,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollLeft)
+ */
+ mutable scrollLeft: float,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollWidth)
+ */
+ scrollWidth: int,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollHeight)
+ */
+ scrollHeight: int,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientTop)
+ */
+ clientTop: int,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientLeft)
+ */
+ clientLeft: int,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientWidth)
+ */
+ clientWidth: int,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientHeight)
+ */
+ clientHeight: int,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/currentCSSZoom)
+ */
+ currentCSSZoom: float,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/innerHTML)
+ */
+ mutable innerHTML: string,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/outerHTML)
+ */
+ mutable outerHTML: string,
+ /**
+ Returns the child elements.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children)
+ */
+ children: htmlCollection,
+ /**
+ Returns the first child that is an element, and null otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild)
+ */
+ firstElementChild: Null.t,
+ /**
+ Returns the last child that is an element, and null otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/lastElementChild)
+ */
+ lastElementChild: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/childElementCount)
+ */
+ childElementCount: int,
+ /**
+ Returns the first preceding sibling that is an element, and null otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/previousElementSibling)
+ */
+ previousElementSibling: Null.t,
+ /**
+ Returns the first following sibling that is an element, and null otherwise.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/nextElementSibling)
+ */
+ nextElementSibling: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/assignedSlot)
+ */
+ assignedSlot: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaAtomic)
+ */
+ mutable ariaAtomic: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaAutoComplete)
+ */
+ mutable ariaAutoComplete: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaBrailleLabel)
+ */
+ mutable ariaBrailleLabel: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaBrailleRoleDescription)
+ */
+ mutable ariaBrailleRoleDescription: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaBusy)
+ */
+ mutable ariaBusy: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaChecked)
+ */
+ mutable ariaChecked: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColCount)
+ */
+ mutable ariaColCount: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndex)
+ */
+ mutable ariaColIndex: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndexText)
+ */
+ mutable ariaColIndexText: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColSpan)
+ */
+ mutable ariaColSpan: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaCurrent)
+ */
+ mutable ariaCurrent: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaDescription)
+ */
+ mutable ariaDescription: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaDisabled)
+ */
+ mutable ariaDisabled: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaExpanded)
+ */
+ mutable ariaExpanded: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaHasPopup)
+ */
+ mutable ariaHasPopup: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaHidden)
+ */
+ mutable ariaHidden: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaKeyShortcuts)
+ */
+ mutable ariaKeyShortcuts: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaLabel)
+ */
+ mutable ariaLabel: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaLevel)
+ */
+ mutable ariaLevel: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaLive)
+ */
+ mutable ariaLive: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaModal)
+ */
+ mutable ariaModal: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiLine)
+ */
+ mutable ariaMultiLine: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiSelectable)
+ */
+ mutable ariaMultiSelectable: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaOrientation)
+ */
+ mutable ariaOrientation: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaPlaceholder)
+ */
+ mutable ariaPlaceholder: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaPosInSet)
+ */
+ mutable ariaPosInSet: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaPressed)
+ */
+ mutable ariaPressed: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaReadOnly)
+ */
+ mutable ariaReadOnly: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRequired)
+ */
+ mutable ariaRequired: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRoleDescription)
+ */
+ mutable ariaRoleDescription: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowCount)
+ */
+ mutable ariaRowCount: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndex)
+ */
+ mutable ariaRowIndex: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndexText)
+ */
+ mutable ariaRowIndexText: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowSpan)
+ */
+ mutable ariaRowSpan: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaSelected)
+ */
+ mutable ariaSelected: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaSetSize)
+ */
+ mutable ariaSetSize: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaSort)
+ */
+ mutable ariaSort: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMax)
+ */
+ mutable ariaValueMax: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMin)
+ */
+ mutable ariaValueMin: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueNow)
+ */
+ mutable ariaValueNow: Null.t,
+ /**
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueText)
+ */
+ mutable ariaValueText: Null.t,
+}
diff --git a/src/DOM/CSSRuleList.res b/src/CSSOM/CSSRuleList.res
similarity index 100%
rename from src/DOM/CSSRuleList.res
rename to src/CSSOM/CSSRuleList.res
diff --git a/src/DOM/CSSStyleDeclaration.res b/src/CSSOM/CSSStyleDeclaration.res
similarity index 100%
rename from src/DOM/CSSStyleDeclaration.res
rename to src/CSSOM/CSSStyleDeclaration.res
diff --git a/src/DOM/CSSStyleSheet.res b/src/CSSOM/CSSStyleSheet.res
similarity index 100%
rename from src/DOM/CSSStyleSheet.res
rename to src/CSSOM/CSSStyleSheet.res
diff --git a/src/DOM/MediaList.res b/src/CSSOM/MediaList.res
similarity index 100%
rename from src/DOM/MediaList.res
rename to src/CSSOM/MediaList.res
diff --git a/src/DOM/MediaQueryList.res b/src/CSSOM/MediaQueryList.res
similarity index 100%
rename from src/DOM/MediaQueryList.res
rename to src/CSSOM/MediaQueryList.res
diff --git a/src/DOM/StyleSheetList.res b/src/CSSOM/StyleSheetList.res
similarity index 100%
rename from src/DOM/StyleSheetList.res
rename to src/CSSOM/StyleSheetList.res
diff --git a/src/DOM/CSSStyleValue.res b/src/CSSTypedOM/CSSStyleValue.res
similarity index 68%
rename from src/DOM/CSSStyleValue.res
rename to src/CSSTypedOM/CSSStyleValue.res
index b2b1c4ce..501564d8 100644
--- a/src/DOM/CSSStyleValue.res
+++ b/src/CSSTypedOM/CSSStyleValue.res
@@ -1,12 +1,14 @@
+@editor.completeFrom(CSSStyleValue)
+type t = private {}
+
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parse_static)
*/
@scope("CSSStyleValue")
-external parse: (~property: string, ~cssText: string) => DomTypes.cssStyleValue = "parse"
+external parse: (~property: string, ~cssText: string) => t = "parse"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parseAll_static)
*/
@scope("CSSStyleValue")
-external parseAll: (~property: string, ~cssText: string) => array =
- "parseAll"
+external parseAll: (~property: string, ~cssText: string) => array = "parseAll"
diff --git a/src/DOM/StylePropertyMap.res b/src/CSSTypedOM/StylePropertyMap.res
similarity index 50%
rename from src/DOM/StylePropertyMap.res
rename to src/CSSTypedOM/StylePropertyMap.res
index b838610d..b95f4bb0 100644
--- a/src/DOM/StylePropertyMap.res
+++ b/src/CSSTypedOM/StylePropertyMap.res
@@ -1,57 +1,53 @@
-external asStylePropertyMapReadOnly: DomTypes.stylePropertyMap => DomTypes.stylePropertyMapReadOnly =
- "%identity"
+@editor.completeFrom(StylePropertyMap)
+type t = private {
+ ...StylePropertyMapReadOnly.t,
+}
+
+external asStylePropertyMapReadOnly: t => StylePropertyMapReadOnly.t = "%identity"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll)
*/
@send
-external getAll: (DomTypes.stylePropertyMap, string) => array = "getAll"
+external getAll: (t, string) => array = "getAll"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has)
*/
@send
-external has: (DomTypes.stylePropertyMap, string) => bool = "has"
+external has: (t, string) => bool = "has"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/set)
*/
@send
-external set: (
- DomTypes.stylePropertyMap,
- ~property: string,
- ~values: DomTypes.cssStyleValue,
-) => unit = "set"
+external set: (t, ~property: string, ~values: CSSStyleValue.t) => unit = "set"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/set)
*/
@send
-external set2: (DomTypes.stylePropertyMap, ~property: string, ~values: string) => unit = "set"
+external set2: (t, ~property: string, ~values: string) => unit = "set"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/append)
*/
@send
-external append: (
- DomTypes.stylePropertyMap,
- ~property: string,
- ~values: DomTypes.cssStyleValue,
-) => unit = "append"
+external append: (t, ~property: string, ~values: CSSStyleValue.t) => unit = "append"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/append)
*/
@send
-external append2: (DomTypes.stylePropertyMap, ~property: string, ~values: string) => unit = "append"
+external append2: (t, ~property: string, ~values: string) => unit = "append"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/delete)
*/
@send
-external delete: (DomTypes.stylePropertyMap, string) => unit = "delete"
+external delete: (t, string) => unit = "delete"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/clear)
*/
@send
-external clear: DomTypes.stylePropertyMap => unit = "clear"
+external clear: t => unit = "clear"
diff --git a/src/DOM/StylePropertyMapReadOnly.res b/src/CSSTypedOM/StylePropertyMapReadOnly.res
similarity index 52%
rename from src/DOM/StylePropertyMapReadOnly.res
rename to src/CSSTypedOM/StylePropertyMapReadOnly.res
index d53efc4e..b35a1367 100644
--- a/src/DOM/StylePropertyMapReadOnly.res
+++ b/src/CSSTypedOM/StylePropertyMapReadOnly.res
@@ -1,12 +1,16 @@
+@editor.completeFrom(StylePropertyMapReadOnly)
+type t = private {
+ size: int,
+}
+
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll)
*/
@send
-external getAll: (DomTypes.stylePropertyMapReadOnly, string) => array =
- "getAll"
+external getAll: (t, string) => array = "getAll"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has)
*/
@send
-external has: (DomTypes.stylePropertyMapReadOnly, string) => bool = "has"
+external has: (t, string) => bool = "has"
diff --git a/src/DOM/ImageData.res b/src/Canvas/ImageData.res
similarity index 100%
rename from src/DOM/ImageData.res
rename to src/Canvas/ImageData.res
diff --git a/src/DOM/VideoColorSpace.res b/src/Canvas/VideoColorSpace.res
similarity index 100%
rename from src/DOM/VideoColorSpace.res
rename to src/Canvas/VideoColorSpace.res
diff --git a/src/Canvas/VideoFrame.res b/src/Canvas/VideoFrame.res
index a9c8475d..75a4d743 100644
--- a/src/Canvas/VideoFrame.res
+++ b/src/Canvas/VideoFrame.res
@@ -196,7 +196,7 @@ external copyTo: (
@send
external copyTo2: (
DomTypes.videoFrame,
- ~destination: ArrayBufferTypedArrayOrDataView.t,
+ ~destination: ArrayBuffer.t,
~options: DomTypes.videoFrameCopyToOptions=?,
) => promise> = "copyTo"
diff --git a/src/Clipboard/Clipboard.res b/src/Clipboard/Clipboard.res
index 7e7135d8..d7a9a806 100644
--- a/src/Clipboard/Clipboard.res
+++ b/src/Clipboard/Clipboard.res
@@ -3,27 +3,26 @@ include EventTarget.Impl({type t = ClipboardTypes.clipboard})
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/read)
*/
-@send
-external read: ClipboardTypes.clipboard => promise> = "read"
+@scope("globalThis.navigator.clipboard")
+external read: unit => promise> = "read"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/readText)
*/
-@send
-external readText: ClipboardTypes.clipboard => promise = "readText"
+@scope("globalThis.navigator.clipboard")
+external readText: unit => promise = "readText"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/write)
*/
-@send
-external write: (ClipboardTypes.clipboard, array) => promise =
- "write"
+@scope("globalThis.navigator.clipboard")
+external write: array => promise = "write"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText)
*/
-@send
-external writeText: (ClipboardTypes.clipboard, string) => promise = "writeText"
+@scope("globalThis.navigator.clipboard")
+external writeText: string => promise = "writeText"
module ClipboardItem = ClipboardItem
module Types = ClipboardTypes
diff --git a/src/CredentialManagement/CredentialManagementTypes.res b/src/CredentialManagement/CredentialManagementTypes.res
index 5fa16f2c..45c0bfdf 100644
--- a/src/CredentialManagement/CredentialManagementTypes.res
+++ b/src/CredentialManagement/CredentialManagementTypes.res
@@ -58,13 +58,13 @@ type credential = {
type publicKeyCredentialDescriptor = {
@as("type") mutable type_: publicKeyCredentialType,
- mutable id: ArrayBufferTypedArrayOrDataView.t,
+ mutable id: ArrayBuffer.t,
mutable transports?: array,
}
type authenticationExtensionsPRFValues = {
- mutable first: ArrayBufferTypedArrayOrDataView.t,
- mutable second?: ArrayBufferTypedArrayOrDataView.t,
+ mutable first: ArrayBuffer.t,
+ mutable second?: ArrayBuffer.t,
}
type authenticationExtensionsPRFInputs = {
@@ -81,7 +81,7 @@ type authenticationExtensionsClientInputs = {
}
type publicKeyCredentialRequestOptions = {
- mutable challenge: ArrayBufferTypedArrayOrDataView.t,
+ mutable challenge: ArrayBuffer.t,
mutable timeout?: int,
mutable rpId?: string,
mutable allowCredentials?: array,
@@ -104,7 +104,7 @@ type publicKeyCredentialRpEntity = {
type publicKeyCredentialUserEntity = {
...publicKeyCredentialEntity,
- mutable id: ArrayBufferTypedArrayOrDataView.t,
+ mutable id: ArrayBuffer.t,
mutable displayName: string,
}
@@ -123,7 +123,7 @@ type authenticatorSelectionCriteria = {
type publicKeyCredentialCreationOptions = {
mutable rp: publicKeyCredentialRpEntity,
mutable user: publicKeyCredentialUserEntity,
- mutable challenge: ArrayBufferTypedArrayOrDataView.t,
+ mutable challenge: ArrayBuffer.t,
mutable pubKeyCredParams: array,
mutable timeout?: int,
mutable excludeCredentials?: array,
diff --git a/src/CredentialManagement/CredentialsContainer.res b/src/CredentialManagement/CredentialsContainer.res
index 5e3405d0..3a5fe95c 100644
--- a/src/CredentialManagement/CredentialsContainer.res
+++ b/src/CredentialManagement/CredentialsContainer.res
@@ -1,33 +1,27 @@
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get)
*/
-@send
+@scope("globalThis.navigator.credentials")
external get: (
- CredentialManagementTypes.credentialsContainer,
~options: CredentialManagementTypes.credentialRequestOptions=?,
) => promise = "get"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store)
*/
-@send
-external store: (
- CredentialManagementTypes.credentialsContainer,
- CredentialManagementTypes.credential,
-) => promise = "store"
+@scope("globalThis.navigator.credentials")
+external store: CredentialManagementTypes.credential => promise = "store"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/create)
*/
-@send
+@scope("globalThis.navigator.credentials")
external create: (
- CredentialManagementTypes.credentialsContainer,
~options: CredentialManagementTypes.credentialCreationOptions=?,
) => promise = "create"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/preventSilentAccess)
*/
-@send
-external preventSilentAccess: CredentialManagementTypes.credentialsContainer => promise =
- "preventSilentAccess"
+@scope("globalThis.navigator.credentials")
+external preventSilentAccess: unit => promise = "preventSilentAccess"
diff --git a/src/DOM/CustomElementRegistry.res b/src/CustomElements/CustomElementRegistry.res
similarity index 58%
rename from src/DOM/CustomElementRegistry.res
rename to src/CustomElements/CustomElementRegistry.res
index eede652d..5af21f98 100644
--- a/src/DOM/CustomElementRegistry.res
+++ b/src/CustomElements/CustomElementRegistry.res
@@ -1,9 +1,8 @@
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define)
*/
-@send
+@scope("globalThis.customElements")
external define: (
- DomTypes.customElementRegistry,
~name: string,
~constructor: DomTypes.htmlElement,
~options: DomTypes.elementDefinitionOptions=?,
@@ -12,21 +11,17 @@ external define: (
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/getName)
*/
-@send
-external getName: (DomTypes.customElementRegistry, DomTypes.customElementConstructor) => string =
- "getName"
+@scope("globalThis.customElements")
+external getName: DomTypes.customElementConstructor => string = "getName"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/whenDefined)
*/
-@send
-external whenDefined: (
- DomTypes.customElementRegistry,
- string,
-) => promise = "whenDefined"
+@scope("globalThis.customElements")
+external whenDefined: string => promise = "whenDefined"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/upgrade)
*/
-@send
-external upgrade: (DomTypes.customElementRegistry, DomTypes.node) => unit = "upgrade"
+@scope("globalThis.customElements")
+external upgrade: DomTypes.node => unit = "upgrade"
diff --git a/src/DOM/ElementInternals.res b/src/CustomElements/ElementInternals.res
similarity index 100%
rename from src/DOM/ElementInternals.res
rename to src/CustomElements/ElementInternals.res
diff --git a/src/Base/DOM.res b/src/DOM/DOM.res
similarity index 88%
rename from src/Base/DOM.res
rename to src/DOM/DOM.res
index 1a954a89..63101dfb 100644
--- a/src/Base/DOM.res
+++ b/src/DOM/DOM.res
@@ -1,31 +1,12 @@
@@warning("-30")
-/**
-An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
-[See DOMException on MDN](https://developer.mozilla.org/docs/Web/API/DOMException)
-*/
-type domException = {
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMException/name)
- */
- name: string,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMException/message)
- */
- message: string,
-}
+type domException = DOMException.t
/**
A type returned by some APIs which contains a list of DOMString (strings).
[See DOMStringList on MDN](https://developer.mozilla.org/docs/Web/API/DOMStringList)
*/
-type domStringList = {
- /**
- Returns the number of strings in strings.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMStringList/length)
- */
- length: int,
-}
+type domStringList = DOMStringList.t
type window
@@ -50,11 +31,7 @@ type documentVisibilityState =
| @as("hidden") Hidden
| @as("visible") Visible
-type orientationType =
- | @as("landscape-primary") LandscapePrimary
- | @as("landscape-secondary") LandscapeSecondary
- | @as("portrait-primary") PortraitPrimary
- | @as("portrait-secondary") PortraitSecondary
+type orientationType = ScreenOrientation.orientationType
type insertPosition =
| @as("afterbegin") Afterbegin
@@ -203,96 +180,8 @@ The location (WebApiURL) of the object it is linked to. Changes done on it are r
[See Location on MDN](https://developer.mozilla.org/docs/Web/API/Location)
TODO: mark as private once mutating fields of private records is allowed
*/
-@editor.completeFrom(DOM.Location)
-type location = {
- /**
- Returns the Location object's URL.
-
-Can be set, to navigate to the given URL.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/href)
- */
- mutable href: string,
- /**
- Returns the Location object's WebApiURL's origin.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/origin)
- */
- origin: string,
- /**
- Returns the Location object's WebApiURL's scheme.
-
-Can be set, to navigate to the same WebApiURL with a changed scheme.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/protocol)
- */
- mutable protocol: string,
- /**
- Returns the Location object's WebApiURL's host and port (if different from the default port for the scheme).
-
-Can be set, to navigate to the same WebApiURL with a changed host and port.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/host)
- */
- mutable host: string,
- /**
- Returns the Location object's WebApiURL's host.
-
-Can be set, to navigate to the same WebApiURL with a changed host.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/hostname)
- */
- mutable hostname: string,
- /**
- Returns the Location object's WebApiURL's port.
-
-Can be set, to navigate to the same WebApiURL with a changed port.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/port)
- */
- mutable port: string,
- /**
- Returns the Location object's WebApiURL's path.
-
-Can be set, to navigate to the same WebApiURL with a changed path.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/pathname)
- */
- mutable pathname: string,
- /**
- Returns the Location object's WebApiURL's query (includes leading "?" if non-empty).
-
-Can be set, to navigate to the same WebApiURL with a changed query (ignores leading "?").
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/search)
- */
- mutable search: string,
- /**
- Returns the Location object's WebApiURL's fragment (includes leading "#" if non-empty).
-
-Can be set, to navigate to the same WebApiURL with a changed fragment (ignores leading "#").
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/hash)
- */
- mutable hash: string,
- /**
- Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing context to the top-level browsing context.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/ancestorOrigins)
- */
- ancestorOrigins: domStringList,
-}
-
-/**
-[See UserActivation on MDN](https://developer.mozilla.org/docs/Web/API/UserActivation)
-*/
-type userActivation = {
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/UserActivation/hasBeenActive)
- */
- hasBeenActive: bool,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/UserActivation/isActive)
- */
- isActive: bool,
-}
-
-/**
-The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities.
-[See Navigator on MDN](https://developer.mozilla.org/docs/Web/API/Navigator)
-*/
-@editor.completeFrom(DOM.Navigator)
-type navigator
+@editor.completeFrom(Location)
+type location = Location.t
// TODO: mark as private once mutating fields of private records is allowed
@editor.completeFrom(DOM.DOMTokenList)
@@ -348,18 +237,7 @@ type barProp = {
[See ScreenOrientation on MDN](https://developer.mozilla.org/docs/Web/API/ScreenOrientation)
*/
@editor.completeFrom(DOM.ScreenOrientation)
-type screenOrientation = private {
- ...BaseEvent.eventTarget,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ScreenOrientation/type)
- */
- @as("type")
- type_: orientationType,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ScreenOrientation/angle)
- */
- angle: int,
-}
+type screenOrientation = ScreenOrientation.t
/**
A screen, usually the one on which the current window is being rendered, and is obtained using window.screen.
@@ -448,20 +326,13 @@ type mediaList = {
[See StylePropertyMapReadOnly on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly)
*/
@editor.completeFrom(DOM.StylePropertyMapReadOnly)
-type stylePropertyMapReadOnly = private {
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/size)
- */
- size: int,
-}
+type stylePropertyMapReadOnly = StylePropertyMapReadOnly.t
/**
[See StylePropertyMap on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap)
*/
@editor.completeFrom(DOM.StylePropertyMap)
-type stylePropertyMap = private {
- ...stylePropertyMapReadOnly,
-}
+type stylePropertyMap = StylePropertyMap.t
/**
Used by the dataset HTML attribute to represent data for custom attributes added to elements.
@@ -2370,402 +2241,36 @@ type rec node = {
Returns the next sibling.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)
*/
- nextSibling: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)
- */
- mutable nodeValue: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/textContent)
- */
- mutable textContent: Null.t,
-}
-
-/**
-NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll().
-[See NodeList on MDN](https://developer.mozilla.org/docs/Web/API/NodeList)
-*/
-@editor.completeFrom(DOM.NodeList) and nodeList<'tNode> = private {
- /**
- Returns the number of nodes in the collection.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeList/length)
- */
- length: int,
-}
-
-/**
-Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.
-[See Element on MDN](https://developer.mozilla.org/docs/Web/API/Element)
-TODO: mark as private once mutating fields of private records is allowed
-*/
-@editor.completeFrom(DOM.Element) and element = {
- // Base properties from Node
- /**
- Returns the type of node.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeType)
- */
- nodeType: int,
- /**
- Returns a string appropriate for the type of node.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
- */
- nodeName: string,
- /**
- Returns node's node document's document base URL.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/baseURI)
- */
- baseURI: string,
- /**
- Returns true if node is connected and false otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isConnected)
- */
- isConnected: bool,
- /**
- Returns the node document. Returns null for documents.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)
- */
- ownerDocument: Null.t,
- /**
- Returns the parent.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentNode)
- */
- parentNode: Null.t,
- /**
- Returns the parent element.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentElement)
- */
- parentElement: Null.t,
- /**
- Returns the children.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
- */
- childNodes: nodeList,
- /**
- Returns the first child.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
- */
- firstChild: Null.t,
- /**
- Returns the last child.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lastChild)
- */
- lastChild: Null.t,
- /**
- Returns the previous sibling.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)
- */
- previousSibling: Null.t,
- /**
- Returns the next sibling.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)
- */
- nextSibling: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)
- */
- mutable nodeValue: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/textContent)
- */
- mutable textContent: Null.t,
- // End base properties from Node
-
- /**
- Returns the namespace.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/namespaceURI)
- */
- namespaceURI: Null.t,
- /**
- Returns the namespace prefix.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/prefix)
- */
- prefix: Null.t,
- /**
- Returns the local name.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/localName)
- */
- localName: string,
- /**
- Returns the HTML-uppercased qualified name.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/tagName)
- */
- tagName: string,
- /**
- Returns the value of element's id content attribute. Can be set to change it.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/id)
- */
- mutable id: string,
- /**
- Returns the value of element's class content attribute. Can be set to change it.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/className)
- */
- mutable className: string,
- /**
- Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/classList)
- */
- classList: domTokenList,
- /**
- Returns the value of element's slot content attribute. Can be set to change it.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/slot)
- */
- mutable slot: string,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attributes)
- */
- attributes: namedNodeMap,
- /**
- Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/shadowRoot)
- */
- shadowRoot: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/part)
- */
- part: domTokenList,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTop)
- */
- mutable scrollTop: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollLeft)
- */
- mutable scrollLeft: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollWidth)
- */
- scrollWidth: int,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollHeight)
- */
- scrollHeight: int,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientTop)
- */
- clientTop: int,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientLeft)
- */
- clientLeft: int,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientWidth)
- */
- clientWidth: int,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/clientHeight)
- */
- clientHeight: int,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/currentCSSZoom)
- */
- currentCSSZoom: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/innerHTML)
- */
- mutable innerHTML: string,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/outerHTML)
- */
- mutable outerHTML: string,
- /**
- Returns the child elements.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children)
- */
- children: htmlCollection,
- /**
- Returns the first child that is an element, and null otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild)
- */
- firstElementChild: Null.t,
- /**
- Returns the last child that is an element, and null otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/lastElementChild)
- */
- lastElementChild: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/childElementCount)
- */
- childElementCount: int,
- /**
- Returns the first preceding sibling that is an element, and null otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/previousElementSibling)
- */
- previousElementSibling: Null.t,
- /**
- Returns the first following sibling that is an element, and null otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/nextElementSibling)
- */
- nextElementSibling: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/assignedSlot)
- */
- assignedSlot: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaAtomic)
- */
- mutable ariaAtomic: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaAutoComplete)
- */
- mutable ariaAutoComplete: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaBrailleLabel)
- */
- mutable ariaBrailleLabel: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaBrailleRoleDescription)
- */
- mutable ariaBrailleRoleDescription: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaBusy)
- */
- mutable ariaBusy: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaChecked)
- */
- mutable ariaChecked: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColCount)
- */
- mutable ariaColCount: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndex)
- */
- mutable ariaColIndex: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColIndexText)
- */
- mutable ariaColIndexText: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaColSpan)
- */
- mutable ariaColSpan: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaCurrent)
- */
- mutable ariaCurrent: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaDescription)
- */
- mutable ariaDescription: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaDisabled)
- */
- mutable ariaDisabled: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaExpanded)
- */
- mutable ariaExpanded: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaHasPopup)
- */
- mutable ariaHasPopup: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaHidden)
- */
- mutable ariaHidden: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaKeyShortcuts)
- */
- mutable ariaKeyShortcuts: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaLabel)
- */
- mutable ariaLabel: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaLevel)
- */
- mutable ariaLevel: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaLive)
- */
- mutable ariaLive: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaModal)
- */
- mutable ariaModal: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiLine)
- */
- mutable ariaMultiLine: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaMultiSelectable)
- */
- mutable ariaMultiSelectable: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaOrientation)
- */
- mutable ariaOrientation: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaPlaceholder)
- */
- mutable ariaPlaceholder: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaPosInSet)
- */
- mutable ariaPosInSet: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaPressed)
- */
- mutable ariaPressed: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaReadOnly)
- */
- mutable ariaReadOnly: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRequired)
- */
- mutable ariaRequired: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRoleDescription)
- */
- mutable ariaRoleDescription: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowCount)
- */
- mutable ariaRowCount: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndex)
- */
- mutable ariaRowIndex: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowIndexText)
- */
- mutable ariaRowIndexText: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaRowSpan)
- */
- mutable ariaRowSpan: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaSelected)
- */
- mutable ariaSelected: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaSetSize)
- */
- mutable ariaSetSize: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaSort)
- */
- mutable ariaSort: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMax)
- */
- mutable ariaValueMax: Null.t,
+ nextSibling: Null.t,
/**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueMin)
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)
*/
- mutable ariaValueMin: Null.t,
+ mutable nodeValue: Null.t,
/**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueNow)
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/textContent)
*/
- mutable ariaValueNow: Null.t,
+ mutable textContent: Null.t,
+}
+
+/**
+NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll().
+[See NodeList on MDN](https://developer.mozilla.org/docs/Web/API/NodeList)
+*/
+@editor.completeFrom(DOM.NodeList) and nodeList<'tNode> = private {
/**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/ariaValueText)
+ Returns the number of nodes in the collection.
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeList/length)
*/
- mutable ariaValueText: Null.t,
+ length: int,
}
+/**
+Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.
+[See Element on MDN](https://developer.mozilla.org/docs/Web/API/Element)
+TODO: mark as private once mutating fields of private records is allowed
+*/
+@editor.completeFrom(DOM.Element) and element = Base.element
+
/**
[See ShadowRoot on MDN](https://developer.mozilla.org/docs/Web/API/ShadowRoot)
TODO: mark as private once mutating fields of private records is allowed
@@ -5541,299 +5046,7 @@ Any web page loaded in the browser and serves as an entry point into the web pag
[See Document on MDN](https://developer.mozilla.org/docs/Web/API/Document)
TODO: mark as private once mutating fields of private records is allowed
*/
-@editor.completeFrom(DOM.Document) and document = {
- // Base properties from Node
- /**
- Returns the type of node.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeType)
- */
- nodeType: int,
- /**
- Returns a string appropriate for the type of node.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
- */
- nodeName: string,
- /**
- Returns node's node document's document base URL.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/baseURI)
- */
- baseURI: string,
- /**
- Returns true if node is connected and false otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isConnected)
- */
- isConnected: bool,
- /**
- Returns the node document. Returns null for documents.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/ownerDocument)
- */
- ownerDocument: Null.t,
- /**
- Returns the parent.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentNode)
- */
- parentNode: Null.t,
- /**
- Returns the parent element.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/parentElement)
- */
- parentElement: Null.t,
- /**
- Returns the children.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
- */
- childNodes: nodeList,
- /**
- Returns the first child.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
- */
- firstChild: Null.t,
- /**
- Returns the last child.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lastChild)
- */
- lastChild: Null.t,
- /**
- Returns the previous sibling.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/previousSibling)
- */
- previousSibling: Null.t,
- /**
- Returns the next sibling.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)
- */
- nextSibling: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/nodeValue)
- */
- mutable nodeValue: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/textContent)
- */
- mutable textContent: Null.t,
- // End base properties from Node
-
- /**
- Gets the implementation object of the current document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/implementation)
- */
- implementation: domImplementation,
- /**
- Sets or gets the URL for the current document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/URL)
- */
- @as("URL")
- url: string,
- /**
- Returns document's URL.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/documentURI)
- */
- documentURI: string,
- /**
- Gets a value that indicates whether standards-compliant mode is switched on for the object.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/compatMode)
- */
- compatMode: string,
- /**
- Returns document's encoding.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/characterSet)
- */
- characterSet: string,
- /**
- Returns document's content type.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/contentType)
- */
- contentType: string,
- /**
- Gets an object representing the document type declaration associated with the current document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/doctype)
- */
- doctype: Null.t,
- /**
- Gets a reference to the root node of the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/documentElement)
- */
- documentElement: htmlElement,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/scrollingElement)
- */
- scrollingElement: Null.t,
- /**
- Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fullscreenEnabled)
- */
- fullscreenEnabled: bool,
- /**
- Contains information about the current URL.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/location)
- */
- mutable location: location,
- /**
- Gets the WebApiURL of the location that referred the user to the current page.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/referrer)
- */
- referrer: string,
- /**
- Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.
-
-Can be set, to add a new cookie to the element's set of HTTP cookies.
-
-If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/cookie)
- */
- mutable cookie: string,
- /**
- Gets the date that the page was last modified, if the page supplies one.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/lastModified)
- */
- lastModified: string,
- /**
- Retrieves a value that indicates the current state of the object.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/readyState)
- */
- readyState: documentReadyState,
- /**
- Contains the title of the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/title)
- */
- mutable title: string,
- /**
- Sets or retrieves a value that indicates the reading order of the object.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/dir)
- */
- mutable dir: string,
- /**
- Specifies the beginning and end of the document body.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/body)
- */
- mutable body: htmlElement,
- /**
- Returns the head element.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/head)
- */
- head: htmlHeadElement,
- /**
- Retrieves a collection, in source order, of img objects in the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/images)
- */
- images: htmlCollection,
- /**
- Retrieves a collection of all embed objects in the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/embeds)
- */
- embeds: htmlCollection,
- /**
- Return an HTMLCollection of the embed elements in the Document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/plugins)
- */
- plugins: htmlCollection,
- /**
- Retrieves a collection of all a objects that specify the href property and all area objects in the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/links)
- */
- links: htmlCollection,
- /**
- Retrieves a collection, in source order, of all form objects in the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/forms)
- */
- forms: htmlCollection,
- /**
- Retrieves a collection of all script objects in the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/scripts)
- */
- scripts: htmlCollection,
- /**
- Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.
-
-Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/currentScript)
- */
- currentScript: Null.t,
- /**
- Returns the Window object of the active document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/defaultView)
- */
- defaultView: Null.t,
- /**
- Sets or gets a value that indicates whether the document can be edited.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/designMode)
- */
- mutable designMode: string,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/hidden)
- */
- hidden: bool,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/visibilityState)
- */
- visibilityState: documentVisibilityState,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureEnabled)
- */
- pictureInPictureEnabled: bool,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fragmentDirective)
- */
- fragmentDirective: fragmentDirective,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/timeline)
- */
- timeline: documentTimeline,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fonts)
- */
- fonts: BaseCSSFontLoading.fontFaceSet,
- /**
- Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/styleSheets)
- */
- styleSheets: styleSheetList,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/adoptedStyleSheets)
- */
- mutable adoptedStyleSheets: array,
- /**
- Returns document's fullscreen element.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/fullscreenElement)
- */
- fullscreenElement: Null.t,
- /**
- Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document.
-
-For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document.
-
-Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/activeElement)
- */
- activeElement: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/pictureInPictureElement)
- */
- pictureInPictureElement: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/pointerLockElement)
- */
- pointerLockElement: Null.t,
- /**
- Returns the child elements.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children)
- */
- children: htmlCollection,
- /**
- Returns the first child that is an element, and null otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild)
- */
- firstElementChild: Null.t,
- /**
- Returns the last child that is an element, and null otherwise.
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/lastElementChild)
- */
- lastElementChild: Null.t,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/childElementCount)
- */
- childElementCount: int,
-}
+@editor.completeFrom(DOM.Document) and document = Base.document
and mutationRecord = {
/**
@@ -6446,50 +5659,15 @@ TODO: mark as private once mutating fields of private records is allowed
[See DOMRectReadOnly on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly)
*/
@editor.completeFrom(DOM.DOMRectReadOnly)
-type domRectReadOnly = private {
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/x)
- */
- x: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/y)
- */
- y: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/width)
- */
- width: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/height)
- */
- height: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/top)
- */
- top: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/right)
- */
- right: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/bottom)
- */
- bottom: float,
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/left)
- */
- left: float,
-}
+type domRectReadOnly = DOMRectReadOnly.t
/**
[See DOMRect on MDN](https://developer.mozilla.org/docs/Web/API/DOMRect)
*/
@editor.completeFrom(DOM.DOMRect)
-type domRect = private {
- ...domRectReadOnly,
-}
+type domRect = DOMRect.t
-@editor.completeFrom(DOM.DOMRectList) type domRectList = private {}
+@editor.completeFrom(DOM.DOMRectList) type domRectList = DOMRectList.t
/**
The validity states that an element can be in, with respect to constraint validation. Together, they help explain why an element's value fails to validate, if it's not valid.
@@ -6983,34 +6161,18 @@ type mediaQueryList = private {
matches: bool,
}
-/**
-[See IdleDeadline on MDN](https://developer.mozilla.org/docs/Web/API/IdleDeadline)
-*/
-@editor.completeFrom(DOM.IdleDeadline)
-type idleDeadline = private {
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IdleDeadline/didTimeout)
- */
- didTimeout: bool,
-}
-
/**
[See CSSStyleValue on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleValue)
*/
@editor.completeFrom(DOM.CSSStyleValue)
-type cssStyleValue = private {}
+type cssStyleValue = CSSStyleValue.t
/**
An object of this type is returned by the files property of the HTML element; this lets you access the list of files selected with the element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage.
[See FileList on MDN](https://developer.mozilla.org/docs/Web/API/FileList)
*/
@editor.completeFrom(DOM.FileList)
-type fileList = private {
- /**
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileList/length)
- */
- length: int,
-}
+type fileList = FileList.t
/**
An error which occurred while handling media in an HTML media element based on HTMLMediaElement, such as