From 03277f76c84dfcc9d1702a5488feb28eda59c2e4 Mon Sep 17 00:00:00 2001 From: tsnobip Date: Fri, 17 Apr 2026 17:49:21 +0200 Subject: [PATCH 01/19] clean types in Prelude --- src/CanvasAPI.res | 3 +-- src/CanvasAPI/FillStyle.res | 10 +++++--- src/ClipboardAPI/ClipboardItem.res | 4 +-- src/CredentialManagementAPI.res | 14 +++++------ src/DOMAPI.res | 14 +++++------ src/DOMAPI/DOMMatrix.res | 7 +++--- src/DOMAPI/DOMMatrixReadOnly.res | 5 ++-- src/DOMAPI/Element.res | 5 ++-- src/DOMAPI/VideoFrame.res | 7 ++++-- src/FetchAPI.res | 9 ++++--- src/FetchAPI/FormDataEntryValue.js | 22 ---------------- src/FetchAPI/FormDataEntryValue.res | 22 ---------------- src/FileAPI.res | 13 +++++----- src/IndexedDBAPI.res | 2 +- src/IndexedDBAPI/IDBIndex.res | 25 +++++++++++-------- src/IndexedDBAPI/IDBObjectStore.res | 21 ++++++++-------- .../IntersectionObserverRoot.res | 8 +++--- src/PerformanceAPI.res | 2 +- src/Prelude.js | 9 ++++++- src/Prelude.res | 14 +++++------ src/ServiceWorkerAPI.res | 3 +-- src/WebAudioAPI.res | 2 +- src/WebCryptoAPI.res | 4 +-- src/WebCryptoAPI/SubtleCrypto.res | 18 ++++++------- src/WebSocketsAPI.res | 3 +-- tests/DOMAPI/HTMLCanvasElement__test.res | 4 ++- tests/DOMAPI/HTMLInputElement__test.res | 5 ++-- tests/FetchAPI/FormData__test.js | 23 ++++++++--------- tests/FetchAPI/FormData__test.res | 23 ++++++++--------- 29 files changed, 131 insertions(+), 170 deletions(-) delete mode 100644 src/FetchAPI/FormDataEntryValue.js delete mode 100644 src/FetchAPI/FormDataEntryValue.res diff --git a/src/CanvasAPI.res b/src/CanvasAPI.res index e1b820e3..134d4a1d 100644 --- a/src/CanvasAPI.res +++ b/src/CanvasAPI.res @@ -1,6 +1,5 @@ @@warning("-30") -open Prelude open EventAPI type offscreenRenderingContextId = @@ -425,7 +424,7 @@ type textMetrics = { ideographicBaseline: float, } -type offscreenRenderingContext = any +type offscreenRenderingContext = unknown type imageEncodeOptions = { @as("type") mutable type_?: string, diff --git a/src/CanvasAPI/FillStyle.res b/src/CanvasAPI/FillStyle.res index cd71c4d7..5bdc4f0e 100644 --- a/src/CanvasAPI/FillStyle.res +++ b/src/CanvasAPI/FillStyle.res @@ -5,6 +5,10 @@ external fromString: string => fillStyle = "%identity" external fromCanvasGradient: canvasGradient => fillStyle = "%identity" external fromCanvasPattern: canvasGradient => fillStyle = "%identity" +external toString: fillStyle => string = "%identity" +external toCanvasGradient: fillStyle => canvasGradient = "%identity" +external toCanvasPattern: fillStyle => canvasPattern = "%identity" + /** Represents a decoded version of the abstract `fillStyle` type, used in Context2D. */ @@ -15,10 +19,10 @@ type decoded = let decode = (t: fillStyle): decoded => { if CanvasGradient.isInstanceOf(t) { - CanvasGradient(unsafeConversation(t)) + CanvasGradient(toCanvasGradient(t)) } else if CanvasPattern.isInstanceOf(t) { - CanvasPattern(unsafeConversation(t)) + CanvasPattern(toCanvasPattern(t)) } else { - String(unsafeConversation(t)) + String(toString(t)) } } diff --git a/src/ClipboardAPI/ClipboardItem.res b/src/ClipboardAPI/ClipboardItem.res index 82dbc31a..9e7a6424 100644 --- a/src/ClipboardAPI/ClipboardItem.res +++ b/src/ClipboardAPI/ClipboardItem.res @@ -1,12 +1,12 @@ open FileAPI open ClipboardAPI -open Prelude /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem) */ @new -external make: (~items: any, ~options: clipboardItemOptions=?) => clipboardItem = "ClipboardItem" +external make: (~items: unknown, ~options: clipboardItemOptions=?) => clipboardItem = + "ClipboardItem" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/getType) diff --git a/src/CredentialManagementAPI.res b/src/CredentialManagementAPI.res index 865d6b2d..ee0787a8 100644 --- a/src/CredentialManagementAPI.res +++ b/src/CredentialManagementAPI.res @@ -61,18 +61,18 @@ type credential = { type publicKeyCredentialDescriptor = { @as("type") mutable type_: publicKeyCredentialType, - mutable id: bufferSource, + mutable id: ArrayBufferTypedArrayOrDataView.t, mutable transports?: array, } type authenticationExtensionsPRFValues = { - mutable first: bufferSource, - mutable second?: bufferSource, + mutable first: ArrayBufferTypedArrayOrDataView.t, + mutable second?: ArrayBufferTypedArrayOrDataView.t, } type authenticationExtensionsPRFInputs = { mutable eval?: authenticationExtensionsPRFValues, - mutable evalByCredential?: any, + mutable evalByCredential?: unknown, } type authenticationExtensionsClientInputs = { @@ -84,7 +84,7 @@ type authenticationExtensionsClientInputs = { } type publicKeyCredentialRequestOptions = { - mutable challenge: bufferSource, + mutable challenge: ArrayBufferTypedArrayOrDataView.t, mutable timeout?: int, mutable rpId?: string, mutable allowCredentials?: array, @@ -107,7 +107,7 @@ type publicKeyCredentialRpEntity = { type publicKeyCredentialUserEntity = { ...publicKeyCredentialEntity, - mutable id: bufferSource, + mutable id: ArrayBufferTypedArrayOrDataView.t, mutable displayName: string, } @@ -126,7 +126,7 @@ type authenticatorSelectionCriteria = { type publicKeyCredentialCreationOptions = { mutable rp: publicKeyCredentialRpEntity, mutable user: publicKeyCredentialUserEntity, - mutable challenge: bufferSource, + mutable challenge: ArrayBufferTypedArrayOrDataView.t, mutable pubKeyCredParams: array, mutable timeout?: int, mutable excludeCredentials?: array, diff --git a/src/DOMAPI.res b/src/DOMAPI.res index 073a1a03..68cd66ea 100644 --- a/src/DOMAPI.res +++ b/src/DOMAPI.res @@ -488,9 +488,9 @@ type vibratePattern = | Int(int) | IntArray(array) -type renderingContext = any +type renderingContext = unknown -type offscreenRenderingContext = any +type offscreenRenderingContext = unknown /** [See AnimationTimeline on MDN](https://developer.mozilla.org/docs/Web/API/AnimationTimeline) @@ -6849,7 +6849,7 @@ type elementInternals = { Returns a NodeList of all the label elements that internals's target element is associated with. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/labels) */ - labels: nodeList, + labels: nodeList, /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/states) */ @@ -8107,7 +8107,7 @@ Can be set, to change the selection. mutable selectedIndex: int, } -type mediaProvider = any +type mediaProvider = unknown /** Adds to HTMLElement the properties and methods needed to support basic media-related capabilities that are common to audio and video. @@ -9842,12 +9842,12 @@ type domPointInit = { mutable w?: float, } -type xPathNSResolver = any +type xPathNSResolver = unknown -type timerHandler = any +type timerHandler = unknown type voidFunction = unit => unit -type imageBitmapSource = any +type imageBitmapSource = unknown type customElementConstructor = htmlElement diff --git a/src/DOMAPI/DOMMatrix.res b/src/DOMAPI/DOMMatrix.res index 6bc3d054..c5a33cf2 100644 --- a/src/DOMAPI/DOMMatrix.res +++ b/src/DOMAPI/DOMMatrix.res @@ -1,5 +1,4 @@ open DOMAPI -open Prelude /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix) @@ -21,7 +20,7 @@ external fromMatrix: (~other: domMatrixInit=?) => domMatrixReadOnly = "fromMatri external fromFloat32Array: array => domMatrixReadOnly = "fromFloat32Array" @scope("DOMMatrix") -external fromFloat64Array: float64Array => domMatrixReadOnly = "fromFloat64Array" +external fromFloat64Array: Float64Array.t => domMatrixReadOnly = "fromFloat64Array" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate) @@ -95,7 +94,7 @@ external transformPoint: (domMatrix, ~point: domPointInit=?) => domPoint = "tran external toFloat32Array: domMatrix => array = "toFloat32Array" @send -external toFloat64Array: domMatrix => float64Array = "toFloat64Array" +external toFloat64Array: domMatrix => Float64Array.t = "toFloat64Array" @send external toJSON: domMatrix => Dict.t = "toJSON" @@ -107,7 +106,7 @@ external fromMatrixD: (~other: domMatrixInit=?) => domMatrix = "fromMatrix" external fromFloat32ArrayD: array => domMatrix = "fromFloat32Array" @scope("DOMMatrix") -external fromFloat64ArrayD: float64Array => domMatrix = "fromFloat64Array" +external fromFloat64ArrayD: Float64Array.t => domMatrix = "fromFloat64Array" @send external multiplySelf: (domMatrix, ~other: domMatrixInit=?) => domMatrix = "multiplySelf" diff --git a/src/DOMAPI/DOMMatrixReadOnly.res b/src/DOMAPI/DOMMatrixReadOnly.res index 4ecc1bbe..2c4d2b65 100644 --- a/src/DOMAPI/DOMMatrixReadOnly.res +++ b/src/DOMAPI/DOMMatrixReadOnly.res @@ -1,5 +1,4 @@ open DOMAPI -open Prelude /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly) @@ -20,7 +19,7 @@ external fromMatrix: (~other: domMatrixInit=?) => domMatrixReadOnly = "fromMatri external fromFloat32Array: array => domMatrixReadOnly = "fromFloat32Array" @scope("DOMMatrixReadOnly") -external fromFloat64Array: float64Array => domMatrixReadOnly = "fromFloat64Array" +external fromFloat64Array: Float64Array.t => domMatrixReadOnly = "fromFloat64Array" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate) @@ -97,7 +96,7 @@ external transformPoint: (domMatrixReadOnly, ~point: domPointInit=?) => domPoint external toFloat32Array: domMatrixReadOnly => array = "toFloat32Array" @send -external toFloat64Array: domMatrixReadOnly => float64Array = "toFloat64Array" +external toFloat64Array: domMatrixReadOnly => Float64Array.t = "toFloat64Array" @send external toJSON: domMatrixReadOnly => Dict.t = "toJSON" diff --git a/src/DOMAPI/Element.res b/src/DOMAPI/Element.res index 179e6132..e9092d77 100644 --- a/src/DOMAPI/Element.res +++ b/src/DOMAPI/Element.res @@ -1,5 +1,4 @@ open DOMAPI -open Prelude module Impl = ( T: { @@ -32,13 +31,13 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) */ @send - external animate: (T.t, ~keyframes: any, ~options: float=?) => animation = "animate" + external animate: (T.t, ~keyframes: unknown, ~options: float=?) => animation = "animate" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) */ @send - external animate2: (T.t, ~keyframes: any, ~options: keyframeAnimationOptions=?) => animation = + external animate2: (T.t, ~keyframes: unknown, ~options: keyframeAnimationOptions=?) => animation = "animate" /** diff --git a/src/DOMAPI/VideoFrame.res b/src/DOMAPI/VideoFrame.res index 5ba36fdb..ae03c36a 100644 --- a/src/DOMAPI/VideoFrame.res +++ b/src/DOMAPI/VideoFrame.res @@ -54,7 +54,10 @@ external make8: (~data: ArrayBuffer.t, ~init: videoFrameBufferInit) => videoFram [Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) */ @new -external make9: (~data: sharedArrayBuffer, ~init: videoFrameBufferInit) => videoFrame = "VideoFrame" +external make9: ( + ~data: ArrayBufferTypedArrayOrDataView.t, + ~init: videoFrameBufferInit, +) => videoFrame = "VideoFrame" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) @@ -84,7 +87,7 @@ external copyTo: ( @send external copyTo2: ( videoFrame, - ~destination: sharedArrayBuffer, + ~destination: ArrayBufferTypedArrayOrDataView.t, ~options: videoFrameCopyToOptions=?, ) => promise> = "copyTo" diff --git a/src/FetchAPI.res b/src/FetchAPI.res index 3e499f52..36bfebc0 100644 --- a/src/FetchAPI.res +++ b/src/FetchAPI.res @@ -1,6 +1,5 @@ @@warning("-30") -open Prelude open EventAPI open FileAPI @@ -216,10 +215,12 @@ type formData = {} @editor.completeFrom(BodyInit) type bodyInit -type requestInfo = any +type requestInfo = unknown -@editor.completeFrom(FormDataEntryValue) -type formDataEntryValue +@editor.completeFrom(FormDataEntryValue) @unboxed +type formDataEntryValue = + | String(string) + | File(file) type requestInit = { /** diff --git a/src/FetchAPI/FormDataEntryValue.js b/src/FetchAPI/FormDataEntryValue.js deleted file mode 100644 index e4da9e84..00000000 --- a/src/FetchAPI/FormDataEntryValue.js +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as File$WebAPI from "../FileAPI/File.js"; - -function decode(t) { - if (File$WebAPI.isInstanceOf(t)) { - return { - TAG: "File", - _0: t - }; - } else { - return { - TAG: "String", - _0: t - }; - } -} - -export { - decode, -} -/* File-WebAPI Not a pure module */ diff --git a/src/FetchAPI/FormDataEntryValue.res b/src/FetchAPI/FormDataEntryValue.res deleted file mode 100644 index d31ac576..00000000 --- a/src/FetchAPI/FormDataEntryValue.res +++ /dev/null @@ -1,22 +0,0 @@ -open Prelude -open FetchAPI -open FileAPI - -external fromString: string => formDataEntryValue = "%identity" -external fromFile: file => formDataEntryValue = "%identity" - -/** -Represents a decoded version of the abstract `formDataEntryValue` type. -A FormData entry value is either a string or a File. -*/ -type decoded = - | String(string) - | File(file) - -let decode = (t: formDataEntryValue): decoded => { - if File.isInstanceOf(t) { - File(unsafeConversation(t)) - } else { - String(unsafeConversation(t)) - } -} diff --git a/src/FileAPI.res b/src/FileAPI.res index aa2cd7a6..84ed8628 100644 --- a/src/FileAPI.res +++ b/src/FileAPI.res @@ -1,6 +1,5 @@ @@warning("-30") -open Prelude open EventAPI type endingType = @@ -126,7 +125,7 @@ type fileSystemFileHandle = { */ @editor.completeFrom(FileSystemWritableFileStream) type fileSystemWritableFileStream = { - ...writableStream, + ...writableStream, } @unboxed @@ -136,15 +135,15 @@ type blobPart = // | ArrayBuffer(ArrayBuffer.t) // | TypedArray(TypedArray.t) -type queuingStrategy<'t> = any +type queuingStrategy<'t> = unknown -type underlyingSink<'t> = any +type underlyingSink<'t> = unknown -type readableStreamReader<'t> = any +type readableStreamReader<'t> = unknown -type writableStreamDefaultWriter<'t> = any +type writableStreamDefaultWriter<'t> = unknown -type fileSystemWriteChunkType = any +type fileSystemWriteChunkType = unknown type underlyingSourceCancelCallback = JSON.t => promise diff --git a/src/IndexedDBAPI.res b/src/IndexedDBAPI.res index bbc58409..bd669b07 100644 --- a/src/IndexedDBAPI.res +++ b/src/IndexedDBAPI.res @@ -190,7 +190,7 @@ type idbIndex = { unique: bool, } -type idbValidKey = any +type idbValidKey = unknown type idbDatabaseInfo = { mutable name?: string, diff --git a/src/IndexedDBAPI/IDBIndex.res b/src/IndexedDBAPI/IDBIndex.res index 4eefef20..21a6d8e0 100644 --- a/src/IndexedDBAPI/IDBIndex.res +++ b/src/IndexedDBAPI/IDBIndex.res @@ -1,5 +1,4 @@ open IndexedDBAPI -open Prelude /** Retrieves the value of the first record matching the given key or key range in query. @@ -8,7 +7,7 @@ If successful, request's result will be the value, or undefined if there was no [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBIndex/get) */ @send -external get: (idbIndex, any) => idbRequest = "get" +external get: (idbIndex, unknown) => idbRequest = "get" /** Retrieves the key of the first record matching the given key or key range in query. @@ -17,7 +16,7 @@ If successful, request's result will be the key, or undefined if there was no ma [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBIndex/getKey) */ @send -external getKey: (idbIndex, any) => idbRequest = "getKey" +external getKey: (idbIndex, unknown) => idbRequest = "getKey" /** Retrieves the values of the records matching the given key or key range in query (up to count if given). @@ -26,7 +25,8 @@ If successful, request's result will be an Array of the values. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBIndex/getAll) */ @send -external getAll: (idbIndex, ~query: any=?, ~count: int=?) => idbRequest> = "getAll" +external getAll: (idbIndex, ~query: unknown=?, ~count: int=?) => idbRequest> = + "getAll" /** Retrieves the keys of records matching the given key or key range in query (up to count if given). @@ -35,8 +35,11 @@ If successful, request's result will be an Array of the keys. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBIndex/getAllKeys) */ @send -external getAllKeys: (idbIndex, ~query: any=?, ~count: int=?) => idbRequest> = - "getAllKeys" +external getAllKeys: ( + idbIndex, + ~query: unknown=?, + ~count: int=?, +) => idbRequest> = "getAllKeys" /** Retrieves the number of records matching the given key or key range in query. @@ -45,7 +48,7 @@ If successful, request's result will be the count. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBIndex/count) */ @send -external count: (idbIndex, ~query: any=?) => idbRequest = "count" +external count: (idbIndex, ~query: unknown=?) => idbRequest = "count" /** Opens a cursor over the records matching query, ordered by direction. If query is null, all records in index are matched. @@ -56,9 +59,9 @@ If successful, request's result will be an IDBCursorWithValue, or null if there @send external openCursor: ( idbIndex, - ~query: any=?, + ~query: unknown=?, ~direction: idbCursorDirection=?, -) => idbRequest = "openCursor" +) => idbRequest = "openCursor" /** Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched. @@ -69,6 +72,6 @@ If successful, request's result will be an IDBCursor, or null if there were no m @send external openKeyCursor: ( idbIndex, - ~query: any=?, + ~query: unknown=?, ~direction: idbCursorDirection=?, -) => idbRequest = "openKeyCursor" +) => idbRequest = "openKeyCursor" diff --git a/src/IndexedDBAPI/IDBObjectStore.res b/src/IndexedDBAPI/IDBObjectStore.res index 79515d89..f2637aec 100644 --- a/src/IndexedDBAPI/IDBObjectStore.res +++ b/src/IndexedDBAPI/IDBObjectStore.res @@ -1,5 +1,4 @@ open IndexedDBAPI -open Prelude /** Adds or updates a record in store with the given value and key. @@ -36,7 +35,7 @@ If successful, request's result will be undefined. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/delete) */ @send -external delete: (idbObjectStore, any) => idbRequest = "delete" +external delete: (idbObjectStore, unknown) => idbRequest = "delete" /** Deletes all records in store. @@ -54,7 +53,7 @@ If successful, request's result will be the value, or undefined if there was no [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/get) */ @send -external get: (idbObjectStore, any) => idbRequest = "get" +external get: (idbObjectStore, unknown) => idbRequest = "get" /** Retrieves the key of the first record matching the given key or key range in query. @@ -63,7 +62,7 @@ If successful, request's result will be the key, or undefined if there was no ma [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getKey) */ @send -external getKey: (idbObjectStore, any) => idbRequest = "getKey" +external getKey: (idbObjectStore, unknown) => idbRequest = "getKey" /** Retrieves the values of the records matching the given key or key range in query (up to count if given). @@ -72,7 +71,7 @@ If successful, request's result will be an Array of the values. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/getAll) */ @send -external getAll: (idbObjectStore, ~query: any=?, ~count: int=?) => idbRequest> = +external getAll: (idbObjectStore, ~query: unknown=?, ~count: int=?) => idbRequest> = "getAll" /** @@ -84,7 +83,7 @@ If successful, request's result will be an Array of the keys. @send external getAllKeys: ( idbObjectStore, - ~query: any=?, + ~query: unknown=?, ~count: int=?, ) => idbRequest> = "getAllKeys" @@ -95,7 +94,7 @@ If successful, request's result will be the count. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/count) */ @send -external count: (idbObjectStore, ~query: any=?) => idbRequest = "count" +external count: (idbObjectStore, ~query: unknown=?) => idbRequest = "count" /** Opens a cursor over the records matching query, ordered by direction. If query is null, all records in store are matched. @@ -106,9 +105,9 @@ If successful, request's result will be an IDBCursorWithValue pointing at the fi @send external openCursor: ( idbObjectStore, - ~query: any=?, + ~query: unknown=?, ~direction: idbCursorDirection=?, -) => idbRequest = "openCursor" +) => idbRequest = "openCursor" /** Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched. @@ -119,9 +118,9 @@ If successful, request's result will be an IDBCursor pointing at the first match @send external openKeyCursor: ( idbObjectStore, - ~query: any=?, + ~query: unknown=?, ~direction: idbCursorDirection=?, -) => idbRequest = "openKeyCursor" +) => idbRequest = "openKeyCursor" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBObjectStore/index) diff --git a/src/IntersectionObserverAPI/IntersectionObserverRoot.res b/src/IntersectionObserverAPI/IntersectionObserverRoot.res index 7bb8c752..3f0be416 100644 --- a/src/IntersectionObserverAPI/IntersectionObserverRoot.res +++ b/src/IntersectionObserverAPI/IntersectionObserverRoot.res @@ -5,17 +5,19 @@ external fromDocument: document => root = "%identity" external fromElement: element => root = "%identity" external fromNull: root = "null" +external toElement: root => element = "%identity" +external toDocument: root => document = "%identity" + type decoded = | Element(element) | Document(document) | Null let decode = (t: root): decoded => { - open Prelude if Element.isInstanceOf(t) { - Element(t->unsafeConversation) + Element(t->toElement) } else if Document.isInstanceOf(t) { - Document(t->unsafeConversation) + Document(t->toDocument) } else { Null } diff --git a/src/PerformanceAPI.res b/src/PerformanceAPI.res index f942b9d0..fa1b0876 100644 --- a/src/PerformanceAPI.res +++ b/src/PerformanceAPI.res @@ -74,7 +74,7 @@ type performanceMeasure = { detail: JSON.t, } -type performanceEntryList = any +type performanceEntryList = unknown type performanceMarkOptions = { mutable detail?: JSON.t, diff --git a/src/Prelude.js b/src/Prelude.js index d856702b..e78c81c8 100644 --- a/src/Prelude.js +++ b/src/Prelude.js @@ -1,2 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ + + +let ArrayBufferTypedArrayOrDataView = {}; + +export { + ArrayBufferTypedArrayOrDataView, +} +/* No side effect */ diff --git a/src/Prelude.res b/src/Prelude.res index fbc617f9..6efd85a5 100644 --- a/src/Prelude.res +++ b/src/Prelude.res @@ -1,13 +1,11 @@ @@warning("-30") -type any = {} -external unsafeConversation: 'tinput => 'toutput = "%identity" - -type bufferSource = any - -type sharedArrayBuffer = any - -type float64Array = any +module ArrayBufferTypedArrayOrDataView = { + type t + external fromArrayBuffer: ArrayBuffer.t => t = "%identity" + external fromTypedArray: TypedArray.t<'t> => t = "%identity" + external fromDataView: DataView.t => t = "%identity" +} /** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. diff --git a/src/ServiceWorkerAPI.res b/src/ServiceWorkerAPI.res index af1e5a83..252b49eb 100644 --- a/src/ServiceWorkerAPI.res +++ b/src/ServiceWorkerAPI.res @@ -1,6 +1,5 @@ @@warning("-30") -open Prelude open EventAPI open PushAPI open WebWorkersAPI @@ -110,7 +109,7 @@ type registrationOptions = { mutable updateViaCache?: serviceWorkerUpdateViaCache, } -type requestInfo = any +type requestInfo = unknown /** The Clients interface provides access to Client objects. Access it via self.clients within a service worker. diff --git a/src/WebAudioAPI.res b/src/WebAudioAPI.res index 8fe75a9d..6d97943b 100644 --- a/src/WebAudioAPI.res +++ b/src/WebAudioAPI.res @@ -1269,7 +1269,7 @@ type audioWorkletNodeOptions = { mutable numberOfInputs?: int, mutable numberOfOutputs?: int, mutable outputChannelCount?: array, - mutable parameterData?: any, + mutable parameterData?: unknown, mutable processorOptions?: Dict.t, } diff --git a/src/WebCryptoAPI.res b/src/WebCryptoAPI.res index 5b341c70..1aef951a 100644 --- a/src/WebCryptoAPI.res +++ b/src/WebCryptoAPI.res @@ -1,7 +1,5 @@ @@warning("-30") -open Prelude - type keyType = | @as("private") Private | @as("public") Public @@ -68,6 +66,6 @@ type cryptoKey = { usages: array, } -type algorithmIdentifier = any +type algorithmIdentifier = unknown type algorithm = {mutable name: string} diff --git a/src/WebCryptoAPI/SubtleCrypto.res b/src/WebCryptoAPI/SubtleCrypto.res index 6cd6fac0..a15fb5a0 100644 --- a/src/WebCryptoAPI/SubtleCrypto.res +++ b/src/WebCryptoAPI/SubtleCrypto.res @@ -9,7 +9,7 @@ external encrypt: ( subtleCrypto, ~algorithm: algorithmIdentifier, ~key: cryptoKey, - ~data: bufferSource, + ~data: ArrayBufferTypedArrayOrDataView.t, ) => promise = "encrypt" /** @@ -20,7 +20,7 @@ external decrypt: ( subtleCrypto, ~algorithm: algorithmIdentifier, ~key: cryptoKey, - ~data: bufferSource, + ~data: ArrayBufferTypedArrayOrDataView.t, ) => promise = "decrypt" /** @@ -31,7 +31,7 @@ external sign: ( subtleCrypto, ~algorithm: algorithmIdentifier, ~key: cryptoKey, - ~data: bufferSource, + ~data: ArrayBufferTypedArrayOrDataView.t, ) => promise = "sign" /** @@ -42,8 +42,8 @@ external verify: ( subtleCrypto, ~algorithm: algorithmIdentifier, ~key: cryptoKey, - ~signature: bufferSource, - ~data: bufferSource, + ~signature: ArrayBufferTypedArrayOrDataView.t, + ~data: ArrayBufferTypedArrayOrDataView.t, ) => promise = "verify" /** @@ -53,7 +53,7 @@ external verify: ( external digest: ( subtleCrypto, ~algorithm: algorithmIdentifier, - ~data: bufferSource, + ~data: ArrayBufferTypedArrayOrDataView.t, ) => promise = "digest" /** @@ -119,8 +119,8 @@ external deriveBits2: ( @send external importKey: ( subtleCrypto, - ~format: any, - ~keyData: bufferSource, + ~format: unknown, + ~keyData: ArrayBufferTypedArrayOrDataView.t, ~algorithm: algorithmIdentifier, ~extractable: bool, ~keyUsages: array, @@ -164,7 +164,7 @@ external wrapKey2: ( external unwrapKey: ( subtleCrypto, ~format: keyFormat, - ~wrappedKey: bufferSource, + ~wrappedKey: ArrayBufferTypedArrayOrDataView.t, ~unwrappingKey: cryptoKey, ~unwrapAlgorithm: algorithmIdentifier, ~unwrappedKeyAlgorithm: algorithmIdentifier, diff --git a/src/WebSocketsAPI.res b/src/WebSocketsAPI.res index 1ce792c2..b1db9d80 100644 --- a/src/WebSocketsAPI.res +++ b/src/WebSocketsAPI.res @@ -1,6 +1,5 @@ @@warning("-30") -open Prelude open EventAPI open ChannelMessagingAPI @@ -8,7 +7,7 @@ type binaryType = | @as("arraybuffer") Arraybuffer | @as("blob") Blob -type messageEventSource = any +type messageEventSource = unknown /** Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. diff --git a/tests/DOMAPI/HTMLCanvasElement__test.res b/tests/DOMAPI/HTMLCanvasElement__test.res index 75522a30..69452696 100644 --- a/tests/DOMAPI/HTMLCanvasElement__test.res +++ b/tests/DOMAPI/HTMLCanvasElement__test.res @@ -1,7 +1,9 @@ open WebAPI.Global +external toHTMLCanvasElement: null => DOMAPI.htmlCanvasElement = "%identity" + let myCanvas: DOMAPI.htmlCanvasElement = - document->Document.getElementById("myCanvas")->Prelude.unsafeConversation + document->Document.getElementById("myCanvas")->toHTMLCanvasElement let ctx = myCanvas->HTMLCanvasElement.getContext2D ctx.fillStyle = FillStyle.fromString("red") diff --git a/tests/DOMAPI/HTMLInputElement__test.res b/tests/DOMAPI/HTMLInputElement__test.res index 899e49e2..ef3dd285 100644 --- a/tests/DOMAPI/HTMLInputElement__test.res +++ b/tests/DOMAPI/HTMLInputElement__test.res @@ -1,5 +1,6 @@ open Global -let input: DOMAPI.htmlInputElement = - document->Document.createElement("input")->Prelude.unsafeConversation +external toHTMLInputElement: DOMAPI.element => DOMAPI.htmlInputElement = "%identity" + +let input: DOMAPI.htmlInputElement = document->Document.createElement("input")->toHTMLInputElement let value = input.value diff --git a/tests/FetchAPI/FormData__test.js b/tests/FetchAPI/FormData__test.js index a407aba6..7655fc9a 100644 --- a/tests/FetchAPI/FormData__test.js +++ b/tests/FetchAPI/FormData__test.js @@ -1,17 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as FormDataEntryValue$WebAPI from "../../src/FetchAPI/FormDataEntryValue.js"; let formData = new FormData(document.forms.myForm); let phoneEntry = formData.get("phone"); if (phoneEntry !== null) { - let value = FormDataEntryValue$WebAPI.decode(phoneEntry); - if (value.TAG === "String") { - console.log(`Phone: ` + value._0); + if (typeof phoneEntry === "string") { + console.log(`Phone: ` + phoneEntry); } else { - console.log(`Unexpected file: ` + value._0.name); + console.log(`Unexpected file: ` + phoneEntry.name); } } else { console.log("No phone field"); @@ -20,12 +18,11 @@ if (phoneEntry !== null) { let allImages = formData.getAll("images"); allImages.forEach(entry => { - let value = FormDataEntryValue$WebAPI.decode(entry); - if (value.TAG === "String") { - console.log(`String value: ` + value._0); + if (typeof entry === "string") { + console.log(`String value: ` + entry); return; } - console.log(`File: ` + value._0.name); + console.log(`File: ` + entry.name); }); let fileEntry = new File([], "test.txt"); @@ -33,13 +30,13 @@ let fileEntry = new File([], "test.txt"); let entries = formData.entries(); entries.forEach(param => { + let value = param[1]; let key = param[0]; - let s = FormDataEntryValue$WebAPI.decode(param[1]); - if (s.TAG === "String") { - console.log(key + `: ` + s._0); + if (typeof value === "string") { + console.log(key + `: ` + value); return; } - console.log(key + `: [File] ` + s._0.name); + console.log(key + `: [File] ` + value.name); }); let stringEntry = "test value"; diff --git a/tests/FetchAPI/FormData__test.res b/tests/FetchAPI/FormData__test.res index 6a5cb28e..5412aa42 100644 --- a/tests/FetchAPI/FormData__test.res +++ b/tests/FetchAPI/FormData__test.res @@ -10,11 +10,8 @@ let phoneEntry: null = formData->FormData.get("phon // Decode the entry to handle both string and File cases let _ = switch phoneEntry->Null.toOption { | None => Console.log("No phone field") -| Some(entry) => - switch entry->FormDataEntryValue.decode { - | FormDataEntryValue.String(value) => Console.log(`Phone: ${value}`) - | FormDataEntryValue.File(file) => Console.log(`Unexpected file: ${file.name}`) - } +| Some(String(value)) => Console.log(`Phone: ${value}`) +| Some(File(file)) => Console.log(`Unexpected file: ${file.name}`) } // Get all values for a field (useful for multi-select or multiple file inputs) @@ -22,21 +19,21 @@ let allImages: array = formData->FormData.getAll("i // Process all entries let _ = allImages->Array.forEach(entry => { - switch entry->FormDataEntryValue.decode { - | FormDataEntryValue.String(value) => Console.log(`String value: ${value}`) - | FormDataEntryValue.File(file) => Console.log(`File: ${file.name}`) + switch entry { + | String(value) => Console.log(`String value: ${value}`) + | File(file) => Console.log(`File: ${file.name}`) } }) // Create formDataEntryValue from string or file -let stringEntry = FormDataEntryValue.fromString("test value") -let fileEntry = FormDataEntryValue.fromFile(File.make(~fileBits=[], ~fileName="test.txt")) +let stringEntry = FetchAPI.String("test value") +let fileEntry = FetchAPI.File(File.make(~fileBits=[], ~fileName="test.txt")) // Iterate over all entries in the FormData let entries: Iterator.t<(string, FetchAPI.formDataEntryValue)> = formData->FormData.entries let _ = entries->Iterator.forEach(((key, value)) => { - switch value->FormDataEntryValue.decode { - | FormDataEntryValue.String(s) => Console.log(`${key}: ${s}`) - | FormDataEntryValue.File(f) => Console.log(`${key}: [File] ${f.name}`) + switch value { + | String(s) => Console.log(`${key}: ${s}`) + | File(f) => Console.log(`${key}: [File] ${f.name}`) } }) From bcba34ddc9f44a5347969156faee5196b9411708 Mon Sep 17 00:00:00 2001 From: tsnobip Date: Sat, 18 Apr 2026 16:07:46 +0200 Subject: [PATCH 02/19] split into subpackages --- .gitignore | 3 + package-lock.json | 1266 +++++++-- package.json | 11 +- packages/.DS_Store | Bin 0 -> 6148 bytes packages/CSSFontLoading/package.json | 23 + packages/CSSFontLoading/rescript.json | 19 + .../CSSFontLoading/src}/FontFace.js | 0 .../CSSFontLoading/src}/FontFace.res | 14 +- packages/CSSFontLoading/src/FontFaceSet.js | 7 + .../CSSFontLoading/src}/FontFaceSet.res | 14 +- .../CSSFontLoading/src/Types.js | 0 .../CSSFontLoading/src/Types.res | 18 +- packages/Canvas/lib/rescript.lock | 1 + packages/Canvas/package.json | 27 + packages/Canvas/rescript.json | 22 + .../Canvas/src}/CanvasGradient.js | 0 .../Canvas/src}/CanvasGradient.res | 4 +- .../Canvas/src}/CanvasPattern.js | 0 .../Canvas/src}/CanvasPattern.res | 5 +- .../Canvas/src}/CanvasRenderingContext2D.js | 0 .../Canvas/src}/CanvasRenderingContext2D.res | 265 +- .../Canvas/src}/FillStyle.js | 8 +- packages/Canvas/src/FillStyle.res | 25 + {src => packages/Canvas/src}/Global.js | 0 packages/Canvas/src/Global.res | 179 ++ packages/Canvas/src/HTMLCanvasElement.js | 7 + .../Canvas/src}/HTMLCanvasElement.res | 44 +- .../Canvas/src}/ImageBitmap.js | 0 .../Canvas/src}/ImageBitmap.res | 4 +- .../src}/ImageBitmapRenderingContext.js | 0 .../src}/ImageBitmapRenderingContext.res | 4 +- packages/Canvas/src/OffscreenCanvas.js | 7 + .../Canvas/src}/OffscreenCanvas.res | 33 +- .../Canvas/src}/Path2D.js | 0 .../Canvas/src}/Path2D.res | 33 +- .../Canvas/src/Types.js | 0 .../Canvas/src/Types.res | 4 +- .../Canvas/src}/VideoFrame.js | 0 packages/Canvas/src/VideoFrame.res | 140 + packages/ChannelMessaging/package.json | 23 + packages/ChannelMessaging/rescript.json | 18 + packages/ChannelMessaging/src/MessagePort.js | 7 + .../ChannelMessaging/src}/MessagePort.res | 14 +- .../ChannelMessaging/src/Types.js | 0 .../ChannelMessaging/src/Types.res | 4 +- packages/Clipboard/package.json | 24 + packages/Clipboard/rescript.json | 19 + packages/Clipboard/src/Clipboard.js | 7 + .../Clipboard/src}/Clipboard.res | 12 +- .../Clipboard/src}/ClipboardItem.js | 0 .../Clipboard/src}/ClipboardItem.res | 7 +- .../Clipboard/src/Types.js | 0 .../Clipboard/src/Types.res | 4 +- packages/CredentialManagement/package.json | 24 + packages/CredentialManagement/rescript.json | 19 + .../src}/CredentialsContainer.js | 0 .../src}/CredentialsContainer.res | 14 +- .../CredentialManagement/src/Types.js | 0 .../CredentialManagement/src/Types.res | 19 +- packages/DOM/lib/rescript.lock | 1 + packages/DOM/package.json | 52 + packages/DOM/rescript.json | 47 + packages/DOM/src/.DS_Store | Bin 0 -> 6148 bytes packages/DOM/src/Animation.js | 7 + .../DOMAPI => packages/DOM/src}/Animation.res | 22 +- .../DOM/src}/AnimationEffect.js | 0 .../DOM/src}/AnimationEffect.res | 8 +- .../DOM/src}/CSSRuleList.js | 0 .../DOM/src}/CSSRuleList.res | 4 +- .../DOM/src}/CSSStyleDeclaration.js | 0 .../DOM/src}/CSSStyleDeclaration.res | 12 +- .../DOM/src}/CSSStyleSheet.js | 0 packages/DOM/src/CSSStyleSheet.res | 30 + .../DOM/src}/CSSStyleValue.js | 0 .../DOM/src}/CSSStyleValue.res | 6 +- .../DOM/src}/CaretPosition.js | 0 packages/DOM/src/CaretPosition.res | 2 + .../DOM/src}/CharacterData.js | 6 +- .../DOM/src}/CharacterData.res | 12 +- packages/DOM/src/Comment.js | 7 + packages/DOM/src/Comment.res | 7 + .../DOM/src}/CustomElementRegistry.js | 0 .../DOM/src}/CustomElementRegistry.res | 19 +- .../DOM/src}/DOMImplementation.js | 0 .../DOM/src}/DOMImplementation.res | 14 +- {src/DOMAPI => packages/DOM/src}/DOMMatrix.js | 0 packages/DOM/src/DOMMatrix.res | 166 ++ .../DOM/src}/DOMMatrixReadOnly.js | 0 packages/DOM/src/DOMMatrixReadOnly.res | 100 + {src/DOMAPI => packages/DOM/src}/DOMPoint.js | 0 {src/DOMAPI => packages/DOM/src}/DOMPoint.res | 14 +- .../DOM/src}/DOMPointReadOnly.js | 0 .../DOM/src}/DOMPointReadOnly.res | 10 +- {src/DOMAPI => packages/DOM/src}/DOMRect.js | 0 {src/DOMAPI => packages/DOM/src}/DOMRect.res | 12 +- .../DOM/src}/DOMRectList.js | 0 packages/DOM/src/DOMRectList.res | 2 + .../DOM/src}/DOMRectReadOnly.js | 0 .../DOM/src}/DOMRectReadOnly.res | 8 +- .../DOM/src}/DOMTokenList.js | 0 .../DOM/src}/DOMTokenList.res | 16 +- {src/DOMAPI => packages/DOM/src}/Document.js | 4 +- {src/DOMAPI => packages/DOM/src}/Document.res | 150 +- .../DOM/src}/DocumentFragment.js | 6 +- .../DOM/src}/DocumentFragment.res | 20 +- .../DOM/src}/DocumentTimeline.js | 0 packages/DOM/src/DocumentTimeline.res | 7 + {src/DOMAPI => packages/DOM/src}/Element.js | 6 +- {src/DOMAPI => packages/DOM/src}/Element.res | 78 +- .../DOM/src}/ElementInternals.js | 0 .../DOM/src}/ElementInternals.res | 14 +- {src/DOMAPI => packages/DOM/src}/FileList.js | 0 {src/DOMAPI => packages/DOM/src}/FileList.res | 5 +- src/DOMAPI.js => packages/DOM/src/Global.js | 0 {src => packages/DOM/src}/Global.res | 334 +-- packages/DOM/src/HTMLAnchorElement.js | 7 + packages/DOM/src/HTMLAnchorElement.res | 1 + packages/DOM/src/HTMLAreaElement.js | 7 + packages/DOM/src/HTMLAreaElement.res | 1 + packages/DOM/src/HTMLAudioElement.js | 7 + packages/DOM/src/HTMLAudioElement.res | 1 + packages/DOM/src/HTMLBRElement.js | 7 + packages/DOM/src/HTMLBRElement.res | 1 + packages/DOM/src/HTMLBaseElement.js | 7 + packages/DOM/src/HTMLBaseElement.res | 1 + packages/DOM/src/HTMLBodyElement.js | 7 + packages/DOM/src/HTMLBodyElement.res | 1 + packages/DOM/src/HTMLButtonElement.js | 7 + .../DOM/src}/HTMLButtonElement.res | 10 +- .../DOM/src}/HTMLCollection.js | 0 .../DOM/src}/HTMLCollection.res | 6 +- packages/DOM/src/HTMLDListElement.js | 7 + packages/DOM/src/HTMLDListElement.res | 1 + packages/DOM/src/HTMLDataElement.js | 7 + packages/DOM/src/HTMLDataElement.res | 1 + packages/DOM/src/HTMLDataListElement.js | 7 + packages/DOM/src/HTMLDataListElement.res | 1 + packages/DOM/src/HTMLDialogElement.js | 7 + .../DOM/src}/HTMLDialogElement.res | 10 +- packages/DOM/src/HTMLDivElement.js | 7 + packages/DOM/src/HTMLDivElement.res | 1 + .../DOM/src}/HTMLElement.js | 6 +- .../DOM/src}/HTMLElement.res | 10 +- packages/DOM/src/HTMLEmbedElement.js | 7 + packages/DOM/src/HTMLEmbedElement.res | 4 + packages/DOM/src/HTMLFieldSetElement.js | 7 + .../DOM/src}/HTMLFieldSetElement.res | 10 +- .../DOM/src}/HTMLFormControlsCollection.js | 0 .../DOM/src}/HTMLFormControlsCollection.res | 8 +- packages/DOM/src/HTMLFormElement.js | 7 + .../DOM/src}/HTMLFormElement.res | 14 +- packages/DOM/src/HTMLFrameSetElement.js | 7 + packages/DOM/src/HTMLFrameSetElement.res | 1 + packages/DOM/src/HTMLHRElement.js | 7 + packages/DOM/src/HTMLHRElement.res | 1 + packages/DOM/src/HTMLHeadElement.js | 7 + packages/DOM/src/HTMLHeadElement.res | 1 + packages/DOM/src/HTMLHeadingElement.js | 7 + packages/DOM/src/HTMLHeadingElement.res | 1 + packages/DOM/src/HTMLHtmlElement.js | 7 + packages/DOM/src/HTMLHtmlElement.res | 1 + packages/DOM/src/HTMLIFrameElement.js | 7 + packages/DOM/src/HTMLIFrameElement.res | 4 + packages/DOM/src/HTMLImageElement.js | 7 + packages/DOM/src/HTMLImageElement.res | 7 + packages/DOM/src/HTMLInputElement.js | 7 + .../DOM/src}/HTMLInputElement.res | 26 +- packages/DOM/src/HTMLLIElement.js | 7 + packages/DOM/src/HTMLLIElement.res | 1 + packages/DOM/src/HTMLLabelElement.js | 7 + packages/DOM/src/HTMLLabelElement.res | 1 + packages/DOM/src/HTMLLegendElement.js | 7 + packages/DOM/src/HTMLLegendElement.res | 1 + packages/DOM/src/HTMLLinkElement.js | 7 + packages/DOM/src/HTMLLinkElement.res | 1 + packages/DOM/src/HTMLMapElement.js | 7 + packages/DOM/src/HTMLMapElement.res | 1 + packages/DOM/src/HTMLMediaElement.js | 15 + .../DOM/src}/HTMLMediaElement.res | 22 +- packages/DOM/src/HTMLMenuElement.js | 7 + packages/DOM/src/HTMLMenuElement.res | 1 + packages/DOM/src/HTMLMetaElement.js | 7 + packages/DOM/src/HTMLMetaElement.res | 1 + packages/DOM/src/HTMLMeterElement.js | 7 + packages/DOM/src/HTMLMeterElement.res | 1 + packages/DOM/src/HTMLModElement.js | 7 + packages/DOM/src/HTMLModElement.res | 1 + packages/DOM/src/HTMLOListElement.js | 7 + packages/DOM/src/HTMLOListElement.res | 1 + packages/DOM/src/HTMLObjectElement.js | 7 + .../DOM/src}/HTMLObjectElement.res | 12 +- packages/DOM/src/HTMLOptGroupElement.js | 7 + packages/DOM/src/HTMLOptGroupElement.res | 1 + packages/DOM/src/HTMLOptionElement.js | 7 + packages/DOM/src/HTMLOptionElement.res | 1 + .../DOM/src}/HTMLOptionsCollection.js | 0 .../DOM/src}/HTMLOptionsCollection.res | 8 +- packages/DOM/src/HTMLOutputElement.js | 7 + .../DOM/src}/HTMLOutputElement.res | 10 +- packages/DOM/src/HTMLParagraphElement.js | 7 + packages/DOM/src/HTMLParagraphElement.res | 1 + packages/DOM/src/HTMLPictureElement.js | 7 + packages/DOM/src/HTMLPictureElement.res | 1 + packages/DOM/src/HTMLPreElement.js | 7 + packages/DOM/src/HTMLPreElement.res | 1 + packages/DOM/src/HTMLProgressElement.js | 7 + packages/DOM/src/HTMLProgressElement.res | 1 + packages/DOM/src/HTMLQuoteElement.js | 7 + packages/DOM/src/HTMLQuoteElement.res | 1 + packages/DOM/src/HTMLScriptElement.js | 7 + .../DOM/src}/HTMLScriptElement.res | 4 +- packages/DOM/src/HTMLSelectElement.js | 7 + .../DOM/src}/HTMLSelectElement.res | 22 +- packages/DOM/src/HTMLSlotElement.js | 7 + .../DOM/src}/HTMLSlotElement.res | 12 +- packages/DOM/src/HTMLSourceElement.js | 7 + packages/DOM/src/HTMLSourceElement.res | 1 + packages/DOM/src/HTMLSpanElement.js | 7 + packages/DOM/src/HTMLSpanElement.res | 1 + packages/DOM/src/HTMLStyleElement.js | 7 + packages/DOM/src/HTMLStyleElement.res | 1 + packages/DOM/src/HTMLTableCaptionElement.js | 7 + packages/DOM/src/HTMLTableCaptionElement.res | 1 + packages/DOM/src/HTMLTableCellElement.js | 7 + packages/DOM/src/HTMLTableCellElement.res | 1 + packages/DOM/src/HTMLTableElement.js | 7 + .../DOM/src}/HTMLTableElement.res | 22 +- packages/DOM/src/HTMLTableRowElement.js | 7 + .../DOM/src}/HTMLTableRowElement.res | 8 +- packages/DOM/src/HTMLTableSectionElement.js | 7 + .../DOM/src}/HTMLTableSectionElement.res | 8 +- packages/DOM/src/HTMLTemplateElement.js | 7 + packages/DOM/src/HTMLTemplateElement.res | 1 + packages/DOM/src/HTMLTextAreaElement.js | 7 + .../DOM/src}/HTMLTextAreaElement.res | 20 +- packages/DOM/src/HTMLTimeElement.js | 7 + packages/DOM/src/HTMLTimeElement.res | 1 + packages/DOM/src/HTMLTitleElement.js | 7 + packages/DOM/src/HTMLTitleElement.res | 1 + packages/DOM/src/HTMLTrackElement.js | 7 + packages/DOM/src/HTMLTrackElement.res | 1 + packages/DOM/src/HTMLUListElement.js | 7 + packages/DOM/src/HTMLUListElement.res | 1 + packages/DOM/src/HTMLVideoElement.js | 7 + packages/DOM/src/HTMLVideoElement.res | 32 + .../DOM/src}/IdleDeadline.js | 0 .../DOM/src}/IdleDeadline.res | 4 +- {src/DOMAPI => packages/DOM/src}/ImageData.js | 0 .../DOMAPI => packages/DOM/src}/ImageData.res | 8 +- {src/DOMAPI => packages/DOM/src}/Location.js | 0 {src/DOMAPI => packages/DOM/src}/Location.res | 8 +- {src/DOMAPI => packages/DOM/src}/MediaList.js | 0 .../DOMAPI => packages/DOM/src}/MediaList.res | 8 +- packages/DOM/src/MediaQueryList.js | 7 + packages/DOM/src/MediaQueryList.res | 1 + .../DOM/src}/NamedNodeMap.js | 0 .../DOM/src}/NamedNodeMap.res | 26 +- {src/DOMAPI => packages/DOM/src}/Navigator.js | 0 packages/DOM/src/Navigator.res | 0 packages/DOM/src/Node.js | 15 + {src/DOMAPI => packages/DOM/src}/Node.res | 22 +- .../DOMAPI => packages/DOM/src}/NodeFilter.js | 0 packages/DOM/src/NodeFilter.res | 2 + .../DOM/src}/NodeIterator.js | 0 .../DOM/src}/NodeIterator.res | 6 +- {src/DOMAPI => packages/DOM/src}/NodeList.js | 0 {src/DOMAPI => packages/DOM/src}/NodeList.res | 4 +- {src/DOMAPI => packages/DOM/src}/Range.js | 0 {src/DOMAPI => packages/DOM/src}/Range.res | 53 +- .../DOM/src}/SVGGraphicsElement.js | 4 +- packages/DOM/src/SVGGraphicsElement.res | 15 + {src/DOMAPI => packages/DOM/src}/SVGLength.js | 0 .../DOMAPI => packages/DOM/src}/SVGLength.res | 6 +- packages/DOM/src/ScreenOrientation.js | 7 + packages/DOM/src/ScreenOrientation.res | 7 + {src/DOMAPI => packages/DOM/src}/Selection.js | 0 .../DOMAPI => packages/DOM/src}/Selection.res | 36 +- packages/DOM/src/ShadowRoot.js | 7 + packages/DOM/src/ShadowRoot.res | 19 + .../DOM/src}/StylePropertyMap.js | 0 packages/DOM/src/StylePropertyMap.res | 54 + .../DOM/src}/StylePropertyMapReadOnly.js | 0 .../DOM/src}/StylePropertyMapReadOnly.res | 6 +- .../DOM/src}/StyleSheetList.js | 0 .../DOM/src}/StyleSheetList.res | 4 +- packages/DOM/src/Text.js | 7 + {src/DOMAPI => packages/DOM/src}/Text.res | 8 +- packages/DOM/src/TextTrackList.js | 7 + packages/DOM/src/TextTrackList.res | 7 + .../DOMAPI => packages/DOM/src}/TimeRanges.js | 0 .../DOM/src}/TimeRanges.res | 6 +- .../DOMAPI => packages/DOM/src}/TreeWalker.js | 0 .../DOM/src}/TreeWalker.res | 16 +- .../DOM/src/Types.js | 0 packages/DOM/src/Types.res | 2079 ++++++++++++++ .../DOM/src/VideoColorSpace.js | 0 .../DOM/src}/VideoColorSpace.res | 6 +- packages/DOM/src/Window.js | 7 + packages/DOM/src/Window.res | 282 ++ .../DOM/src/XPathExpression.js | 0 .../DOM/src}/XPathExpression.res | 10 +- .../DOM/src/XPathResult.js | 0 .../DOM/src}/XPathResult.res | 6 +- .../EncryptedMediaExtensions/package.json | 25 + .../EncryptedMediaExtensions/rescript.json | 20 + .../src/HTMLMediaElement.js | 0 .../src/HTMLMediaElement.res | 11 + .../src/MediaKeySession.js | 7 + .../src}/MediaKeySession.res | 18 +- .../src/MediaKeyStatusMap.js | 0 .../src}/MediaKeyStatusMap.res | 6 +- .../src/MediaKeySystemAccess.js | 0 .../src}/MediaKeySystemAccess.res | 6 +- .../EncryptedMediaExtensions/src/MediaKeys.js | 0 .../src}/MediaKeys.res | 10 +- .../EncryptedMediaExtensions/src/Navigator.js | 0 .../src/Navigator.res | 9 + .../EncryptedMediaExtensions/src/Types.js | 0 .../EncryptedMediaExtensions/src/Types.res | 4 +- packages/Event/package.json | 23 + packages/Event/rescript.json | 19 + .../Event/src/AbortController.js | 0 .../Event/src}/AbortController.res | 6 +- packages/Event/src/AbortSignal.js | 7 + .../Event/src}/AbortSignal.res | 12 +- {src/EventAPI => packages/Event/src}/Event.js | 0 .../EventAPI => packages/Event/src}/Event.res | 10 +- .../Event/src}/EventTarget.js | 0 .../Event/src}/EventTarget.res | 30 +- .../Event/src}/ExtendableEvent.js | 6 +- .../Event/src}/ExtendableEvent.res | 6 +- .../Event/src/Types.js | 0 .../Event/src/Types.res | 2 +- packages/Fetch/lib/rescript.lock | 1 + packages/Fetch/package.json | 26 + packages/Fetch/rescript.json | 21 + .../Fetch/src/BodyInit.js | 0 .../Fetch/src}/BodyInit.res | 22 +- .../Fetch/src/FormData.js | 0 .../Fetch/src}/FormData.res | 26 +- .../Fetch/src/Global.js | 0 packages/Fetch/src/Global.res | 11 + .../Fetch/src/Headers.js | 0 .../Fetch/src}/Headers.res | 22 +- .../Fetch/src/HeadersInit.js | 0 .../Fetch/src}/HeadersInit.res | 8 +- .../Fetch/src/Navigator.js | 0 packages/Fetch/src/Navigator.res | 54 + .../Fetch/src/Request.js | 0 .../Fetch/src}/Request.res | 21 +- .../Fetch/src/Response.js | 0 .../Fetch/src}/Response.res | 44 +- .../Fetch/src/Types.js | 0 .../Fetch/src/Types.res | 13 +- .../Fetch/src}/URLSearchParams.js | 0 packages/File/package.json | 23 + packages/File/rescript.json | 19 + {src/FileAPI => packages/File/src}/Blob.js | 0 {src/FileAPI => packages/File/src}/Blob.res | 12 +- {src/FileAPI => packages/File/src}/File.js | 4 +- {src/FileAPI => packages/File/src}/File.res | 10 +- .../File/src/FileSystemDirectoryHandle.js | 0 .../File/src}/FileSystemDirectoryHandle.res | 24 +- .../File/src/FileSystemFileHandle.js | 0 packages/File/src/FileSystemFileHandle.res | 21 + .../File/src/FileSystemHandle.js | 0 packages/File/src/FileSystemHandle.res | 5 + .../File/src/FileSystemWritableFileStream.js | 0 .../src}/FileSystemWritableFileStream.res | 24 +- .../File/src/ReadableStream.js | 0 .../File/src}/ReadableStream.res | 28 +- .../File/src/Types.js | 0 .../File/src/Types.res | 12 +- .../File/src/WritableStream.js | 0 .../File/src}/WritableStream.res | 14 +- .../src/WritableStreamDefaultController.js | 0 .../src}/WritableStreamDefaultController.res | 4 +- packages/FileAndDirectoryEntries/package.json | 23 + .../FileAndDirectoryEntries/rescript.json | 18 + .../src/FileSystemDirectoryEntry.js | 0 .../src/FileSystemDirectoryEntry.res | 40 + .../src/FileSystemDirectoryReader.js | 0 .../src}/FileSystemDirectoryReader.res | 8 +- .../src/FileSystemEntry.js | 0 .../src}/FileSystemEntry.res | 8 +- .../FileAndDirectoryEntries/src/Types.js | 0 .../FileAndDirectoryEntries/src/Types.res | 35 + packages/Gamepad/package.json | 23 + packages/Gamepad/rescript.json | 18 + .../Gamepad/src/GamepadHapticActuator.js | 0 .../Gamepad/src/GamepadHapticActuator.res | 15 + .../Gamepad/src/Navigator.js | 0 packages/Gamepad/src/Navigator.res | 5 + .../Gamepad/src/Types.js | 0 .../Gamepad/src/Types.res | 0 packages/Geolocation/package.json | 21 + packages/Geolocation/rescript.json | 16 + .../Geolocation/src/Geolocation.js | 0 .../Geolocation/src}/Geolocation.res | 20 +- .../Geolocation/src/GeolocationCoordinates.js | 0 .../src}/GeolocationCoordinates.res | 4 +- .../Geolocation/src/GeolocationPosition.js | 0 .../Geolocation/src}/GeolocationPosition.res | 4 +- .../Geolocation/src/Types.js | 0 .../Geolocation/src/Types.res | 0 packages/Globals/package.json | 21 + packages/Globals/rescript.json | 15 + .../Globals/src/Global.js | 0 packages/Globals/src/Global.res | 1 + packages/History/package.json | 21 + packages/History/rescript.json | 16 + .../History/src/History.js | 0 .../History/src}/History.res | 12 +- .../History/src/Types.js | 0 .../History/src/Types.res | 0 packages/IndexedDB/package.json | 24 + packages/IndexedDB/rescript.json | 19 + packages/IndexedDB/src/IDBDatabase.js | 7 + .../IndexedDB/src}/IDBDatabase.res | 30 +- .../IndexedDB/src/IDBFactory.js | 0 .../IndexedDB/src}/IDBFactory.res | 10 +- .../IndexedDB/src/IDBIndex.js | 0 .../IndexedDB/src}/IDBIndex.res | 26 +- .../IndexedDB/src/IDBObjectStore.js | 0 .../IndexedDB/src}/IDBObjectStore.res | 50 +- packages/IndexedDB/src/IDBTransaction.js | 7 + .../IndexedDB/src}/IDBTransaction.res | 10 +- .../IndexedDB/src/Types.js | 0 .../IndexedDB/src/Types.res | 21 +- packages/IntersectionObserver/package.json | 23 + packages/IntersectionObserver/rescript.json | 18 + .../src/IntersectionObserver.js | 0 .../src}/IntersectionObserver.res | 17 +- .../src/IntersectionObserverRoot.js | 25 + .../src/IntersectionObserverRoot.res | 21 + .../IntersectionObserver/src/Types.js | 0 .../IntersectionObserver/src/Types.res | 10 +- packages/MediaCapabilities/package.json | 21 + packages/MediaCapabilities/rescript.json | 16 + .../src/MediaCapabilities.js | 0 .../src}/MediaCapabilities.res | 14 +- .../MediaCapabilities/src/Types.js | 0 .../MediaCapabilities/src/Types.res | 0 packages/MediaCaptureAndStreams/package.json | 23 + packages/MediaCaptureAndStreams/rescript.json | 18 + .../src/MediaDeviceInfo.js | 0 .../src}/MediaDeviceInfo.res | 4 +- .../src/MediaDevices.js | 7 + .../src}/MediaDevices.res | 20 +- .../MediaCaptureAndStreams/src/MediaStream.js | 7 + .../src}/MediaStream.res | 24 +- .../src/MediaStreamTrack.js | 7 + .../src}/MediaStreamTrack.res | 18 +- .../MediaCaptureAndStreams/src/Types.js | 0 .../MediaCaptureAndStreams/src/Types.res | 8 +- packages/MediaSession/package.json | 21 + packages/MediaSession/rescript.json | 16 + .../MediaSession/src/MediaMetadata.js | 0 packages/MediaSession/src/MediaMetadata.res | 5 + .../MediaSession/src/MediaSession.js | 0 .../MediaSession/src}/MediaSession.res | 10 +- .../MediaSession/src/Types.js | 0 .../MediaSession/src/Types.res | 0 packages/MutationObserver/package.json | 23 + packages/MutationObserver/rescript.json | 19 + .../MutationObserver/src/MutationObserver.js | 0 .../src}/MutationObserver.res | 16 +- .../MutationObserver/src/Types.js | 0 .../MutationObserver/src/Types.res | 4 +- packages/Notification/package.json | 23 + packages/Notification/rescript.json | 18 + packages/Notification/src/Notification.js | 7 + .../Notification/src}/Notification.res | 14 +- .../Notification/src/Types.js | 0 .../Notification/src/Types.res | 6 +- packages/Performance/package.json | 23 + packages/Performance/rescript.json | 18 + packages/Performance/src/Performance.js | 7 + .../Performance/src}/Performance.res | 38 +- .../Performance/src/PerformanceEntry.js | 0 .../Performance/src}/PerformanceEntry.res | 4 +- .../Performance/src/PerformanceMark.js | 0 packages/Performance/src/PerformanceMark.res | 13 + .../Performance/src/Types.js | 0 .../Performance/src/Types.res | 5 +- packages/Permissions/package.json | 23 + packages/Permissions/rescript.json | 18 + .../Permissions/src/Permissions.js | 0 packages/Permissions/src/Permissions.res | 5 + .../Permissions/src/Types.js | 0 .../Permissions/src/Types.res | 4 +- packages/PictureInPicture/package.json | 23 + packages/PictureInPicture/rescript.json | 18 + .../PictureInPicture/src/Types.js | 0 .../PictureInPicture/src/Types.res | 4 +- packages/Prelude/lib/rescript.lock | 1 + packages/Prelude/package.json | 21 + packages/Prelude/rescript.json | 16 + .../Prelude/src/DOMException.js | 0 packages/Prelude/src/DOMException.res | 5 + .../Prelude/src/DOMStringList.js | 0 .../Prelude/src}/DOMStringList.res | 6 +- {src => packages/Prelude/src}/Prelude.js | 0 packages/Prelude/src/Types.js | 9 + .../Prelude/src/Types.res | 2385 ++--------------- packages/Push/package.json | 23 + packages/Push/rescript.json | 18 + .../Push/src/ApplicationServerKey.js | 0 packages/Push/src/ApplicationServerKey.res | 2 + packages/Push/src/PushEvent.js | 7 + packages/Push/src/PushEvent.res | 1 + .../Push/src/PushManager.js | 0 .../Push/src}/PushManager.res | 16 +- .../Push/src/PushMessageData.js | 0 .../Push/src}/PushMessageData.res | 6 +- .../Push/src/PushSubscription.js | 0 .../Push/src}/PushSubscription.res | 8 +- .../Push/src/Types.js | 0 .../Push/src/Types.res | 4 +- packages/RemotePlayback/package.json | 23 + packages/RemotePlayback/rescript.json | 18 + packages/RemotePlayback/src/RemotePlayback.js | 7 + .../RemotePlayback/src}/RemotePlayback.res | 10 +- .../RemotePlayback/src/Types.js | 0 .../RemotePlayback/src/Types.res | 4 +- packages/ResizeObserver/package.json | 23 + packages/ResizeObserver/rescript.json | 18 + .../ResizeObserver/src/ResizeObserver.js | 0 .../ResizeObserver/src}/ResizeObserver.res | 11 +- .../ResizeObserver/src/Types.js | 0 .../ResizeObserver/src/Types.res | 6 +- packages/ScreenWakeLock/package.json | 23 + packages/ScreenWakeLock/rescript.json | 18 + .../ScreenWakeLock/src/Types.js | 0 .../ScreenWakeLock/src/Types.res | 4 +- .../ScreenWakeLock/src/WakeLock.js | 0 packages/ScreenWakeLock/src/WakeLock.res | 5 + .../ScreenWakeLock/src/WakeLockSentinel.js | 7 + .../ScreenWakeLock/src/WakeLockSentinel.res | 7 + packages/ServiceWorker/package.json | 29 + packages/ServiceWorker/rescript.json | 24 + .../ServiceWorker/src/Cache.js | 0 packages/ServiceWorker/src/Cache.res | 97 + .../ServiceWorker/src/Clients.js | 0 .../ServiceWorker/src}/Clients.res | 10 +- .../src/NavigationPreloadManager.js | 0 .../src}/NavigationPreloadManager.res | 10 +- .../ServiceWorker/src/Navigator.js | 0 packages/ServiceWorker/src/Navigator.res | 5 + packages/ServiceWorker/src/ServiceWorker.js | 7 + .../ServiceWorker/src}/ServiceWorker.res | 11 +- .../src/ServiceWorkerContainer.js | 7 + .../src}/ServiceWorkerContainer.res | 18 +- .../src/ServiceWorkerGlobalScope.js | 7 + .../src}/ServiceWorkerGlobalScope.res | 6 +- .../src/ServiceWorkerRegistration.js | 7 + .../src}/ServiceWorkerRegistration.res | 19 +- .../ServiceWorker/src/Types.js | 0 .../ServiceWorker/src/Types.res | 18 +- packages/Storage/package.json | 23 + packages/Storage/rescript.json | 18 + .../Storage/src/StorageManager.js | 0 .../Storage/src}/StorageManager.res | 11 +- .../Storage/src/Types.js | 0 .../Storage/src/Types.res | 0 packages/UIEvents/package.json | 27 + packages/UIEvents/rescript.json | 22 + packages/UIEvents/src/CompositionEvent.js | 7 + packages/UIEvents/src/CompositionEvent.res | 8 + .../UIEvents/src/DataTransfer.js | 0 .../UIEvents/src}/DataTransfer.res | 14 +- .../UIEvents/src/DataTransferItem.js | 0 .../UIEvents/src}/DataTransferItem.res | 13 +- .../UIEvents/src/DataTransferItemList.js | 0 .../UIEvents/src}/DataTransferItemList.res | 11 +- packages/UIEvents/src/FocusEvent.js | 7 + packages/UIEvents/src/FocusEvent.res | 7 + packages/UIEvents/src/InputEvent.js | 7 + packages/UIEvents/src/InputEvent.res | 14 + packages/UIEvents/src/KeyboardEvent.js | 7 + packages/UIEvents/src/KeyboardEvent.res | 14 + .../UIEvents/src}/MouseEvent.js | 6 +- .../UIEvents/src}/MouseEvent.res | 8 +- packages/UIEvents/src/PointerEvent.js | 7 + packages/UIEvents/src/PointerEvent.res | 19 + .../UIEvents/src/Touch.js | 0 .../UIEvents/src}/Touch.res | 4 +- packages/UIEvents/src/TouchEvent.js | 7 + packages/UIEvents/src/TouchEvent.res | 7 + .../UIEvents/src/TouchList.js | 0 .../UIEvents/src}/TouchList.res | 4 +- .../UIEvents/src/Types.js | 0 .../UIEvents/src/Types.res | 27 +- .../UIEvents/src}/UIEvent.js | 6 +- packages/UIEvents/src/UIEvent.res | 17 + packages/UIEvents/src/WheelEvent.js | 7 + packages/UIEvents/src/WheelEvent.res | 7 + packages/URL/package.json | 21 + packages/URL/rescript.json | 16 + .../URL/src/Types.js | 0 src/URLAPI.res => packages/URL/src/Types.res | 0 .../URL/src/URL.js | 0 {src/URLAPI => packages/URL/src}/URL.res | 8 +- .../URL/src/URLSearchParams.js | 0 .../URL/src}/URLSearchParams.res | 32 +- packages/ViewTransitions/package.json | 21 + packages/ViewTransitions/rescript.json | 16 + .../ViewTransitions/src/Types.js | 0 .../ViewTransitions/src/Types.res | 0 .../ViewTransitions/src/ViewTransition.js | 0 .../ViewTransitions/src}/ViewTransition.res | 4 +- packages/VisualViewport/package.json | 23 + packages/VisualViewport/rescript.json | 18 + .../VisualViewport/src/Types.js | 0 .../VisualViewport/src/Types.res | 4 +- packages/WebAudio/package.json | 27 + packages/WebAudio/rescript.json | 22 + packages/WebAudio/src/AnalyserNode.js | 7 + packages/WebAudio/src/AnalyserNode.res | 32 + .../WebAudio/src/AudioBuffer.js | 0 .../WebAudio/src}/AudioBuffer.res | 10 +- .../WebAudio/src/AudioBufferSourceNode.js | 7 + .../WebAudio/src}/AudioBufferSourceNode.res | 12 +- packages/WebAudio/src/AudioContext.js | 7 + .../WebAudio/src}/AudioContext.res | 22 +- packages/WebAudio/src/AudioDestinationNode.js | 7 + .../WebAudio/src/AudioDestinationNode.res | 1 + .../WebAudio/src}/AudioNode.js | 4 +- .../WebAudio/src}/AudioNode.res | 20 +- .../WebAudio/src/AudioParam.js | 0 .../WebAudio/src}/AudioParam.res | 20 +- packages/WebAudio/src/AudioProcessingEvent.js | 7 + .../WebAudio/src/AudioProcessingEvent.res | 8 + .../WebAudio/src}/AudioScheduledSourceNode.js | 6 +- .../src}/AudioScheduledSourceNode.res | 6 +- packages/WebAudio/src/AudioWorkletNode.js | 7 + packages/WebAudio/src/AudioWorkletNode.res | 11 + .../WebAudio/src}/BaseAudioContext.js | 4 +- .../WebAudio/src}/BaseAudioContext.res | 48 +- packages/WebAudio/src/BiquadFilterNode.js | 7 + .../WebAudio/src}/BiquadFilterNode.res | 8 +- packages/WebAudio/src/ChannelMergerNode.js | 7 + packages/WebAudio/src/ChannelMergerNode.res | 8 + packages/WebAudio/src/ChannelSplitterNode.js | 7 + packages/WebAudio/src/ChannelSplitterNode.res | 10 + packages/WebAudio/src/ConstantSourceNode.js | 7 + packages/WebAudio/src/ConstantSourceNode.res | 10 + packages/WebAudio/src/ConvolverNode.js | 7 + packages/WebAudio/src/ConvolverNode.res | 8 + packages/WebAudio/src/DelayNode.js | 7 + packages/WebAudio/src/DelayNode.res | 7 + .../WebAudio/src/DynamicsCompressorNode.js | 7 + .../WebAudio/src/DynamicsCompressorNode.res | 10 + packages/WebAudio/src/GainNode.js | 7 + packages/WebAudio/src/GainNode.res | 7 + packages/WebAudio/src/IIRFilterNode.js | 7 + .../WebAudio/src}/IIRFilterNode.res | 8 +- .../src/MediaElementAudioSourceNode.js | 7 + .../src/MediaElementAudioSourceNode.res | 10 + .../src/MediaStreamAudioDestinationNode.js | 7 + .../src/MediaStreamAudioDestinationNode.res | 10 + .../src/MediaStreamAudioSourceNode.js | 7 + .../src/MediaStreamAudioSourceNode.res | 10 + .../src/OfflineAudioCompletionEvent.js | 7 + .../src/OfflineAudioCompletionEvent.res | 10 + packages/WebAudio/src/OfflineAudioContext.js | 7 + .../WebAudio/src}/OfflineAudioContext.res | 14 +- packages/WebAudio/src/OscillatorNode.js | 7 + packages/WebAudio/src/OscillatorNode.res | 14 + packages/WebAudio/src/PannerNode.js | 7 + packages/WebAudio/src/PannerNode.res | 7 + .../WebAudio/src/PeriodicWave.js | 0 packages/WebAudio/src/PeriodicWave.res | 6 + packages/WebAudio/src/StereoPannerNode.js | 7 + packages/WebAudio/src/StereoPannerNode.res | 8 + .../WebAudio/src/Types.js | 0 .../WebAudio/src/Types.res | 50 +- packages/WebAudio/src/WaveShaperNode.js | 7 + packages/WebAudio/src/WaveShaperNode.res | 8 + .../WebAudio/src/Worklet.js | 0 .../WebAudio/src}/Worklet.res | 4 +- packages/WebCrypto/package.json | 23 + packages/WebCrypto/rescript.json | 18 + .../WebCrypto/src/Crypto.js | 0 .../WebCrypto/src}/Crypto.res | 6 +- .../WebCrypto/src/SubtleCrypto.js | 0 .../WebCrypto/src}/SubtleCrypto.res | 124 +- .../WebCrypto/src/Types.js | 0 .../WebCrypto/src/Types.res | 0 packages/WebLocks/package.json | 23 + packages/WebLocks/rescript.json | 18 + .../WebLocks/src/LockManager.js | 0 .../WebLocks/src}/LockManager.res | 12 +- .../WebLocks/src/Types.js | 0 .../WebLocks/src/Types.res | 4 +- packages/WebMIDI/package.json | 24 + packages/WebMIDI/rescript.json | 19 + .../WebMIDI/src/Navigator.js | 0 packages/WebMIDI/src/Navigator.res | 8 + .../WebMIDI/src/Types.js | 0 .../WebMIDI/src/Types.res | 4 +- packages/WebSockets/package.json | 25 + packages/WebSockets/rescript.json | 20 + packages/WebSockets/src/CloseEvent.js | 7 + packages/WebSockets/src/CloseEvent.res | 7 + packages/WebSockets/src/MessageEvent.js | 2 + .../WebSockets/src}/MessageEvent.res | 15 +- packages/WebSockets/src/Types.js | 2 + .../WebSockets/src/Types.res | 17 +- packages/WebSockets/src/WebSocket.js | 7 + .../WebSockets/src}/WebSocket.res | 19 +- packages/WebSpeech/package.json | 23 + packages/WebSpeech/rescript.json | 18 + packages/WebSpeech/src/SpeechSynthesis.js | 7 + .../WebSpeech/src}/SpeechSynthesis.res | 14 +- .../WebSpeech/src/SpeechSynthesisUtterance.js | 7 + .../src/SpeechSynthesisUtterance.res | 7 + packages/WebSpeech/src/Types.js | 2 + .../WebSpeech/src/Types.res | 6 +- packages/WebStorage/package.json | 23 + packages/WebStorage/rescript.json | 18 + packages/WebStorage/src/Storage.js | 2 + .../WebStorage/src}/Storage.res | 12 +- packages/WebStorage/src/StorageEvent.js | 7 + packages/WebStorage/src/StorageEvent.res | 7 + packages/WebStorage/src/Types.js | 2 + .../WebStorage/src/Types.res | 6 +- packages/WebVTT/package.json | 23 + packages/WebVTT/rescript.json | 18 + packages/WebVTT/src/TextTrack.js | 7 + .../WebVTT/src}/TextTrack.res | 8 +- packages/WebVTT/src/TextTrackCueList.js | 2 + .../WebVTT/src}/TextTrackCueList.res | 4 +- packages/WebVTT/src/Types.js | 2 + .../WebVTT/src/Types.res | 8 +- packages/WebWorkers/package.json | 26 + packages/WebWorkers/rescript.json | 21 + packages/WebWorkers/src/CacheStorage.js | 2 + .../WebWorkers/src}/CacheStorage.res | 25 +- packages/WebWorkers/src/SharedWorker.js | 7 + .../WebWorkers/src}/SharedWorker.res | 13 +- .../WebWorkers/src/SharedWorkerGlobalScope.js | 15 + .../src}/SharedWorkerGlobalScope.res | 4 +- packages/WebWorkers/src/Types.js | 2 + .../WebWorkers/src/Types.res | 7 +- packages/WebWorkers/src/WorkerGlobalScope.js | 15 + .../WebWorkers/src}/WorkerGlobalScope.res | 11 +- rescript.json | 55 +- src/CSSFontLoadingAPI/FontFaceSet.js | 7 - src/CanvasAPI/FillStyle.res | 28 - src/CanvasAPI/OffscreenCanvas.js | 7 - src/ChannelMessagingAPI/MessagePort.js | 7 - src/ClipboardAPI/Clipboard.js | 7 - src/DOMAPI/Animation.js | 7 - src/DOMAPI/CSSStyleSheet.res | 32 - src/DOMAPI/CaretPosition.res | 4 - src/DOMAPI/Comment.js | 7 - src/DOMAPI/Comment.res | 9 - src/DOMAPI/DOMMatrix.res | 168 -- src/DOMAPI/DOMMatrixReadOnly.res | 102 - src/DOMAPI/DOMRectList.res | 4 - src/DOMAPI/DocumentTimeline.res | 9 - src/DOMAPI/HTMLAnchorElement.js | 7 - src/DOMAPI/HTMLAnchorElement.res | 3 - src/DOMAPI/HTMLAreaElement.js | 7 - src/DOMAPI/HTMLAreaElement.res | 3 - src/DOMAPI/HTMLAudioElement.js | 7 - src/DOMAPI/HTMLAudioElement.res | 3 - src/DOMAPI/HTMLBRElement.js | 7 - src/DOMAPI/HTMLBRElement.res | 3 - src/DOMAPI/HTMLBaseElement.js | 7 - src/DOMAPI/HTMLBaseElement.res | 3 - src/DOMAPI/HTMLBodyElement.js | 7 - src/DOMAPI/HTMLBodyElement.res | 3 - src/DOMAPI/HTMLButtonElement.js | 7 - src/DOMAPI/HTMLCanvasElement.js | 7 - src/DOMAPI/HTMLDListElement.js | 7 - src/DOMAPI/HTMLDListElement.res | 3 - src/DOMAPI/HTMLDataElement.js | 7 - src/DOMAPI/HTMLDataElement.res | 3 - src/DOMAPI/HTMLDataListElement.js | 7 - src/DOMAPI/HTMLDataListElement.res | 3 - src/DOMAPI/HTMLDialogElement.js | 7 - src/DOMAPI/HTMLDivElement.js | 7 - src/DOMAPI/HTMLDivElement.res | 3 - src/DOMAPI/HTMLEmbedElement.js | 7 - src/DOMAPI/HTMLEmbedElement.res | 6 - src/DOMAPI/HTMLFieldSetElement.js | 7 - src/DOMAPI/HTMLFormElement.js | 7 - src/DOMAPI/HTMLFrameSetElement.js | 7 - src/DOMAPI/HTMLFrameSetElement.res | 3 - src/DOMAPI/HTMLHRElement.js | 7 - src/DOMAPI/HTMLHRElement.res | 3 - src/DOMAPI/HTMLHeadElement.js | 7 - src/DOMAPI/HTMLHeadElement.res | 3 - src/DOMAPI/HTMLHeadingElement.js | 7 - src/DOMAPI/HTMLHeadingElement.res | 3 - src/DOMAPI/HTMLHtmlElement.js | 7 - src/DOMAPI/HTMLHtmlElement.res | 3 - src/DOMAPI/HTMLIFrameElement.js | 7 - src/DOMAPI/HTMLIFrameElement.res | 6 - src/DOMAPI/HTMLImageElement.js | 7 - src/DOMAPI/HTMLImageElement.res | 9 - src/DOMAPI/HTMLInputElement.js | 7 - src/DOMAPI/HTMLLIElement.js | 7 - src/DOMAPI/HTMLLIElement.res | 3 - src/DOMAPI/HTMLLabelElement.js | 7 - src/DOMAPI/HTMLLabelElement.res | 3 - src/DOMAPI/HTMLLegendElement.js | 7 - src/DOMAPI/HTMLLegendElement.res | 3 - src/DOMAPI/HTMLLinkElement.js | 7 - src/DOMAPI/HTMLLinkElement.res | 3 - src/DOMAPI/HTMLMapElement.js | 7 - src/DOMAPI/HTMLMapElement.res | 3 - src/DOMAPI/HTMLMediaElement.js | 15 - src/DOMAPI/HTMLMenuElement.js | 7 - src/DOMAPI/HTMLMenuElement.res | 3 - src/DOMAPI/HTMLMetaElement.js | 7 - src/DOMAPI/HTMLMetaElement.res | 3 - src/DOMAPI/HTMLMeterElement.js | 7 - src/DOMAPI/HTMLMeterElement.res | 3 - src/DOMAPI/HTMLModElement.js | 7 - src/DOMAPI/HTMLModElement.res | 3 - src/DOMAPI/HTMLOListElement.js | 7 - src/DOMAPI/HTMLOListElement.res | 3 - src/DOMAPI/HTMLObjectElement.js | 7 - src/DOMAPI/HTMLOptGroupElement.js | 7 - src/DOMAPI/HTMLOptGroupElement.res | 3 - src/DOMAPI/HTMLOptionElement.js | 7 - src/DOMAPI/HTMLOptionElement.res | 3 - src/DOMAPI/HTMLOutputElement.js | 7 - src/DOMAPI/HTMLParagraphElement.js | 7 - src/DOMAPI/HTMLParagraphElement.res | 3 - src/DOMAPI/HTMLPictureElement.js | 7 - src/DOMAPI/HTMLPictureElement.res | 3 - src/DOMAPI/HTMLPreElement.js | 7 - src/DOMAPI/HTMLPreElement.res | 3 - src/DOMAPI/HTMLProgressElement.js | 7 - src/DOMAPI/HTMLProgressElement.res | 3 - src/DOMAPI/HTMLQuoteElement.js | 7 - src/DOMAPI/HTMLQuoteElement.res | 3 - src/DOMAPI/HTMLScriptElement.js | 7 - src/DOMAPI/HTMLSelectElement.js | 7 - src/DOMAPI/HTMLSlotElement.js | 7 - src/DOMAPI/HTMLSourceElement.js | 7 - src/DOMAPI/HTMLSourceElement.res | 3 - src/DOMAPI/HTMLSpanElement.js | 7 - src/DOMAPI/HTMLSpanElement.res | 3 - src/DOMAPI/HTMLStyleElement.js | 7 - src/DOMAPI/HTMLStyleElement.res | 3 - src/DOMAPI/HTMLTableCaptionElement.js | 7 - src/DOMAPI/HTMLTableCaptionElement.res | 3 - src/DOMAPI/HTMLTableCellElement.js | 7 - src/DOMAPI/HTMLTableCellElement.res | 3 - src/DOMAPI/HTMLTableElement.js | 7 - src/DOMAPI/HTMLTableRowElement.js | 7 - src/DOMAPI/HTMLTableSectionElement.js | 7 - src/DOMAPI/HTMLTemplateElement.js | 7 - src/DOMAPI/HTMLTemplateElement.res | 3 - src/DOMAPI/HTMLTextAreaElement.js | 7 - src/DOMAPI/HTMLTimeElement.js | 7 - src/DOMAPI/HTMLTimeElement.res | 3 - src/DOMAPI/HTMLTitleElement.js | 7 - src/DOMAPI/HTMLTitleElement.res | 3 - src/DOMAPI/HTMLTrackElement.js | 7 - src/DOMAPI/HTMLTrackElement.res | 3 - src/DOMAPI/HTMLUListElement.js | 7 - src/DOMAPI/HTMLUListElement.res | 3 - src/DOMAPI/HTMLVideoElement.js | 7 - src/DOMAPI/HTMLVideoElement.res | 31 - src/DOMAPI/MediaQueryList.js | 7 - src/DOMAPI/MediaQueryList.res | 3 - src/DOMAPI/Navigator.res | 115 - src/DOMAPI/Node.js | 15 - src/DOMAPI/NodeFilter.res | 4 - src/DOMAPI/SVGGraphicsElement.res | 17 - src/DOMAPI/ScreenOrientation.js | 7 - src/DOMAPI/ScreenOrientation.res | 9 - src/DOMAPI/ShadowRoot.js | 7 - src/DOMAPI/ShadowRoot.res | 21 - src/DOMAPI/StylePropertyMap.res | 50 - src/DOMAPI/Text.js | 7 - src/DOMAPI/TextTrackList.js | 7 - src/DOMAPI/TextTrackList.res | 10 - src/DOMAPI/VideoFrame.res | 114 - src/DOMAPI/Window.js | 7 - src/DOMAPI/Window.res | 517 ---- .../MediaKeySession.js | 7 - src/EventAPI/AbortSignal.js | 7 - src/FileAPI/FileSystemFileHandle.res | 23 - src/FileAPI/FileSystemHandle.res | 7 - src/FileAndDirectoryEntriesAPI.res | 89 - .../FileSystemDirectoryEntry.res | 42 - src/GamepadAPI/GamepadHapticActuator.res | 17 - src/IndexedDBAPI/IDBDatabase.js | 7 - src/IndexedDBAPI/IDBTransaction.js | 7 - .../IntersectionObserverRoot.js | 25 - .../IntersectionObserverRoot.res | 24 - src/MediaCaptureAndStreamsAPI/MediaDevices.js | 7 - src/MediaCaptureAndStreamsAPI/MediaStream.js | 7 - .../MediaStreamTrack.js | 7 - src/MediaSessionAPI/MediaMetadata.res | 7 - src/NotificationAPI/Notification.js | 7 - src/PerformanceAPI/Performance.js | 7 - src/PerformanceAPI/PerformanceMark.res | 15 - src/PermissionsAPI/Permissions.res | 7 - src/Prelude.res | 35 - src/Prelude/DOMException.res | 7 - src/PushAPI/ApplicationServerKey.res | 4 - src/PushAPI/PushEvent.js | 7 - src/PushAPI/PushEvent.res | 3 - src/RemotePlaybackAPI/RemotePlayback.js | 7 - src/ScreenWakeLockAPI/WakeLock.res | 7 - src/ScreenWakeLockAPI/WakeLockSentinel.js | 7 - src/ScreenWakeLockAPI/WakeLockSentinel.res | 9 - src/ServiceWorkerAPI/Cache.res | 100 - src/ServiceWorkerAPI/ServiceWorker.js | 7 - .../ServiceWorkerContainer.js | 7 - .../ServiceWorkerGlobalScope.js | 7 - .../ServiceWorkerRegistration.js | 7 - src/UIEventsAPI/CompositionEvent.js | 7 - src/UIEventsAPI/CompositionEvent.res | 10 - src/UIEventsAPI/FocusEvent.js | 7 - src/UIEventsAPI/FocusEvent.res | 9 - src/UIEventsAPI/InputEvent.js | 7 - src/UIEventsAPI/InputEvent.res | 16 - src/UIEventsAPI/KeyboardEvent.js | 7 - src/UIEventsAPI/KeyboardEvent.res | 16 - src/UIEventsAPI/PointerEvent.js | 7 - src/UIEventsAPI/PointerEvent.res | 21 - src/UIEventsAPI/TouchEvent.js | 7 - src/UIEventsAPI/TouchEvent.res | 9 - src/UIEventsAPI/UIEvent.res | 19 - src/UIEventsAPI/WheelEvent.js | 7 - src/UIEventsAPI/WheelEvent.res | 9 - src/WebAudioAPI/AnalyserNode.js | 7 - src/WebAudioAPI/AnalyserNode.res | 34 - src/WebAudioAPI/AudioBufferSourceNode.js | 7 - src/WebAudioAPI/AudioContext.js | 7 - src/WebAudioAPI/AudioDestinationNode.js | 7 - src/WebAudioAPI/AudioDestinationNode.res | 3 - src/WebAudioAPI/AudioProcessingEvent.js | 7 - src/WebAudioAPI/AudioProcessingEvent.res | 10 - src/WebAudioAPI/AudioWorkletNode.js | 7 - src/WebAudioAPI/AudioWorkletNode.res | 13 - src/WebAudioAPI/BiquadFilterNode.js | 7 - src/WebAudioAPI/ChannelMergerNode.js | 7 - src/WebAudioAPI/ChannelMergerNode.res | 10 - src/WebAudioAPI/ChannelSplitterNode.js | 7 - src/WebAudioAPI/ChannelSplitterNode.res | 12 - src/WebAudioAPI/ConstantSourceNode.js | 7 - src/WebAudioAPI/ConstantSourceNode.res | 12 - src/WebAudioAPI/ConvolverNode.js | 7 - src/WebAudioAPI/ConvolverNode.res | 10 - src/WebAudioAPI/DelayNode.js | 7 - src/WebAudioAPI/DelayNode.res | 9 - src/WebAudioAPI/DynamicsCompressorNode.js | 7 - src/WebAudioAPI/DynamicsCompressorNode.res | 12 - src/WebAudioAPI/GainNode.js | 7 - src/WebAudioAPI/GainNode.res | 9 - src/WebAudioAPI/IIRFilterNode.js | 7 - .../MediaElementAudioSourceNode.js | 7 - .../MediaElementAudioSourceNode.res | 12 - .../MediaStreamAudioDestinationNode.js | 7 - .../MediaStreamAudioDestinationNode.res | 12 - src/WebAudioAPI/MediaStreamAudioSourceNode.js | 7 - .../MediaStreamAudioSourceNode.res | 12 - .../OfflineAudioCompletionEvent.js | 7 - .../OfflineAudioCompletionEvent.res | 12 - src/WebAudioAPI/OfflineAudioContext.js | 7 - src/WebAudioAPI/OscillatorNode.js | 7 - src/WebAudioAPI/OscillatorNode.res | 16 - src/WebAudioAPI/PannerNode.js | 7 - src/WebAudioAPI/PannerNode.res | 9 - src/WebAudioAPI/PeriodicWave.res | 8 - src/WebAudioAPI/StereoPannerNode.js | 7 - src/WebAudioAPI/StereoPannerNode.res | 10 - src/WebAudioAPI/WaveShaperNode.js | 7 - src/WebAudioAPI/WaveShaperNode.res | 10 - src/WebSocketsAPI/CloseEvent.js | 7 - src/WebSocketsAPI/CloseEvent.res | 9 - src/WebSocketsAPI/WebSocket.js | 7 - src/WebSpeechAPI/SpeechSynthesis.js | 7 - src/WebSpeechAPI/SpeechSynthesisUtterance.js | 7 - src/WebSpeechAPI/SpeechSynthesisUtterance.res | 9 - src/WebStorageAPI/StorageEvent.js | 7 - src/WebStorageAPI/StorageEvent.res | 9 - src/WebVTTAPI/TextTrack.js | 7 - src/WebWorkersAPI/SharedWorker.js | 7 - src/WebWorkersAPI/SharedWorkerGlobalScope.js | 15 - src/WebWorkersAPI/WorkerGlobalScope.js | 15 - tests/DOMAPI/AddEventListener__test.res | 9 +- tests/DOMAPI/Element__test.res | 4 +- tests/DOMAPI/HTMLCanvasElement__test.js | 4 +- tests/DOMAPI/HTMLCanvasElement__test.res | 43 +- tests/DOMAPI/HTMLElement__test.res | 9 +- tests/DOMAPI/HTMLInputElement__test.res | 7 +- tests/DOMAPI/ImageData__test.res | 4 +- tests/DOMAPI/Location__test.js | 2 +- tests/DOMAPI/Location__test.res | 7 +- tests/FetchAPI/FormData__test.res | 26 +- tests/FetchAPI/Headers__test.res | 10 +- tests/FetchAPI/Request__test.res | 10 +- tests/FetchAPI/Response__test.res | 6 +- tests/FetchAPI/URLSearchParams__test.res | 14 +- tests/Global__test.res | 32 +- .../IntersectionObserver__test.js | 10 +- .../IntersectionObserver__test.res | 25 +- .../MutationObserver__test.js | 3 + .../MutationObserver__test.res | 16 +- tests/NotificationsAPI/Notification__test.res | 6 +- .../ServiceWorkerAPI/ServiceWorker__test.res | 20 +- tests/URLAPI/URL__test.res | 4 +- .../AudioDestinationNode__.test.res | 22 +- tests/WebStorageAPI/Storage__test.res | 15 +- .../SharedWorkerGlobalScope__test.res | 6 +- tests/WebWorkersAPI/SharedWorker__test.res | 16 +- 1017 files changed, 9845 insertions(+), 7686 deletions(-) create mode 100644 packages/.DS_Store create mode 100644 packages/CSSFontLoading/package.json create mode 100644 packages/CSSFontLoading/rescript.json rename {src/CSSFontLoadingAPI => packages/CSSFontLoading/src}/FontFace.js (100%) rename {src/CSSFontLoadingAPI => packages/CSSFontLoading/src}/FontFace.res (66%) create mode 100644 packages/CSSFontLoading/src/FontFaceSet.js rename {src/CSSFontLoadingAPI => packages/CSSFontLoading/src}/FontFaceSet.res (50%) rename src/CSSFontLoadingAPI.js => packages/CSSFontLoading/src/Types.js (100%) rename src/CSSFontLoadingAPI.res => packages/CSSFontLoading/src/Types.res (86%) create mode 100644 packages/Canvas/lib/rescript.lock create mode 100644 packages/Canvas/package.json create mode 100644 packages/Canvas/rescript.json rename {src/CanvasAPI => packages/Canvas/src}/CanvasGradient.js (100%) rename {src/CanvasAPI => packages/Canvas/src}/CanvasGradient.res (80%) rename {src/CanvasAPI => packages/Canvas/src}/CanvasPattern.js (100%) rename {src/CanvasAPI => packages/Canvas/src}/CanvasPattern.res (70%) rename {src/DOMAPI => packages/Canvas/src}/CanvasRenderingContext2D.js (100%) rename {src/DOMAPI => packages/Canvas/src}/CanvasRenderingContext2D.res (68%) rename {src/CanvasAPI => packages/Canvas/src}/FillStyle.js (57%) create mode 100644 packages/Canvas/src/FillStyle.res rename {src => packages/Canvas/src}/Global.js (100%) create mode 100644 packages/Canvas/src/Global.res create mode 100644 packages/Canvas/src/HTMLCanvasElement.js rename {src/DOMAPI => packages/Canvas/src}/HTMLCanvasElement.res (77%) rename {src/CanvasAPI => packages/Canvas/src}/ImageBitmap.js (100%) rename {src/CanvasAPI => packages/Canvas/src}/ImageBitmap.res (69%) rename {src/CanvasAPI => packages/Canvas/src}/ImageBitmapRenderingContext.js (100%) rename {src/CanvasAPI => packages/Canvas/src}/ImageBitmapRenderingContext.res (74%) create mode 100644 packages/Canvas/src/OffscreenCanvas.js rename {src/CanvasAPI => packages/Canvas/src}/OffscreenCanvas.res (82%) rename {src/CanvasAPI => packages/Canvas/src}/Path2D.js (100%) rename {src/CanvasAPI => packages/Canvas/src}/Path2D.res (75%) rename src/CanvasAPI.js => packages/Canvas/src/Types.js (100%) rename src/CanvasAPI.res => packages/Canvas/src/Types.res (99%) rename {src/DOMAPI => packages/Canvas/src}/VideoFrame.js (100%) create mode 100644 packages/Canvas/src/VideoFrame.res create mode 100644 packages/ChannelMessaging/package.json create mode 100644 packages/ChannelMessaging/rescript.json create mode 100644 packages/ChannelMessaging/src/MessagePort.js rename {src/ChannelMessagingAPI => packages/ChannelMessaging/src}/MessagePort.res (77%) rename src/ChannelMessagingAPI.js => packages/ChannelMessaging/src/Types.js (100%) rename src/ChannelMessagingAPI.res => packages/ChannelMessaging/src/Types.res (92%) create mode 100644 packages/Clipboard/package.json create mode 100644 packages/Clipboard/rescript.json create mode 100644 packages/Clipboard/src/Clipboard.js rename {src/ClipboardAPI => packages/Clipboard/src}/Clipboard.res (50%) rename {src/ClipboardAPI => packages/Clipboard/src}/ClipboardItem.js (100%) rename {src/ClipboardAPI => packages/Clipboard/src}/ClipboardItem.res (66%) rename src/ClipboardAPI.js => packages/Clipboard/src/Types.js (100%) rename src/ClipboardAPI.res => packages/Clipboard/src/Types.res (95%) create mode 100644 packages/CredentialManagement/package.json create mode 100644 packages/CredentialManagement/rescript.json rename {src/CredentialManagementAPI => packages/CredentialManagement/src}/CredentialsContainer.js (100%) rename {src/CredentialManagementAPI => packages/CredentialManagement/src}/CredentialsContainer.res (51%) rename src/CredentialManagementAPI.js => packages/CredentialManagement/src/Types.js (100%) rename src/CredentialManagementAPI.res => packages/CredentialManagement/src/Types.res (88%) create mode 100644 packages/DOM/lib/rescript.lock create mode 100644 packages/DOM/package.json create mode 100644 packages/DOM/rescript.json create mode 100644 packages/DOM/src/.DS_Store create mode 100644 packages/DOM/src/Animation.js rename {src/DOMAPI => packages/DOM/src}/Animation.res (58%) rename {src/DOMAPI => packages/DOM/src}/AnimationEffect.js (100%) rename {src/DOMAPI => packages/DOM/src}/AnimationEffect.res (52%) rename {src/DOMAPI => packages/DOM/src}/CSSRuleList.js (100%) rename {src/DOMAPI => packages/DOM/src}/CSSRuleList.res (55%) rename {src/DOMAPI => packages/DOM/src}/CSSStyleDeclaration.js (100%) rename {src/DOMAPI => packages/DOM/src}/CSSStyleDeclaration.res (63%) rename {src/DOMAPI => packages/DOM/src}/CSSStyleSheet.js (100%) create mode 100644 packages/DOM/src/CSSStyleSheet.res rename {src/DOMAPI => packages/DOM/src}/CSSStyleValue.js (100%) rename {src/DOMAPI => packages/DOM/src}/CSSStyleValue.res (70%) rename {src/DOMAPI => packages/DOM/src}/CaretPosition.js (100%) create mode 100644 packages/DOM/src/CaretPosition.res rename {src/DOMAPI => packages/DOM/src}/CharacterData.js (59%) rename {src/DOMAPI => packages/DOM/src}/CharacterData.res (91%) create mode 100644 packages/DOM/src/Comment.js create mode 100644 packages/DOM/src/Comment.res rename {src/DOMAPI => packages/DOM/src}/CustomElementRegistry.js (100%) rename {src/DOMAPI => packages/DOM/src}/CustomElementRegistry.res (53%) rename {src/DOMAPI => packages/DOM/src}/DOMImplementation.js (100%) rename {src/DOMAPI => packages/DOM/src}/DOMImplementation.res (65%) rename {src/DOMAPI => packages/DOM/src}/DOMMatrix.js (100%) create mode 100644 packages/DOM/src/DOMMatrix.res rename {src/DOMAPI => packages/DOM/src}/DOMMatrixReadOnly.js (100%) create mode 100644 packages/DOM/src/DOMMatrixReadOnly.res rename {src/DOMAPI => packages/DOM/src}/DOMPoint.js (100%) rename {src/DOMAPI => packages/DOM/src}/DOMPoint.res (51%) rename {src/DOMAPI => packages/DOM/src}/DOMPointReadOnly.js (100%) rename {src/DOMAPI => packages/DOM/src}/DOMPointReadOnly.res (59%) rename {src/DOMAPI => packages/DOM/src}/DOMRect.js (100%) rename {src/DOMAPI => packages/DOM/src}/DOMRect.res (52%) rename {src/DOMAPI => packages/DOM/src}/DOMRectList.js (100%) create mode 100644 packages/DOM/src/DOMRectList.res rename {src/DOMAPI => packages/DOM/src}/DOMRectReadOnly.js (100%) rename {src/DOMAPI => packages/DOM/src}/DOMRectReadOnly.res (61%) rename {src/DOMAPI => packages/DOM/src}/DOMTokenList.js (100%) rename {src/DOMAPI => packages/DOM/src}/DOMTokenList.res (80%) rename {src/DOMAPI => packages/DOM/src}/Document.js (73%) rename {src/DOMAPI => packages/DOM/src}/Document.res (76%) rename {src/DOMAPI => packages/DOM/src}/DocumentFragment.js (59%) rename {src/DOMAPI => packages/DOM/src}/DocumentFragment.res (81%) rename {src/DOMAPI => packages/DOM/src}/DocumentTimeline.js (100%) create mode 100644 packages/DOM/src/DocumentTimeline.res rename {src/DOMAPI => packages/DOM/src}/Element.js (71%) rename {src/DOMAPI => packages/DOM/src}/Element.res (83%) rename {src/DOMAPI => packages/DOM/src}/ElementInternals.js (100%) rename {src/DOMAPI => packages/DOM/src}/ElementInternals.res (80%) rename {src/DOMAPI => packages/DOM/src}/FileList.js (100%) rename {src/DOMAPI => packages/DOM/src}/FileList.res (82%) rename src/DOMAPI.js => packages/DOM/src/Global.js (100%) rename {src => packages/DOM/src}/Global.res (66%) create mode 100644 packages/DOM/src/HTMLAnchorElement.js create mode 100644 packages/DOM/src/HTMLAnchorElement.res create mode 100644 packages/DOM/src/HTMLAreaElement.js create mode 100644 packages/DOM/src/HTMLAreaElement.res create mode 100644 packages/DOM/src/HTMLAudioElement.js create mode 100644 packages/DOM/src/HTMLAudioElement.res create mode 100644 packages/DOM/src/HTMLBRElement.js create mode 100644 packages/DOM/src/HTMLBRElement.res create mode 100644 packages/DOM/src/HTMLBaseElement.js create mode 100644 packages/DOM/src/HTMLBaseElement.res create mode 100644 packages/DOM/src/HTMLBodyElement.js create mode 100644 packages/DOM/src/HTMLBodyElement.res create mode 100644 packages/DOM/src/HTMLButtonElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLButtonElement.res (65%) rename {src/DOMAPI => packages/DOM/src}/HTMLCollection.js (100%) rename {src/DOMAPI => packages/DOM/src}/HTMLCollection.res (69%) create mode 100644 packages/DOM/src/HTMLDListElement.js create mode 100644 packages/DOM/src/HTMLDListElement.res create mode 100644 packages/DOM/src/HTMLDataElement.js create mode 100644 packages/DOM/src/HTMLDataElement.res create mode 100644 packages/DOM/src/HTMLDataListElement.js create mode 100644 packages/DOM/src/HTMLDataListElement.res create mode 100644 packages/DOM/src/HTMLDialogElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLDialogElement.res (60%) create mode 100644 packages/DOM/src/HTMLDivElement.js create mode 100644 packages/DOM/src/HTMLDivElement.res rename {src/DOMAPI => packages/DOM/src}/HTMLElement.js (56%) rename {src/DOMAPI => packages/DOM/src}/HTMLElement.res (80%) create mode 100644 packages/DOM/src/HTMLEmbedElement.js create mode 100644 packages/DOM/src/HTMLEmbedElement.res create mode 100644 packages/DOM/src/HTMLFieldSetElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLFieldSetElement.res (65%) rename {src/DOMAPI => packages/DOM/src}/HTMLFormControlsCollection.js (100%) rename {src/DOMAPI => packages/DOM/src}/HTMLFormControlsCollection.res (51%) create mode 100644 packages/DOM/src/HTMLFormElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLFormElement.res (61%) create mode 100644 packages/DOM/src/HTMLFrameSetElement.js create mode 100644 packages/DOM/src/HTMLFrameSetElement.res create mode 100644 packages/DOM/src/HTMLHRElement.js create mode 100644 packages/DOM/src/HTMLHRElement.res create mode 100644 packages/DOM/src/HTMLHeadElement.js create mode 100644 packages/DOM/src/HTMLHeadElement.res create mode 100644 packages/DOM/src/HTMLHeadingElement.js create mode 100644 packages/DOM/src/HTMLHeadingElement.res create mode 100644 packages/DOM/src/HTMLHtmlElement.js create mode 100644 packages/DOM/src/HTMLHtmlElement.res create mode 100644 packages/DOM/src/HTMLIFrameElement.js create mode 100644 packages/DOM/src/HTMLIFrameElement.res create mode 100644 packages/DOM/src/HTMLImageElement.js create mode 100644 packages/DOM/src/HTMLImageElement.res create mode 100644 packages/DOM/src/HTMLInputElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLInputElement.res (75%) create mode 100644 packages/DOM/src/HTMLLIElement.js create mode 100644 packages/DOM/src/HTMLLIElement.res create mode 100644 packages/DOM/src/HTMLLabelElement.js create mode 100644 packages/DOM/src/HTMLLabelElement.res create mode 100644 packages/DOM/src/HTMLLegendElement.js create mode 100644 packages/DOM/src/HTMLLegendElement.res create mode 100644 packages/DOM/src/HTMLLinkElement.js create mode 100644 packages/DOM/src/HTMLLinkElement.res create mode 100644 packages/DOM/src/HTMLMapElement.js create mode 100644 packages/DOM/src/HTMLMapElement.res create mode 100644 packages/DOM/src/HTMLMediaElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLMediaElement.res (71%) create mode 100644 packages/DOM/src/HTMLMenuElement.js create mode 100644 packages/DOM/src/HTMLMenuElement.res create mode 100644 packages/DOM/src/HTMLMetaElement.js create mode 100644 packages/DOM/src/HTMLMetaElement.res create mode 100644 packages/DOM/src/HTMLMeterElement.js create mode 100644 packages/DOM/src/HTMLMeterElement.res create mode 100644 packages/DOM/src/HTMLModElement.js create mode 100644 packages/DOM/src/HTMLModElement.res create mode 100644 packages/DOM/src/HTMLOListElement.js create mode 100644 packages/DOM/src/HTMLOListElement.res create mode 100644 packages/DOM/src/HTMLObjectElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLObjectElement.res (60%) create mode 100644 packages/DOM/src/HTMLOptGroupElement.js create mode 100644 packages/DOM/src/HTMLOptGroupElement.res create mode 100644 packages/DOM/src/HTMLOptionElement.js create mode 100644 packages/DOM/src/HTMLOptionElement.res rename {src/DOMAPI => packages/DOM/src}/HTMLOptionsCollection.js (100%) rename {src/DOMAPI => packages/DOM/src}/HTMLOptionsCollection.res (75%) create mode 100644 packages/DOM/src/HTMLOutputElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLOutputElement.res (52%) create mode 100644 packages/DOM/src/HTMLParagraphElement.js create mode 100644 packages/DOM/src/HTMLParagraphElement.res create mode 100644 packages/DOM/src/HTMLPictureElement.js create mode 100644 packages/DOM/src/HTMLPictureElement.res create mode 100644 packages/DOM/src/HTMLPreElement.js create mode 100644 packages/DOM/src/HTMLPreElement.res create mode 100644 packages/DOM/src/HTMLProgressElement.js create mode 100644 packages/DOM/src/HTMLProgressElement.res create mode 100644 packages/DOM/src/HTMLQuoteElement.js create mode 100644 packages/DOM/src/HTMLQuoteElement.res create mode 100644 packages/DOM/src/HTMLScriptElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLScriptElement.res (72%) create mode 100644 packages/DOM/src/HTMLSelectElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLSelectElement.res (77%) create mode 100644 packages/DOM/src/HTMLSlotElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLSlotElement.res (51%) create mode 100644 packages/DOM/src/HTMLSourceElement.js create mode 100644 packages/DOM/src/HTMLSourceElement.res create mode 100644 packages/DOM/src/HTMLSpanElement.js create mode 100644 packages/DOM/src/HTMLSpanElement.res create mode 100644 packages/DOM/src/HTMLStyleElement.js create mode 100644 packages/DOM/src/HTMLStyleElement.res create mode 100644 packages/DOM/src/HTMLTableCaptionElement.js create mode 100644 packages/DOM/src/HTMLTableCaptionElement.res create mode 100644 packages/DOM/src/HTMLTableCellElement.js create mode 100644 packages/DOM/src/HTMLTableCellElement.res create mode 100644 packages/DOM/src/HTMLTableElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLTableElement.res (68%) create mode 100644 packages/DOM/src/HTMLTableRowElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLTableRowElement.res (74%) create mode 100644 packages/DOM/src/HTMLTableSectionElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLTableSectionElement.res (71%) create mode 100644 packages/DOM/src/HTMLTemplateElement.js create mode 100644 packages/DOM/src/HTMLTemplateElement.res create mode 100644 packages/DOM/src/HTMLTextAreaElement.js rename {src/DOMAPI => packages/DOM/src}/HTMLTextAreaElement.res (73%) create mode 100644 packages/DOM/src/HTMLTimeElement.js create mode 100644 packages/DOM/src/HTMLTimeElement.res create mode 100644 packages/DOM/src/HTMLTitleElement.js create mode 100644 packages/DOM/src/HTMLTitleElement.res create mode 100644 packages/DOM/src/HTMLTrackElement.js create mode 100644 packages/DOM/src/HTMLTrackElement.res create mode 100644 packages/DOM/src/HTMLUListElement.js create mode 100644 packages/DOM/src/HTMLUListElement.res create mode 100644 packages/DOM/src/HTMLVideoElement.js create mode 100644 packages/DOM/src/HTMLVideoElement.res rename {src/DOMAPI => packages/DOM/src}/IdleDeadline.js (100%) rename {src/DOMAPI => packages/DOM/src}/IdleDeadline.res (56%) rename {src/DOMAPI => packages/DOM/src}/ImageData.js (100%) rename {src/DOMAPI => packages/DOM/src}/ImageData.res (58%) rename {src/DOMAPI => packages/DOM/src}/Location.js (100%) rename {src/DOMAPI => packages/DOM/src}/Location.res (70%) rename {src/DOMAPI => packages/DOM/src}/MediaList.js (100%) rename {src/DOMAPI => packages/DOM/src}/MediaList.res (58%) create mode 100644 packages/DOM/src/MediaQueryList.js create mode 100644 packages/DOM/src/MediaQueryList.res rename {src/DOMAPI => packages/DOM/src}/NamedNodeMap.js (100%) rename {src/DOMAPI => packages/DOM/src}/NamedNodeMap.res (51%) rename {src/DOMAPI => packages/DOM/src}/Navigator.js (100%) create mode 100644 packages/DOM/src/Navigator.res create mode 100644 packages/DOM/src/Node.js rename {src/DOMAPI => packages/DOM/src}/Node.res (79%) rename {src/DOMAPI => packages/DOM/src}/NodeFilter.js (100%) create mode 100644 packages/DOM/src/NodeFilter.res rename {src/DOMAPI => packages/DOM/src}/NodeIterator.js (100%) rename {src/DOMAPI => packages/DOM/src}/NodeIterator.res (59%) rename {src/DOMAPI => packages/DOM/src}/NodeList.js (100%) rename {src/DOMAPI => packages/DOM/src}/NodeList.res (71%) rename {src/DOMAPI => packages/DOM/src}/Range.js (100%) rename {src/DOMAPI => packages/DOM/src}/Range.res (56%) rename {src/DOMAPI => packages/DOM/src}/SVGGraphicsElement.js (51%) create mode 100644 packages/DOM/src/SVGGraphicsElement.res rename {src/DOMAPI => packages/DOM/src}/SVGLength.js (100%) rename {src/DOMAPI => packages/DOM/src}/SVGLength.res (54%) create mode 100644 packages/DOM/src/ScreenOrientation.js create mode 100644 packages/DOM/src/ScreenOrientation.res rename {src/DOMAPI => packages/DOM/src}/Selection.js (100%) rename {src/DOMAPI => packages/DOM/src}/Selection.res (60%) create mode 100644 packages/DOM/src/ShadowRoot.js create mode 100644 packages/DOM/src/ShadowRoot.res rename {src/DOMAPI => packages/DOM/src}/StylePropertyMap.js (100%) create mode 100644 packages/DOM/src/StylePropertyMap.res rename {src/DOMAPI => packages/DOM/src}/StylePropertyMapReadOnly.js (100%) rename {src/DOMAPI => packages/DOM/src}/StylePropertyMapReadOnly.res (55%) rename {src/DOMAPI => packages/DOM/src}/StyleSheetList.js (100%) rename {src/DOMAPI => packages/DOM/src}/StyleSheetList.res (55%) create mode 100644 packages/DOM/src/Text.js rename {src/DOMAPI => packages/DOM/src}/Text.res (58%) create mode 100644 packages/DOM/src/TextTrackList.js create mode 100644 packages/DOM/src/TextTrackList.res rename {src/DOMAPI => packages/DOM/src}/TimeRanges.js (100%) rename {src/DOMAPI => packages/DOM/src}/TimeRanges.res (79%) rename {src/DOMAPI => packages/DOM/src}/TreeWalker.js (100%) rename {src/DOMAPI => packages/DOM/src}/TreeWalker.res (58%) rename src/DOMAPI/VideoColorSpace.js => packages/DOM/src/Types.js (100%) create mode 100644 packages/DOM/src/Types.res rename src/DOMAPI/XPathExpression.js => packages/DOM/src/VideoColorSpace.js (100%) rename {src/DOMAPI => packages/DOM/src}/VideoColorSpace.res (52%) create mode 100644 packages/DOM/src/Window.js create mode 100644 packages/DOM/src/Window.res rename src/DOMAPI/XPathResult.js => packages/DOM/src/XPathExpression.js (100%) rename {src/DOMAPI => packages/DOM/src}/XPathExpression.res (53%) rename src/EncryptedMediaExtensionsAPI.js => packages/DOM/src/XPathResult.js (100%) rename {src/DOMAPI => packages/DOM/src}/XPathResult.res (57%) create mode 100644 packages/EncryptedMediaExtensions/package.json create mode 100644 packages/EncryptedMediaExtensions/rescript.json rename src/EncryptedMediaExtensionsAPI/MediaKeyStatusMap.js => packages/EncryptedMediaExtensions/src/HTMLMediaElement.js (100%) create mode 100644 packages/EncryptedMediaExtensions/src/HTMLMediaElement.res create mode 100644 packages/EncryptedMediaExtensions/src/MediaKeySession.js rename {src/EncryptedMediaExtensionsAPI => packages/EncryptedMediaExtensions/src}/MediaKeySession.res (66%) rename src/EncryptedMediaExtensionsAPI/MediaKeySystemAccess.js => packages/EncryptedMediaExtensions/src/MediaKeyStatusMap.js (100%) rename {src/EncryptedMediaExtensionsAPI => packages/EncryptedMediaExtensions/src}/MediaKeyStatusMap.res (54%) rename src/EncryptedMediaExtensionsAPI/MediaKeys.js => packages/EncryptedMediaExtensions/src/MediaKeySystemAccess.js (100%) rename {src/EncryptedMediaExtensionsAPI => packages/EncryptedMediaExtensions/src}/MediaKeySystemAccess.res (50%) rename src/EventAPI.js => packages/EncryptedMediaExtensions/src/MediaKeys.js (100%) rename {src/EncryptedMediaExtensionsAPI => packages/EncryptedMediaExtensions/src}/MediaKeys.res (51%) rename src/EventAPI/AbortController.js => packages/EncryptedMediaExtensions/src/Navigator.js (100%) create mode 100644 packages/EncryptedMediaExtensions/src/Navigator.res rename src/FetchAPI.js => packages/EncryptedMediaExtensions/src/Types.js (100%) rename src/EncryptedMediaExtensionsAPI.res => packages/EncryptedMediaExtensions/src/Types.res (99%) create mode 100644 packages/Event/package.json create mode 100644 packages/Event/rescript.json rename src/FetchAPI/BodyInit.js => packages/Event/src/AbortController.js (100%) rename {src/EventAPI => packages/Event/src}/AbortController.res (70%) create mode 100644 packages/Event/src/AbortSignal.js rename {src/EventAPI => packages/Event/src}/AbortSignal.res (59%) rename {src/EventAPI => packages/Event/src}/Event.js (100%) rename {src/EventAPI => packages/Event/src}/Event.res (85%) rename {src/EventAPI => packages/Event/src}/EventTarget.js (100%) rename {src/EventAPI => packages/Event/src}/EventTarget.res (88%) rename {src/EventAPI => packages/Event/src}/ExtendableEvent.js (58%) rename {src/EventAPI => packages/Event/src}/ExtendableEvent.res (56%) rename src/FetchAPI/FormData.js => packages/Event/src/Types.js (100%) rename src/EventAPI.res => packages/Event/src/Types.res (99%) create mode 100644 packages/Fetch/lib/rescript.lock create mode 100644 packages/Fetch/package.json create mode 100644 packages/Fetch/rescript.json rename src/FetchAPI/Headers.js => packages/Fetch/src/BodyInit.js (100%) rename {src/FetchAPI => packages/Fetch/src}/BodyInit.res (62%) rename src/FetchAPI/HeadersInit.js => packages/Fetch/src/FormData.js (100%) rename {src/FetchAPI => packages/Fetch/src}/FormData.res (52%) rename src/FetchAPI/Request.js => packages/Fetch/src/Global.js (100%) create mode 100644 packages/Fetch/src/Global.res rename src/FetchAPI/Response.js => packages/Fetch/src/Headers.js (100%) rename {src/FetchAPI => packages/Fetch/src}/Headers.res (57%) rename src/FetchAPI/URLSearchParams.js => packages/Fetch/src/HeadersInit.js (100%) rename {src/FetchAPI => packages/Fetch/src}/HeadersInit.res (60%) rename src/FileAPI.js => packages/Fetch/src/Navigator.js (100%) create mode 100644 packages/Fetch/src/Navigator.res rename src/FileAPI/FileSystemDirectoryHandle.js => packages/Fetch/src/Request.js (100%) rename {src/FetchAPI => packages/Fetch/src}/Request.res (56%) rename src/FileAPI/FileSystemFileHandle.js => packages/Fetch/src/Response.js (100%) rename {src/FetchAPI => packages/Fetch/src}/Response.res (51%) rename src/FileAPI/FileSystemHandle.js => packages/Fetch/src/Types.js (100%) rename src/FetchAPI.res => packages/Fetch/src/Types.res (97%) rename {src/URLAPI => packages/Fetch/src}/URLSearchParams.js (100%) create mode 100644 packages/File/package.json create mode 100644 packages/File/rescript.json rename {src/FileAPI => packages/File/src}/Blob.js (100%) rename {src/FileAPI => packages/File/src}/Blob.res (73%) rename {src/FileAPI => packages/File/src}/File.js (72%) rename {src/FileAPI => packages/File/src}/File.res (57%) rename src/FileAPI/FileSystemWritableFileStream.js => packages/File/src/FileSystemDirectoryHandle.js (100%) rename {src/FileAPI => packages/File/src}/FileSystemDirectoryHandle.res (51%) rename src/FileAPI/ReadableStream.js => packages/File/src/FileSystemFileHandle.js (100%) create mode 100644 packages/File/src/FileSystemFileHandle.res rename src/FileAPI/WritableStream.js => packages/File/src/FileSystemHandle.js (100%) create mode 100644 packages/File/src/FileSystemHandle.res rename src/FileAPI/WritableStreamDefaultController.js => packages/File/src/FileSystemWritableFileStream.js (100%) rename {src/FileAPI => packages/File/src}/FileSystemWritableFileStream.res (51%) rename src/FileAndDirectoryEntriesAPI.js => packages/File/src/ReadableStream.js (100%) rename {src/FileAPI => packages/File/src}/ReadableStream.res (59%) rename src/FileAndDirectoryEntriesAPI/FileSystemDirectoryEntry.js => packages/File/src/Types.js (100%) rename src/FileAPI.res => packages/File/src/Types.res (95%) rename src/FileAndDirectoryEntriesAPI/FileSystemDirectoryReader.js => packages/File/src/WritableStream.js (100%) rename {src/FileAPI => packages/File/src}/WritableStream.res (50%) rename src/FileAndDirectoryEntriesAPI/FileSystemEntry.js => packages/File/src/WritableStreamDefaultController.js (100%) rename {src/FileAPI => packages/File/src}/WritableStreamDefaultController.res (54%) create mode 100644 packages/FileAndDirectoryEntries/package.json create mode 100644 packages/FileAndDirectoryEntries/rescript.json rename src/GamepadAPI.js => packages/FileAndDirectoryEntries/src/FileSystemDirectoryEntry.js (100%) create mode 100644 packages/FileAndDirectoryEntries/src/FileSystemDirectoryEntry.res rename src/GamepadAPI/GamepadHapticActuator.js => packages/FileAndDirectoryEntries/src/FileSystemDirectoryReader.js (100%) rename {src/FileAndDirectoryEntriesAPI => packages/FileAndDirectoryEntries/src}/FileSystemDirectoryReader.res (53%) rename src/GeolocationAPI.js => packages/FileAndDirectoryEntries/src/FileSystemEntry.js (100%) rename {src/FileAndDirectoryEntriesAPI => packages/FileAndDirectoryEntries/src}/FileSystemEntry.res (52%) rename src/GeolocationAPI/Geolocation.js => packages/FileAndDirectoryEntries/src/Types.js (100%) create mode 100644 packages/FileAndDirectoryEntries/src/Types.res create mode 100644 packages/Gamepad/package.json create mode 100644 packages/Gamepad/rescript.json rename src/GeolocationAPI/GeolocationCoordinates.js => packages/Gamepad/src/GamepadHapticActuator.js (100%) create mode 100644 packages/Gamepad/src/GamepadHapticActuator.res rename src/GeolocationAPI/GeolocationPosition.js => packages/Gamepad/src/Navigator.js (100%) create mode 100644 packages/Gamepad/src/Navigator.res rename src/HistoryAPI.js => packages/Gamepad/src/Types.js (100%) rename src/GamepadAPI.res => packages/Gamepad/src/Types.res (100%) create mode 100644 packages/Geolocation/package.json create mode 100644 packages/Geolocation/rescript.json rename src/HistoryAPI/History.js => packages/Geolocation/src/Geolocation.js (100%) rename {src/GeolocationAPI => packages/Geolocation/src}/Geolocation.res (53%) rename src/IndexedDBAPI.js => packages/Geolocation/src/GeolocationCoordinates.js (100%) rename {src/GeolocationAPI => packages/Geolocation/src}/GeolocationCoordinates.res (54%) rename src/IndexedDBAPI/IDBFactory.js => packages/Geolocation/src/GeolocationPosition.js (100%) rename {src/GeolocationAPI => packages/Geolocation/src}/GeolocationPosition.res (54%) rename src/IndexedDBAPI/IDBIndex.js => packages/Geolocation/src/Types.js (100%) rename src/GeolocationAPI.res => packages/Geolocation/src/Types.res (100%) create mode 100644 packages/Globals/package.json create mode 100644 packages/Globals/rescript.json rename src/IndexedDBAPI/IDBObjectStore.js => packages/Globals/src/Global.js (100%) create mode 100644 packages/Globals/src/Global.res create mode 100644 packages/History/package.json create mode 100644 packages/History/rescript.json rename src/IntersectionObserverAPI.js => packages/History/src/History.js (100%) rename {src/HistoryAPI => packages/History/src}/History.res (57%) rename src/IntersectionObserverAPI/IntersectionObserver.js => packages/History/src/Types.js (100%) rename src/HistoryAPI.res => packages/History/src/Types.res (100%) create mode 100644 packages/IndexedDB/package.json create mode 100644 packages/IndexedDB/rescript.json create mode 100644 packages/IndexedDB/src/IDBDatabase.js rename {src/IndexedDBAPI => packages/IndexedDB/src}/IDBDatabase.res (68%) rename src/MediaCapabilitiesAPI.js => packages/IndexedDB/src/IDBFactory.js (100%) rename {src/IndexedDBAPI => packages/IndexedDB/src}/IDBFactory.res (73%) rename src/MediaCapabilitiesAPI/MediaCapabilities.js => packages/IndexedDB/src/IDBIndex.js (100%) rename {src/IndexedDBAPI => packages/IndexedDB/src}/IDBIndex.res (76%) rename src/MediaCaptureAndStreamsAPI.js => packages/IndexedDB/src/IDBObjectStore.js (100%) rename {src/IndexedDBAPI => packages/IndexedDB/src}/IDBObjectStore.res (78%) create mode 100644 packages/IndexedDB/src/IDBTransaction.js rename {src/IndexedDBAPI => packages/IndexedDB/src}/IDBTransaction.res (64%) rename src/MediaCaptureAndStreamsAPI/MediaDeviceInfo.js => packages/IndexedDB/src/Types.js (100%) rename src/IndexedDBAPI.res => packages/IndexedDB/src/Types.res (95%) create mode 100644 packages/IntersectionObserver/package.json create mode 100644 packages/IntersectionObserver/rescript.json rename src/MediaSessionAPI.js => packages/IntersectionObserver/src/IntersectionObserver.js (100%) rename {src/IntersectionObserverAPI => packages/IntersectionObserver/src}/IntersectionObserver.res (51%) create mode 100644 packages/IntersectionObserver/src/IntersectionObserverRoot.js create mode 100644 packages/IntersectionObserver/src/IntersectionObserverRoot.res rename src/MediaSessionAPI/MediaMetadata.js => packages/IntersectionObserver/src/Types.js (100%) rename src/IntersectionObserverAPI.res => packages/IntersectionObserver/src/Types.res (92%) create mode 100644 packages/MediaCapabilities/package.json create mode 100644 packages/MediaCapabilities/rescript.json rename src/MediaSessionAPI/MediaSession.js => packages/MediaCapabilities/src/MediaCapabilities.js (100%) rename {src/MediaCapabilitiesAPI => packages/MediaCapabilities/src}/MediaCapabilities.res (50%) rename src/MutationObserverAPI.js => packages/MediaCapabilities/src/Types.js (100%) rename src/MediaCapabilitiesAPI.res => packages/MediaCapabilities/src/Types.res (100%) create mode 100644 packages/MediaCaptureAndStreams/package.json create mode 100644 packages/MediaCaptureAndStreams/rescript.json rename src/MutationObserverAPI/MutationObserver.js => packages/MediaCaptureAndStreams/src/MediaDeviceInfo.js (100%) rename {src/MediaCaptureAndStreamsAPI => packages/MediaCaptureAndStreams/src}/MediaDeviceInfo.res (51%) create mode 100644 packages/MediaCaptureAndStreams/src/MediaDevices.js rename {src/MediaCaptureAndStreamsAPI => packages/MediaCaptureAndStreams/src}/MediaDevices.res (50%) create mode 100644 packages/MediaCaptureAndStreams/src/MediaStream.js rename {src/MediaCaptureAndStreamsAPI => packages/MediaCaptureAndStreams/src}/MediaStream.res (52%) create mode 100644 packages/MediaCaptureAndStreams/src/MediaStreamTrack.js rename {src/MediaCaptureAndStreamsAPI => packages/MediaCaptureAndStreams/src}/MediaStreamTrack.res (55%) rename src/NotificationAPI.js => packages/MediaCaptureAndStreams/src/Types.js (100%) rename src/MediaCaptureAndStreamsAPI.res => packages/MediaCaptureAndStreams/src/Types.res (98%) create mode 100644 packages/MediaSession/package.json create mode 100644 packages/MediaSession/rescript.json rename src/PerformanceAPI.js => packages/MediaSession/src/MediaMetadata.js (100%) create mode 100644 packages/MediaSession/src/MediaMetadata.res rename src/PerformanceAPI/PerformanceEntry.js => packages/MediaSession/src/MediaSession.js (100%) rename {src/MediaSessionAPI => packages/MediaSession/src}/MediaSession.res (55%) rename src/PerformanceAPI/PerformanceMark.js => packages/MediaSession/src/Types.js (100%) rename src/MediaSessionAPI.res => packages/MediaSession/src/Types.res (100%) create mode 100644 packages/MutationObserver/package.json create mode 100644 packages/MutationObserver/rescript.json rename src/PermissionsAPI.js => packages/MutationObserver/src/MutationObserver.js (100%) rename {src/MutationObserverAPI => packages/MutationObserver/src}/MutationObserver.res (50%) rename src/PermissionsAPI/Permissions.js => packages/MutationObserver/src/Types.js (100%) rename src/MutationObserverAPI.res => packages/MutationObserver/src/Types.res (81%) create mode 100644 packages/Notification/package.json create mode 100644 packages/Notification/rescript.json create mode 100644 packages/Notification/src/Notification.js rename {src/NotificationAPI => packages/Notification/src}/Notification.res (53%) rename src/PictureInPictureAPI.js => packages/Notification/src/Types.js (100%) rename src/NotificationAPI.res => packages/Notification/src/Types.res (97%) create mode 100644 packages/Performance/package.json create mode 100644 packages/Performance/rescript.json create mode 100644 packages/Performance/src/Performance.js rename {src/PerformanceAPI => packages/Performance/src}/Performance.res (56%) rename src/Prelude/DOMException.js => packages/Performance/src/PerformanceEntry.js (100%) rename {src/PerformanceAPI => packages/Performance/src}/PerformanceEntry.res (54%) rename src/Prelude/DOMStringList.js => packages/Performance/src/PerformanceMark.js (100%) create mode 100644 packages/Performance/src/PerformanceMark.res rename src/PushAPI.js => packages/Performance/src/Types.js (100%) rename src/PerformanceAPI.res => packages/Performance/src/Types.res (98%) create mode 100644 packages/Permissions/package.json create mode 100644 packages/Permissions/rescript.json rename src/PushAPI/ApplicationServerKey.js => packages/Permissions/src/Permissions.js (100%) create mode 100644 packages/Permissions/src/Permissions.res rename src/PushAPI/PushManager.js => packages/Permissions/src/Types.js (100%) rename src/PermissionsAPI.res => packages/Permissions/src/Types.res (96%) create mode 100644 packages/PictureInPicture/package.json create mode 100644 packages/PictureInPicture/rescript.json rename src/PushAPI/PushMessageData.js => packages/PictureInPicture/src/Types.js (100%) rename src/PictureInPictureAPI.res => packages/PictureInPicture/src/Types.res (92%) create mode 100644 packages/Prelude/lib/rescript.lock create mode 100644 packages/Prelude/package.json create mode 100644 packages/Prelude/rescript.json rename src/PushAPI/PushSubscription.js => packages/Prelude/src/DOMException.js (100%) create mode 100644 packages/Prelude/src/DOMException.res rename src/RemotePlaybackAPI.js => packages/Prelude/src/DOMStringList.js (100%) rename {src/Prelude => packages/Prelude/src}/DOMStringList.res (69%) rename {src => packages/Prelude/src}/Prelude.js (100%) create mode 100644 packages/Prelude/src/Types.js rename src/DOMAPI.res => packages/Prelude/src/Types.res (78%) create mode 100644 packages/Push/package.json create mode 100644 packages/Push/rescript.json rename src/ResizeObserverAPI.js => packages/Push/src/ApplicationServerKey.js (100%) create mode 100644 packages/Push/src/ApplicationServerKey.res create mode 100644 packages/Push/src/PushEvent.js create mode 100644 packages/Push/src/PushEvent.res rename src/ResizeObserverAPI/ResizeObserver.js => packages/Push/src/PushManager.js (100%) rename {src/PushAPI => packages/Push/src}/PushManager.res (50%) rename src/ScreenWakeLockAPI.js => packages/Push/src/PushMessageData.js (100%) rename {src/PushAPI => packages/Push/src}/PushMessageData.res (79%) rename src/ScreenWakeLockAPI/WakeLock.js => packages/Push/src/PushSubscription.js (100%) rename {src/PushAPI => packages/Push/src}/PushSubscription.res (54%) rename src/ServiceWorkerAPI.js => packages/Push/src/Types.js (100%) rename src/PushAPI.res => packages/Push/src/Types.res (98%) create mode 100644 packages/RemotePlayback/package.json create mode 100644 packages/RemotePlayback/rescript.json create mode 100644 packages/RemotePlayback/src/RemotePlayback.js rename {src/RemotePlaybackAPI => packages/RemotePlayback/src}/RemotePlayback.res (53%) rename src/ServiceWorkerAPI/Cache.js => packages/RemotePlayback/src/Types.js (100%) rename src/RemotePlaybackAPI.res => packages/RemotePlayback/src/Types.res (93%) create mode 100644 packages/ResizeObserver/package.json create mode 100644 packages/ResizeObserver/rescript.json rename src/ServiceWorkerAPI/Clients.js => packages/ResizeObserver/src/ResizeObserver.js (100%) rename {src/ResizeObserverAPI => packages/ResizeObserver/src}/ResizeObserver.res (53%) rename src/ServiceWorkerAPI/NavigationPreloadManager.js => packages/ResizeObserver/src/Types.js (100%) rename src/ResizeObserverAPI.res => packages/ResizeObserver/src/Types.res (96%) create mode 100644 packages/ScreenWakeLock/package.json create mode 100644 packages/ScreenWakeLock/rescript.json rename src/StorageAPI.js => packages/ScreenWakeLock/src/Types.js (100%) rename src/ScreenWakeLockAPI.res => packages/ScreenWakeLock/src/Types.res (94%) rename src/StorageAPI/StorageManager.js => packages/ScreenWakeLock/src/WakeLock.js (100%) create mode 100644 packages/ScreenWakeLock/src/WakeLock.res create mode 100644 packages/ScreenWakeLock/src/WakeLockSentinel.js create mode 100644 packages/ScreenWakeLock/src/WakeLockSentinel.res create mode 100644 packages/ServiceWorker/package.json create mode 100644 packages/ServiceWorker/rescript.json rename src/UIEventsAPI.js => packages/ServiceWorker/src/Cache.js (100%) create mode 100644 packages/ServiceWorker/src/Cache.res rename src/UIEventsAPI/DataTransfer.js => packages/ServiceWorker/src/Clients.js (100%) rename {src/ServiceWorkerAPI => packages/ServiceWorker/src}/Clients.res (70%) rename src/UIEventsAPI/DataTransferItem.js => packages/ServiceWorker/src/NavigationPreloadManager.js (100%) rename {src/ServiceWorkerAPI => packages/ServiceWorker/src}/NavigationPreloadManager.res (55%) rename src/UIEventsAPI/DataTransferItemList.js => packages/ServiceWorker/src/Navigator.js (100%) create mode 100644 packages/ServiceWorker/src/Navigator.res create mode 100644 packages/ServiceWorker/src/ServiceWorker.js rename {src/ServiceWorkerAPI => packages/ServiceWorker/src}/ServiceWorker.res (53%) create mode 100644 packages/ServiceWorker/src/ServiceWorkerContainer.js rename {src/ServiceWorkerAPI => packages/ServiceWorker/src}/ServiceWorkerContainer.res (53%) create mode 100644 packages/ServiceWorker/src/ServiceWorkerGlobalScope.js rename {src/ServiceWorkerAPI => packages/ServiceWorker/src}/ServiceWorkerGlobalScope.res (51%) create mode 100644 packages/ServiceWorker/src/ServiceWorkerRegistration.js rename {src/ServiceWorkerAPI => packages/ServiceWorker/src}/ServiceWorkerRegistration.res (54%) rename src/UIEventsAPI/Touch.js => packages/ServiceWorker/src/Types.js (100%) rename src/ServiceWorkerAPI.res => packages/ServiceWorker/src/Types.res (94%) create mode 100644 packages/Storage/package.json create mode 100644 packages/Storage/rescript.json rename src/UIEventsAPI/TouchList.js => packages/Storage/src/StorageManager.js (100%) rename {src/StorageAPI => packages/Storage/src}/StorageManager.res (54%) rename src/URLAPI.js => packages/Storage/src/Types.js (100%) rename src/StorageAPI.res => packages/Storage/src/Types.res (100%) create mode 100644 packages/UIEvents/package.json create mode 100644 packages/UIEvents/rescript.json create mode 100644 packages/UIEvents/src/CompositionEvent.js create mode 100644 packages/UIEvents/src/CompositionEvent.res rename src/URLAPI/URL.js => packages/UIEvents/src/DataTransfer.js (100%) rename {src/UIEventsAPI => packages/UIEvents/src}/DataTransfer.res (65%) rename src/ViewTransitionsAPI.js => packages/UIEvents/src/DataTransferItem.js (100%) rename {src/UIEventsAPI => packages/UIEvents/src}/DataTransferItem.res (54%) rename src/ViewTransitionsAPI/ViewTransition.js => packages/UIEvents/src/DataTransferItemList.js (100%) rename {src/UIEventsAPI => packages/UIEvents/src}/DataTransferItemList.res (69%) create mode 100644 packages/UIEvents/src/FocusEvent.js create mode 100644 packages/UIEvents/src/FocusEvent.res create mode 100644 packages/UIEvents/src/InputEvent.js create mode 100644 packages/UIEvents/src/InputEvent.res create mode 100644 packages/UIEvents/src/KeyboardEvent.js create mode 100644 packages/UIEvents/src/KeyboardEvent.res rename {src/UIEventsAPI => packages/UIEvents/src}/MouseEvent.js (55%) rename {src/UIEventsAPI => packages/UIEvents/src}/MouseEvent.res (62%) create mode 100644 packages/UIEvents/src/PointerEvent.js create mode 100644 packages/UIEvents/src/PointerEvent.res rename src/VisualViewportAPI.js => packages/UIEvents/src/Touch.js (100%) rename {src/UIEventsAPI => packages/UIEvents/src}/Touch.res (56%) create mode 100644 packages/UIEvents/src/TouchEvent.js create mode 100644 packages/UIEvents/src/TouchEvent.res rename src/WebAudioAPI.js => packages/UIEvents/src/TouchList.js (100%) rename {src/UIEventsAPI => packages/UIEvents/src}/TouchList.res (57%) rename src/WebAudioAPI/AudioBuffer.js => packages/UIEvents/src/Types.js (100%) rename src/UIEventsAPI.res => packages/UIEvents/src/Types.res (97%) rename {src/UIEventsAPI => packages/UIEvents/src}/UIEvent.js (53%) create mode 100644 packages/UIEvents/src/UIEvent.res create mode 100644 packages/UIEvents/src/WheelEvent.js create mode 100644 packages/UIEvents/src/WheelEvent.res create mode 100644 packages/URL/package.json create mode 100644 packages/URL/rescript.json rename src/WebAudioAPI/AudioParam.js => packages/URL/src/Types.js (100%) rename src/URLAPI.res => packages/URL/src/Types.res (100%) rename src/WebAudioAPI/PeriodicWave.js => packages/URL/src/URL.js (100%) rename {src/URLAPI => packages/URL/src}/URL.res (80%) rename src/WebAudioAPI/Worklet.js => packages/URL/src/URLSearchParams.js (100%) rename {src/URLAPI => packages/URL/src}/URLSearchParams.res (66%) create mode 100644 packages/ViewTransitions/package.json create mode 100644 packages/ViewTransitions/rescript.json rename src/WebCryptoAPI.js => packages/ViewTransitions/src/Types.js (100%) rename src/ViewTransitionsAPI.res => packages/ViewTransitions/src/Types.res (100%) rename src/WebCryptoAPI/Crypto.js => packages/ViewTransitions/src/ViewTransition.js (100%) rename {src/ViewTransitionsAPI => packages/ViewTransitions/src}/ViewTransition.res (53%) create mode 100644 packages/VisualViewport/package.json create mode 100644 packages/VisualViewport/rescript.json rename src/WebCryptoAPI/SubtleCrypto.js => packages/VisualViewport/src/Types.js (100%) rename src/VisualViewportAPI.res => packages/VisualViewport/src/Types.res (96%) create mode 100644 packages/WebAudio/package.json create mode 100644 packages/WebAudio/rescript.json create mode 100644 packages/WebAudio/src/AnalyserNode.js create mode 100644 packages/WebAudio/src/AnalyserNode.res rename src/WebLocksAPI.js => packages/WebAudio/src/AudioBuffer.js (100%) rename {src/WebAudioAPI => packages/WebAudio/src}/AudioBuffer.res (76%) create mode 100644 packages/WebAudio/src/AudioBufferSourceNode.js rename {src/WebAudioAPI => packages/WebAudio/src}/AudioBufferSourceNode.res (56%) create mode 100644 packages/WebAudio/src/AudioContext.js rename {src/WebAudioAPI => packages/WebAudio/src}/AudioContext.res (53%) create mode 100644 packages/WebAudio/src/AudioDestinationNode.js create mode 100644 packages/WebAudio/src/AudioDestinationNode.res rename {src/WebAudioAPI => packages/WebAudio/src}/AudioNode.js (53%) rename {src/WebAudioAPI => packages/WebAudio/src}/AudioNode.res (58%) rename src/WebLocksAPI/LockManager.js => packages/WebAudio/src/AudioParam.js (100%) rename {src/WebAudioAPI => packages/WebAudio/src}/AudioParam.res (61%) create mode 100644 packages/WebAudio/src/AudioProcessingEvent.js create mode 100644 packages/WebAudio/src/AudioProcessingEvent.res rename {src/WebAudioAPI => packages/WebAudio/src}/AudioScheduledSourceNode.js (53%) rename {src/WebAudioAPI => packages/WebAudio/src}/AudioScheduledSourceNode.res (73%) create mode 100644 packages/WebAudio/src/AudioWorkletNode.js create mode 100644 packages/WebAudio/src/AudioWorkletNode.res rename {src/WebAudioAPI => packages/WebAudio/src}/BaseAudioContext.js (53%) rename {src/WebAudioAPI => packages/WebAudio/src}/BaseAudioContext.res (64%) create mode 100644 packages/WebAudio/src/BiquadFilterNode.js rename {src/WebAudioAPI => packages/WebAudio/src}/BiquadFilterNode.res (65%) create mode 100644 packages/WebAudio/src/ChannelMergerNode.js create mode 100644 packages/WebAudio/src/ChannelMergerNode.res create mode 100644 packages/WebAudio/src/ChannelSplitterNode.js create mode 100644 packages/WebAudio/src/ChannelSplitterNode.res create mode 100644 packages/WebAudio/src/ConstantSourceNode.js create mode 100644 packages/WebAudio/src/ConstantSourceNode.res create mode 100644 packages/WebAudio/src/ConvolverNode.js create mode 100644 packages/WebAudio/src/ConvolverNode.res create mode 100644 packages/WebAudio/src/DelayNode.js create mode 100644 packages/WebAudio/src/DelayNode.res create mode 100644 packages/WebAudio/src/DynamicsCompressorNode.js create mode 100644 packages/WebAudio/src/DynamicsCompressorNode.res create mode 100644 packages/WebAudio/src/GainNode.js create mode 100644 packages/WebAudio/src/GainNode.res create mode 100644 packages/WebAudio/src/IIRFilterNode.js rename {src/WebAudioAPI => packages/WebAudio/src}/IIRFilterNode.res (67%) create mode 100644 packages/WebAudio/src/MediaElementAudioSourceNode.js create mode 100644 packages/WebAudio/src/MediaElementAudioSourceNode.res create mode 100644 packages/WebAudio/src/MediaStreamAudioDestinationNode.js create mode 100644 packages/WebAudio/src/MediaStreamAudioDestinationNode.res create mode 100644 packages/WebAudio/src/MediaStreamAudioSourceNode.js create mode 100644 packages/WebAudio/src/MediaStreamAudioSourceNode.res create mode 100644 packages/WebAudio/src/OfflineAudioCompletionEvent.js create mode 100644 packages/WebAudio/src/OfflineAudioCompletionEvent.res create mode 100644 packages/WebAudio/src/OfflineAudioContext.js rename {src/WebAudioAPI => packages/WebAudio/src}/OfflineAudioContext.res (56%) create mode 100644 packages/WebAudio/src/OscillatorNode.js create mode 100644 packages/WebAudio/src/OscillatorNode.res create mode 100644 packages/WebAudio/src/PannerNode.js create mode 100644 packages/WebAudio/src/PannerNode.res rename src/WebMIDIAPI.js => packages/WebAudio/src/PeriodicWave.js (100%) create mode 100644 packages/WebAudio/src/PeriodicWave.res create mode 100644 packages/WebAudio/src/StereoPannerNode.js create mode 100644 packages/WebAudio/src/StereoPannerNode.res rename src/WebSocketsAPI.js => packages/WebAudio/src/Types.js (100%) rename src/WebAudioAPI.res => packages/WebAudio/src/Types.res (97%) create mode 100644 packages/WebAudio/src/WaveShaperNode.js create mode 100644 packages/WebAudio/src/WaveShaperNode.res rename src/WebSocketsAPI/MessageEvent.js => packages/WebAudio/src/Worklet.js (100%) rename {src/WebAudioAPI => packages/WebAudio/src}/Worklet.res (87%) create mode 100644 packages/WebCrypto/package.json create mode 100644 packages/WebCrypto/rescript.json rename src/WebSpeechAPI.js => packages/WebCrypto/src/Crypto.js (100%) rename {src/WebCryptoAPI => packages/WebCrypto/src}/Crypto.res (58%) rename src/WebStorageAPI.js => packages/WebCrypto/src/SubtleCrypto.js (100%) rename {src/WebCryptoAPI => packages/WebCrypto/src}/SubtleCrypto.res (53%) rename src/WebStorageAPI/Storage.js => packages/WebCrypto/src/Types.js (100%) rename src/WebCryptoAPI.res => packages/WebCrypto/src/Types.res (100%) create mode 100644 packages/WebLocks/package.json create mode 100644 packages/WebLocks/rescript.json rename src/WebVTTAPI.js => packages/WebLocks/src/LockManager.js (100%) rename {src/WebLocksAPI => packages/WebLocks/src}/LockManager.res (56%) rename src/WebVTTAPI/TextTrackCueList.js => packages/WebLocks/src/Types.js (100%) rename src/WebLocksAPI.res => packages/WebLocks/src/Types.res (95%) create mode 100644 packages/WebMIDI/package.json create mode 100644 packages/WebMIDI/rescript.json rename src/WebWorkersAPI.js => packages/WebMIDI/src/Navigator.js (100%) create mode 100644 packages/WebMIDI/src/Navigator.res rename src/WebWorkersAPI/CacheStorage.js => packages/WebMIDI/src/Types.js (100%) rename src/WebMIDIAPI.res => packages/WebMIDI/src/Types.res (96%) create mode 100644 packages/WebSockets/package.json create mode 100644 packages/WebSockets/rescript.json create mode 100644 packages/WebSockets/src/CloseEvent.js create mode 100644 packages/WebSockets/src/CloseEvent.res create mode 100644 packages/WebSockets/src/MessageEvent.js rename {src/WebSocketsAPI => packages/WebSockets/src}/MessageEvent.res (70%) create mode 100644 packages/WebSockets/src/Types.js rename src/WebSocketsAPI.res => packages/WebSockets/src/Types.res (94%) create mode 100644 packages/WebSockets/src/WebSocket.js rename {src/WebSocketsAPI => packages/WebSockets/src}/WebSocket.res (68%) create mode 100644 packages/WebSpeech/package.json create mode 100644 packages/WebSpeech/rescript.json create mode 100644 packages/WebSpeech/src/SpeechSynthesis.js rename {src/WebSpeechAPI => packages/WebSpeech/src}/SpeechSynthesis.res (54%) create mode 100644 packages/WebSpeech/src/SpeechSynthesisUtterance.js create mode 100644 packages/WebSpeech/src/SpeechSynthesisUtterance.res create mode 100644 packages/WebSpeech/src/Types.js rename src/WebSpeechAPI.res => packages/WebSpeech/src/Types.res (98%) create mode 100644 packages/WebStorage/package.json create mode 100644 packages/WebStorage/rescript.json create mode 100644 packages/WebStorage/src/Storage.js rename {src/WebStorageAPI => packages/WebStorage/src}/Storage.res (80%) create mode 100644 packages/WebStorage/src/StorageEvent.js create mode 100644 packages/WebStorage/src/StorageEvent.res create mode 100644 packages/WebStorage/src/Types.js rename src/WebStorageAPI.res => packages/WebStorage/src/Types.res (97%) create mode 100644 packages/WebVTT/package.json create mode 100644 packages/WebVTT/rescript.json create mode 100644 packages/WebVTT/src/TextTrack.js rename {src/WebVTTAPI => packages/WebVTT/src}/TextTrack.res (59%) create mode 100644 packages/WebVTT/src/TextTrackCueList.js rename {src/WebVTTAPI => packages/WebVTT/src}/TextTrackCueList.res (75%) create mode 100644 packages/WebVTT/src/Types.js rename src/WebVTTAPI.res => packages/WebVTT/src/Types.res (97%) create mode 100644 packages/WebWorkers/package.json create mode 100644 packages/WebWorkers/rescript.json create mode 100644 packages/WebWorkers/src/CacheStorage.js rename {src/WebWorkersAPI => packages/WebWorkers/src}/CacheStorage.res (53%) create mode 100644 packages/WebWorkers/src/SharedWorker.js rename {src/WebWorkersAPI => packages/WebWorkers/src}/SharedWorker.res (79%) create mode 100644 packages/WebWorkers/src/SharedWorkerGlobalScope.js rename {src/WebWorkersAPI => packages/WebWorkers/src}/SharedWorkerGlobalScope.res (88%) create mode 100644 packages/WebWorkers/src/Types.js rename src/WebWorkersAPI.res => packages/WebWorkers/src/Types.res (96%) create mode 100644 packages/WebWorkers/src/WorkerGlobalScope.js rename {src/WebWorkersAPI => packages/WebWorkers/src}/WorkerGlobalScope.res (72%) delete mode 100644 src/CSSFontLoadingAPI/FontFaceSet.js delete mode 100644 src/CanvasAPI/FillStyle.res delete mode 100644 src/CanvasAPI/OffscreenCanvas.js delete mode 100644 src/ChannelMessagingAPI/MessagePort.js delete mode 100644 src/ClipboardAPI/Clipboard.js delete mode 100644 src/DOMAPI/Animation.js delete mode 100644 src/DOMAPI/CSSStyleSheet.res delete mode 100644 src/DOMAPI/CaretPosition.res delete mode 100644 src/DOMAPI/Comment.js delete mode 100644 src/DOMAPI/Comment.res delete mode 100644 src/DOMAPI/DOMMatrix.res delete mode 100644 src/DOMAPI/DOMMatrixReadOnly.res delete mode 100644 src/DOMAPI/DOMRectList.res delete mode 100644 src/DOMAPI/DocumentTimeline.res delete mode 100644 src/DOMAPI/HTMLAnchorElement.js delete mode 100644 src/DOMAPI/HTMLAnchorElement.res delete mode 100644 src/DOMAPI/HTMLAreaElement.js delete mode 100644 src/DOMAPI/HTMLAreaElement.res delete mode 100644 src/DOMAPI/HTMLAudioElement.js delete mode 100644 src/DOMAPI/HTMLAudioElement.res delete mode 100644 src/DOMAPI/HTMLBRElement.js delete mode 100644 src/DOMAPI/HTMLBRElement.res delete mode 100644 src/DOMAPI/HTMLBaseElement.js delete mode 100644 src/DOMAPI/HTMLBaseElement.res delete mode 100644 src/DOMAPI/HTMLBodyElement.js delete mode 100644 src/DOMAPI/HTMLBodyElement.res delete mode 100644 src/DOMAPI/HTMLButtonElement.js delete mode 100644 src/DOMAPI/HTMLCanvasElement.js delete mode 100644 src/DOMAPI/HTMLDListElement.js delete mode 100644 src/DOMAPI/HTMLDListElement.res delete mode 100644 src/DOMAPI/HTMLDataElement.js delete mode 100644 src/DOMAPI/HTMLDataElement.res delete mode 100644 src/DOMAPI/HTMLDataListElement.js delete mode 100644 src/DOMAPI/HTMLDataListElement.res delete mode 100644 src/DOMAPI/HTMLDialogElement.js delete mode 100644 src/DOMAPI/HTMLDivElement.js delete mode 100644 src/DOMAPI/HTMLDivElement.res delete mode 100644 src/DOMAPI/HTMLEmbedElement.js delete mode 100644 src/DOMAPI/HTMLEmbedElement.res delete mode 100644 src/DOMAPI/HTMLFieldSetElement.js delete mode 100644 src/DOMAPI/HTMLFormElement.js delete mode 100644 src/DOMAPI/HTMLFrameSetElement.js delete mode 100644 src/DOMAPI/HTMLFrameSetElement.res delete mode 100644 src/DOMAPI/HTMLHRElement.js delete mode 100644 src/DOMAPI/HTMLHRElement.res delete mode 100644 src/DOMAPI/HTMLHeadElement.js delete mode 100644 src/DOMAPI/HTMLHeadElement.res delete mode 100644 src/DOMAPI/HTMLHeadingElement.js delete mode 100644 src/DOMAPI/HTMLHeadingElement.res delete mode 100644 src/DOMAPI/HTMLHtmlElement.js delete mode 100644 src/DOMAPI/HTMLHtmlElement.res delete mode 100644 src/DOMAPI/HTMLIFrameElement.js delete mode 100644 src/DOMAPI/HTMLIFrameElement.res delete mode 100644 src/DOMAPI/HTMLImageElement.js delete mode 100644 src/DOMAPI/HTMLImageElement.res delete mode 100644 src/DOMAPI/HTMLInputElement.js delete mode 100644 src/DOMAPI/HTMLLIElement.js delete mode 100644 src/DOMAPI/HTMLLIElement.res delete mode 100644 src/DOMAPI/HTMLLabelElement.js delete mode 100644 src/DOMAPI/HTMLLabelElement.res delete mode 100644 src/DOMAPI/HTMLLegendElement.js delete mode 100644 src/DOMAPI/HTMLLegendElement.res delete mode 100644 src/DOMAPI/HTMLLinkElement.js delete mode 100644 src/DOMAPI/HTMLLinkElement.res delete mode 100644 src/DOMAPI/HTMLMapElement.js delete mode 100644 src/DOMAPI/HTMLMapElement.res delete mode 100644 src/DOMAPI/HTMLMediaElement.js delete mode 100644 src/DOMAPI/HTMLMenuElement.js delete mode 100644 src/DOMAPI/HTMLMenuElement.res delete mode 100644 src/DOMAPI/HTMLMetaElement.js delete mode 100644 src/DOMAPI/HTMLMetaElement.res delete mode 100644 src/DOMAPI/HTMLMeterElement.js delete mode 100644 src/DOMAPI/HTMLMeterElement.res delete mode 100644 src/DOMAPI/HTMLModElement.js delete mode 100644 src/DOMAPI/HTMLModElement.res delete mode 100644 src/DOMAPI/HTMLOListElement.js delete mode 100644 src/DOMAPI/HTMLOListElement.res delete mode 100644 src/DOMAPI/HTMLObjectElement.js delete mode 100644 src/DOMAPI/HTMLOptGroupElement.js delete mode 100644 src/DOMAPI/HTMLOptGroupElement.res delete mode 100644 src/DOMAPI/HTMLOptionElement.js delete mode 100644 src/DOMAPI/HTMLOptionElement.res delete mode 100644 src/DOMAPI/HTMLOutputElement.js delete mode 100644 src/DOMAPI/HTMLParagraphElement.js delete mode 100644 src/DOMAPI/HTMLParagraphElement.res delete mode 100644 src/DOMAPI/HTMLPictureElement.js delete mode 100644 src/DOMAPI/HTMLPictureElement.res delete mode 100644 src/DOMAPI/HTMLPreElement.js delete mode 100644 src/DOMAPI/HTMLPreElement.res delete mode 100644 src/DOMAPI/HTMLProgressElement.js delete mode 100644 src/DOMAPI/HTMLProgressElement.res delete mode 100644 src/DOMAPI/HTMLQuoteElement.js delete mode 100644 src/DOMAPI/HTMLQuoteElement.res delete mode 100644 src/DOMAPI/HTMLScriptElement.js delete mode 100644 src/DOMAPI/HTMLSelectElement.js delete mode 100644 src/DOMAPI/HTMLSlotElement.js delete mode 100644 src/DOMAPI/HTMLSourceElement.js delete mode 100644 src/DOMAPI/HTMLSourceElement.res delete mode 100644 src/DOMAPI/HTMLSpanElement.js delete mode 100644 src/DOMAPI/HTMLSpanElement.res delete mode 100644 src/DOMAPI/HTMLStyleElement.js delete mode 100644 src/DOMAPI/HTMLStyleElement.res delete mode 100644 src/DOMAPI/HTMLTableCaptionElement.js delete mode 100644 src/DOMAPI/HTMLTableCaptionElement.res delete mode 100644 src/DOMAPI/HTMLTableCellElement.js delete mode 100644 src/DOMAPI/HTMLTableCellElement.res delete mode 100644 src/DOMAPI/HTMLTableElement.js delete mode 100644 src/DOMAPI/HTMLTableRowElement.js delete mode 100644 src/DOMAPI/HTMLTableSectionElement.js delete mode 100644 src/DOMAPI/HTMLTemplateElement.js delete mode 100644 src/DOMAPI/HTMLTemplateElement.res delete mode 100644 src/DOMAPI/HTMLTextAreaElement.js delete mode 100644 src/DOMAPI/HTMLTimeElement.js delete mode 100644 src/DOMAPI/HTMLTimeElement.res delete mode 100644 src/DOMAPI/HTMLTitleElement.js delete mode 100644 src/DOMAPI/HTMLTitleElement.res delete mode 100644 src/DOMAPI/HTMLTrackElement.js delete mode 100644 src/DOMAPI/HTMLTrackElement.res delete mode 100644 src/DOMAPI/HTMLUListElement.js delete mode 100644 src/DOMAPI/HTMLUListElement.res delete mode 100644 src/DOMAPI/HTMLVideoElement.js delete mode 100644 src/DOMAPI/HTMLVideoElement.res delete mode 100644 src/DOMAPI/MediaQueryList.js delete mode 100644 src/DOMAPI/MediaQueryList.res delete mode 100644 src/DOMAPI/Navigator.res delete mode 100644 src/DOMAPI/Node.js delete mode 100644 src/DOMAPI/NodeFilter.res delete mode 100644 src/DOMAPI/SVGGraphicsElement.res delete mode 100644 src/DOMAPI/ScreenOrientation.js delete mode 100644 src/DOMAPI/ScreenOrientation.res delete mode 100644 src/DOMAPI/ShadowRoot.js delete mode 100644 src/DOMAPI/ShadowRoot.res delete mode 100644 src/DOMAPI/StylePropertyMap.res delete mode 100644 src/DOMAPI/Text.js delete mode 100644 src/DOMAPI/TextTrackList.js delete mode 100644 src/DOMAPI/TextTrackList.res delete mode 100644 src/DOMAPI/VideoFrame.res delete mode 100644 src/DOMAPI/Window.js delete mode 100644 src/DOMAPI/Window.res delete mode 100644 src/EncryptedMediaExtensionsAPI/MediaKeySession.js delete mode 100644 src/EventAPI/AbortSignal.js delete mode 100644 src/FileAPI/FileSystemFileHandle.res delete mode 100644 src/FileAPI/FileSystemHandle.res delete mode 100644 src/FileAndDirectoryEntriesAPI.res delete mode 100644 src/FileAndDirectoryEntriesAPI/FileSystemDirectoryEntry.res delete mode 100644 src/GamepadAPI/GamepadHapticActuator.res delete mode 100644 src/IndexedDBAPI/IDBDatabase.js delete mode 100644 src/IndexedDBAPI/IDBTransaction.js delete mode 100644 src/IntersectionObserverAPI/IntersectionObserverRoot.js delete mode 100644 src/IntersectionObserverAPI/IntersectionObserverRoot.res delete mode 100644 src/MediaCaptureAndStreamsAPI/MediaDevices.js delete mode 100644 src/MediaCaptureAndStreamsAPI/MediaStream.js delete mode 100644 src/MediaCaptureAndStreamsAPI/MediaStreamTrack.js delete mode 100644 src/MediaSessionAPI/MediaMetadata.res delete mode 100644 src/NotificationAPI/Notification.js delete mode 100644 src/PerformanceAPI/Performance.js delete mode 100644 src/PerformanceAPI/PerformanceMark.res delete mode 100644 src/PermissionsAPI/Permissions.res delete mode 100644 src/Prelude.res delete mode 100644 src/Prelude/DOMException.res delete mode 100644 src/PushAPI/ApplicationServerKey.res delete mode 100644 src/PushAPI/PushEvent.js delete mode 100644 src/PushAPI/PushEvent.res delete mode 100644 src/RemotePlaybackAPI/RemotePlayback.js delete mode 100644 src/ScreenWakeLockAPI/WakeLock.res delete mode 100644 src/ScreenWakeLockAPI/WakeLockSentinel.js delete mode 100644 src/ScreenWakeLockAPI/WakeLockSentinel.res delete mode 100644 src/ServiceWorkerAPI/Cache.res delete mode 100644 src/ServiceWorkerAPI/ServiceWorker.js delete mode 100644 src/ServiceWorkerAPI/ServiceWorkerContainer.js delete mode 100644 src/ServiceWorkerAPI/ServiceWorkerGlobalScope.js delete mode 100644 src/ServiceWorkerAPI/ServiceWorkerRegistration.js delete mode 100644 src/UIEventsAPI/CompositionEvent.js delete mode 100644 src/UIEventsAPI/CompositionEvent.res delete mode 100644 src/UIEventsAPI/FocusEvent.js delete mode 100644 src/UIEventsAPI/FocusEvent.res delete mode 100644 src/UIEventsAPI/InputEvent.js delete mode 100644 src/UIEventsAPI/InputEvent.res delete mode 100644 src/UIEventsAPI/KeyboardEvent.js delete mode 100644 src/UIEventsAPI/KeyboardEvent.res delete mode 100644 src/UIEventsAPI/PointerEvent.js delete mode 100644 src/UIEventsAPI/PointerEvent.res delete mode 100644 src/UIEventsAPI/TouchEvent.js delete mode 100644 src/UIEventsAPI/TouchEvent.res delete mode 100644 src/UIEventsAPI/UIEvent.res delete mode 100644 src/UIEventsAPI/WheelEvent.js delete mode 100644 src/UIEventsAPI/WheelEvent.res delete mode 100644 src/WebAudioAPI/AnalyserNode.js delete mode 100644 src/WebAudioAPI/AnalyserNode.res delete mode 100644 src/WebAudioAPI/AudioBufferSourceNode.js delete mode 100644 src/WebAudioAPI/AudioContext.js delete mode 100644 src/WebAudioAPI/AudioDestinationNode.js delete mode 100644 src/WebAudioAPI/AudioDestinationNode.res delete mode 100644 src/WebAudioAPI/AudioProcessingEvent.js delete mode 100644 src/WebAudioAPI/AudioProcessingEvent.res delete mode 100644 src/WebAudioAPI/AudioWorkletNode.js delete mode 100644 src/WebAudioAPI/AudioWorkletNode.res delete mode 100644 src/WebAudioAPI/BiquadFilterNode.js delete mode 100644 src/WebAudioAPI/ChannelMergerNode.js delete mode 100644 src/WebAudioAPI/ChannelMergerNode.res delete mode 100644 src/WebAudioAPI/ChannelSplitterNode.js delete mode 100644 src/WebAudioAPI/ChannelSplitterNode.res delete mode 100644 src/WebAudioAPI/ConstantSourceNode.js delete mode 100644 src/WebAudioAPI/ConstantSourceNode.res delete mode 100644 src/WebAudioAPI/ConvolverNode.js delete mode 100644 src/WebAudioAPI/ConvolverNode.res delete mode 100644 src/WebAudioAPI/DelayNode.js delete mode 100644 src/WebAudioAPI/DelayNode.res delete mode 100644 src/WebAudioAPI/DynamicsCompressorNode.js delete mode 100644 src/WebAudioAPI/DynamicsCompressorNode.res delete mode 100644 src/WebAudioAPI/GainNode.js delete mode 100644 src/WebAudioAPI/GainNode.res delete mode 100644 src/WebAudioAPI/IIRFilterNode.js delete mode 100644 src/WebAudioAPI/MediaElementAudioSourceNode.js delete mode 100644 src/WebAudioAPI/MediaElementAudioSourceNode.res delete mode 100644 src/WebAudioAPI/MediaStreamAudioDestinationNode.js delete mode 100644 src/WebAudioAPI/MediaStreamAudioDestinationNode.res delete mode 100644 src/WebAudioAPI/MediaStreamAudioSourceNode.js delete mode 100644 src/WebAudioAPI/MediaStreamAudioSourceNode.res delete mode 100644 src/WebAudioAPI/OfflineAudioCompletionEvent.js delete mode 100644 src/WebAudioAPI/OfflineAudioCompletionEvent.res delete mode 100644 src/WebAudioAPI/OfflineAudioContext.js delete mode 100644 src/WebAudioAPI/OscillatorNode.js delete mode 100644 src/WebAudioAPI/OscillatorNode.res delete mode 100644 src/WebAudioAPI/PannerNode.js delete mode 100644 src/WebAudioAPI/PannerNode.res delete mode 100644 src/WebAudioAPI/PeriodicWave.res delete mode 100644 src/WebAudioAPI/StereoPannerNode.js delete mode 100644 src/WebAudioAPI/StereoPannerNode.res delete mode 100644 src/WebAudioAPI/WaveShaperNode.js delete mode 100644 src/WebAudioAPI/WaveShaperNode.res delete mode 100644 src/WebSocketsAPI/CloseEvent.js delete mode 100644 src/WebSocketsAPI/CloseEvent.res delete mode 100644 src/WebSocketsAPI/WebSocket.js delete mode 100644 src/WebSpeechAPI/SpeechSynthesis.js delete mode 100644 src/WebSpeechAPI/SpeechSynthesisUtterance.js delete mode 100644 src/WebSpeechAPI/SpeechSynthesisUtterance.res delete mode 100644 src/WebStorageAPI/StorageEvent.js delete mode 100644 src/WebStorageAPI/StorageEvent.res delete mode 100644 src/WebVTTAPI/TextTrack.js delete mode 100644 src/WebWorkersAPI/SharedWorker.js delete mode 100644 src/WebWorkersAPI/SharedWorkerGlobalScope.js delete mode 100644 src/WebWorkersAPI/WorkerGlobalScope.js diff --git a/.gitignore b/.gitignore index f4fca422..a6095c13 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ dist/ tmp/ docs/public/llm.txt *~ + +**/lib/bs/ +**/lib/ocaml \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5e779246..0e02cab4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,16 @@ { - "name": "@rescript/webapi", + "name": "experimental-rescript-webapi", "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@rescript/webapi", + "name": "experimental-rescript-webapi", "version": "0.1.0", "license": "MIT", + "workspaces": [ + "packages/*" + ], "devDependencies": { "@astrojs/starlight": "0.37.7", "astro": "^5.10.1", @@ -1611,6 +1614,186 @@ "win32" ] }, + "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/globals": { + "resolved": "packages/Globals", + "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/prelude": { + "resolved": "packages/Prelude", + "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", @@ -1618,7 +1801,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -1634,7 +1816,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -1650,7 +1831,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1666,7 +1846,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -1678,8 +1857,7 @@ "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==", - "dev": true + "integrity": "sha512-NwfljDRq1rjFPHUaca1nzFz13xsa9ZGkBkLvMhvVgavJT5+A4rMcLu8XAaVTi/oAhO/tlHf9ZDoOTF1AfyAk9Q==" }, "node_modules/@rescript/win32-x64": { "version": "12.2.0", @@ -1688,7 +1866,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -6503,7 +6680,6 @@ "version": "12.2.0", "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.2.0.tgz", "integrity": "sha512-1Jf2cmNhyx5Mj2vwZ4XXPcXvNSjGj9D1jPBUcoqIOqRpLPo1ch2Ta/7eWh23xAHWHK5ow7BCDyYFjvZSjyjLzg==", - "dev": true, "dependencies": { "@rescript/runtime": "12.2.0" }, @@ -7492,166 +7668,639 @@ "type": "github", "url": "https://github.com/sponsors/wooorm" } - } - }, - "dependencies": { - "@astrojs/compiler": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.13.0.tgz", - "integrity": "sha512-mqVORhUJViA28fwHYaWmsXSzLO9osbdZ5ImUfxBarqsYdMlPbqAqGJCxsNzvppp1BEzc1mJNjOVvQqeDN8Vspw==", - "dev": true }, - "@astrojs/internal-helpers": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.6.1.tgz", - "integrity": "sha512-l5Pqf6uZu31aG+3Lv8nl/3s4DbUzdlxTWDof4pEpto6GUJNhhCbelVi9dEyurOVyqaelwmS9oSyOWOENSfgo9A==", - "dev": true + "packages/Canvas": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@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/prelude": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } }, - "@astrojs/markdown-remark": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-6.3.1.tgz", - "integrity": "sha512-c5F5gGrkczUaTVgmMW9g1YMJGzOtRvjjhw6IfGuxarM6ct09MpwysP10US729dy07gg8y+ofVifezvP3BNsWZg==", - "dev": true, - "requires": { - "@astrojs/internal-helpers": "0.6.1", - "@astrojs/prism": "3.2.0", - "github-slugger": "^2.0.0", - "hast-util-from-html": "^2.0.3", - "hast-util-to-text": "^4.0.2", - "import-meta-resolve": "^4.1.0", - "js-yaml": "^4.1.0", - "mdast-util-definitions": "^6.0.0", - "rehype-raw": "^7.0.0", - "rehype-stringify": "^10.0.1", - "remark-gfm": "^4.0.1", - "remark-parse": "^11.0.0", - "remark-rehype": "^11.1.1", - "remark-smartypants": "^3.0.2", - "shiki": "^3.0.0", - "smol-toml": "^1.3.1", - "unified": "^11.0.5", - "unist-util-remove-position": "^5.0.0", - "unist-util-visit": "^5.0.0", - "unist-util-visit-parents": "^6.0.1", - "vfile": "^6.0.3" + "packages/ChannelMessaging": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" } }, - "@astrojs/mdx": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-4.2.4.tgz", - "integrity": "sha512-c832AWpiMCcuPY8j+yr5T+hOf8n5RlKLFHlNTt15xxkOk3zjFJP81TIYKrMrbhD5rMzJ09Ixi+xM0m68w2Q0DQ==", - "dev": true, - "requires": { - "@astrojs/markdown-remark": "6.3.1", - "@mdx-js/mdx": "^3.1.0", - "acorn": "^8.14.1", - "es-module-lexer": "^1.6.0", - "estree-util-visit": "^2.0.0", - "hast-util-to-html": "^9.0.5", - "kleur": "^4.1.5", - "rehype-raw": "^7.0.0", - "remark-gfm": "^4.0.1", - "remark-smartypants": "^3.0.2", - "source-map": "^0.7.4", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.3" + "packages/Clipboard": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/file": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" } }, - "@astrojs/prism": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.2.0.tgz", - "integrity": "sha512-GilTHKGCW6HMq7y3BUv9Ac7GMe/MO9gi9GW62GzKtth0SwukCu/qp2wLiGpEujhY+VVhaG9v7kv/5vFzvf4NYw==", - "dev": true, - "requires": { - "prismjs": "^1.29.0" + "packages/CredentialManagement": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" } }, - "@astrojs/sitemap": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.3.0.tgz", - "integrity": "sha512-nYE4lKQtk+Kbrw/w0G0TTgT724co0jUsU4tPlHY9au5HmTBKbwiCLwO/15b1/y13aZ4Kr9ZbMeMHlXuwn0ty4Q==", - "dev": true, - "requires": { - "sitemap": "^8.0.0", - "stream-replace-string": "^2.0.0", - "zod": "^3.24.2" + "packages/CSSFontLoading": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" } }, - "@astrojs/starlight": { - "version": "0.37.7", - "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.37.7.tgz", - "integrity": "sha512-KyBnou8aKIlPJUSNx6a1SN7XyH22oj/VAvTGC+Edld4Bnei1A//pmCRTBvSrSeoGrdUjK0ErFUfaEhhO1bPfDg==", - "dev": true, - "requires": { - "@astrojs/markdown-remark": "^6.3.1", - "@astrojs/mdx": "^4.2.3", - "@astrojs/sitemap": "^3.3.0", - "@pagefind/default-ui": "^1.3.0", - "@types/hast": "^3.0.4", - "@types/js-yaml": "^4.0.9", - "@types/mdast": "^4.0.4", - "astro-expressive-code": "^0.41.1", - "bcp-47": "^2.1.0", - "hast-util-from-html": "^2.0.1", - "hast-util-select": "^6.0.2", - "hast-util-to-string": "^3.0.0", - "hastscript": "^9.0.0", - "i18next": "^23.11.5", - "js-yaml": "^4.1.0", - "klona": "^2.0.6", - "magic-string": "^0.30.17", - "mdast-util-directive": "^3.0.0", - "mdast-util-to-markdown": "^2.1.0", - "mdast-util-to-string": "^4.0.0", - "pagefind": "^1.3.0", - "rehype": "^13.0.1", - "rehype-format": "^5.0.0", - "remark-directive": "^3.0.0", - "ultrahtml": "^1.6.0", - "unified": "^11.0.5", - "unist-util-visit": "^5.0.0", - "vfile": "^6.0.2" + "packages/DOM": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@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/encrypted-media-extensions": "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/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/prelude": "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-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" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" } }, - "@astrojs/telemetry": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.3.0.tgz", - "integrity": "sha512-UFBgfeldP06qu6khs/yY+q1cDAaArM2/7AEIqQ9Cuvf7B1hNLq0xDrZkct+QoIGyjq56y8IaE2I3CTvG99mlhQ==", - "dev": true, - "requires": { - "ci-info": "^4.2.0", - "debug": "^4.4.0", - "dlv": "^1.1.3", - "dset": "^3.1.4", - "is-docker": "^3.0.0", - "is-wsl": "^3.1.0", - "which-pm-runs": "^1.1.0" + "packages/EncryptedMediaExtensions": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0", + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" } }, - "@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "dev": true + "packages/Event": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } }, - "@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "dev": true + "packages/Fetch": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0", + "@rescript-webapi/file": "0.1.0", + "@rescript-webapi/url": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } }, - "@babel/parser": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", - "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", - "dev": true, - "requires": { - "@babel/types": "^7.28.5" + "packages/File": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" } }, - "@babel/runtime": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", + "packages/FileAndDirectoryEntries": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/prelude": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Gamepad": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Geolocation": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Globals": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/History": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/IndexedDB": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/prelude": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/IntersectionObserver": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/MediaCapabilities": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/MediaCaptureAndStreams": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/MediaSession": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/MutationObserver": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Notification": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Performance": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Permissions": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/PictureInPicture": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Prelude": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Push": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/RemotePlayback": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/ResizeObserver": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/ScreenWakeLock": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/ServiceWorker": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@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" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/Storage": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/file": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/UIEvents": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0", + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/file": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/URL": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/ViewTransitions": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/VisualViewport": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebAudio": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@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/prelude": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebCrypto": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebLocks": { + "version": "0.1.0", + "license": "MIT", + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebMIDI": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/dom": "0.1.0", + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebSockets": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/channel-messaging": "0.1.0", + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/file": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebSpeech": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebStorage": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebVTT": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@rescript-webapi/event": "0.1.0" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + }, + "packages/WebWorkers": { + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@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" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + } + } + }, + "dependencies": { + "@astrojs/compiler": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.13.0.tgz", + "integrity": "sha512-mqVORhUJViA28fwHYaWmsXSzLO9osbdZ5ImUfxBarqsYdMlPbqAqGJCxsNzvppp1BEzc1mJNjOVvQqeDN8Vspw==", + "dev": true + }, + "@astrojs/internal-helpers": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.6.1.tgz", + "integrity": "sha512-l5Pqf6uZu31aG+3Lv8nl/3s4DbUzdlxTWDof4pEpto6GUJNhhCbelVi9dEyurOVyqaelwmS9oSyOWOENSfgo9A==", + "dev": true + }, + "@astrojs/markdown-remark": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-6.3.1.tgz", + "integrity": "sha512-c5F5gGrkczUaTVgmMW9g1YMJGzOtRvjjhw6IfGuxarM6ct09MpwysP10US729dy07gg8y+ofVifezvP3BNsWZg==", + "dev": true, + "requires": { + "@astrojs/internal-helpers": "0.6.1", + "@astrojs/prism": "3.2.0", + "github-slugger": "^2.0.0", + "hast-util-from-html": "^2.0.3", + "hast-util-to-text": "^4.0.2", + "import-meta-resolve": "^4.1.0", + "js-yaml": "^4.1.0", + "mdast-util-definitions": "^6.0.0", + "rehype-raw": "^7.0.0", + "rehype-stringify": "^10.0.1", + "remark-gfm": "^4.0.1", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.1.1", + "remark-smartypants": "^3.0.2", + "shiki": "^3.0.0", + "smol-toml": "^1.3.1", + "unified": "^11.0.5", + "unist-util-remove-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1", + "vfile": "^6.0.3" + } + }, + "@astrojs/mdx": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-4.2.4.tgz", + "integrity": "sha512-c832AWpiMCcuPY8j+yr5T+hOf8n5RlKLFHlNTt15xxkOk3zjFJP81TIYKrMrbhD5rMzJ09Ixi+xM0m68w2Q0DQ==", + "dev": true, + "requires": { + "@astrojs/markdown-remark": "6.3.1", + "@mdx-js/mdx": "^3.1.0", + "acorn": "^8.14.1", + "es-module-lexer": "^1.6.0", + "estree-util-visit": "^2.0.0", + "hast-util-to-html": "^9.0.5", + "kleur": "^4.1.5", + "rehype-raw": "^7.0.0", + "remark-gfm": "^4.0.1", + "remark-smartypants": "^3.0.2", + "source-map": "^0.7.4", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.3" + } + }, + "@astrojs/prism": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.2.0.tgz", + "integrity": "sha512-GilTHKGCW6HMq7y3BUv9Ac7GMe/MO9gi9GW62GzKtth0SwukCu/qp2wLiGpEujhY+VVhaG9v7kv/5vFzvf4NYw==", + "dev": true, + "requires": { + "prismjs": "^1.29.0" + } + }, + "@astrojs/sitemap": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.3.0.tgz", + "integrity": "sha512-nYE4lKQtk+Kbrw/w0G0TTgT724co0jUsU4tPlHY9au5HmTBKbwiCLwO/15b1/y13aZ4Kr9ZbMeMHlXuwn0ty4Q==", + "dev": true, + "requires": { + "sitemap": "^8.0.0", + "stream-replace-string": "^2.0.0", + "zod": "^3.24.2" + } + }, + "@astrojs/starlight": { + "version": "0.37.7", + "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.37.7.tgz", + "integrity": "sha512-KyBnou8aKIlPJUSNx6a1SN7XyH22oj/VAvTGC+Edld4Bnei1A//pmCRTBvSrSeoGrdUjK0ErFUfaEhhO1bPfDg==", + "dev": true, + "requires": { + "@astrojs/markdown-remark": "^6.3.1", + "@astrojs/mdx": "^4.2.3", + "@astrojs/sitemap": "^3.3.0", + "@pagefind/default-ui": "^1.3.0", + "@types/hast": "^3.0.4", + "@types/js-yaml": "^4.0.9", + "@types/mdast": "^4.0.4", + "astro-expressive-code": "^0.41.1", + "bcp-47": "^2.1.0", + "hast-util-from-html": "^2.0.1", + "hast-util-select": "^6.0.2", + "hast-util-to-string": "^3.0.0", + "hastscript": "^9.0.0", + "i18next": "^23.11.5", + "js-yaml": "^4.1.0", + "klona": "^2.0.6", + "magic-string": "^0.30.17", + "mdast-util-directive": "^3.0.0", + "mdast-util-to-markdown": "^2.1.0", + "mdast-util-to-string": "^4.0.0", + "pagefind": "^1.3.0", + "rehype": "^13.0.1", + "rehype-format": "^5.0.0", + "remark-directive": "^3.0.0", + "ultrahtml": "^1.6.0", + "unified": "^11.0.5", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.2" + } + }, + "@astrojs/telemetry": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.3.0.tgz", + "integrity": "sha512-UFBgfeldP06qu6khs/yY+q1cDAaArM2/7AEIqQ9Cuvf7B1hNLq0xDrZkct+QoIGyjq56y8IaE2I3CTvG99mlhQ==", + "dev": true, + "requires": { + "ci-info": "^4.2.0", + "debug": "^4.4.0", + "dlv": "^1.1.3", + "dset": "^3.1.4", + "is-docker": "^3.0.0", + "is-wsl": "^3.1.0", + "which-pm-runs": "^1.1.0" + } + }, + "@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true + }, + "@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "dev": true, + "requires": { + "@babel/types": "^7.28.5" + } + }, + "@babel/runtime": { + "version": "7.27.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", "dev": true }, @@ -8336,45 +8985,343 @@ "dev": true, "optional": true }, + "@rescript-webapi/canvas": { + "version": "file:packages/Canvas", + "requires": { + "@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/prelude": "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/css-font-loading": { + "version": "file:packages/CSSFontLoading", + "requires": { + "@rescript-webapi/event": "0.1.0" + } + }, + "@rescript-webapi/dom": { + "version": "file:packages/DOM", + "requires": { + "@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/encrypted-media-extensions": "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/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/prelude": "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-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/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/dom": "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/prelude": "0.1.0" + } + }, + "@rescript-webapi/gamepad": { + "version": "file:packages/Gamepad", + "requires": { + "@rescript-webapi/dom": "0.1.0" + } + }, + "@rescript-webapi/geolocation": { + "version": "file:packages/Geolocation", + "requires": {} + }, + "@rescript-webapi/globals": { + "version": "file:packages/Globals", + "requires": {} + }, + "@rescript-webapi/history": { + "version": "file:packages/History", + "requires": {} + }, + "@rescript-webapi/indexed-db": { + "version": "file:packages/IndexedDB", + "requires": { + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/prelude": "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/prelude": { + "version": "file:packages/Prelude", + "requires": {} + }, + "@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/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/dom": "0.1.0", + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/file": "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/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/prelude": "0.1.0" + } + }, + "@rescript-webapi/web-crypto": { + "version": "file:packages/WebCrypto", + "requires": {} + }, + "@rescript-webapi/web-locks": { + "version": "file:packages/WebLocks", + "requires": {} + }, + "@rescript-webapi/web-midi": { + "version": "file:packages/WebMIDI", + "requires": { + "@rescript-webapi/dom": "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==", - "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==", - "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==", - "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==", - "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==", - "dev": true + "integrity": "sha512-NwfljDRq1rjFPHUaca1nzFz13xsa9ZGkBkLvMhvVgavJT5+A4rMcLu8XAaVTi/oAhO/tlHf9ZDoOTF1AfyAk9Q==" }, "@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==", - "dev": true, "optional": true }, "@rollup/pluginutils": { @@ -11625,7 +12572,6 @@ "version": "12.2.0", "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.2.0.tgz", "integrity": "sha512-1Jf2cmNhyx5Mj2vwZ4XXPcXvNSjGj9D1jPBUcoqIOqRpLPo1ch2Ta/7eWh23xAHWHK5ow7BCDyYFjvZSjyjLzg==", - "dev": true, "requires": { "@rescript/darwin-arm64": "12.2.0", "@rescript/darwin-x64": "12.2.0", diff --git a/package.json b/package.json index 9ef9cb43..20a94bbe 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@rescript/webapi", + "name": "experimental-rescript-webapi", "version": "0.1.0", "description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)", "keywords": [ @@ -22,11 +22,11 @@ "type": "git", "url": "git+https://github.com/rescript-lang/experimental-rescript-webapi.git" }, - "files": [ - "rescript.json", - "src/**/*.res" - ], + "private": true, "type": "module", + "workspaces": [ + "packages/*" + ], "publishConfig": { "access": "public", "provenance": true @@ -34,6 +34,7 @@ "scripts": { "test": "node tests/index.js", "build": "rescript", + "build:packages": "npm run build --workspaces --if-present", "format": "rescript format && oxfmt ./tests/index.js ./package.json ./docs && prettier --write ./docs/pages", "format:check": "rescript format --check && oxfmt ./tests/index.js ./package.json ./docs --check && prettier --check ./docs/pages", "docs": "astro dev", diff --git a/packages/.DS_Store b/packages/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..64fb30f7df4eaf6cc8f68517d946e7ce86fd98c9 GIT binary patch literal 6148 zcmeH~J!->15QX2wE(~c@y4)rQ$PE^wl);5BkRss5I1otcJ$l~!G?85g5#GSe+nLoM z=_|Av0CxC#e+DK1JGv{LJS@zZZ!qJC*YDHk_408&v*K0YA!25%OjzvKwnPL(Km0}5m*NS|2{OjYcCzC@#$cQ5rDd7IgIO=C8*5{)LuGLS)o}? z4_2)fV~E$Io!aWUUOG~<9ah7K)t$|!7@B1}tTCZk4^a>S5m*q|WIp-%|3bev|1VmU zihv0GGXl1qPxFBv{dHs=gj{YFy6n>nDJTAH{om826hmsJ(QgvO?33KwwZ1 Ifj=ei1DRV9DF6Tf literal 0 HcmV?d00001 diff --git a/packages/CSSFontLoading/package.json b/packages/CSSFontLoading/package.json new file mode 100644 index 00000000..e8b2ef7d --- /dev/null +++ b/packages/CSSFontLoading/package.json @@ -0,0 +1,23 @@ +{ + "name": "@rescript-webapi/css-font-loading", + "version": "0.1.0", + "license": "MIT", + "type": "module", + "files": [ + "rescript.json", + "src/**/*.res" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "scripts": { + "build": "rescript" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + }, + "dependencies": { + "@rescript-webapi/event": "0.1.0" + } +} diff --git a/packages/CSSFontLoading/rescript.json b/packages/CSSFontLoading/rescript.json new file mode 100644 index 00000000..7a1f70e0 --- /dev/null +++ b/packages/CSSFontLoading/rescript.json @@ -0,0 +1,19 @@ +{ + "name": "@rescript-webapi/css-font-loading", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "package-specs": { + "module": "esmodule", + "in-source": true + }, + "suffix": ".js", + "dependencies": [ + "@rescript-webapi/event", + "@rescript-webapi/prelude" + ], + "namespace": "CSSFontLoading" +} \ No newline at end of file diff --git a/src/CSSFontLoadingAPI/FontFace.js b/packages/CSSFontLoading/src/FontFace.js similarity index 100% rename from src/CSSFontLoadingAPI/FontFace.js rename to packages/CSSFontLoading/src/FontFace.js diff --git a/src/CSSFontLoadingAPI/FontFace.res b/packages/CSSFontLoading/src/FontFace.res similarity index 66% rename from src/CSSFontLoadingAPI/FontFace.res rename to packages/CSSFontLoading/src/FontFace.res index b8ed62b9..618e47b3 100644 --- a/src/CSSFontLoadingAPI/FontFace.res +++ b/packages/CSSFontLoading/src/FontFace.res @@ -1,10 +1,8 @@ -open CSSFontLoadingAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace) */ @new -external make: (~family: string, ~source: string, ~descriptors: fontFaceDescriptors=?) => fontFace = +external make: (~family: string, ~source: string, ~descriptors: Types.fontFaceDescriptors=?) => Types.fontFace = "FontFace" /** @@ -14,8 +12,8 @@ external make: (~family: string, ~source: string, ~descriptors: fontFaceDescript external make2: ( ~family: string, ~source: DataView.t, - ~descriptors: fontFaceDescriptors=?, -) => fontFace = "FontFace" + ~descriptors: Types.fontFaceDescriptors=?, +) => Types.fontFace = "FontFace" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace) @@ -24,11 +22,11 @@ external make2: ( external make3: ( ~family: string, ~source: ArrayBuffer.t, - ~descriptors: fontFaceDescriptors=?, -) => fontFace = "FontFace" + ~descriptors: Types.fontFaceDescriptors=?, +) => Types.fontFace = "FontFace" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace/load) */ @send -external load: fontFace => promise = "load" +external load: Types.fontFace => promise = "load" diff --git a/packages/CSSFontLoading/src/FontFaceSet.js b/packages/CSSFontLoading/src/FontFaceSet.js new file mode 100644 index 00000000..d8fc27bc --- /dev/null +++ b/packages/CSSFontLoading/src/FontFaceSet.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +EventTarget$Event.Impl({}); + +/* Not a pure module */ diff --git a/src/CSSFontLoadingAPI/FontFaceSet.res b/packages/CSSFontLoading/src/FontFaceSet.res similarity index 50% rename from src/CSSFontLoadingAPI/FontFaceSet.res rename to packages/CSSFontLoading/src/FontFaceSet.res index 9d6d1780..ed73faa2 100644 --- a/src/CSSFontLoadingAPI/FontFaceSet.res +++ b/packages/CSSFontLoading/src/FontFaceSet.res @@ -1,33 +1,31 @@ -open CSSFontLoadingAPI - -include EventTarget.Impl({type t = fontFaceSet}) +include Event.EventTarget.Impl({type t = Types.fontFaceSet}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/add) */ @send -external add: (fontFaceSet, fontFace) => fontFaceSet = "add" +external add: (Types.fontFaceSet, Types.fontFace) => Types.fontFaceSet = "add" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/delete) */ @send -external delete: (fontFaceSet, fontFace) => bool = "delete" +external delete: (Types.fontFaceSet, Types.fontFace) => bool = "delete" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/clear) */ @send -external clear: fontFaceSet => unit = "clear" +external clear: Types.fontFaceSet => unit = "clear" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/load) */ @send -external load: (fontFaceSet, ~font: string, ~text: string=?) => promise> = "load" +external load: (Types.fontFaceSet, ~font: string, ~text: string=?) => promise> = "load" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/check) */ @send -external check: (fontFaceSet, ~font: string, ~text: string=?) => bool = "check" +external check: (Types.fontFaceSet, ~font: string, ~text: string=?) => bool = "check" diff --git a/src/CSSFontLoadingAPI.js b/packages/CSSFontLoading/src/Types.js similarity index 100% rename from src/CSSFontLoadingAPI.js rename to packages/CSSFontLoading/src/Types.js diff --git a/src/CSSFontLoadingAPI.res b/packages/CSSFontLoading/src/Types.res similarity index 86% rename from src/CSSFontLoadingAPI.res rename to packages/CSSFontLoading/src/Types.res index 1cda2172..f63a2be6 100644 --- a/src/CSSFontLoadingAPI.res +++ b/packages/CSSFontLoading/src/Types.res @@ -1,7 +1,5 @@ @@warning("-30") -open EventAPI - type fontDisplay = | @as("auto") Auto | @as("block") Block @@ -9,13 +7,13 @@ type fontDisplay = | @as("optional") Optional | @as("swap") Swap -type fontFaceLoadStatus = +type fontFaceLoadStatus = Prelude.Types.fontFaceLoadStatus = | @as("error") Error | @as("loaded") Loaded | @as("loading") Loading | @as("unloaded") Unloaded -type fontFaceSetLoadStatus = +type fontFaceSetLoadStatus = Prelude.Types.fontFaceSetLoadStatus = | @as("loaded") Loaded | @as("loading") Loading @@ -78,17 +76,7 @@ type rec fontFace = { [See FontFaceSet on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet) */ @editor.completeFrom(FontFaceSet) -type rec fontFaceSet = { - ...eventTarget, - /** - [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/ready) - */ - ready: promise, - /** - [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFaceSet/status) - */ - status: fontFaceSetLoadStatus, -} +type fontFaceSet = Prelude.Types.fontFaceSet type fontFaceDescriptors = { mutable style?: string, diff --git a/packages/Canvas/lib/rescript.lock b/packages/Canvas/lib/rescript.lock new file mode 100644 index 00000000..76d2a8a4 --- /dev/null +++ b/packages/Canvas/lib/rescript.lock @@ -0,0 +1 @@ +79172 \ No newline at end of file diff --git a/packages/Canvas/package.json b/packages/Canvas/package.json new file mode 100644 index 00000000..dd3a2af0 --- /dev/null +++ b/packages/Canvas/package.json @@ -0,0 +1,27 @@ +{ + "name": "@rescript-webapi/canvas", + "version": "0.1.0", + "license": "MIT", + "type": "module", + "files": [ + "rescript.json", + "src/**/*.res" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "scripts": { + "build": "rescript" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + }, + "dependencies": { + "@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/prelude": "0.1.0" + } +} diff --git a/packages/Canvas/rescript.json b/packages/Canvas/rescript.json new file mode 100644 index 00000000..5cc31f6c --- /dev/null +++ b/packages/Canvas/rescript.json @@ -0,0 +1,22 @@ +{ + "name": "@rescript-webapi/canvas", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "package-specs": { + "module": "esmodule", + "in-source": true + }, + "suffix": ".js", + "dependencies": [ + "@rescript-webapi/dom", + "@rescript-webapi/event", + "@rescript-webapi/file", + "@rescript-webapi/media-capture-and-streams", + "@rescript-webapi/prelude" + ], + "namespace": "Canvas" +} diff --git a/src/CanvasAPI/CanvasGradient.js b/packages/Canvas/src/CanvasGradient.js similarity index 100% rename from src/CanvasAPI/CanvasGradient.js rename to packages/Canvas/src/CanvasGradient.js diff --git a/src/CanvasAPI/CanvasGradient.res b/packages/Canvas/src/CanvasGradient.res similarity index 80% rename from src/CanvasAPI/CanvasGradient.res rename to packages/Canvas/src/CanvasGradient.res index 86347e0a..d8978d3b 100644 --- a/src/CanvasAPI/CanvasGradient.res +++ b/packages/Canvas/src/CanvasGradient.res @@ -1,5 +1,3 @@ -open CanvasAPI - /** Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. @@ -7,6 +5,6 @@ Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasGradient/addColorStop) */ @send -external addColorStop: (canvasGradient, ~offset: float, ~color: string) => unit = "addColorStop" +external addColorStop: (Types.canvasGradient, ~offset: float, ~color: string) => unit = "addColorStop" let isInstanceOf = (_: 't): bool => %raw(`param instanceof CanvasGradient`) diff --git a/src/CanvasAPI/CanvasPattern.js b/packages/Canvas/src/CanvasPattern.js similarity index 100% rename from src/CanvasAPI/CanvasPattern.js rename to packages/Canvas/src/CanvasPattern.js diff --git a/src/CanvasAPI/CanvasPattern.res b/packages/Canvas/src/CanvasPattern.res similarity index 70% rename from src/CanvasAPI/CanvasPattern.res rename to packages/Canvas/src/CanvasPattern.res index 9e3f2434..12982847 100644 --- a/src/CanvasAPI/CanvasPattern.res +++ b/packages/Canvas/src/CanvasPattern.res @@ -1,11 +1,8 @@ -open DOMAPI -open CanvasAPI - /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasPattern/setTransform) */ @send -external setTransform: (canvasPattern, ~transform: domMatrix2DInit=?) => unit = "setTransform" +external setTransform: (Types.canvasPattern, ~transform: DOM.Types.domMatrix2DInit=?) => unit = "setTransform" let isInstanceOf = (_: 't): bool => %raw(`param instanceof CanvasPattern`) diff --git a/src/DOMAPI/CanvasRenderingContext2D.js b/packages/Canvas/src/CanvasRenderingContext2D.js similarity index 100% rename from src/DOMAPI/CanvasRenderingContext2D.js rename to packages/Canvas/src/CanvasRenderingContext2D.js diff --git a/src/DOMAPI/CanvasRenderingContext2D.res b/packages/Canvas/src/CanvasRenderingContext2D.res similarity index 68% rename from src/DOMAPI/CanvasRenderingContext2D.res rename to packages/Canvas/src/CanvasRenderingContext2D.res index b52b56ad..82881307 100644 --- a/src/DOMAPI/CanvasRenderingContext2D.res +++ b/packages/Canvas/src/CanvasRenderingContext2D.res @@ -1,54 +1,51 @@ -open DOMAPI -open CanvasAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/save) */ @send -external save: canvasRenderingContext2D => unit = "save" +external save: DOM.Types.canvasRenderingContext2D => unit = "save" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/restore) */ @send -external restore: canvasRenderingContext2D => unit = "restore" +external restore: DOM.Types.canvasRenderingContext2D => unit = "restore" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/reset) */ @send -external reset: canvasRenderingContext2D => unit = "reset" +external reset: DOM.Types.canvasRenderingContext2D => unit = "reset" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isContextLost) */ @send -external isContextLost: canvasRenderingContext2D => bool = "isContextLost" +external isContextLost: DOM.Types.canvasRenderingContext2D => bool = "isContextLost" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/scale) */ @send -external scale: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "scale" +external scale: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float) => unit = "scale" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rotate) */ @send -external rotate: (canvasRenderingContext2D, float) => unit = "rotate" +external rotate: (DOM.Types.canvasRenderingContext2D, float) => unit = "rotate" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/translate) */ @send -external translate: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "translate" +external translate: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float) => unit = "translate" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/transform) */ @send external transform: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~a: float, ~b: float, ~c: float, @@ -61,14 +58,14 @@ external transform: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getTransform) */ @send -external getTransform: canvasRenderingContext2D => domMatrix = "getTransform" +external getTransform: DOM.Types.canvasRenderingContext2D => DOM.Types.domMatrix = "getTransform" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setTransform) */ @send external setTransform: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~a: float, ~b: float, ~c: float, @@ -81,134 +78,134 @@ external setTransform: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setTransform) */ @send -external setTransform2: (canvasRenderingContext2D, ~transform: domMatrix2DInit=?) => unit = +external setTransform2: (DOM.Types.canvasRenderingContext2D, ~transform: DOM.Types.domMatrix2DInit=?) => unit = "setTransform" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/resetTransform) */ @send -external resetTransform: canvasRenderingContext2D => unit = "resetTransform" +external resetTransform: DOM.Types.canvasRenderingContext2D => unit = "resetTransform" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createLinearGradient) */ @send external createLinearGradient: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x0: float, ~y0: float, ~x1: float, ~y1: float, -) => canvasGradient = "createLinearGradient" +) => Types.canvasGradient = "createLinearGradient" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createRadialGradient) */ @send external createRadialGradient: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x0: float, ~y0: float, ~r0: float, ~x1: float, ~y1: float, ~r1: float, -) => canvasGradient = "createRadialGradient" +) => Types.canvasGradient = "createRadialGradient" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createConicGradient) */ @send external createConicGradient: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~startAngle: float, ~x: float, ~y: float, -) => canvasGradient = "createConicGradient" +) => Types.canvasGradient = "createConicGradient" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ @send external createPattern: ( - canvasRenderingContext2D, - ~image: htmlImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlImageElement, ~repetition: string, -) => canvasPattern = "createPattern" +) => Types.canvasPattern = "createPattern" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ @send external createPattern2: ( - canvasRenderingContext2D, - ~image: svgImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.svgImageElement, ~repetition: string, -) => canvasPattern = "createPattern" +) => Types.canvasPattern = "createPattern" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ @send external createPattern3: ( - canvasRenderingContext2D, - ~image: htmlVideoElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlVideoElement, ~repetition: string, -) => canvasPattern = "createPattern" +) => Types.canvasPattern = "createPattern" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ @send external createPattern4: ( - canvasRenderingContext2D, - ~image: htmlCanvasElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlCanvasElement, ~repetition: string, -) => canvasPattern = "createPattern" +) => Types.canvasPattern = "createPattern" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ @send external createPattern5: ( - canvasRenderingContext2D, - ~image: imageBitmap, + DOM.Types.canvasRenderingContext2D, + ~image: Types.imageBitmap, ~repetition: string, -) => canvasPattern = "createPattern" +) => Types.canvasPattern = "createPattern" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ @send external createPattern6: ( - canvasRenderingContext2D, - ~image: offscreenCanvas, + DOM.Types.canvasRenderingContext2D, + ~image: Types.offscreenCanvas, ~repetition: string, -) => canvasPattern = "createPattern" +) => Types.canvasPattern = "createPattern" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createPattern) */ @send external createPattern7: ( - canvasRenderingContext2D, - ~image: videoFrame, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.videoFrame, ~repetition: string, -) => canvasPattern = "createPattern" +) => Types.canvasPattern = "createPattern" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clearRect) */ @send -external clearRect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = +external clearRect: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "clearRect" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fillRect) */ @send -external fillRect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = +external fillRect: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "fillRect" /** @@ -216,7 +213,7 @@ external fillRect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~ */ @send external strokeRect: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, @@ -227,44 +224,44 @@ external strokeRect: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/beginPath) */ @send -external beginPath: canvasRenderingContext2D => unit = "beginPath" +external beginPath: DOM.Types.canvasRenderingContext2D => unit = "beginPath" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill) */ @send -external fill: (canvasRenderingContext2D, ~fillRule: canvasFillRule=?) => unit = "fill" +external fill: (DOM.Types.canvasRenderingContext2D, ~fillRule: Types.canvasFillRule=?) => unit = "fill" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill) */ @send -external fill2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit = +external fill2: (DOM.Types.canvasRenderingContext2D, ~path: Types.path2D, ~fillRule: Types.canvasFillRule=?) => unit = "fill" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke) */ @send -external stroke: canvasRenderingContext2D => unit = "stroke" +external stroke: DOM.Types.canvasRenderingContext2D => unit = "stroke" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/stroke) */ @send -external stroke2: (canvasRenderingContext2D, path2D) => unit = "stroke" +external stroke2: (DOM.Types.canvasRenderingContext2D, Types.path2D) => unit = "stroke" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip) */ @send -external clip: (canvasRenderingContext2D, ~fillRule: canvasFillRule=?) => unit = "clip" +external clip: (DOM.Types.canvasRenderingContext2D, ~fillRule: Types.canvasFillRule=?) => unit = "clip" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip) */ @send -external clip2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillRule=?) => unit = +external clip2: (DOM.Types.canvasRenderingContext2D, ~path: Types.path2D, ~fillRule: Types.canvasFillRule=?) => unit = "clip" /** @@ -272,10 +269,10 @@ external clip2: (canvasRenderingContext2D, ~path: path2D, ~fillRule: canvasFillR */ @send external isPointInPath: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, - ~fillRule: canvasFillRule=?, + ~fillRule: Types.canvasFillRule=?, ) => bool = "isPointInPath" /** @@ -283,38 +280,42 @@ external isPointInPath: ( */ @send external isPointInPath2: ( - canvasRenderingContext2D, - ~path: path2D, + DOM.Types.canvasRenderingContext2D, + ~path: Types.path2D, ~x: float, ~y: float, - ~fillRule: canvasFillRule=?, + ~fillRule: Types.canvasFillRule=?, ) => bool = "isPointInPath" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke) */ @send -external isPointInStroke: (canvasRenderingContext2D, ~x: float, ~y: float) => bool = +external isPointInStroke: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float) => bool = "isPointInStroke" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isPointInStroke) */ @send -external isPointInStroke2: (canvasRenderingContext2D, ~path: path2D, ~x: float, ~y: float) => bool = +external isPointInStroke2: (DOM.Types.canvasRenderingContext2D, ~path: Types.path2D, ~x: float, ~y: float) => bool = "isPointInStroke" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) */ @send -external drawFocusIfNeeded: (canvasRenderingContext2D, element) => unit = "drawFocusIfNeeded" +external drawFocusIfNeeded: (DOM.Types.canvasRenderingContext2D, DOM.Types.element) => unit = "drawFocusIfNeeded" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded) */ @send -external drawFocusIfNeeded2: (canvasRenderingContext2D, ~path: path2D, ~element: element) => unit = +external drawFocusIfNeeded2: ( + DOM.Types.canvasRenderingContext2D, + ~path: Types.path2D, + ~element: DOM.Types.element, +) => unit = "drawFocusIfNeeded" /** @@ -322,7 +323,7 @@ external drawFocusIfNeeded2: (canvasRenderingContext2D, ~path: path2D, ~element: */ @send external fillText: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~text: string, ~x: float, ~y: float, @@ -334,7 +335,7 @@ external fillText: ( */ @send external strokeText: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~text: string, ~x: float, ~y: float, @@ -345,15 +346,15 @@ external strokeText: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/measureText) */ @send -external measureText: (canvasRenderingContext2D, string) => textMetrics = "measureText" +external measureText: (DOM.Types.canvasRenderingContext2D, string) => Types.textMetrics = "measureText" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage) */ @send external drawImage: ( - canvasRenderingContext2D, - ~image: htmlImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlImageElement, ~dx: float, ~dy: float, ) => unit = "drawImage" @@ -363,8 +364,8 @@ external drawImage: ( */ @send external drawImageWithSvg: ( - canvasRenderingContext2D, - ~image: svgImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.svgImageElement, ~dx: float, ~dy: float, ) => unit = "drawImage" @@ -374,8 +375,8 @@ external drawImageWithSvg: ( */ @send external drawImageWithVideo: ( - canvasRenderingContext2D, - ~image: htmlVideoElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlVideoElement, ~dx: float, ~dy: float, ) => unit = "drawImage" @@ -385,8 +386,8 @@ external drawImageWithVideo: ( */ @send external drawImageWithCanvas: ( - canvasRenderingContext2D, - ~image: htmlCanvasElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlCanvasElement, ~dx: float, ~dy: float, ) => unit = "drawImage" @@ -396,8 +397,8 @@ external drawImageWithCanvas: ( */ @send external drawImageWithImageBitmap: ( - canvasRenderingContext2D, - ~image: imageBitmap, + DOM.Types.canvasRenderingContext2D, + ~image: Types.imageBitmap, ~dx: float, ~dy: float, ) => unit = "drawImage" @@ -407,8 +408,8 @@ external drawImageWithImageBitmap: ( */ @send external drawImageWithOffscreenCanvas: ( - canvasRenderingContext2D, - ~image: offscreenCanvas, + DOM.Types.canvasRenderingContext2D, + ~image: Types.offscreenCanvas, ~dx: float, ~dy: float, ) => unit = "drawImage" @@ -418,8 +419,8 @@ external drawImageWithOffscreenCanvas: ( */ @send external drawImageWithVideoFrame: ( - canvasRenderingContext2D, - ~image: videoFrame, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.videoFrame, ~dx: float, ~dy: float, ) => unit = "drawImage" @@ -429,8 +430,8 @@ external drawImageWithVideoFrame: ( */ @send external drawImageWithDimensions: ( - canvasRenderingContext2D, - ~image: htmlImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlImageElement, ~dx: float, ~dy: float, ~dw: float, @@ -442,8 +443,8 @@ external drawImageWithDimensions: ( */ @send external drawImageWithSvgDimensions: ( - canvasRenderingContext2D, - ~image: svgImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.svgImageElement, ~dx: float, ~dy: float, ~dw: float, @@ -455,8 +456,8 @@ external drawImageWithSvgDimensions: ( */ @send external drawImageWithVideoDimensions: ( - canvasRenderingContext2D, - ~image: htmlVideoElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlVideoElement, ~dx: float, ~dy: float, ~dw: float, @@ -468,8 +469,8 @@ external drawImageWithVideoDimensions: ( */ @send external drawImageWithCanvasDimensions: ( - canvasRenderingContext2D, - ~image: htmlCanvasElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlCanvasElement, ~dx: float, ~dy: float, ~dw: float, @@ -481,8 +482,8 @@ external drawImageWithCanvasDimensions: ( */ @send external drawImageWithImageBitmapDimensions: ( - canvasRenderingContext2D, - ~image: imageBitmap, + DOM.Types.canvasRenderingContext2D, + ~image: Types.imageBitmap, ~dx: float, ~dy: float, ~dw: float, @@ -494,8 +495,8 @@ external drawImageWithImageBitmapDimensions: ( */ @send external drawImageWithOffscreenCanvasDimensions: ( - canvasRenderingContext2D, - ~image: offscreenCanvas, + DOM.Types.canvasRenderingContext2D, + ~image: Types.offscreenCanvas, ~dx: float, ~dy: float, ~dw: float, @@ -507,8 +508,8 @@ external drawImageWithOffscreenCanvasDimensions: ( */ @send external drawImageWithVideoFrameDimensions: ( - canvasRenderingContext2D, - ~image: videoFrame, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.videoFrame, ~dx: float, ~dy: float, ~dw: float, @@ -520,8 +521,8 @@ external drawImageWithVideoFrameDimensions: ( */ @send external drawImageWithSubRectangle: ( - canvasRenderingContext2D, - ~image: htmlImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlImageElement, ~sx: float, ~sy: float, ~sw: float, @@ -537,8 +538,8 @@ external drawImageWithSubRectangle: ( */ @send external drawImageWithSvgSubRectangle: ( - canvasRenderingContext2D, - ~image: svgImageElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.svgImageElement, ~sx: float, ~sy: float, ~sw: float, @@ -554,8 +555,8 @@ external drawImageWithSvgSubRectangle: ( */ @send external drawImageWithVideoSubRectangle: ( - canvasRenderingContext2D, - ~image: htmlVideoElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlVideoElement, ~sx: float, ~sy: float, ~sw: float, @@ -571,8 +572,8 @@ external drawImageWithVideoSubRectangle: ( */ @send external drawImageWithCanvasSubRectangle: ( - canvasRenderingContext2D, - ~image: htmlCanvasElement, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.htmlCanvasElement, ~sx: float, ~sy: float, ~sw: float, @@ -588,8 +589,8 @@ external drawImageWithCanvasSubRectangle: ( */ @send external drawImageWithImageBitmapSubRectangle: ( - canvasRenderingContext2D, - ~image: imageBitmap, + DOM.Types.canvasRenderingContext2D, + ~image: Types.imageBitmap, ~sx: float, ~sy: float, ~sw: float, @@ -605,8 +606,8 @@ external drawImageWithImageBitmapSubRectangle: ( */ @send external drawImageWithOffscreenCanvasSubRectangle: ( - canvasRenderingContext2D, - ~image: offscreenCanvas, + DOM.Types.canvasRenderingContext2D, + ~image: Types.offscreenCanvas, ~sx: float, ~sy: float, ~sw: float, @@ -622,8 +623,8 @@ external drawImageWithOffscreenCanvasSubRectangle: ( */ @send external drawImageWithVideoFrameSubRectangle: ( - canvasRenderingContext2D, - ~image: videoFrame, + DOM.Types.canvasRenderingContext2D, + ~image: DOM.Types.videoFrame, ~sx: float, ~sy: float, ~sw: float, @@ -639,38 +640,38 @@ external drawImageWithVideoFrameSubRectangle: ( */ @send external createImageData: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~sw: int, ~sh: int, - ~settings: imageDataSettings=?, -) => imageData = "createImageData" + ~settings: DOM.Types.imageDataSettings=?, +) => DOM.Types.imageData = "createImageData" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/createImageData) */ @send -external createImageData2: (canvasRenderingContext2D, imageData) => imageData = "createImageData" +external createImageData2: (DOM.Types.canvasRenderingContext2D, DOM.Types.imageData) => DOM.Types.imageData = "createImageData" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getImageData) */ @send external getImageData: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~sx: int, ~sy: int, ~sw: int, ~sh: int, - ~settings: imageDataSettings=?, -) => imageData = "getImageData" + ~settings: DOM.Types.imageDataSettings=?, +) => DOM.Types.imageData = "getImageData" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/putImageData) */ @send external putImageData: ( - canvasRenderingContext2D, - ~imagedata: imageData, + DOM.Types.canvasRenderingContext2D, + ~imagedata: DOM.Types.imageData, ~dx: int, ~dy: int, ) => unit = "putImageData" @@ -680,8 +681,8 @@ external putImageData: ( */ @send external putImageData2: ( - canvasRenderingContext2D, - ~imagedata: imageData, + DOM.Types.canvasRenderingContext2D, + ~imagedata: DOM.Types.imageData, ~dx: int, ~dy: int, ~dirtyX: int, @@ -694,38 +695,38 @@ external putImageData2: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash) */ @send -external setLineDash: (canvasRenderingContext2D, array) => unit = "setLineDash" +external setLineDash: (DOM.Types.canvasRenderingContext2D, array) => unit = "setLineDash" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getLineDash) */ @send -external getLineDash: canvasRenderingContext2D => array = "getLineDash" +external getLineDash: DOM.Types.canvasRenderingContext2D => array = "getLineDash" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath) */ @send -external closePath: canvasRenderingContext2D => unit = "closePath" +external closePath: DOM.Types.canvasRenderingContext2D => unit = "closePath" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo) */ @send -external moveTo: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "moveTo" +external moveTo: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float) => unit = "moveTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo) */ @send -external lineTo: (canvasRenderingContext2D, ~x: float, ~y: float) => unit = "lineTo" +external lineTo: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float) => unit = "lineTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo) */ @send external quadraticCurveTo: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~cpx: float, ~cpy: float, ~x: float, @@ -737,7 +738,7 @@ external quadraticCurveTo: ( */ @send external bezierCurveTo: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~cp1x: float, ~cp1y: float, ~cp2x: float, @@ -751,7 +752,7 @@ external bezierCurveTo: ( */ @send external arcTo: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x1: float, ~y1: float, ~x2: float, @@ -763,7 +764,7 @@ external arcTo: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect) */ @send -external rect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = +external rect: (DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "rect" /** @@ -771,7 +772,7 @@ external rect: (canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: f */ @send external roundRect: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, @@ -784,7 +785,7 @@ external roundRect: ( */ @send external roundRect2: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, @@ -797,7 +798,7 @@ external roundRect2: ( */ @send external roundRect3: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, @@ -810,7 +811,7 @@ external roundRect3: ( */ @send external arc: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~radius: float, @@ -824,7 +825,7 @@ external arc: ( */ @send external ellipse: ( - canvasRenderingContext2D, + DOM.Types.canvasRenderingContext2D, ~x: float, ~y: float, ~radiusX: float, @@ -839,5 +840,5 @@ external ellipse: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/getContextAttributes) */ @send -external getContextAttributes: canvasRenderingContext2D => canvasRenderingContext2DSettings = +external getContextAttributes: DOM.Types.canvasRenderingContext2D => Types.canvasRenderingContext2DSettings = "getContextAttributes" diff --git a/src/CanvasAPI/FillStyle.js b/packages/Canvas/src/FillStyle.js similarity index 57% rename from src/CanvasAPI/FillStyle.js rename to packages/Canvas/src/FillStyle.js index 7a8e910e..48d251eb 100644 --- a/src/CanvasAPI/FillStyle.js +++ b/packages/Canvas/src/FillStyle.js @@ -1,15 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as CanvasPattern$WebAPI from "./CanvasPattern.js"; -import * as CanvasGradient$WebAPI from "./CanvasGradient.js"; +import * as CanvasPattern$Canvas from "./CanvasPattern.js"; +import * as CanvasGradient$Canvas from "./CanvasGradient.js"; function decode(t) { - if (CanvasGradient$WebAPI.isInstanceOf(t)) { + if (CanvasGradient$Canvas.isInstanceOf(t)) { return { TAG: "CanvasGradient", _0: t }; - } else if (CanvasPattern$WebAPI.isInstanceOf(t)) { + } else if (CanvasPattern$Canvas.isInstanceOf(t)) { return { TAG: "CanvasPattern", _0: t diff --git a/packages/Canvas/src/FillStyle.res b/packages/Canvas/src/FillStyle.res new file mode 100644 index 00000000..aa5141ed --- /dev/null +++ b/packages/Canvas/src/FillStyle.res @@ -0,0 +1,25 @@ +external fromString: string => Types.fillStyle = "%identity" +external fromCanvasGradient: Types.canvasGradient => Types.fillStyle = "%identity" +external fromCanvasPattern: Types.canvasPattern => Types.fillStyle = "%identity" + +external toString: Types.fillStyle => string = "%identity" +external toCanvasGradient: Types.fillStyle => Types.canvasGradient = "%identity" +external toCanvasPattern: Types.fillStyle => Types.canvasPattern = "%identity" + +/** +Represents a decoded version of the abstract `fillStyle` type, used in Context2D. + */ +type decoded = + | String(string) + | CanvasGradient(Types.canvasGradient) + | CanvasPattern(Types.canvasPattern) + +let decode = (t: Types.fillStyle): decoded => { + if CanvasGradient.isInstanceOf(t) { + CanvasGradient(toCanvasGradient(t)) + } else if CanvasPattern.isInstanceOf(t) { + CanvasPattern(toCanvasPattern(t)) + } else { + String(toString(t)) + } +} diff --git a/src/Global.js b/packages/Canvas/src/Global.js similarity index 100% rename from src/Global.js rename to packages/Canvas/src/Global.js diff --git a/packages/Canvas/src/Global.res b/packages/Canvas/src/Global.res new file mode 100644 index 00000000..28c7f704 --- /dev/null +++ b/packages/Canvas/src/Global.res @@ -0,0 +1,179 @@ +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap: ( + ~image: DOM.Types.htmlImageElement, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap2: ( + ~image: DOM.Types.svgImageElement, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap3: ( + ~image: DOM.Types.htmlVideoElement, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap4: ( + ~image: DOM.Types.htmlCanvasElement, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap5: ( + ~image: Types.imageBitmap, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap6: ( + ~image: Types.offscreenCanvas, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap7: ( + ~image: DOM.Types.videoFrame, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap8: ( + ~image: File.Types.blob, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap9: ( + ~image: DOM.Types.imageData, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap10: ( + ~image: DOM.Types.htmlImageElement, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap11: ( + ~image: DOM.Types.svgImageElement, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap12: ( + ~image: DOM.Types.htmlVideoElement, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap13: ( + ~image: DOM.Types.htmlCanvasElement, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap14: ( + ~image: Types.imageBitmap, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap15: ( + ~image: Types.offscreenCanvas, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap16: ( + ~image: DOM.Types.videoFrame, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap17: ( + ~image: File.Types.blob, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) +*/ +external createImageBitmap18: ( + ~image: DOM.Types.imageData, + ~sx: int, + ~sy: int, + ~sw: int, + ~sh: int, + ~options: DOM.Types.imageBitmapOptions=?, +) => promise = "createImageBitmap" diff --git a/packages/Canvas/src/HTMLCanvasElement.js b/packages/Canvas/src/HTMLCanvasElement.js new file mode 100644 index 00000000..ce2b6697 --- /dev/null +++ b/packages/Canvas/src/HTMLCanvasElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "@rescript-webapi/dom/src/HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLCanvasElement.res b/packages/Canvas/src/HTMLCanvasElement.res similarity index 77% rename from src/DOMAPI/HTMLCanvasElement.res rename to packages/Canvas/src/HTMLCanvasElement.res index d7d7121f..bb684658 100644 --- a/src/DOMAPI/HTMLCanvasElement.res +++ b/packages/Canvas/src/HTMLCanvasElement.res @@ -1,8 +1,4 @@ -open DOMAPI -open CanvasAPI -open MediaCaptureAndStreamsAPI - -include HTMLElement.Impl({type t = htmlCanvasElement}) +include DOM.HTMLElement.Impl({type t = DOM.Types.htmlCanvasElement}) /** Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. @@ -12,10 +8,10 @@ Creates a CanvasRenderingContext2D object representing a two-dimensional renderi */ @send external getContext2D: ( - htmlCanvasElement, + DOM.Types.htmlCanvasElement, @as("2d") _, - ~options: canvasRenderingContext2DSettings=?, -) => canvasRenderingContext2D = "getContext" + ~options: Types.canvasRenderingContext2DSettings=?, +) => DOM.Types.canvasRenderingContext2D = "getContext" /** Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. @@ -24,10 +20,10 @@ Returns an object that provides methods and properties for drawing and manipulat */ @send external getContextWebGL: ( - htmlCanvasElement, + DOM.Types.htmlCanvasElement, @as("webgl") _, - ~options: webGLContextAttributes=?, -) => webGLRenderingContext = "getContext" + ~options: Types.webGLContextAttributes=?, +) => Types.webGLRenderingContext = "getContext" /** Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. @@ -36,10 +32,10 @@ Returns an object that provides methods and properties for drawing and manipulat */ @send external getContextWebGL2: ( - htmlCanvasElement, + DOM.Types.htmlCanvasElement, @as("webgl2") _, - ~options: webGLContextAttributes=?, -) => webGL2RenderingContext = "getContext" + ~options: Types.webGLContextAttributes=?, +) => Types.webGL2RenderingContext = "getContext" /** Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. @@ -48,10 +44,10 @@ Returns an object that provides methods and properties for drawing and manipulat */ @send external getContextBitmapRenderer: ( - htmlCanvasElement, + DOM.Types.htmlCanvasElement, @as("bitmaprenderer") _, - ~options: imageBitmapRenderingContextSettings=?, -) => imageBitmapRenderingContext = "getContext" + ~options: Types.imageBitmapRenderingContextSettings=?, +) => Types.imageBitmapRenderingContext = "getContext" /** Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. @@ -59,7 +55,7 @@ Returns the content of the current canvas as an image that you can use as a sour [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/toDataURL) */ @send -external toDataURL: (htmlCanvasElement, ~type_: string=?, ~quality: JSON.t=?) => string = +external toDataURL: (DOM.Types.htmlCanvasElement, ~type_: string=?, ~quality: JSON.t=?) => string = "toDataURL" /** @@ -67,8 +63,8 @@ external toDataURL: (htmlCanvasElement, ~type_: string=?, ~quality: JSON.t=?) => */ @send external toBlob: ( - htmlCanvasElement, - ~callback: blobCallback, + DOM.Types.htmlCanvasElement, + ~callback: File.Types.blob => unit, ~type_: string=?, ~quality: JSON.t=?, ) => unit = "toBlob" @@ -77,12 +73,14 @@ external toBlob: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen) */ @send -external transferControlToOffscreen: htmlCanvasElement => offscreenCanvas = +external transferControlToOffscreen: DOM.Types.htmlCanvasElement => Types.offscreenCanvas = "transferControlToOffscreen" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/captureStream) */ @send -external captureStream: (htmlCanvasElement, ~frameRequestRate: float=?) => mediaStream = - "captureStream" +external captureStream: ( + DOM.Types.htmlCanvasElement, + ~frameRequestRate: float=?, +) => MediaCaptureAndStreams.Types.mediaStream = "captureStream" diff --git a/src/CanvasAPI/ImageBitmap.js b/packages/Canvas/src/ImageBitmap.js similarity index 100% rename from src/CanvasAPI/ImageBitmap.js rename to packages/Canvas/src/ImageBitmap.js diff --git a/src/CanvasAPI/ImageBitmap.res b/packages/Canvas/src/ImageBitmap.res similarity index 69% rename from src/CanvasAPI/ImageBitmap.res rename to packages/Canvas/src/ImageBitmap.res index 61ff7268..087279dc 100644 --- a/src/CanvasAPI/ImageBitmap.res +++ b/packages/Canvas/src/ImageBitmap.res @@ -1,8 +1,6 @@ -open CanvasAPI - /** Releases imageBitmap's underlying bitmap data. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageBitmap/close) */ @send -external close: imageBitmap => unit = "close" +external close: Types.imageBitmap => unit = "close" diff --git a/src/CanvasAPI/ImageBitmapRenderingContext.js b/packages/Canvas/src/ImageBitmapRenderingContext.js similarity index 100% rename from src/CanvasAPI/ImageBitmapRenderingContext.js rename to packages/Canvas/src/ImageBitmapRenderingContext.js diff --git a/src/CanvasAPI/ImageBitmapRenderingContext.res b/packages/Canvas/src/ImageBitmapRenderingContext.res similarity index 74% rename from src/CanvasAPI/ImageBitmapRenderingContext.res rename to packages/Canvas/src/ImageBitmapRenderingContext.res index 9e422d2f..85c85f10 100644 --- a/src/CanvasAPI/ImageBitmapRenderingContext.res +++ b/packages/Canvas/src/ImageBitmapRenderingContext.res @@ -1,9 +1,7 @@ -open CanvasAPI - /** Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageBitmapRenderingContext/transferFromImageBitmap) */ @send -external transferFromImageBitmap: (imageBitmapRenderingContext, imageBitmap) => unit = +external transferFromImageBitmap: (Types.imageBitmapRenderingContext, Types.imageBitmap) => unit = "transferFromImageBitmap" diff --git a/packages/Canvas/src/OffscreenCanvas.js b/packages/Canvas/src/OffscreenCanvas.js new file mode 100644 index 00000000..d8fc27bc --- /dev/null +++ b/packages/Canvas/src/OffscreenCanvas.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +EventTarget$Event.Impl({}); + +/* Not a pure module */ diff --git a/src/CanvasAPI/OffscreenCanvas.res b/packages/Canvas/src/OffscreenCanvas.res similarity index 82% rename from src/CanvasAPI/OffscreenCanvas.res rename to packages/Canvas/src/OffscreenCanvas.res index 83b68802..6cd13eed 100644 --- a/src/CanvasAPI/OffscreenCanvas.res +++ b/packages/Canvas/src/OffscreenCanvas.res @@ -1,13 +1,10 @@ -open CanvasAPI -open FileAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas) */ @new -external make: (~width: int, ~height: int) => offscreenCanvas = "OffscreenCanvas" +external make: (~width: int, ~height: int) => Types.offscreenCanvas = "OffscreenCanvas" -include EventTarget.Impl({type t = offscreenCanvas}) +include Event.EventTarget.Impl({type t = Types.offscreenCanvas}) /** Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. @@ -19,10 +16,10 @@ Returns null if the canvas has already been initialized with another context typ */ @send external getContext2D: ( - offscreenCanvas, + Types.offscreenCanvas, @as("2d") _, ~options: JSON.t=?, -) => offscreenCanvasRenderingContext2D = "getContext" +) => Types.offscreenCanvasRenderingContext2D = "getContext" /** Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. @@ -34,10 +31,10 @@ Returns null if the canvas has already been initialized with another context typ */ @send external getContextWebGL: ( - offscreenCanvas, + Types.offscreenCanvas, @as("webgl") _, - ~options: webGLContextAttributes=?, -) => webGLRenderingContext = "getContext" + ~options: Types.webGLContextAttributes=?, +) => Types.webGLRenderingContext = "getContext" /** Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. @@ -49,10 +46,10 @@ Returns null if the canvas has already been initialized with another context typ */ @send external getContextWebGL2: ( - offscreenCanvas, + Types.offscreenCanvas, @as("webgl2") _, - ~options: webGLContextAttributes=?, -) => webGL2RenderingContext = "getContext" + ~options: Types.webGLContextAttributes=?, +) => Types.webGL2RenderingContext = "getContext" /** Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API. @@ -64,17 +61,17 @@ Returns null if the canvas has already been initialized with another context typ */ @send external getContextBitmapRenderer: ( - offscreenCanvas, + Types.offscreenCanvas, @as("bitmaprenderer") _, - ~options: imageBitmapRenderingContextSettings=?, -) => imageBitmapRenderingContext = "getContext" + ~options: Types.imageBitmapRenderingContextSettings=?, +) => Types.imageBitmapRenderingContext = "getContext" /** Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/transferToImageBitmap) */ @send -external transferToImageBitmap: offscreenCanvas => imageBitmap = "transferToImageBitmap" +external transferToImageBitmap: Types.offscreenCanvas => Types.imageBitmap = "transferToImageBitmap" /** Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object. @@ -83,5 +80,5 @@ The argument, if provided, is a dictionary that controls the encoding options of [Read more on MDN](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/convertToBlob) */ @send -external convertToBlob: (offscreenCanvas, ~options: imageEncodeOptions=?) => promise = +external convertToBlob: (Types.offscreenCanvas, ~options: Types.imageEncodeOptions=?) => promise = "convertToBlob" diff --git a/src/CanvasAPI/Path2D.js b/packages/Canvas/src/Path2D.js similarity index 100% rename from src/CanvasAPI/Path2D.js rename to packages/Canvas/src/Path2D.js diff --git a/src/CanvasAPI/Path2D.res b/packages/Canvas/src/Path2D.res similarity index 75% rename from src/CanvasAPI/Path2D.res rename to packages/Canvas/src/Path2D.res index 24d4f89d..4758b174 100644 --- a/src/CanvasAPI/Path2D.res +++ b/packages/Canvas/src/Path2D.res @@ -1,41 +1,38 @@ -open CanvasAPI -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D) */ @new -external make: (~path: path2D=?) => path2D = "Path2D" +external make: (~path: Types.path2D=?) => Types.path2D = "Path2D" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D) */ @new -external make2: (~path: string=?) => path2D = "Path2D" +external make2: (~path: string=?) => Types.path2D = "Path2D" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath) */ @send -external closePath: path2D => unit = "closePath" +external closePath: Types.path2D => unit = "closePath" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo) */ @send -external moveTo: (path2D, ~x: float, ~y: float) => unit = "moveTo" +external moveTo: (Types.path2D, ~x: float, ~y: float) => unit = "moveTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo) */ @send -external lineTo: (path2D, ~x: float, ~y: float) => unit = "lineTo" +external lineTo: (Types.path2D, ~x: float, ~y: float) => unit = "lineTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo) */ @send -external quadraticCurveTo: (path2D, ~cpx: float, ~cpy: float, ~x: float, ~y: float) => unit = +external quadraticCurveTo: (Types.path2D, ~cpx: float, ~cpy: float, ~x: float, ~y: float) => unit = "quadraticCurveTo" /** @@ -43,7 +40,7 @@ external quadraticCurveTo: (path2D, ~cpx: float, ~cpy: float, ~x: float, ~y: flo */ @send external bezierCurveTo: ( - path2D, + Types.path2D, ~cp1x: float, ~cp1y: float, ~cp2x: float, @@ -56,21 +53,21 @@ external bezierCurveTo: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arcTo) */ @send -external arcTo: (path2D, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~radius: float) => unit = +external arcTo: (Types.path2D, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~radius: float) => unit = "arcTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect) */ @send -external rect: (path2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "rect" +external rect: (Types.path2D, ~x: float, ~y: float, ~w: float, ~h: float) => unit = "rect" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect) */ @send external roundRect: ( - path2D, + Types.path2D, ~x: float, ~y: float, ~w: float, @@ -83,7 +80,7 @@ external roundRect: ( */ @send external roundRect2: ( - path2D, + Types.path2D, ~x: float, ~y: float, ~w: float, @@ -96,7 +93,7 @@ external roundRect2: ( */ @send external roundRect3: ( - path2D, + Types.path2D, ~x: float, ~y: float, ~w: float, @@ -109,7 +106,7 @@ external roundRect3: ( */ @send external arc: ( - path2D, + Types.path2D, ~x: float, ~y: float, ~radius: float, @@ -123,7 +120,7 @@ external arc: ( */ @send external ellipse: ( - path2D, + Types.path2D, ~x: float, ~y: float, ~radiusX: float, @@ -139,4 +136,4 @@ Adds to the path the path given by the argument. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D/addPath) */ @send -external addPath: (path2D, ~path: path2D, ~transform: domMatrix2DInit=?) => unit = "addPath" +external addPath: (Types.path2D, ~path: Types.path2D, ~transform: DOM.Types.domMatrix2DInit=?) => unit = "addPath" diff --git a/src/CanvasAPI.js b/packages/Canvas/src/Types.js similarity index 100% rename from src/CanvasAPI.js rename to packages/Canvas/src/Types.js diff --git a/src/CanvasAPI.res b/packages/Canvas/src/Types.res similarity index 99% rename from src/CanvasAPI.res rename to packages/Canvas/src/Types.res index 134d4a1d..0a7d08e0 100644 --- a/src/CanvasAPI.res +++ b/packages/Canvas/src/Types.res @@ -1,7 +1,5 @@ @@warning("-30") -open EventAPI - type offscreenRenderingContextId = | @as("2d") V2d | @as("bitmaprenderer") Bitmaprenderer @@ -123,7 +121,7 @@ type webGLPowerPreference = */ @editor.completeFrom(OffscreenCanvas) type offscreenCanvas = { - ...eventTarget, + ...Event.Types.eventTarget, /** These attributes return the dimensions of the OffscreenCanvas object's bitmap. diff --git a/src/DOMAPI/VideoFrame.js b/packages/Canvas/src/VideoFrame.js similarity index 100% rename from src/DOMAPI/VideoFrame.js rename to packages/Canvas/src/VideoFrame.js diff --git a/packages/Canvas/src/VideoFrame.res b/packages/Canvas/src/VideoFrame.res new file mode 100644 index 00000000..3fb76729 --- /dev/null +++ b/packages/Canvas/src/VideoFrame.res @@ -0,0 +1,140 @@ +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make: ( + ~image: DOM.Types.htmlImageElement, + ~init: DOM.Types.videoFrameInit=?, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make2: ( + ~image: DOM.Types.svgImageElement, + ~init: DOM.Types.videoFrameInit=?, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make3: ( + ~image: DOM.Types.htmlVideoElement, + ~init: DOM.Types.videoFrameInit=?, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make4: ( + ~image: DOM.Types.htmlCanvasElement, + ~init: DOM.Types.videoFrameInit=?, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make5: ( + ~image: Types.imageBitmap, + ~init: DOM.Types.videoFrameInit=?, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make6: ( + ~image: Types.offscreenCanvas, + ~init: DOM.Types.videoFrameInit=?, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make7: ( + ~image: DOM.Types.videoFrame, + ~init: DOM.Types.videoFrameInit=?, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make8: ( + ~data: ArrayBuffer.t, + ~init: DOM.Types.videoFrameBufferInit, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make9: ( + ~data: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, + ~init: DOM.Types.videoFrameBufferInit, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame) +*/ +@new +external make10: ( + ~data: DataView.t, + ~init: DOM.Types.videoFrameBufferInit, +) => DOM.Types.videoFrame = "VideoFrame" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame/allocationSize) +*/ +@send +external allocationSize: ( + DOM.Types.videoFrame, + ~options: DOM.Types.videoFrameCopyToOptions=?, +) => int = "allocationSize" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame/copyTo) +*/ +@send +external copyTo: ( + DOM.Types.videoFrame, + ~destination: ArrayBuffer.t, + ~options: DOM.Types.videoFrameCopyToOptions=?, +) => promise> = "copyTo" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame/copyTo) +*/ +@send +external copyTo2: ( + DOM.Types.videoFrame, + ~destination: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, + ~options: DOM.Types.videoFrameCopyToOptions=?, +) => promise> = "copyTo" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame/copyTo) +*/ +@send +external copyTo3: ( + DOM.Types.videoFrame, + ~destination: DataView.t, + ~options: DOM.Types.videoFrameCopyToOptions=?, +) => promise> = "copyTo" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame/clone) +*/ +@send +external clone: DOM.Types.videoFrame => DOM.Types.videoFrame = "clone" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/VideoFrame/close) +*/ +@send +external close: DOM.Types.videoFrame => unit = "close" diff --git a/packages/ChannelMessaging/package.json b/packages/ChannelMessaging/package.json new file mode 100644 index 00000000..2c7cabef --- /dev/null +++ b/packages/ChannelMessaging/package.json @@ -0,0 +1,23 @@ +{ + "name": "@rescript-webapi/channel-messaging", + "version": "0.1.0", + "license": "MIT", + "type": "module", + "files": [ + "rescript.json", + "src/**/*.res" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "scripts": { + "build": "rescript" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + }, + "dependencies": { + "@rescript-webapi/event": "0.1.0" + } +} diff --git a/packages/ChannelMessaging/rescript.json b/packages/ChannelMessaging/rescript.json new file mode 100644 index 00000000..696ed07b --- /dev/null +++ b/packages/ChannelMessaging/rescript.json @@ -0,0 +1,18 @@ +{ + "name": "@rescript-webapi/channel-messaging", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "package-specs": { + "module": "esmodule", + "in-source": true + }, + "suffix": ".js", + "dependencies": [ + "@rescript-webapi/event" + ], + "namespace": "ChannelMessaging" +} diff --git a/packages/ChannelMessaging/src/MessagePort.js b/packages/ChannelMessaging/src/MessagePort.js new file mode 100644 index 00000000..d8fc27bc --- /dev/null +++ b/packages/ChannelMessaging/src/MessagePort.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +EventTarget$Event.Impl({}); + +/* Not a pure module */ diff --git a/src/ChannelMessagingAPI/MessagePort.res b/packages/ChannelMessaging/src/MessagePort.res similarity index 77% rename from src/ChannelMessagingAPI/MessagePort.res rename to packages/ChannelMessaging/src/MessagePort.res index c0e3e78f..c530ba2a 100644 --- a/src/ChannelMessagingAPI/MessagePort.res +++ b/packages/ChannelMessaging/src/MessagePort.res @@ -1,6 +1,4 @@ -open ChannelMessagingAPI - -include EventTarget.Impl({type t = messagePort}) +include Event.EventTarget.Impl({type t = Types.messagePort}) /** Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side. @@ -9,7 +7,7 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage) */ @send -external postMessage: (messagePort, ~message: JSON.t, ~transfer: array>) => unit = +external postMessage: (Types.messagePort, ~message: JSON.t, ~transfer: array>) => unit = "postMessage" /** @@ -20,9 +18,9 @@ Throws a "DataCloneError" DOMException if transfer contains duplicate objects or */ @send external postMessage2: ( - messagePort, + Types.messagePort, ~message: JSON.t, - ~options: structuredSerializeOptions=?, + ~options: Types.structuredSerializeOptions=?, ) => unit = "postMessage" /** @@ -30,11 +28,11 @@ Begins dispatching messages received on the port. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/start) */ @send -external start: messagePort => unit = "start" +external start: Types.messagePort => unit = "start" /** Disconnects the port, so that it is no longer active. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort/close) */ @send -external close: messagePort => unit = "close" +external close: Types.messagePort => unit = "close" diff --git a/src/ChannelMessagingAPI.js b/packages/ChannelMessaging/src/Types.js similarity index 100% rename from src/ChannelMessagingAPI.js rename to packages/ChannelMessaging/src/Types.js diff --git a/src/ChannelMessagingAPI.res b/packages/ChannelMessaging/src/Types.res similarity index 92% rename from src/ChannelMessagingAPI.res rename to packages/ChannelMessaging/src/Types.res index a960ac74..5dc39ea1 100644 --- a/src/ChannelMessagingAPI.res +++ b/packages/ChannelMessaging/src/Types.res @@ -1,14 +1,12 @@ @@warning("-30") -open EventAPI - /** This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. [See MessagePort on MDN](https://developer.mozilla.org/docs/Web/API/MessagePort) */ @editor.completeFrom(MessagePort) type messagePort = { - ...eventTarget, + ...Event.Types.eventTarget, } type structuredSerializeOptions = {mutable transfer?: array>} diff --git a/packages/Clipboard/package.json b/packages/Clipboard/package.json new file mode 100644 index 00000000..9843cba1 --- /dev/null +++ b/packages/Clipboard/package.json @@ -0,0 +1,24 @@ +{ + "name": "@rescript-webapi/clipboard", + "version": "0.1.0", + "license": "MIT", + "type": "module", + "files": [ + "rescript.json", + "src/**/*.res" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "scripts": { + "build": "rescript" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + }, + "dependencies": { + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/file": "0.1.0" + } +} diff --git a/packages/Clipboard/rescript.json b/packages/Clipboard/rescript.json new file mode 100644 index 00000000..351f8154 --- /dev/null +++ b/packages/Clipboard/rescript.json @@ -0,0 +1,19 @@ +{ + "name": "@rescript-webapi/clipboard", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "package-specs": { + "module": "esmodule", + "in-source": true + }, + "suffix": ".js", + "dependencies": [ + "@rescript-webapi/event", + "@rescript-webapi/file" + ], + "namespace": "Clipboard" +} diff --git a/packages/Clipboard/src/Clipboard.js b/packages/Clipboard/src/Clipboard.js new file mode 100644 index 00000000..d8fc27bc --- /dev/null +++ b/packages/Clipboard/src/Clipboard.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +EventTarget$Event.Impl({}); + +/* Not a pure module */ diff --git a/src/ClipboardAPI/Clipboard.res b/packages/Clipboard/src/Clipboard.res similarity index 50% rename from src/ClipboardAPI/Clipboard.res rename to packages/Clipboard/src/Clipboard.res index 690ae195..187630cb 100644 --- a/src/ClipboardAPI/Clipboard.res +++ b/packages/Clipboard/src/Clipboard.res @@ -1,27 +1,25 @@ -open ClipboardAPI - -include EventTarget.Impl({type t = clipboard}) +include Event.EventTarget.Impl({type t = Types.clipboard}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/read) */ @send -external read: clipboard => promise> = "read" +external read: Types.clipboard => promise> = "read" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/readText) */ @send -external readText: clipboard => promise = "readText" +external readText: Types.clipboard => promise = "readText" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/write) */ @send -external write: (clipboard, array) => promise = "write" +external write: (Types.clipboard, array) => promise = "write" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText) */ @send -external writeText: (clipboard, string) => promise = "writeText" +external writeText: (Types.clipboard, string) => promise = "writeText" diff --git a/src/ClipboardAPI/ClipboardItem.js b/packages/Clipboard/src/ClipboardItem.js similarity index 100% rename from src/ClipboardAPI/ClipboardItem.js rename to packages/Clipboard/src/ClipboardItem.js diff --git a/src/ClipboardAPI/ClipboardItem.res b/packages/Clipboard/src/ClipboardItem.res similarity index 66% rename from src/ClipboardAPI/ClipboardItem.res rename to packages/Clipboard/src/ClipboardItem.res index 9e7a6424..39d77359 100644 --- a/src/ClipboardAPI/ClipboardItem.res +++ b/packages/Clipboard/src/ClipboardItem.res @@ -1,18 +1,15 @@ -open FileAPI -open ClipboardAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem) */ @new -external make: (~items: unknown, ~options: clipboardItemOptions=?) => clipboardItem = +external make: (~items: unknown, ~options: Types.clipboardItemOptions=?) => Types.clipboardItem = "ClipboardItem" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/getType) */ @send -external getType: (clipboardItem, string) => promise = "getType" +external getType: (Types.clipboardItem, string) => promise = "getType" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ClipboardItem/supports_static) diff --git a/src/ClipboardAPI.js b/packages/Clipboard/src/Types.js similarity index 100% rename from src/ClipboardAPI.js rename to packages/Clipboard/src/Types.js diff --git a/src/ClipboardAPI.res b/packages/Clipboard/src/Types.res similarity index 95% rename from src/ClipboardAPI.res rename to packages/Clipboard/src/Types.res index ab2e5c5f..eb33e948 100644 --- a/src/ClipboardAPI.res +++ b/packages/Clipboard/src/Types.res @@ -1,7 +1,5 @@ @@warning("-30") -open EventAPI - type presentationStyle = | @as("attachment") Attachment | @as("inline") Inline @@ -27,7 +25,7 @@ type clipboardItem = { */ @editor.completeFrom(Clipboard) type clipboard = { - ...eventTarget, + ...Event.Types.eventTarget, } type clipboardItemOptions = {mutable presentationStyle?: presentationStyle} diff --git a/packages/CredentialManagement/package.json b/packages/CredentialManagement/package.json new file mode 100644 index 00000000..430fb99e --- /dev/null +++ b/packages/CredentialManagement/package.json @@ -0,0 +1,24 @@ +{ + "name": "@rescript-webapi/credential-management", + "version": "0.1.0", + "license": "MIT", + "type": "module", + "files": [ + "rescript.json", + "src/**/*.res" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "scripts": { + "build": "rescript" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + }, + "dependencies": { + "@rescript-webapi/event": "0.1.0", + "@rescript-webapi/prelude": "0.1.0" + } +} diff --git a/packages/CredentialManagement/rescript.json b/packages/CredentialManagement/rescript.json new file mode 100644 index 00000000..11ab0c85 --- /dev/null +++ b/packages/CredentialManagement/rescript.json @@ -0,0 +1,19 @@ +{ + "name": "@rescript-webapi/credential-management", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "package-specs": { + "module": "esmodule", + "in-source": true + }, + "suffix": ".js", + "dependencies": [ + "@rescript-webapi/event", + "@rescript-webapi/prelude" + ], + "namespace": "CredentialManagement" +} diff --git a/src/CredentialManagementAPI/CredentialsContainer.js b/packages/CredentialManagement/src/CredentialsContainer.js similarity index 100% rename from src/CredentialManagementAPI/CredentialsContainer.js rename to packages/CredentialManagement/src/CredentialsContainer.js diff --git a/src/CredentialManagementAPI/CredentialsContainer.res b/packages/CredentialManagement/src/CredentialsContainer.res similarity index 51% rename from src/CredentialManagementAPI/CredentialsContainer.res rename to packages/CredentialManagement/src/CredentialsContainer.res index 32fc0c32..6de0f0fd 100644 --- a/src/CredentialManagementAPI/CredentialsContainer.res +++ b/packages/CredentialManagement/src/CredentialsContainer.res @@ -1,29 +1,27 @@ -open CredentialManagementAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get) */ @send -external get: (credentialsContainer, ~options: credentialRequestOptions=?) => promise = +external get: (Types.credentialsContainer, ~options: Types.credentialRequestOptions=?) => promise = "get" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store) */ @send -external store: (credentialsContainer, credential) => promise = "store" +external store: (Types.credentialsContainer, Types.credential) => promise = "store" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/create) */ @send external create: ( - credentialsContainer, - ~options: credentialCreationOptions=?, -) => promise = "create" + Types.credentialsContainer, + ~options: Types.credentialCreationOptions=?, +) => promise = "create" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/preventSilentAccess) */ @send -external preventSilentAccess: credentialsContainer => promise = "preventSilentAccess" +external preventSilentAccess: Types.credentialsContainer => promise = "preventSilentAccess" diff --git a/src/CredentialManagementAPI.js b/packages/CredentialManagement/src/Types.js similarity index 100% rename from src/CredentialManagementAPI.js rename to packages/CredentialManagement/src/Types.js diff --git a/src/CredentialManagementAPI.res b/packages/CredentialManagement/src/Types.res similarity index 88% rename from src/CredentialManagementAPI.res rename to packages/CredentialManagement/src/Types.res index ee0787a8..cf59f4a5 100644 --- a/src/CredentialManagementAPI.res +++ b/packages/CredentialManagement/src/Types.res @@ -1,8 +1,5 @@ @@warning("-30") -open Prelude -open EventAPI - type authenticatorTransport = | @as("ble") Ble | @as("hybrid") Hybrid @@ -61,13 +58,13 @@ type credential = { type publicKeyCredentialDescriptor = { @as("type") mutable type_: publicKeyCredentialType, - mutable id: ArrayBufferTypedArrayOrDataView.t, + mutable id: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, mutable transports?: array, } type authenticationExtensionsPRFValues = { - mutable first: ArrayBufferTypedArrayOrDataView.t, - mutable second?: ArrayBufferTypedArrayOrDataView.t, + mutable first: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, + mutable second?: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, } type authenticationExtensionsPRFInputs = { @@ -84,7 +81,7 @@ type authenticationExtensionsClientInputs = { } type publicKeyCredentialRequestOptions = { - mutable challenge: ArrayBufferTypedArrayOrDataView.t, + mutable challenge: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, mutable timeout?: int, mutable rpId?: string, mutable allowCredentials?: array, @@ -94,7 +91,7 @@ type publicKeyCredentialRequestOptions = { type credentialRequestOptions = { mutable mediation?: credentialMediationRequirement, - mutable signal?: abortSignal, + mutable signal?: Event.Types.abortSignal, mutable publicKey?: publicKeyCredentialRequestOptions, } @@ -107,7 +104,7 @@ type publicKeyCredentialRpEntity = { type publicKeyCredentialUserEntity = { ...publicKeyCredentialEntity, - mutable id: ArrayBufferTypedArrayOrDataView.t, + mutable id: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, mutable displayName: string, } @@ -126,7 +123,7 @@ type authenticatorSelectionCriteria = { type publicKeyCredentialCreationOptions = { mutable rp: publicKeyCredentialRpEntity, mutable user: publicKeyCredentialUserEntity, - mutable challenge: ArrayBufferTypedArrayOrDataView.t, + mutable challenge: Prelude.Types.ArrayBufferTypedArrayOrDataView.t, mutable pubKeyCredParams: array, mutable timeout?: int, mutable excludeCredentials?: array, @@ -136,6 +133,6 @@ type publicKeyCredentialCreationOptions = { } type credentialCreationOptions = { - mutable signal?: abortSignal, + mutable signal?: Event.Types.abortSignal, mutable publicKey?: publicKeyCredentialCreationOptions, } diff --git a/packages/DOM/lib/rescript.lock b/packages/DOM/lib/rescript.lock new file mode 100644 index 00000000..91db4f6e --- /dev/null +++ b/packages/DOM/lib/rescript.lock @@ -0,0 +1 @@ +48697 \ No newline at end of file diff --git a/packages/DOM/package.json b/packages/DOM/package.json new file mode 100644 index 00000000..23d514f6 --- /dev/null +++ b/packages/DOM/package.json @@ -0,0 +1,52 @@ +{ + "name": "@rescript-webapi/dom", + "version": "0.1.0", + "license": "MIT", + "type": "module", + "files": [ + "rescript.json", + "src/**/*.res" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "scripts": { + "build": "rescript" + }, + "peerDependencies": { + "rescript": ">=12.0.0 <13" + }, + "dependencies": { + "@rescript-webapi/css-font-loading": "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/event": "0.1.0", + "@rescript-webapi/file": "0.1.0", + "@rescript-webapi/file-and-directory-entries": "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/prelude": "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-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" + } +} diff --git a/packages/DOM/rescript.json b/packages/DOM/rescript.json new file mode 100644 index 00000000..2224aade --- /dev/null +++ b/packages/DOM/rescript.json @@ -0,0 +1,47 @@ +{ + "name": "@rescript-webapi/dom", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "package-specs": { + "module": "esmodule", + "in-source": true + }, + "suffix": ".js", + "dependencies": [ + "@rescript-webapi/css-font-loading", + "@rescript-webapi/channel-messaging", + "@rescript-webapi/clipboard", + "@rescript-webapi/credential-management", + "@rescript-webapi/event", + "@rescript-webapi/file", + "@rescript-webapi/file-and-directory-entries", + "@rescript-webapi/geolocation", + "@rescript-webapi/history", + "@rescript-webapi/indexed-db", + "@rescript-webapi/media-capabilities", + "@rescript-webapi/media-capture-and-streams", + "@rescript-webapi/media-session", + "@rescript-webapi/performance", + "@rescript-webapi/permissions", + "@rescript-webapi/picture-in-picture", + "@rescript-webapi/prelude", + "@rescript-webapi/remote-playback", + "@rescript-webapi/screen-wake-lock", + "@rescript-webapi/service-worker", + "@rescript-webapi/storage", + "@rescript-webapi/url", + "@rescript-webapi/view-transitions", + "@rescript-webapi/visual-viewport", + "@rescript-webapi/web-crypto", + "@rescript-webapi/web-locks", + "@rescript-webapi/web-speech", + "@rescript-webapi/web-storage", + "@rescript-webapi/web-vtt", + "@rescript-webapi/web-workers" + ], + "namespace": "DOM" +} \ No newline at end of file diff --git a/packages/DOM/src/.DS_Store b/packages/DOM/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 animation = +external make: (~effect: Types.animationEffect=?, ~timeline: Types.animationTimeline=?) => Types.animation = "Animation" -include EventTarget.Impl({type t = animation}) +include Event.EventTarget.Impl({type t = Types.animation}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/cancel) */ @send -external cancel: animation => unit = "cancel" +external cancel: Types.animation => unit = "cancel" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/finish) */ @send -external finish: animation => unit = "finish" +external finish: Types.animation => unit = "finish" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/play) */ @send -external play: animation => unit = "play" +external play: Types.animation => unit = "play" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/pause) */ @send -external pause: animation => unit = "pause" +external pause: Types.animation => unit = "pause" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/updatePlaybackRate) */ @send -external updatePlaybackRate: (animation, float) => unit = "updatePlaybackRate" +external updatePlaybackRate: (Types.animation, float) => unit = "updatePlaybackRate" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/reverse) */ @send -external reverse: animation => unit = "reverse" +external reverse: Types.animation => unit = "reverse" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/persist) */ @send -external persist: animation => unit = "persist" +external persist: Types.animation => unit = "persist" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Animation/commitStyles) */ @send -external commitStyles: animation => unit = "commitStyles" +external commitStyles: Types.animation => unit = "commitStyles" diff --git a/src/DOMAPI/AnimationEffect.js b/packages/DOM/src/AnimationEffect.js similarity index 100% rename from src/DOMAPI/AnimationEffect.js rename to packages/DOM/src/AnimationEffect.js diff --git a/src/DOMAPI/AnimationEffect.res b/packages/DOM/src/AnimationEffect.res similarity index 52% rename from src/DOMAPI/AnimationEffect.res rename to packages/DOM/src/AnimationEffect.res index a82b8ac8..4bfe75bf 100644 --- a/src/DOMAPI/AnimationEffect.res +++ b/packages/DOM/src/AnimationEffect.res @@ -1,19 +1,17 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getTiming) */ @send -external getTiming: animationEffect => effectTiming = "getTiming" +external getTiming: Types.animationEffect => Types.effectTiming = "getTiming" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect/getComputedTiming) */ @send -external getComputedTiming: animationEffect => computedEffectTiming = "getComputedTiming" +external getComputedTiming: Types.animationEffect => Types.computedEffectTiming = "getComputedTiming" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationEffect/updateTiming) */ @send -external updateTiming: (animationEffect, ~timing: optionalEffectTiming=?) => unit = "updateTiming" +external updateTiming: (Types.animationEffect, ~timing: Types.optionalEffectTiming=?) => unit = "updateTiming" diff --git a/src/DOMAPI/CSSRuleList.js b/packages/DOM/src/CSSRuleList.js similarity index 100% rename from src/DOMAPI/CSSRuleList.js rename to packages/DOM/src/CSSRuleList.js diff --git a/src/DOMAPI/CSSRuleList.res b/packages/DOM/src/CSSRuleList.res similarity index 55% rename from src/DOMAPI/CSSRuleList.res rename to packages/DOM/src/CSSRuleList.res index bf28421c..d8bd2741 100644 --- a/src/DOMAPI/CSSRuleList.res +++ b/packages/DOM/src/CSSRuleList.res @@ -1,7 +1,5 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSRuleList/item) */ @send -external item: (cssRuleList, int) => cssRule = "item" +external item: (Prelude.Types.cssRuleList, int) => Types.cssRule = "item" diff --git a/src/DOMAPI/CSSStyleDeclaration.js b/packages/DOM/src/CSSStyleDeclaration.js similarity index 100% rename from src/DOMAPI/CSSStyleDeclaration.js rename to packages/DOM/src/CSSStyleDeclaration.js diff --git a/src/DOMAPI/CSSStyleDeclaration.res b/packages/DOM/src/CSSStyleDeclaration.res similarity index 63% rename from src/DOMAPI/CSSStyleDeclaration.res rename to packages/DOM/src/CSSStyleDeclaration.res index 85462137..4085a769 100644 --- a/src/DOMAPI/CSSStyleDeclaration.res +++ b/packages/DOM/src/CSSStyleDeclaration.res @@ -1,29 +1,27 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/item) */ @send -external item: (cssStyleDeclaration, int) => string = "item" +external item: (Types.cssStyleDeclaration, int) => string = "item" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyValue) */ @send -external getPropertyValue: (cssStyleDeclaration, string) => string = "getPropertyValue" +external getPropertyValue: (Types.cssStyleDeclaration, string) => string = "getPropertyValue" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/getPropertyPriority) */ @send -external getPropertyPriority: (cssStyleDeclaration, string) => string = "getPropertyPriority" +external getPropertyPriority: (Types.cssStyleDeclaration, string) => string = "getPropertyPriority" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/setProperty) */ @send external setProperty: ( - cssStyleDeclaration, + Types.cssStyleDeclaration, ~property: string, ~value: string, ~priority: string=?, @@ -33,4 +31,4 @@ external setProperty: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleDeclaration/removeProperty) */ @send -external removeProperty: (cssStyleDeclaration, string) => string = "removeProperty" +external removeProperty: (Types.cssStyleDeclaration, string) => string = "removeProperty" diff --git a/src/DOMAPI/CSSStyleSheet.js b/packages/DOM/src/CSSStyleSheet.js similarity index 100% rename from src/DOMAPI/CSSStyleSheet.js rename to packages/DOM/src/CSSStyleSheet.js diff --git a/packages/DOM/src/CSSStyleSheet.res b/packages/DOM/src/CSSStyleSheet.res new file mode 100644 index 00000000..5d6cac8d --- /dev/null +++ b/packages/DOM/src/CSSStyleSheet.res @@ -0,0 +1,30 @@ +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet) +*/ +@new +external make: (~options: Types.cssStyleSheetInit=?) => Types.cssStyleSheet = "CSSStyleSheet" + +external asStyleSheet: Types.cssStyleSheet => Types.styleSheet = "%identity" +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule) +*/ +@send +external insertRule: (Types.cssStyleSheet, ~rule: string, ~index: int=?) => int = "insertRule" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/deleteRule) +*/ +@send +external deleteRule: (Types.cssStyleSheet, int) => unit = "deleteRule" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replace) +*/ +@send +external replace: (Types.cssStyleSheet, string) => promise = "replace" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replaceSync) +*/ +@send +external replaceSync: (Types.cssStyleSheet, string) => unit = "replaceSync" diff --git a/src/DOMAPI/CSSStyleValue.js b/packages/DOM/src/CSSStyleValue.js similarity index 100% rename from src/DOMAPI/CSSStyleValue.js rename to packages/DOM/src/CSSStyleValue.js diff --git a/src/DOMAPI/CSSStyleValue.res b/packages/DOM/src/CSSStyleValue.res similarity index 70% rename from src/DOMAPI/CSSStyleValue.res rename to packages/DOM/src/CSSStyleValue.res index 43c1bd2b..135b28bf 100644 --- a/src/DOMAPI/CSSStyleValue.res +++ b/packages/DOM/src/CSSStyleValue.res @@ -1,13 +1,11 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parse_static) */ @scope("CSSStyleValue") -external parse: (~property: string, ~cssText: string) => cssStyleValue = "parse" +external parse: (~property: string, ~cssText: string) => Prelude.Types.cssStyleValue = "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/DOMAPI/CaretPosition.js b/packages/DOM/src/CaretPosition.js similarity index 100% rename from src/DOMAPI/CaretPosition.js rename to packages/DOM/src/CaretPosition.js diff --git a/packages/DOM/src/CaretPosition.res b/packages/DOM/src/CaretPosition.res new file mode 100644 index 00000000..abcea065 --- /dev/null +++ b/packages/DOM/src/CaretPosition.res @@ -0,0 +1,2 @@ +@send +external getClientRect: Prelude.Types.caretPosition => Prelude.Types.domRect = "getClientRect" diff --git a/src/DOMAPI/CharacterData.js b/packages/DOM/src/CharacterData.js similarity index 59% rename from src/DOMAPI/CharacterData.js rename to packages/DOM/src/CharacterData.js index d7d93d7c..a46ff94e 100644 --- a/src/DOMAPI/CharacterData.js +++ b/packages/DOM/src/CharacterData.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$DOM from "./Node.js"; function Impl(T) { - Node$WebAPI.Impl({}); + Node$DOM.Impl({}); return {}; } -Node$WebAPI.Impl({}); +Node$DOM.Impl({}); export { Impl, diff --git a/src/DOMAPI/CharacterData.res b/packages/DOM/src/CharacterData.res similarity index 91% rename from src/DOMAPI/CharacterData.res rename to packages/DOM/src/CharacterData.res index 8ebc3065..22fe29a6 100644 --- a/src/DOMAPI/CharacterData.res +++ b/packages/DOM/src/CharacterData.res @@ -1,5 +1,3 @@ -open DOMAPI - module Impl = ( T: { type t @@ -7,7 +5,7 @@ module Impl = ( ) => { include Node.Impl({type t = T.t}) - external asCharacterData: T.t => characterData = "%identity" + external asCharacterData: T.t => Types.characterData = "%identity" /** Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. @@ -16,7 +14,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) */ @send - external after: (T.t, node) => unit = "after" + external after: (T.t, Types.node) => unit = "after" /** Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. @@ -40,7 +38,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) */ @send - external before: (T.t, node) => unit = "before" + external before: (T.t, Types.node) => unit = "before" /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. @@ -83,7 +81,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) */ @send - external replaceWith: (T.t, node) => unit = "replaceWith" + external replaceWith: (T.t, Types.node) => unit = "replaceWith" /** Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -101,4 +99,4 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre external substringData: (T.t, ~offset: int, ~count: int) => string = "substringData" } -include Impl({type t = characterData}) +include Impl({type t = Types.characterData}) diff --git a/packages/DOM/src/Comment.js b/packages/DOM/src/Comment.js new file mode 100644 index 00000000..966c8ebb --- /dev/null +++ b/packages/DOM/src/Comment.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as CharacterData$DOM from "./CharacterData.js"; + +CharacterData$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/Comment.res b/packages/DOM/src/Comment.res new file mode 100644 index 00000000..623d9652 --- /dev/null +++ b/packages/DOM/src/Comment.res @@ -0,0 +1,7 @@ +include CharacterData.Impl({type t = Types.comment}) + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Comment) +*/ +@new +external make: (~data: string=?) => Types.comment = "Comment" diff --git a/src/DOMAPI/CustomElementRegistry.js b/packages/DOM/src/CustomElementRegistry.js similarity index 100% rename from src/DOMAPI/CustomElementRegistry.js rename to packages/DOM/src/CustomElementRegistry.js diff --git a/src/DOMAPI/CustomElementRegistry.res b/packages/DOM/src/CustomElementRegistry.res similarity index 53% rename from src/DOMAPI/CustomElementRegistry.res rename to packages/DOM/src/CustomElementRegistry.res index 2de909b6..ca33736c 100644 --- a/src/DOMAPI/CustomElementRegistry.res +++ b/packages/DOM/src/CustomElementRegistry.res @@ -1,31 +1,32 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/define) */ @send external define: ( - customElementRegistry, + Types.customElementRegistry, ~name: string, - ~constructor: customElementConstructor, - ~options: elementDefinitionOptions=?, + ~constructor: Types.htmlElement, + ~options: Types.elementDefinitionOptions=?, ) => unit = "define" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/getName) */ @send -external getName: (customElementRegistry, customElementConstructor) => string = "getName" +external getName: (Types.customElementRegistry, Types.customElementConstructor) => string = + "getName" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/whenDefined) */ @send -external whenDefined: (customElementRegistry, string) => promise = - "whenDefined" +external whenDefined: ( + Types.customElementRegistry, + string, +) => promise = "whenDefined" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry/upgrade) */ @send -external upgrade: (customElementRegistry, node) => unit = "upgrade" +external upgrade: (Types.customElementRegistry, Types.node) => unit = "upgrade" diff --git a/src/DOMAPI/DOMImplementation.js b/packages/DOM/src/DOMImplementation.js similarity index 100% rename from src/DOMAPI/DOMImplementation.js rename to packages/DOM/src/DOMImplementation.js diff --git a/src/DOMAPI/DOMImplementation.res b/packages/DOM/src/DOMImplementation.res similarity index 65% rename from src/DOMAPI/DOMImplementation.res rename to packages/DOM/src/DOMImplementation.res index d87ee6c3..c24b981f 100644 --- a/src/DOMAPI/DOMImplementation.res +++ b/packages/DOM/src/DOMImplementation.res @@ -1,30 +1,28 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocumentType) */ @send external createDocumentType: ( - domImplementation, + Prelude.Types.domImplementation, ~qualifiedName: string, ~publicId: string, ~systemId: string, -) => documentType = "createDocumentType" +) => Types.documentType = "createDocumentType" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createDocument) */ @send external createDocument: ( - domImplementation, + Types.domImplementation, ~namespace: string, ~qualifiedName: string, - ~doctype: documentType=?, -) => xmlDocument = "createDocument" + ~doctype: Types.documentType=?, +) => Types.xmlDocument = "createDocument" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument) */ @send -external createHTMLDocument: (domImplementation, ~title: string=?) => document = +external createHTMLDocument: (Types.domImplementation, ~title: string=?) => Types.document = "createHTMLDocument" diff --git a/src/DOMAPI/DOMMatrix.js b/packages/DOM/src/DOMMatrix.js similarity index 100% rename from src/DOMAPI/DOMMatrix.js rename to packages/DOM/src/DOMMatrix.js diff --git a/packages/DOM/src/DOMMatrix.res b/packages/DOM/src/DOMMatrix.res new file mode 100644 index 00000000..e925f143 --- /dev/null +++ b/packages/DOM/src/DOMMatrix.res @@ -0,0 +1,166 @@ +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix) +*/ +@new +external make: (~init: string=?) => Types.domMatrix = "DOMMatrix" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix) +*/ +@new +external make2: (~init: array=?) => Types.domMatrix = "DOMMatrix" + +external asDOMMatrixReadOnly: Types.domMatrix => Types.domMatrixReadOnly = "%identity" +@scope("DOMMatrix") +external fromMatrix: (~other: Types.domMatrixInit=?) => Types.domMatrixReadOnly = "fromMatrix" + +@scope("DOMMatrix") +external fromFloat32Array: array => Types.domMatrixReadOnly = "fromFloat32Array" + +@scope("DOMMatrix") +external fromFloat64Array: Float64Array.t => Types.domMatrixReadOnly = "fromFloat64Array" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate) +*/ +@send +external translate: (Types.domMatrix, ~tx: float=?, ~ty: float=?, ~tz: float=?) => Types.domMatrix = "translate" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale) +*/ +@send +external scale: ( + Types.domMatrix, + ~scaleX: float=?, + ~scaleY: float=?, + ~scaleZ: float=?, + ~originX: float=?, + ~originY: float=?, + ~originZ: float=?, +) => Types.domMatrix = "scale" + +@send +external scale3d: ( + Types.domMatrix, + ~scale: float=?, + ~originX: float=?, + ~originY: float=?, + ~originZ: float=?, +) => Types.domMatrix = "scale3d" + +@send +external rotate: (Types.domMatrix, ~rotX: float=?, ~rotY: float=?, ~rotZ: float=?) => Types.domMatrix = "rotate" + +@send +external rotateFromVector: (Types.domMatrix, ~x: float=?, ~y: float=?) => Types.domMatrix = "rotateFromVector" + +@send +external rotateAxisAngle: ( + Types.domMatrix, + ~x: float=?, + ~y: float=?, + ~z: float=?, + ~angle: float=?, +) => Types.domMatrix = "rotateAxisAngle" + +@send +external skewX: (Types.domMatrix, ~sx: float=?) => Types.domMatrix = "skewX" + +@send +external skewY: (Types.domMatrix, ~sy: float=?) => Types.domMatrix = "skewY" + +@send +external multiply: (Types.domMatrix, ~other: Types.domMatrixInit=?) => Types.domMatrix = "multiply" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipX) +*/ +@send +external flipX: Types.domMatrix => Types.domMatrix = "flipX" + +@send +external flipY: Types.domMatrix => Types.domMatrix = "flipY" + +@send +external inverse: Types.domMatrix => Types.domMatrix = "inverse" + +@send +external transformPoint: (Types.domMatrix, ~point: Types.domPointInit=?) => Types.domPoint = "transformPoint" + +@send +external toFloat32Array: Types.domMatrix => array = "toFloat32Array" + +@send +external toFloat64Array: Types.domMatrix => Float64Array.t = "toFloat64Array" + +@send +external toJSON: Types.domMatrix => Dict.t = "toJSON" + +@scope("DOMMatrix") +external fromMatrixD: (~other: Types.domMatrixInit=?) => Types.domMatrix = "fromMatrix" + +@scope("DOMMatrix") +external fromFloat32ArrayD: array => Types.domMatrix = "fromFloat32Array" + +@scope("DOMMatrix") +external fromFloat64ArrayD: Float64Array.t => Types.domMatrix = "fromFloat64Array" + +@send +external multiplySelf: (Types.domMatrix, ~other: Types.domMatrixInit=?) => Types.domMatrix = "multiplySelf" + +@send +external preMultiplySelf: (Types.domMatrix, ~other: Types.domMatrixInit=?) => Types.domMatrix = "preMultiplySelf" + +@send +external translateSelf: (Types.domMatrix, ~tx: float=?, ~ty: float=?, ~tz: float=?) => Types.domMatrix = + "translateSelf" + +@send +external scaleSelf: ( + Types.domMatrix, + ~scaleX: float=?, + ~scaleY: float=?, + ~scaleZ: float=?, + ~originX: float=?, + ~originY: float=?, + ~originZ: float=?, +) => Types.domMatrix = "scaleSelf" + +@send +external scale3dSelf: ( + Types.domMatrix, + ~scale: float=?, + ~originX: float=?, + ~originY: float=?, + ~originZ: float=?, +) => Types.domMatrix = "scale3dSelf" + +@send +external rotateSelf: (Types.domMatrix, ~rotX: float=?, ~rotY: float=?, ~rotZ: float=?) => Types.domMatrix = + "rotateSelf" + +@send +external rotateFromVectorSelf: (Types.domMatrix, ~x: float=?, ~y: float=?) => Types.domMatrix = + "rotateFromVectorSelf" + +@send +external rotateAxisAngleSelf: ( + Types.domMatrix, + ~x: float=?, + ~y: float=?, + ~z: float=?, + ~angle: float=?, +) => Types.domMatrix = "rotateAxisAngleSelf" + +@send +external skewXSelf: (Types.domMatrix, ~sx: float=?) => Types.domMatrix = "skewXSelf" + +@send +external skewYSelf: (Types.domMatrix, ~sy: float=?) => Types.domMatrix = "skewYSelf" + +@send +external invertSelf: Types.domMatrix => Types.domMatrix = "invertSelf" + +@send +external setMatrixValue: (Types.domMatrix, string) => Types.domMatrix = "setMatrixValue" diff --git a/src/DOMAPI/DOMMatrixReadOnly.js b/packages/DOM/src/DOMMatrixReadOnly.js similarity index 100% rename from src/DOMAPI/DOMMatrixReadOnly.js rename to packages/DOM/src/DOMMatrixReadOnly.js diff --git a/packages/DOM/src/DOMMatrixReadOnly.res b/packages/DOM/src/DOMMatrixReadOnly.res new file mode 100644 index 00000000..0a358caa --- /dev/null +++ b/packages/DOM/src/DOMMatrixReadOnly.res @@ -0,0 +1,100 @@ +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly) +*/ +@new +external make: (~init: string=?) => Types.domMatrixReadOnly = "DOMMatrixReadOnly" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly) +*/ +@new +external make2: (~init: array=?) => Types.domMatrixReadOnly = "DOMMatrixReadOnly" + +@scope("DOMMatrixReadOnly") +external fromMatrix: (~other: Types.domMatrixInit=?) => Types.domMatrixReadOnly = "fromMatrix" + +@scope("DOMMatrixReadOnly") +external fromFloat32Array: array => Types.domMatrixReadOnly = "fromFloat32Array" + +@scope("DOMMatrixReadOnly") +external fromFloat64Array: Float64Array.t => Types.domMatrixReadOnly = "fromFloat64Array" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate) +*/ +@send +external translate: (Types.domMatrixReadOnly, ~tx: float=?, ~ty: float=?, ~tz: float=?) => Types.domMatrix = + "translate" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale) +*/ +@send +external scale: ( + Types.domMatrixReadOnly, + ~scaleX: float=?, + ~scaleY: float=?, + ~scaleZ: float=?, + ~originX: float=?, + ~originY: float=?, + ~originZ: float=?, +) => Types.domMatrix = "scale" + +@send +external scale3d: ( + Types.domMatrixReadOnly, + ~scale: float=?, + ~originX: float=?, + ~originY: float=?, + ~originZ: float=?, +) => Types.domMatrix = "scale3d" + +@send +external rotate: (Types.domMatrixReadOnly, ~rotX: float=?, ~rotY: float=?, ~rotZ: float=?) => Types.domMatrix = + "rotate" + +@send +external rotateFromVector: (Types.domMatrixReadOnly, ~x: float=?, ~y: float=?) => Types.domMatrix = + "rotateFromVector" + +@send +external rotateAxisAngle: ( + Types.domMatrixReadOnly, + ~x: float=?, + ~y: float=?, + ~z: float=?, + ~angle: float=?, +) => Types.domMatrix = "rotateAxisAngle" + +@send +external skewX: (Types.domMatrixReadOnly, ~sx: float=?) => Types.domMatrix = "skewX" + +@send +external skewY: (Types.domMatrixReadOnly, ~sy: float=?) => Types.domMatrix = "skewY" + +@send +external multiply: (Types.domMatrixReadOnly, ~other: Types.domMatrixInit=?) => Types.domMatrix = "multiply" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipX) +*/ +@send +external flipX: Types.domMatrixReadOnly => Types.domMatrix = "flipX" + +@send +external flipY: Types.domMatrixReadOnly => Types.domMatrix = "flipY" + +@send +external inverse: Types.domMatrixReadOnly => Types.domMatrix = "inverse" + +@send +external transformPoint: (Types.domMatrixReadOnly, ~point: Types.domPointInit=?) => Types.domPoint = "transformPoint" + +@send +external toFloat32Array: Types.domMatrixReadOnly => array = "toFloat32Array" + +@send +external toFloat64Array: Types.domMatrixReadOnly => Float64Array.t = "toFloat64Array" + +@send +external toJSON: Types.domMatrixReadOnly => Dict.t = "toJSON" diff --git a/src/DOMAPI/DOMPoint.js b/packages/DOM/src/DOMPoint.js similarity index 100% rename from src/DOMAPI/DOMPoint.js rename to packages/DOM/src/DOMPoint.js diff --git a/src/DOMAPI/DOMPoint.res b/packages/DOM/src/DOMPoint.res similarity index 51% rename from src/DOMAPI/DOMPoint.res rename to packages/DOM/src/DOMPoint.res index 75c31e9a..c34fbece 100644 --- a/src/DOMAPI/DOMPoint.res +++ b/packages/DOM/src/DOMPoint.res @@ -1,29 +1,27 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPoint) */ @new -external make: (~x: float=?, ~y: float=?, ~z: float=?, ~w: float=?) => domPoint = "DOMPoint" +external make: (~x: float=?, ~y: float=?, ~z: float=?, ~w: float=?) => Types.domPoint = "DOMPoint" -external asDOMPointReadOnly: domPoint => domPointReadOnly = "%identity" +external asDOMPointReadOnly: Types.domPoint => Types.domPointReadOnly = "%identity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/fromPoint_static) */ @scope("DOMPoint") -external fromPoint: (~other: domPointInit=?) => domPointReadOnly = "fromPoint" +external fromPoint: (~other: Types.domPointInit=?) => Types.domPointReadOnly = "fromPoint" @send -external matrixTransform: (domPoint, ~matrix: domMatrixInit=?) => domPoint = "matrixTransform" +external matrixTransform: (Types.domPoint, ~matrix: Types.domMatrixInit=?) => Types.domPoint = "matrixTransform" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/toJSON) */ @send -external toJSON: domPoint => Dict.t = "toJSON" +external toJSON: Types.domPoint => Dict.t = "toJSON" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPoint/fromPoint_static) */ @scope("DOMPoint") -external fromPointD: (~other: domPointInit=?) => domPoint = "fromPoint" +external fromPointD: (~other: Types.domPointInit=?) => Types.domPoint = "fromPoint" diff --git a/src/DOMAPI/DOMPointReadOnly.js b/packages/DOM/src/DOMPointReadOnly.js similarity index 100% rename from src/DOMAPI/DOMPointReadOnly.js rename to packages/DOM/src/DOMPointReadOnly.js diff --git a/src/DOMAPI/DOMPointReadOnly.res b/packages/DOM/src/DOMPointReadOnly.res similarity index 59% rename from src/DOMAPI/DOMPointReadOnly.res rename to packages/DOM/src/DOMPointReadOnly.res index 4d92aaac..35047a37 100644 --- a/src/DOMAPI/DOMPointReadOnly.res +++ b/packages/DOM/src/DOMPointReadOnly.res @@ -1,24 +1,22 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly) */ @new -external make: (~x: float=?, ~y: float=?, ~z: float=?, ~w: float=?) => domPointReadOnly = +external make: (~x: float=?, ~y: float=?, ~z: float=?, ~w: float=?) => Types.domPointReadOnly = "DOMPointReadOnly" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/fromPoint_static) */ @scope("DOMPointReadOnly") -external fromPoint: (~other: domPointInit=?) => domPointReadOnly = "fromPoint" +external fromPoint: (~other: Types.domPointInit=?) => Types.domPointReadOnly = "fromPoint" @send -external matrixTransform: (domPointReadOnly, ~matrix: domMatrixInit=?) => domPoint = +external matrixTransform: (Types.domPointReadOnly, ~matrix: Types.domMatrixInit=?) => Types.domPoint = "matrixTransform" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/toJSON) */ @send -external toJSON: domPointReadOnly => Dict.t = "toJSON" +external toJSON: Types.domPointReadOnly => Dict.t = "toJSON" diff --git a/src/DOMAPI/DOMRect.js b/packages/DOM/src/DOMRect.js similarity index 100% rename from src/DOMAPI/DOMRect.js rename to packages/DOM/src/DOMRect.js diff --git a/src/DOMAPI/DOMRect.res b/packages/DOM/src/DOMRect.res similarity index 52% rename from src/DOMAPI/DOMRect.res rename to packages/DOM/src/DOMRect.res index 6bcb61fe..8394f797 100644 --- a/src/DOMAPI/DOMRect.res +++ b/packages/DOM/src/DOMRect.res @@ -1,23 +1,21 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRect) */ @new -external make: (~x: float=?, ~y: float=?, ~width: float=?, ~height: float=?) => domRect = "DOMRect" +external make: (~x: float=?, ~y: float=?, ~width: float=?, ~height: float=?) => Types.domRect = "DOMRect" -external asDOMRectReadOnly: domRect => domRectReadOnly = "%identity" +external asDOMRectReadOnly: Types.domRect => Types.domRectReadOnly = "%identity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/fromRect_static) */ @scope("DOMRect") -external fromRect: (~other: domRectInit=?) => domRectReadOnly = "fromRect" +external fromRect: (~other: Types.domRectInit=?) => Types.domRectReadOnly = "fromRect" @send -external toJSON: domRect => Dict.t = "toJSON" +external toJSON: Types.domRect => Dict.t = "toJSON" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRect/fromRect_static) */ @scope("DOMRect") -external fromRectD: (~other: domRectInit=?) => domRect = "fromRect" +external fromRectD: (~other: Types.domRectInit=?) => Types.domRect = "fromRect" diff --git a/src/DOMAPI/DOMRectList.js b/packages/DOM/src/DOMRectList.js similarity index 100% rename from src/DOMAPI/DOMRectList.js rename to packages/DOM/src/DOMRectList.js diff --git a/packages/DOM/src/DOMRectList.res b/packages/DOM/src/DOMRectList.res new file mode 100644 index 00000000..8fd1645a --- /dev/null +++ b/packages/DOM/src/DOMRectList.res @@ -0,0 +1,2 @@ +@send +external item: (Types.domRectList, int) => Types.domRect = "item" diff --git a/src/DOMAPI/DOMRectReadOnly.js b/packages/DOM/src/DOMRectReadOnly.js similarity index 100% rename from src/DOMAPI/DOMRectReadOnly.js rename to packages/DOM/src/DOMRectReadOnly.js diff --git a/src/DOMAPI/DOMRectReadOnly.res b/packages/DOM/src/DOMRectReadOnly.res similarity index 61% rename from src/DOMAPI/DOMRectReadOnly.res rename to packages/DOM/src/DOMRectReadOnly.res index 1e02459d..f5a72860 100644 --- a/src/DOMAPI/DOMRectReadOnly.res +++ b/packages/DOM/src/DOMRectReadOnly.res @@ -1,17 +1,15 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly) */ @new -external make: (~x: float=?, ~y: float=?, ~width: float=?, ~height: float=?) => domRectReadOnly = +external make: (~x: float=?, ~y: float=?, ~width: float=?, ~height: float=?) => Types.domRectReadOnly = "DOMRectReadOnly" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/fromRect_static) */ @scope("DOMRectReadOnly") -external fromRect: (~other: domRectInit=?) => domRectReadOnly = "fromRect" +external fromRect: (~other: Types.domRectInit=?) => Types.domRectReadOnly = "fromRect" @send -external toJSON: domRectReadOnly => Dict.t = "toJSON" +external toJSON: Types.domRectReadOnly => Dict.t = "toJSON" diff --git a/src/DOMAPI/DOMTokenList.js b/packages/DOM/src/DOMTokenList.js similarity index 100% rename from src/DOMAPI/DOMTokenList.js rename to packages/DOM/src/DOMTokenList.js diff --git a/src/DOMAPI/DOMTokenList.res b/packages/DOM/src/DOMTokenList.res similarity index 80% rename from src/DOMAPI/DOMTokenList.res rename to packages/DOM/src/DOMTokenList.res index 47348f69..227c66ea 100644 --- a/src/DOMAPI/DOMTokenList.res +++ b/packages/DOM/src/DOMTokenList.res @@ -1,18 +1,16 @@ -open DOMAPI - /** Returns the token with index index. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/item) */ @send -external item: (domTokenList, int) => string = "item" +external item: (Types.domTokenList, int) => string = "item" /** Returns true if token is present, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/contains) */ @send -external contains: (domTokenList, string) => bool = "contains" +external contains: (Types.domTokenList, string) => bool = "contains" /** Adds all arguments passed, except those already present. @@ -23,7 +21,7 @@ Throws an "InvalidCharacterError" DOMException if one of the arguments contains [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/add) */ @send -external add: (domTokenList, string) => unit = "add" +external add: (Types.domTokenList, string) => unit = "add" /** Removes arguments passed, if they are present. @@ -34,7 +32,7 @@ Throws an "InvalidCharacterError" DOMException if one of the arguments contains [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/remove) */ @send -external remove: (domTokenList, string) => unit = "remove" +external remove: (Types.domTokenList, string) => unit = "remove" /** If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). @@ -47,7 +45,7 @@ Throws an "InvalidCharacterError" DOMException if token contains any spaces. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/toggle) */ @send -external toggle: (domTokenList, ~token: string, ~force: bool=?) => bool = "toggle" +external toggle: (Types.domTokenList, ~token: string, ~force: bool=?) => bool = "toggle" /** Replaces token with newToken. @@ -60,7 +58,7 @@ Throws an "InvalidCharacterError" DOMException if one of the arguments contains [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/replace) */ @send -external replace: (domTokenList, ~token: string, ~newToken: string) => bool = "replace" +external replace: (Types.domTokenList, ~token: string, ~newToken: string) => bool = "replace" /** Returns true if token is in the associated attribute's supported tokens. Returns false otherwise. @@ -69,4 +67,4 @@ Throws a TypeError if the associated attribute has no supported tokens defined. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/supports) */ @send -external supports: (domTokenList, string) => bool = "supports" +external supports: (Types.domTokenList, string) => bool = "supports" diff --git a/src/DOMAPI/Document.js b/packages/DOM/src/Document.js similarity index 73% rename from src/DOMAPI/Document.js rename to packages/DOM/src/Document.js index eee85457..64a7f1c0 100644 --- a/src/DOMAPI/Document.js +++ b/packages/DOM/src/Document.js @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$DOM from "./Node.js"; -Node$WebAPI.Impl({}); +Node$DOM.Impl({}); function isInstanceOf(param) { return (param instanceof Document); diff --git a/src/DOMAPI/Document.res b/packages/DOM/src/Document.res similarity index 76% rename from src/DOMAPI/Document.res rename to packages/DOM/src/Document.res index fa06b986..79319ee4 100644 --- a/src/DOMAPI/Document.res +++ b/packages/DOM/src/Document.res @@ -1,27 +1,23 @@ -open DOMAPI -open EventAPI -open ViewTransitionsAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document) */ @new -external make: unit => document = "Document" +external make: unit => Types.document = "Document" -include Node.Impl({type t = document}) +include Node.Impl({type t = Types.document}) /** Returns the first element within node's descendants whose ID is elementId. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById) */ @send -external getElementById: (document, string) => null = "getElementById" +external getElementById: (Types.document, string) => null = "getElementById" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getAnimations) */ @send -external getAnimations: document => array = "getAnimations" +external getAnimations: Types.document => array = "getAnimations" /** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. @@ -30,7 +26,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) */ @send -external prepend: (document, node) => unit = "prepend" +external prepend: (Types.document, Types.node) => unit = "prepend" /** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. @@ -39,7 +35,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) */ @send -external prepend2: (document, string) => unit = "prepend" +external prepend2: (Types.document, string) => unit = "prepend" /** Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. @@ -48,7 +44,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) */ @send -external append: (document, node) => unit = "append" +external append: (Types.document, Types.node) => unit = "append" /** Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. @@ -57,7 +53,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append) */ @send -external append2: (document, string) => unit = "append" +external append2: (Types.document, string) => unit = "append" /** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -66,7 +62,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) */ @send -external replaceChildren: (document, node) => unit = "replaceChildren" +external replaceChildren: (Types.document, Types.node) => unit = "replaceChildren" /** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -75,44 +71,44 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) */ @send -external replaceChildren2: (document, string) => unit = "replaceChildren" +external replaceChildren2: (Types.document, string) => unit = "replaceChildren" /** Returns the first element that is a descendant of node that matches selectors. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) */ @send -external querySelector: (document, string) => Null.t = "querySelector" +external querySelector: (Types.document, string) => Null.t = "querySelector" /** Returns all element descendants of node that match selectors. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) */ @send -external querySelectorAll: (document, string) => nodeList = "querySelectorAll" +external querySelectorAll: (Types.document, string) => Types.nodeList = "querySelectorAll" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createExpression) */ @send external createExpression: ( - document, + Types.document, ~expression: string, - ~resolver: xPathNSResolver=?, -) => xPathExpression = "createExpression" + ~resolver: Types.xPathNSResolver=?, +) => Types.xPathExpression = "createExpression" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/evaluate) */ @send external evaluate: ( - document, + Types.document, ~expression: string, - ~contextNode: node, - ~resolver: xPathNSResolver=?, + ~contextNode: Types.node, + ~resolver: Types.xPathNSResolver=?, ~type_: int=?, - ~result: xPathResult=?, -) => xPathResult = "evaluate" + ~result: Types.xPathResult=?, +) => Types.xPathResult = "evaluate" /** Retrieves a collection of objects based on the specified element name. @@ -120,7 +116,7 @@ Retrieves a collection of objects based on the specified element name. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagName) */ @send -external getElementsByTagName: (document, string) => htmlCollection = +external getElementsByTagName: (Types.document, string) => Types.htmlCollection = "getElementsByTagName" /** @@ -135,17 +131,17 @@ Otherwise, returns a HTMLCollection of all descendant elements whose namespace i */ @send external getElementsByTagNameNS: ( - document, + Types.document, ~namespace: string, ~localName: string, -) => htmlCollection = "getElementsByTagNameNS" +) => Types.htmlCollection = "getElementsByTagNameNS" /** Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName) */ @send -external getElementsByClassName: (document, string) => htmlCollection = +external getElementsByClassName: (Types.document, string) => Types.htmlCollection = "getElementsByClassName" /** @@ -154,7 +150,7 @@ Creates an instance of the element for the specified tag. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createElement) */ @send -external createElement: (document, string, ~options: string=?) => element = "createElement" +external createElement: (Types.document, string, ~options: string=?) => Types.element = "createElement" /** Creates an instance of the element for the specified tag. @@ -163,10 +159,10 @@ Creates an instance of the element for the specified tag. */ @send external createElement2: ( - document, + Types.document, ~localName: string, - ~options: elementCreationOptions=?, -) => element = "createElement" + ~options: Types.elementCreationOptions=?, +) => Types.element = "createElement" /** Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName. @@ -186,11 +182,11 @@ When supplied, options's is can be used to create a customized built-in element. */ @send external createElementNS: ( - document, + Types.document, ~namespace: string, ~qualifiedName: string, ~options: string=?, -) => element = "createElementNS" +) => Types.element = "createElementNS" /** Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName. @@ -210,18 +206,18 @@ When supplied, options's is can be used to create a customized built-in element. */ @send external createElementNS2: ( - document, + Types.document, ~namespace: string, ~qualifiedName: string, - ~options: elementCreationOptions=?, -) => element = "createElementNS" + ~options: Types.elementCreationOptions=?, +) => Types.element = "createElementNS" /** Creates a new document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createDocumentFragment) */ @send -external createDocumentFragment: document => documentFragment = "createDocumentFragment" +external createDocumentFragment: Types.document => Types.documentFragment = "createDocumentFragment" /** Creates a text string from the specified value. @@ -229,14 +225,14 @@ Creates a text string from the specified value. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createTextNode) */ @send -external createTextNode: (document, string) => text = "createTextNode" +external createTextNode: (Types.document, string) => Types.text = "createTextNode" /** Returns a CDATASection node whose data is data. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createCDATASection) */ @send -external createCDATASection: (document, string) => cdataSection = "createCDATASection" +external createCDATASection: (Types.document, string) => Types.cdataSection = "createCDATASection" /** Creates a comment object with the specified data. @@ -244,7 +240,7 @@ Creates a comment object with the specified data. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createComment) */ @send -external createComment: (document, string) => comment = "createComment" +external createComment: (Types.document, string) => Types.comment = "createComment" /** Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown. @@ -252,10 +248,10 @@ Returns a ProcessingInstruction node whose target is target and data is data. If */ @send external createProcessingInstruction: ( - document, + Types.document, ~target: string, ~data: string, -) => processingInstruction = "createProcessingInstruction" +) => Types.processingInstruction = "createProcessingInstruction" /** Returns a copy of node. If deep is true, the copy also includes the node's descendants. @@ -264,7 +260,7 @@ If node is a document or a shadow root, throws a "NotSupportedError" DOMExceptio [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/importNode) */ @send -external importNode: (document, 't, ~deep: bool=?) => 't = "importNode" +external importNode: (Types.document, 't, ~deep: bool=?) => 't = "importNode" /** Moves node from another document and returns it. @@ -273,7 +269,7 @@ If node is a document, throws a "NotSupportedError" DOMException or, if node is [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/adoptNode) */ @send -external adoptNode: (document, 't) => 't = "adoptNode" +external adoptNode: (Types.document, 't) => 't = "adoptNode" /** Creates an attribute object with a specified name. @@ -281,27 +277,27 @@ Creates an attribute object with a specified name. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createAttribute) */ @send -external createAttribute: (document, string) => attr = "createAttribute" +external createAttribute: (Types.document, string) => Types.attr = "createAttribute" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createAttributeNS) */ @send -external createAttributeNS: (document, ~namespace: string, ~qualifiedName: string) => attr = +external createAttributeNS: (Types.document, ~namespace: string, ~qualifiedName: string) => Types.attr = "createAttributeNS" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createEvent) */ @send -external createEvent: (document, string) => event = "createEvent" +external createEvent: (Types.document, string) => Event.Types.event = "createEvent" /** Returns an empty range object that has both of its boundary points positioned at the beginning of the document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createRange) */ @send -external createRange: document => range = "createRange" +external createRange: Types.document => Types.range = "createRange" /** Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. @@ -312,11 +308,11 @@ Creates a NodeIterator object that you can use to traverse filtered lists of nod */ @send external createNodeIterator: ( - document, - ~root: node, + Types.document, + ~root: Types.node, ~whatToShow: int=?, - ~filter: nodeFilter=?, -) => nodeIterator = "createNodeIterator" + ~filter: Types.nodeFilter=?, +) => Types.nodeIterator = "createNodeIterator" /** Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. @@ -327,44 +323,44 @@ Creates a TreeWalker object that you can use to traverse filtered lists of nodes */ @send external createTreeWalker: ( - document, - ~root: node, + Types.document, + ~root: Types.node, ~whatToShow: int=?, - ~filter: nodeFilter=?, -) => treeWalker = "createTreeWalker" + ~filter: Types.nodeFilter=?, +) => Types.treeWalker = "createTreeWalker" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/startViewTransition) */ @send external startViewTransition: ( - document, - ~callbackOptions: viewTransitionUpdateCallback=?, -) => viewTransition = "startViewTransition" + Types.document, + ~callbackOptions: ViewTransitions.Types.viewTransitionUpdateCallback=?, +) => ViewTransitions.Types.viewTransition = "startViewTransition" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/caretPositionFromPoint) */ @send external caretPositionFromPoint: ( - document, + Types.document, ~x: float, ~y: float, - ~options: caretPositionFromPointOptions=?, -) => caretPosition = "caretPositionFromPoint" + ~options: Types.caretPositionFromPointOptions=?, +) => Types.caretPosition = "caretPositionFromPoint" /** Stops document's fullscreen element from being displayed fullscreen and resolves promise when done. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/exitFullscreen) */ @send -external exitFullscreen: document => promise = "exitFullscreen" +external exitFullscreen: Types.document => promise = "exitFullscreen" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/parseHTMLUnsafe_static) */ @scope("Document") -external parseHTMLUnsafe: string => document = "parseHTMLUnsafe" +external parseHTMLUnsafe: string => Types.document = "parseHTMLUnsafe" /** Gets a collection of objects based on the value of the NAME or ID attribute. @@ -372,7 +368,7 @@ Gets a collection of objects based on the value of the NAME or ID attribute. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementsByName) */ @send -external getElementsByName: (document, string) => nodeList = "getElementsByName" +external getElementsByName: (Types.document, string) => Types.nodeList = "getElementsByName" /** Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. @@ -383,7 +379,7 @@ Opens a new window and loads a document specified by a given URL. Also, opens a [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/open) */ @send -external open_: (document, ~unused1: string=?, ~unused2: string=?) => document = "open" +external open_: (Types.document, ~unused1: string=?, ~unused2: string=?) => Types.document = "open" /** Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. @@ -394,14 +390,14 @@ Opens a new window and loads a document specified by a given URL. Also, opens a [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/open) */ @send -external open2: (document, ~url: string, ~name: string, ~features: string) => window = "open" +external open2: (Types.document, ~url: string, ~name: string, ~features: string) => Types.window = "open" /** Closes an output stream and forces the sent data to display. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/close) */ @send -external close: document => unit = "close" +external close: Types.document => unit = "close" /** Writes one or more HTML expressions to a document in the specified window. @@ -409,7 +405,7 @@ Writes one or more HTML expressions to a document in the specified window. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/write) */ @send -external write: (document, string) => unit = "write" +external write: (Types.document, string) => unit = "write" /** Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. @@ -417,44 +413,44 @@ Writes one or more HTML expressions, followed by a carriage return, to a documen [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/writeln) */ @send -external writeln: (document, string) => unit = "writeln" +external writeln: (Types.document, string) => unit = "writeln" /** Gets a value indicating whether the object currently has focus. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/hasFocus) */ @send -external hasFocus: document => bool = "hasFocus" +external hasFocus: Types.document => bool = "hasFocus" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/exitPictureInPicture) */ @send -external exitPictureInPicture: document => promise = "exitPictureInPicture" +external exitPictureInPicture: Types.document => promise = "exitPictureInPicture" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/exitPointerLock) */ @send -external exitPointerLock: document => unit = "exitPointerLock" +external exitPointerLock: Types.document => unit = "exitPointerLock" /** Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getSelection) */ @send -external getSelection: document => null = "getSelection" +external getSelection: Types.document => null = "getSelection" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/hasStorageAccess) */ @send -external hasStorageAccess: document => promise = "hasStorageAccess" +external hasStorageAccess: Types.document => promise = "hasStorageAccess" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/requestStorageAccess) */ @send -external requestStorageAccess: document => promise = "requestStorageAccess" +external requestStorageAccess: Types.document => promise = "requestStorageAccess" let isInstanceOf = (_: 't): bool => %raw(`param instanceof Document`) diff --git a/src/DOMAPI/DocumentFragment.js b/packages/DOM/src/DocumentFragment.js similarity index 59% rename from src/DOMAPI/DocumentFragment.js rename to packages/DOM/src/DocumentFragment.js index d7d93d7c..a46ff94e 100644 --- a/src/DOMAPI/DocumentFragment.js +++ b/packages/DOM/src/DocumentFragment.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$DOM from "./Node.js"; function Impl(T) { - Node$WebAPI.Impl({}); + Node$DOM.Impl({}); return {}; } -Node$WebAPI.Impl({}); +Node$DOM.Impl({}); export { Impl, diff --git a/src/DOMAPI/DocumentFragment.res b/packages/DOM/src/DocumentFragment.res similarity index 81% rename from src/DOMAPI/DocumentFragment.res rename to packages/DOM/src/DocumentFragment.res index 297fc6fd..c210a4a4 100644 --- a/src/DOMAPI/DocumentFragment.res +++ b/packages/DOM/src/DocumentFragment.res @@ -1,10 +1,8 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragmentFragment) */ @new -external make: unit => documentFragment = "DocumentFragment" +external make: unit => Types.documentFragment = "DocumentFragment" module Impl = ( T: { @@ -13,7 +11,7 @@ module Impl = ( ) => { include Node.Impl({type t = T.t}) - external asDocumentFragment: T.t => documentFragment = "%identity" + external asDocumentFragment: T.t => Types.documentFragment = "%identity" /** Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. @@ -22,7 +20,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append) */ @send - external append: (T.t, node) => unit = "append" + external append: (T.t, Types.node) => unit = "append" /** Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. @@ -38,7 +36,7 @@ Returns the first element within node's descendants whose ID is elementId. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/getElementById) */ @send - external getElementById: (T.t, string) => null = "getElementById" + external getElementById: (T.t, string) => null = "getElementById" /** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. @@ -47,7 +45,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend) */ @send - external prepend: (T.t, node) => unit = "prepend" + external prepend: (T.t, Types.node) => unit = "prepend" /** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. @@ -63,14 +61,14 @@ Returns the first element that is a descendant of node that matches selectors. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelector) */ @send - external querySelector: (T.t, string) => Null.t = "querySelector" + external querySelector: (T.t, string) => Null.t = "querySelector" /** Returns all element descendants of node that match selectors. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelectorAll) */ @send - external querySelectorAll: (T.t, string) => nodeList = "querySelectorAll" + external querySelectorAll: (T.t, string) => Types.nodeList = "querySelectorAll" /** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -79,7 +77,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/replaceChildren) */ @send - external replaceChildren: (T.t, node) => unit = "replaceChildren" + external replaceChildren: (T.t, Types.node) => unit = "replaceChildren" /** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -91,4 +89,4 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre external replaceChildren2: (T.t, string) => unit = "replaceChildren" } -include Impl({type t = documentFragment}) +include Impl({type t = Types.documentFragment}) diff --git a/src/DOMAPI/DocumentTimeline.js b/packages/DOM/src/DocumentTimeline.js similarity index 100% rename from src/DOMAPI/DocumentTimeline.js rename to packages/DOM/src/DocumentTimeline.js diff --git a/packages/DOM/src/DocumentTimeline.res b/packages/DOM/src/DocumentTimeline.res new file mode 100644 index 00000000..c4ace5d3 --- /dev/null +++ b/packages/DOM/src/DocumentTimeline.res @@ -0,0 +1,7 @@ +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentTimeline) +*/ +@new +external make: (~options: Types.documentTimelineOptions=?) => Types.documentTimeline = "DocumentTimeline" + +external asAnimationTimeline: Types.documentTimeline => Types.animationTimeline = "%identity" diff --git a/src/DOMAPI/Element.js b/packages/DOM/src/Element.js similarity index 71% rename from src/DOMAPI/Element.js rename to packages/DOM/src/Element.js index 78c69782..8ec4d42c 100644 --- a/src/DOMAPI/Element.js +++ b/packages/DOM/src/Element.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Node$WebAPI from "./Node.js"; +import * as Node$DOM from "./Node.js"; function Impl(T) { - Node$WebAPI.Impl({}); + Node$DOM.Impl({}); return {}; } -Node$WebAPI.Impl({}); +Node$DOM.Impl({}); function isInstanceOf(param) { return (param instanceof Element); diff --git a/src/DOMAPI/Element.res b/packages/DOM/src/Element.res similarity index 83% rename from src/DOMAPI/Element.res rename to packages/DOM/src/Element.res index e9092d77..5838de32 100644 --- a/src/DOMAPI/Element.res +++ b/packages/DOM/src/Element.res @@ -1,5 +1,3 @@ -open DOMAPI - module Impl = ( T: { type t @@ -7,7 +5,7 @@ module Impl = ( ) => { include Node.Impl({type t = T.t}) - external asElement: T.t => element = "%identity" + external asElement: T.t => Types.element = "%identity" /** Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. @@ -16,7 +14,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/after) */ @send - external after: (T.t, node) => unit = "after" + external after: (T.t, Types.node) => unit = "after" /** Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. @@ -31,13 +29,13 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) */ @send - external animate: (T.t, ~keyframes: unknown, ~options: float=?) => animation = "animate" + external animate: (T.t, ~keyframes: unknown, ~options: float=?) => Types.animation = "animate" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/animate) */ @send - external animate2: (T.t, ~keyframes: unknown, ~options: keyframeAnimationOptions=?) => animation = + external animate2: (T.t, ~keyframes: unknown, ~options: Types.keyframeAnimationOptions=?) => Types.animation = "animate" /** @@ -47,7 +45,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/append) */ @send - external append: (T.t, node) => unit = "append" + external append: (T.t, Types.node) => unit = "append" /** Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes. @@ -63,7 +61,7 @@ Creates a shadow root for element and returns it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/attachShadow) */ @send - external attachShadow: (T.t, shadowRootInit) => shadowRoot = "attachShadow" + external attachShadow: (T.t, Types.shadowRootInit) => Types.shadowRoot = "attachShadow" /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. @@ -72,7 +70,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/before) */ @send - external before: (T.t, node) => unit = "before" + external before: (T.t, Types.node) => unit = "before" /** Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. @@ -87,7 +85,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/checkVisibility) */ @send - external checkVisibility: (T.t, ~options: checkVisibilityOptions=?) => bool = "checkVisibility" + external checkVisibility: (T.t, ~options: Types.checkVisibilityOptions=?) => bool = "checkVisibility" /** Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. @@ -100,13 +98,13 @@ Returns the first (starting at element) inclusive ancestor that matches selector [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/computedStyleMap) */ @send - external computedStyleMap: T.t => stylePropertyMapReadOnly = "computedStyleMap" + external computedStyleMap: T.t => Types.stylePropertyMapReadOnly = "computedStyleMap" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAnimations) */ @send - external getAnimations: (T.t, ~options: getAnimationsOptions=?) => array = + external getAnimations: (T.t, ~options: Types.getAnimationsOptions=?) => array = "getAnimations" /** @@ -127,13 +125,13 @@ Returns the qualified names of all element's attributes. Can contain duplicates. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNode) */ @send - external getAttributeNode: (T.t, string) => attr = "getAttributeNode" + external getAttributeNode: (T.t, string) => Types.attr = "getAttributeNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getAttributeNodeNS) */ @send - external getAttributeNodeNS: (T.t, ~namespace: string, ~localName: string) => attr = + external getAttributeNodeNS: (T.t, ~namespace: string, ~localName: string) => Types.attr = "getAttributeNodeNS" /** @@ -148,43 +146,43 @@ Returns element's attribute whose namespace is namespace and local name is local [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect) */ @send - external getBoundingClientRect: T.t => domRect = "getBoundingClientRect" + external getBoundingClientRect: T.t => Types.domRect = "getBoundingClientRect" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getClientRects) */ @send - external getClientRects: T.t => domRectList = "getClientRects" + external getClientRects: T.t => Types.domRectList = "getClientRects" /** Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName) */ @send - external getElementsByClassName: (T.t, string) => htmlCollection = + external getElementsByClassName: (T.t, string) => Types.htmlCollection = "getElementsByClassName" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName) */ @send - external getElementsByTagName: (T.t, string) => htmlCollection = "getElementsByTagName" + external getElementsByTagName: (T.t, string) => Types.htmlCollection = "getElementsByTagName" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS) */ @send external getElementsByTagNameNS: ( - element, + Types.element, ~namespace: string, ~localName: string, - ) => htmlCollection = "getElementsByTagNameNS" + ) => Types.htmlCollection = "getElementsByTagNameNS" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML) */ @send - external getHTML: (T.t, ~options: getHTMLOptions=?) => string = "getHTML" + external getHTML: (T.t, ~options: Types.getHTMLOptions=?) => string = "getHTML" /** Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. @@ -217,21 +215,21 @@ Returns true if element has attributes, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentElement) */ @send - external insertAdjacentElement: (T.t, ~where: insertPosition, ~element: element) => element = + external insertAdjacentElement: (T.t, ~where: Types.insertPosition, ~element: Types.element) => Types.element = "insertAdjacentElement" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentHTML) */ @send - external insertAdjacentHTML: (T.t, ~position: insertPosition, ~string: string) => unit = + external insertAdjacentHTML: (T.t, ~position: Types.insertPosition, ~string: string) => unit = "insertAdjacentHTML" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/insertAdjacentText) */ @send - external insertAdjacentText: (T.t, ~where: insertPosition, ~data: string) => unit = + external insertAdjacentText: (T.t, ~where: Types.insertPosition, ~data: string) => unit = "insertAdjacentText" /** @@ -248,7 +246,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend) */ @send - external prepend: (T.t, node) => unit = "prepend" + external prepend: (T.t, Types.node) => unit = "prepend" /** Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes. @@ -264,14 +262,14 @@ Returns the first element that is a descendant of node that matches selectors. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector) */ @send - external querySelector: (T.t, string) => Null.t = "querySelector" + external querySelector: (T.t, string) => Null.t = "querySelector" /** Returns all element descendants of node that match selectors. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll) */ @send - external querySelectorAll: (T.t, string) => nodeList = "querySelectorAll" + external querySelectorAll: (T.t, string) => Types.nodeList = "querySelectorAll" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture) @@ -297,7 +295,7 @@ Removes element's first attribute whose qualified name is qualifiedName. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/removeAttributeNode) */ @send - external removeAttributeNode: (T.t, attr) => attr = "removeAttributeNode" + external removeAttributeNode: (T.t, Types.attr) => Types.attr = "removeAttributeNode" /** Removes element's attribute whose namespace is namespace and local name is localName. @@ -314,7 +312,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/replaceChildren) */ @send - external replaceChildren: (T.t, node) => unit = "replaceChildren" + external replaceChildren: (T.t, Types.node) => unit = "replaceChildren" /** Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -332,7 +330,7 @@ Throws a "HierarchyRequestError" DOMException if the constraints of the node tre [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) */ @send - external replaceWith: (T.t, node) => unit = "replaceWith" + external replaceWith: (T.t, Types.node) => unit = "replaceWith" /** Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. @@ -350,21 +348,21 @@ When supplied, options's navigationUI member indicates whether showing navigatio [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestFullscreen) */ @send - external requestFullscreen: (T.t, ~options: fullscreenOptions=?) => promise = + external requestFullscreen: (T.t, ~options: Types.fullscreenOptions=?) => promise = "requestFullscreen" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/requestPointerLock) */ @send - external requestPointerLock: (T.t, ~options: pointerLockOptions=?) => promise = + external requestPointerLock: (T.t, ~options: Types.pointerLockOptions=?) => promise = "requestPointerLock" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) */ @send - external scroll: (T.t, ~options: scrollToOptions=?) => unit = "scroll" + external scroll: (T.t, ~options: Types.scrollToOptions=?) => unit = "scroll" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scroll) @@ -376,7 +374,7 @@ When supplied, options's navigationUI member indicates whether showing navigatio [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) */ @send - external scrollBy: (T.t, ~options: scrollToOptions=?) => unit = "scrollBy" + external scrollBy: (T.t, ~options: Types.scrollToOptions=?) => unit = "scrollBy" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollBy) @@ -424,13 +422,13 @@ element->Element.scrollIntoViewWithOptions({ behavior: DOMAPI.Smooth }) [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView) */ @send - external scrollIntoViewWithOptions: (T.t, scrollIntoViewOptions) => unit = "scrollIntoView" + external scrollIntoViewWithOptions: (T.t, Types.scrollIntoViewOptions) => unit = "scrollIntoView" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) */ @send - external scrollTo: (T.t, ~options: scrollToOptions=?) => unit = "scrollTo" + external scrollTo: (T.t, ~options: Types.scrollToOptions=?) => unit = "scrollTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo) @@ -449,13 +447,13 @@ Sets the value of element's first attribute whose qualified name is qualifiedNam [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNode) */ @send - external setAttributeNode: (T.t, attr) => attr = "setAttributeNode" + external setAttributeNode: (T.t, Types.attr) => Types.attr = "setAttributeNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/setAttributeNodeNS) */ @send - external setAttributeNodeNS: (T.t, attr) => attr = "setAttributeNodeNS" + external setAttributeNodeNS: (T.t, Types.attr) => Types.attr = "setAttributeNodeNS" /** Sets the value of element's attribute whose namespace is namespace and local name is localName to value. @@ -463,7 +461,7 @@ Sets the value of element's attribute whose namespace is namespace and local nam */ @send external setAttributeNS: ( - element, + Types.element, ~namespace: string, ~qualifiedName: string, ~value: string, @@ -492,6 +490,6 @@ Returns true if qualifiedName is now present, and false otherwise. "toggleAttribute" } -include Impl({type t = element}) +include Impl({type t = Types.element}) let isInstanceOf = (_: 't): bool => %raw(`param instanceof Element`) diff --git a/src/DOMAPI/ElementInternals.js b/packages/DOM/src/ElementInternals.js similarity index 100% rename from src/DOMAPI/ElementInternals.js rename to packages/DOM/src/ElementInternals.js diff --git a/src/DOMAPI/ElementInternals.res b/packages/DOM/src/ElementInternals.res similarity index 80% rename from src/DOMAPI/ElementInternals.res rename to packages/DOM/src/ElementInternals.res index f873a2e7..d5dfbcd7 100644 --- a/src/DOMAPI/ElementInternals.res +++ b/packages/DOM/src/ElementInternals.res @@ -1,5 +1,3 @@ -open DOMAPI - /** Sets both the state and submission value of internals's target element to value. @@ -7,7 +5,7 @@ If value is null, the element won't participate in form submission. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue) */ @send -external setFormValue: (elementInternals, ~value: unknown, ~state: unknown=?) => unit = +external setFormValue: (Types.elementInternals, ~value: unknown, ~state: unknown=?) => unit = "setFormValue" /** @@ -16,10 +14,10 @@ Marks internals's target element as suffering from the constraints indicated by */ @send external setValidity: ( - elementInternals, - ~flags: validityStateFlags=?, + Types.elementInternals, + ~flags: Types.validityStateFlags=?, ~message: string=?, - ~anchor: htmlElement=?, + ~anchor: Types.htmlElement=?, ) => unit = "setValidity" /** @@ -27,11 +25,11 @@ Returns true if internals's target element has no validity problems; false other [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity) */ @send -external checkValidity: elementInternals => bool = "checkValidity" +external checkValidity: Types.elementInternals => bool = "checkValidity" /** Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity) */ @send -external reportValidity: elementInternals => bool = "reportValidity" +external reportValidity: Types.elementInternals => bool = "reportValidity" diff --git a/src/DOMAPI/FileList.js b/packages/DOM/src/FileList.js similarity index 100% rename from src/DOMAPI/FileList.js rename to packages/DOM/src/FileList.js diff --git a/src/DOMAPI/FileList.res b/packages/DOM/src/FileList.res similarity index 82% rename from src/DOMAPI/FileList.res rename to packages/DOM/src/FileList.res index 07cb6960..28237961 100644 --- a/src/DOMAPI/FileList.res +++ b/packages/DOM/src/FileList.res @@ -1,6 +1,3 @@ -open FileAPI -open DOMAPI - /** Returns the `File` at the specified index. @@ -16,4 +13,4 @@ for i in 0 to fileList.length - 1 { [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileList/item) */ @send -external item: (fileList, int) => file = "item" +external item: (Types.fileList, int) => File.Types.file = "item" diff --git a/src/DOMAPI.js b/packages/DOM/src/Global.js similarity index 100% rename from src/DOMAPI.js rename to packages/DOM/src/Global.js diff --git a/src/Global.res b/packages/DOM/src/Global.res similarity index 66% rename from src/Global.res rename to packages/DOM/src/Global.res index 9ce95455..a9a22c62 100644 --- a/src/Global.res +++ b/packages/DOM/src/Global.res @@ -1,32 +1,17 @@ -open DOMAPI -open HistoryAPI -open VisualViewportAPI -open WebSpeechAPI -open IndexedDBAPI -open WebCryptoAPI -open PerformanceAPI -open WebWorkersAPI -open WebStorageAPI -open CanvasAPI -open FileAPI -open ChannelMessagingAPI -open FetchAPI -open EventAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/window) */ -external window: window = "window" +external window: Types.window = "window" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/self) */ -external self: window = "self" +external self: Types.window = "self" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/document) */ -external document: document = "document" +external document: Types.document = "document" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/name) @@ -36,54 +21,54 @@ external name: string = "name" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/location) */ -external location: location = "location" +external location: Types.location = "location" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/history) */ -external history: history = "history" +external history: History.Types.history = "history" /** Defines a new custom element, mapping the given name to the given constructor as an autonomous custom element. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/customElements) */ -external customElements: customElementRegistry = "customElements" +external customElements: Types.customElementRegistry = "customElements" /** Returns true if the location bar is visible; otherwise, returns false. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/locationbar) */ -external locationbar: barProp = "locationbar" +external locationbar: Types.barProp = "locationbar" /** Returns true if the menu bar is visible; otherwise, returns false. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/menubar) */ -external menubar: barProp = "menubar" +external menubar: Types.barProp = "menubar" /** Returns true if the personal bar is visible; otherwise, returns false. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/personalbar) */ -external personalbar: barProp = "personalbar" +external personalbar: Types.barProp = "personalbar" /** Returns true if the scrollbars are visible; otherwise, returns false. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollbars) */ -external scrollbars: barProp = "scrollbars" +external scrollbars: Types.barProp = "scrollbars" /** Returns true if the status bar is visible; otherwise, returns false. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/statusbar) */ -external statusbar: barProp = "statusbar" +external statusbar: Types.barProp = "statusbar" /** Returns true if the toolbar is visible; otherwise, returns false. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/toolbar) */ -external toolbar: barProp = "toolbar" +external toolbar: Types.barProp = "toolbar" /** Returns true if the window has been closed, false otherwise. @@ -94,7 +79,7 @@ external closed: bool = "closed" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/frames) */ -external frames: window = "frames" +external frames: Types.window = "frames" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/length) @@ -104,7 +89,7 @@ external length: int = "length" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/top) */ -external top: window = "top" +external top: Types.window = "top" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/opener) @@ -117,27 +102,27 @@ Refers to either the parent WindowProxy, or itself. It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/parent) */ -external parent: window = "parent" +external parent: Types.window = "parent" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/frameElement) */ -external frameElement: element = "frameElement" +external frameElement: Types.element = "frameElement" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/navigator) */ -external navigator: navigator = "navigator" +external navigator: Types.navigator = "navigator" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/screen) */ -external screen: screen = "screen" +external screen: Types.screen = "screen" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/visualViewport) */ -external visualViewport: visualViewport = "visualViewport" +external visualViewport: VisualViewport.Types.visualViewport = "visualViewport" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/innerWidth) @@ -197,7 +182,7 @@ external devicePixelRatio: float = "devicePixelRatio" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/speechSynthesis) */ -external speechSynthesis: speechSynthesis = "speechSynthesis" +external speechSynthesis: WebSpeech.Types.speechSynthesis = "speechSynthesis" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/origin) @@ -217,32 +202,32 @@ external crossOriginIsolated: bool = "crossOriginIsolated" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/indexedDB) */ -external indexedDB: idbFactory = "indexedDB" +external indexedDB: IndexedDB.Types.idbFactory = "indexedDB" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/crypto) */ -external crypto: crypto = "crypto" +external crypto: WebCrypto.Types.crypto = "crypto" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/performance) */ -external performance: performance = "performance" +external performance: Performance.Types.performance = "performance" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/caches) */ -external caches: cacheStorage = "caches" +external caches: WebWorkers.Types.cacheStorage = "caches" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/sessionStorage) */ -external sessionStorage: storage = "sessionStorage" +external sessionStorage: WebStorage.Types.storage = "sessionStorage" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/localStorage) */ -external localStorage: storage = "localStorage" +external localStorage: WebStorage.Types.storage = "localStorage" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/reportError) @@ -264,14 +249,14 @@ Executes a function after a delay given in milliseconds expires. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */ -external setTimeout: (~handler: unit => unit, ~timeout: int=?) => timeoutId = "setTimeout" +external setTimeout: (~handler: unit => unit, ~timeout: int=?) => Types.timeoutId = "setTimeout" /** Cancels the execution of a timeout created with setTimeout. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */ -external clearTimeout: timeoutId => unit = "clearTimeout" +external clearTimeout: Types.timeoutId => unit = "clearTimeout" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setInterval) @@ -291,225 +276,20 @@ external clearInterval: int => unit = "clearInterval" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */ -external queueMicrotask: voidFunction => unit = "queueMicrotask" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap: ( - ~image: htmlImageElement, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap2: ( - ~image: svgImageElement, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap3: ( - ~image: htmlVideoElement, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap4: ( - ~image: htmlCanvasElement, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap5: ( - ~image: imageBitmap, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap6: ( - ~image: offscreenCanvas, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap7: ( - ~image: videoFrame, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap8: ( - ~image: blob, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap9: ( - ~image: imageData, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap10: ( - ~image: htmlImageElement, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap11: ( - ~image: svgImageElement, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap12: ( - ~image: htmlVideoElement, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap13: ( - ~image: htmlCanvasElement, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap14: ( - ~image: imageBitmap, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap15: ( - ~image: offscreenCanvas, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap16: ( - ~image: videoFrame, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap17: ( - ~image: blob, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" - -/** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/createImageBitmap) -*/ -external createImageBitmap18: ( - ~image: imageData, - ~sx: int, - ~sy: int, - ~sw: int, - ~sh: int, - ~options: imageBitmapOptions=?, -) => promise = "createImageBitmap" +external queueMicrotask: unit => unit => unit = "queueMicrotask" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */ -external structuredClone: ('t, ~options: structuredSerializeOptions=?) => 't = "structuredClone" - -/** -`fetch(string, init)` - -Starts the process of fetching a resource from the network, -returning a promise that is fulfilled once the response is available. - -```res -let response = await fetch("https://rescript-lang.org") -``` - -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch) -*/ -external fetch: (string, ~init: requestInit=?) => promise = "fetch" - -/** -`fetchWithRequest(request, init)` - -Starts the process of fetching a resource from the network, -returning a promise that is fulfilled once the response is available. - -```res -let response = await fetch(myRequest) -``` - -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/fetch) -*/ -external fetchWithRequest: (request, ~init: requestInit=?) => promise = "fetch" +external structuredClone: ( + 't, + ~options: ChannelMessaging.Types.structuredSerializeOptions=?, +) => 't = "structuredClone" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) */ -external requestAnimationFrame: frameRequestCallback => int = "requestAnimationFrame" +external requestAnimationFrame: (float => unit) => int = "requestAnimationFrame" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/cancelAnimationFrame) @@ -533,9 +313,9 @@ The event listener is appended to target's event listener list and is not append [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) */ external addEventListener: ( - eventType, - eventListener<'event>, - ~options: addEventListenerOptions=?, + Event.Types.eventType, + Event.Types.eventListener<'event>, + ~options: Event.Types.addEventListenerOptions=?, ) => unit = "addEventListener" /** @@ -555,8 +335,8 @@ The event listener is appended to target's event listener list and is not append [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) */ external addEventListenerWithCapture: ( - eventType, - eventListener<'event>, + Event.Types.eventType, + Event.Types.eventListener<'event>, @as(json`true`) _, ) => unit = "addEventListener" @@ -565,9 +345,9 @@ Removes the event listener in target's event listener list with the same type, c [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) */ external removeEventListener: ( - eventType, - eventListener<'event>, - ~options: eventListenerOptions=?, + Event.Types.eventType, + Event.Types.eventListener<'event>, + ~options: Event.Types.eventListenerOptions=?, ) => unit = "removeEventListener" /** @@ -575,8 +355,8 @@ Removes the event listener in target's event listener list with the same type, c [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener) */ external removeEventListenerUseCapture: ( - eventType, - eventListener<'event>, + Event.Types.eventType, + Event.Types.eventListener<'event>, @as(json`true`) _, ) => unit = "removeEventListener" @@ -584,7 +364,7 @@ external removeEventListenerUseCapture: ( Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent) */ -external dispatchEvent: event => bool = "dispatchEvent" +external dispatchEvent: Event.Types.event => bool = "dispatchEvent" /** Closes the window. @@ -607,7 +387,7 @@ external focus: unit => unit = "focus" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/open) */ -external open_: (~url: string=?, ~target: string=?, ~features: string=?) => window = "open" +external open_: (~url: string=?, ~target: string=?, ~features: string=?) => Types.window = "open" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/alert) @@ -664,13 +444,13 @@ If the origin of the target window doesn't match the given target origin, the me Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/postMessage) */ -external postMessage2: (~message: JSON.t, ~options: windowPostMessageOptions=?) => unit = +external postMessage2: (~message: JSON.t, ~options: Types.windowPostMessageOptions=?) => unit = "postMessage" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/matchMedia) */ -external matchMedia: string => mediaQueryList = "matchMedia" +external matchMedia: string => Types.mediaQueryList = "matchMedia" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/moveTo) @@ -695,7 +475,7 @@ external resizeBy: (~x: int, ~y: int) => unit = "resizeBy" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scroll) */ -external scroll: (~options: scrollToOptions=?) => unit = "scroll" +external scroll: (~options: Types.scrollToOptions=?) => unit = "scroll" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scroll) @@ -705,7 +485,7 @@ external scroll2: (~x: float, ~y: float) => unit = "scroll" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollTo) */ -external scrollTo: (~options: scrollToOptions=?) => unit = "scrollTo" +external scrollTo: (~options: Types.scrollToOptions=?) => unit = "scrollTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollTo) @@ -715,7 +495,7 @@ external scrollTo2: (~x: float, ~y: float) => unit = "scrollTo" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollBy) */ -external scrollBy: (~options: scrollToOptions=?) => unit = "scrollBy" +external scrollBy: (~options: Types.scrollToOptions=?) => unit = "scrollBy" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/scrollBy) @@ -725,15 +505,17 @@ external scrollBy2: (~x: float, ~y: float) => unit = "scrollBy" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/getComputedStyle) */ -external getComputedStyle: (~elt: element, ~pseudoElt: string=?) => cssStyleDeclaration = - "getComputedStyle" +external getComputedStyle: ( + ~elt: Types.element, + ~pseudoElt: string=?, +) => Types.cssStyleDeclaration = "getComputedStyle" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/requestIdleCallback) */ external requestIdleCallback: ( - ~callback: idleRequestCallback, - ~options: idleRequestOptions=?, + ~callback: Types.idleDeadline => unit, + ~options: Types.idleRequestOptions=?, ) => int = "requestIdleCallback" /** @@ -744,4 +526,4 @@ external cancelIdleCallback: int => unit = "cancelIdleCallback" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/getSelection) */ -external getSelection: unit => null = "getSelection" +external getSelection: unit => null = "getSelection" diff --git a/packages/DOM/src/HTMLAnchorElement.js b/packages/DOM/src/HTMLAnchorElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLAnchorElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLAnchorElement.res b/packages/DOM/src/HTMLAnchorElement.res new file mode 100644 index 00000000..5894994d --- /dev/null +++ b/packages/DOM/src/HTMLAnchorElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlAnchorElement}) diff --git a/packages/DOM/src/HTMLAreaElement.js b/packages/DOM/src/HTMLAreaElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLAreaElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLAreaElement.res b/packages/DOM/src/HTMLAreaElement.res new file mode 100644 index 00000000..eefec7c9 --- /dev/null +++ b/packages/DOM/src/HTMLAreaElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlAreaElement}) diff --git a/packages/DOM/src/HTMLAudioElement.js b/packages/DOM/src/HTMLAudioElement.js new file mode 100644 index 00000000..b8a2d987 --- /dev/null +++ b/packages/DOM/src/HTMLAudioElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLMediaElement$DOM from "./HTMLMediaElement.js"; + +HTMLMediaElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLAudioElement.res b/packages/DOM/src/HTMLAudioElement.res new file mode 100644 index 00000000..e3774f94 --- /dev/null +++ b/packages/DOM/src/HTMLAudioElement.res @@ -0,0 +1 @@ +include HTMLMediaElement.Impl({type t = Types.htmlAudioElement}) diff --git a/packages/DOM/src/HTMLBRElement.js b/packages/DOM/src/HTMLBRElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLBRElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLBRElement.res b/packages/DOM/src/HTMLBRElement.res new file mode 100644 index 00000000..42c5d78a --- /dev/null +++ b/packages/DOM/src/HTMLBRElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlbrElement}) diff --git a/packages/DOM/src/HTMLBaseElement.js b/packages/DOM/src/HTMLBaseElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLBaseElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLBaseElement.res b/packages/DOM/src/HTMLBaseElement.res new file mode 100644 index 00000000..5d7a9f07 --- /dev/null +++ b/packages/DOM/src/HTMLBaseElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlBaseElement}) diff --git a/packages/DOM/src/HTMLBodyElement.js b/packages/DOM/src/HTMLBodyElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLBodyElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLBodyElement.res b/packages/DOM/src/HTMLBodyElement.res new file mode 100644 index 00000000..953df584 --- /dev/null +++ b/packages/DOM/src/HTMLBodyElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlBodyElement}) diff --git a/packages/DOM/src/HTMLButtonElement.js b/packages/DOM/src/HTMLButtonElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLButtonElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLButtonElement.res b/packages/DOM/src/HTMLButtonElement.res similarity index 65% rename from src/DOMAPI/HTMLButtonElement.res rename to packages/DOM/src/HTMLButtonElement.res index d98b3db4..c7f23ce1 100644 --- a/src/DOMAPI/HTMLButtonElement.res +++ b/packages/DOM/src/HTMLButtonElement.res @@ -1,19 +1,17 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlButtonElement}) +include HTMLElement.Impl({type t = Types.htmlButtonElement}) /** Returns whether a form will validate when it is submitted, without having to submit it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/checkValidity) */ @send -external checkValidity: htmlButtonElement => bool = "checkValidity" +external checkValidity: Types.htmlButtonElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/reportValidity) */ @send -external reportValidity: htmlButtonElement => bool = "reportValidity" +external reportValidity: Types.htmlButtonElement => bool = "reportValidity" /** Sets a custom error message that is displayed when a form is submitted. @@ -21,4 +19,4 @@ Sets a custom error message that is displayed when a form is submitted. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/setCustomValidity) */ @send -external setCustomValidity: (htmlButtonElement, string) => unit = "setCustomValidity" +external setCustomValidity: (Types.htmlButtonElement, string) => unit = "setCustomValidity" diff --git a/src/DOMAPI/HTMLCollection.js b/packages/DOM/src/HTMLCollection.js similarity index 100% rename from src/DOMAPI/HTMLCollection.js rename to packages/DOM/src/HTMLCollection.js diff --git a/src/DOMAPI/HTMLCollection.res b/packages/DOM/src/HTMLCollection.res similarity index 69% rename from src/DOMAPI/HTMLCollection.res rename to packages/DOM/src/HTMLCollection.res index 02d07cfd..e85dba03 100644 --- a/src/DOMAPI/HTMLCollection.res +++ b/packages/DOM/src/HTMLCollection.res @@ -1,15 +1,13 @@ -open DOMAPI - /** Retrieves an object from various collections. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item) */ @send -external item: (htmlCollection<'t>, int) => 't = "item" +external item: (Types.htmlCollection<'t>, int) => 't = "item" /** Retrieves a select object or an object from an options collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/namedItem) */ @send -external namedItem: (htmlCollection<'t>, string) => 't = "namedItem" +external namedItem: (Types.htmlCollection<'t>, string) => 't = "namedItem" diff --git a/packages/DOM/src/HTMLDListElement.js b/packages/DOM/src/HTMLDListElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLDListElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLDListElement.res b/packages/DOM/src/HTMLDListElement.res new file mode 100644 index 00000000..d3fb938e --- /dev/null +++ b/packages/DOM/src/HTMLDListElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmldListElement}) diff --git a/packages/DOM/src/HTMLDataElement.js b/packages/DOM/src/HTMLDataElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLDataElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLDataElement.res b/packages/DOM/src/HTMLDataElement.res new file mode 100644 index 00000000..21689c4a --- /dev/null +++ b/packages/DOM/src/HTMLDataElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlDataElement}) diff --git a/packages/DOM/src/HTMLDataListElement.js b/packages/DOM/src/HTMLDataListElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLDataListElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLDataListElement.res b/packages/DOM/src/HTMLDataListElement.res new file mode 100644 index 00000000..eab8f211 --- /dev/null +++ b/packages/DOM/src/HTMLDataListElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlDataListElement}) diff --git a/packages/DOM/src/HTMLDialogElement.js b/packages/DOM/src/HTMLDialogElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLDialogElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLDialogElement.res b/packages/DOM/src/HTMLDialogElement.res similarity index 60% rename from src/DOMAPI/HTMLDialogElement.res rename to packages/DOM/src/HTMLDialogElement.res index e759b578..53238793 100644 --- a/src/DOMAPI/HTMLDialogElement.res +++ b/packages/DOM/src/HTMLDialogElement.res @@ -1,19 +1,17 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlDialogElement}) +include HTMLElement.Impl({type t = Types.htmlDialogElement}) /** Displays the dialog element. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/show) */ @send -external show: htmlDialogElement => unit = "show" +external show: Types.htmlDialogElement => unit = "show" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/showModal) */ @send -external showModal: htmlDialogElement => unit = "showModal" +external showModal: Types.htmlDialogElement => unit = "showModal" /** Closes the dialog element. @@ -22,4 +20,4 @@ The argument, if provided, provides a return value. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLDialogElement/close) */ @send -external close: (htmlDialogElement, ~returnValue: string=?) => unit = "close" +external close: (Types.htmlDialogElement, ~returnValue: string=?) => unit = "close" diff --git a/packages/DOM/src/HTMLDivElement.js b/packages/DOM/src/HTMLDivElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLDivElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLDivElement.res b/packages/DOM/src/HTMLDivElement.res new file mode 100644 index 00000000..77f61667 --- /dev/null +++ b/packages/DOM/src/HTMLDivElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlDivElement}) diff --git a/src/DOMAPI/HTMLElement.js b/packages/DOM/src/HTMLElement.js similarity index 56% rename from src/DOMAPI/HTMLElement.js rename to packages/DOM/src/HTMLElement.js index 12e03b30..d451e9a6 100644 --- a/src/DOMAPI/HTMLElement.js +++ b/packages/DOM/src/HTMLElement.js @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Element$WebAPI from "./Element.js"; +import * as Element$DOM from "./Element.js"; function Impl(T) { - Element$WebAPI.Impl({}); + Element$DOM.Impl({}); return {}; } -Element$WebAPI.Impl({}); +Element$DOM.Impl({}); export { Impl, diff --git a/src/DOMAPI/HTMLElement.res b/packages/DOM/src/HTMLElement.res similarity index 80% rename from src/DOMAPI/HTMLElement.res rename to packages/DOM/src/HTMLElement.res index 08c18904..1e5e13e1 100644 --- a/src/DOMAPI/HTMLElement.res +++ b/packages/DOM/src/HTMLElement.res @@ -1,5 +1,3 @@ -open DOMAPI - module Impl = ( T: { type t @@ -7,13 +5,13 @@ module Impl = ( ) => { include Element.Impl({type t = T.t}) - external asHTMLElement: T.t => htmlElement = "%identity" + external asHTMLElement: T.t => Types.htmlElement = "%identity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/attachInternals) */ @send - external attachInternals: T.t => elementInternals = "attachInternals" + external attachInternals: T.t => Types.elementInternals = "attachInternals" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/blur) @@ -31,7 +29,7 @@ module Impl = ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/focus) */ @send - external focus: (T.t, ~options: focusOptions=?) => unit = "focus" + external focus: (T.t, ~options: Types.focusOptions=?) => unit = "focus" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLElement/hidePopover) @@ -52,4 +50,4 @@ module Impl = ( external togglePopover: (T.t, ~force: bool=?) => bool = "togglePopover" } -include Impl({type t = htmlElement}) +include Impl({type t = Types.htmlElement}) diff --git a/packages/DOM/src/HTMLEmbedElement.js b/packages/DOM/src/HTMLEmbedElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLEmbedElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLEmbedElement.res b/packages/DOM/src/HTMLEmbedElement.res new file mode 100644 index 00000000..7c269908 --- /dev/null +++ b/packages/DOM/src/HTMLEmbedElement.res @@ -0,0 +1,4 @@ +include HTMLElement.Impl({type t = Types.htmlEmbedElement}) + +@send +external getSVGDocument: Types.htmlEmbedElement => Types.document = "getSVGDocument" diff --git a/packages/DOM/src/HTMLFieldSetElement.js b/packages/DOM/src/HTMLFieldSetElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLFieldSetElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLFieldSetElement.res b/packages/DOM/src/HTMLFieldSetElement.res similarity index 65% rename from src/DOMAPI/HTMLFieldSetElement.res rename to packages/DOM/src/HTMLFieldSetElement.res index 57defe8e..c9e34dde 100644 --- a/src/DOMAPI/HTMLFieldSetElement.res +++ b/packages/DOM/src/HTMLFieldSetElement.res @@ -1,19 +1,17 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlFieldSetElement}) +include HTMLElement.Impl({type t = Types.htmlFieldSetElement}) /** Returns whether a form will validate when it is submitted, without having to submit it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFieldSetElement/checkValidity) */ @send -external checkValidity: htmlFieldSetElement => bool = "checkValidity" +external checkValidity: Types.htmlFieldSetElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFieldSetElement/reportValidity) */ @send -external reportValidity: htmlFieldSetElement => bool = "reportValidity" +external reportValidity: Types.htmlFieldSetElement => bool = "reportValidity" /** Sets a custom error message that is displayed when a form is submitted. @@ -21,4 +19,4 @@ Sets a custom error message that is displayed when a form is submitted. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFieldSetElement/setCustomValidity) */ @send -external setCustomValidity: (htmlFieldSetElement, string) => unit = "setCustomValidity" +external setCustomValidity: (Types.htmlFieldSetElement, string) => unit = "setCustomValidity" diff --git a/src/DOMAPI/HTMLFormControlsCollection.js b/packages/DOM/src/HTMLFormControlsCollection.js similarity index 100% rename from src/DOMAPI/HTMLFormControlsCollection.js rename to packages/DOM/src/HTMLFormControlsCollection.js diff --git a/src/DOMAPI/HTMLFormControlsCollection.res b/packages/DOM/src/HTMLFormControlsCollection.res similarity index 51% rename from src/DOMAPI/HTMLFormControlsCollection.res rename to packages/DOM/src/HTMLFormControlsCollection.res index 2a5540bc..0fdea5a0 100644 --- a/src/DOMAPI/HTMLFormControlsCollection.res +++ b/packages/DOM/src/HTMLFormControlsCollection.res @@ -1,16 +1,14 @@ -open DOMAPI - -external asHTMLCollection: htmlFormControlsCollection => htmlCollection = "%identity" +external asHTMLCollection: Types.htmlFormControlsCollection => Types.htmlCollection = "%identity" /** Retrieves an object from various collections. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item) */ @send -external item: (htmlFormControlsCollection, int) => element = "item" +external item: (Types.htmlFormControlsCollection, int) => Types.element = "item" /** Retrieves a select object or an object from an options collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/namedItem) */ @send -external namedItem: (htmlFormControlsCollection, string) => element = "namedItem" +external namedItem: (Types.htmlFormControlsCollection, string) => Types.element = "namedItem" diff --git a/packages/DOM/src/HTMLFormElement.js b/packages/DOM/src/HTMLFormElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLFormElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLFormElement.res b/packages/DOM/src/HTMLFormElement.res similarity index 61% rename from src/DOMAPI/HTMLFormElement.res rename to packages/DOM/src/HTMLFormElement.res index 8a6fabc4..c2f484dc 100644 --- a/src/DOMAPI/HTMLFormElement.res +++ b/packages/DOM/src/HTMLFormElement.res @@ -1,36 +1,34 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlFormElement}) +include HTMLElement.Impl({type t = Types.htmlFormElement}) /** Fires when a FORM is about to be submitted. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/submit) */ @send -external submit: htmlFormElement => unit = "submit" +external submit: Types.htmlFormElement => unit = "submit" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/requestSubmit) */ @send -external requestSubmit: (htmlFormElement, ~submitter: htmlElement=?) => unit = "requestSubmit" +external requestSubmit: (Types.htmlFormElement, ~submitter: Types.htmlElement=?) => unit = "requestSubmit" /** Fires when the user resets a form. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/reset) */ @send -external reset: htmlFormElement => unit = "reset" +external reset: Types.htmlFormElement => unit = "reset" /** Returns whether a form will validate when it is submitted, without having to submit it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/checkValidity) */ @send -external checkValidity: htmlFormElement => bool = "checkValidity" +external checkValidity: Types.htmlFormElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormElement/reportValidity) */ @send -external reportValidity: htmlFormElement => bool = "reportValidity" +external reportValidity: Types.htmlFormElement => bool = "reportValidity" diff --git a/packages/DOM/src/HTMLFrameSetElement.js b/packages/DOM/src/HTMLFrameSetElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLFrameSetElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLFrameSetElement.res b/packages/DOM/src/HTMLFrameSetElement.res new file mode 100644 index 00000000..aed6c7e7 --- /dev/null +++ b/packages/DOM/src/HTMLFrameSetElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlFrameSetElement}) diff --git a/packages/DOM/src/HTMLHRElement.js b/packages/DOM/src/HTMLHRElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLHRElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLHRElement.res b/packages/DOM/src/HTMLHRElement.res new file mode 100644 index 00000000..856fcc3c --- /dev/null +++ b/packages/DOM/src/HTMLHRElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlhrElement}) diff --git a/packages/DOM/src/HTMLHeadElement.js b/packages/DOM/src/HTMLHeadElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLHeadElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLHeadElement.res b/packages/DOM/src/HTMLHeadElement.res new file mode 100644 index 00000000..45124481 --- /dev/null +++ b/packages/DOM/src/HTMLHeadElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlHeadElement}) diff --git a/packages/DOM/src/HTMLHeadingElement.js b/packages/DOM/src/HTMLHeadingElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLHeadingElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLHeadingElement.res b/packages/DOM/src/HTMLHeadingElement.res new file mode 100644 index 00000000..7f896e63 --- /dev/null +++ b/packages/DOM/src/HTMLHeadingElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlHeadingElement}) diff --git a/packages/DOM/src/HTMLHtmlElement.js b/packages/DOM/src/HTMLHtmlElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLHtmlElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLHtmlElement.res b/packages/DOM/src/HTMLHtmlElement.res new file mode 100644 index 00000000..0e760954 --- /dev/null +++ b/packages/DOM/src/HTMLHtmlElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlHtmlElement}) diff --git a/packages/DOM/src/HTMLIFrameElement.js b/packages/DOM/src/HTMLIFrameElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLIFrameElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLIFrameElement.res b/packages/DOM/src/HTMLIFrameElement.res new file mode 100644 index 00000000..637d2bd9 --- /dev/null +++ b/packages/DOM/src/HTMLIFrameElement.res @@ -0,0 +1,4 @@ +include HTMLElement.Impl({type t = Types.htmliFrameElement}) + +@send +external getSVGDocument: Types.htmliFrameElement => Types.document = "getSVGDocument" diff --git a/packages/DOM/src/HTMLImageElement.js b/packages/DOM/src/HTMLImageElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLImageElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLImageElement.res b/packages/DOM/src/HTMLImageElement.res new file mode 100644 index 00000000..64979a5d --- /dev/null +++ b/packages/DOM/src/HTMLImageElement.res @@ -0,0 +1,7 @@ +include HTMLElement.Impl({type t = Types.htmlImageElement}) + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLImageElement/decode) +*/ +@send +external decode: Types.htmlImageElement => promise = "decode" diff --git a/packages/DOM/src/HTMLInputElement.js b/packages/DOM/src/HTMLInputElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLInputElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLInputElement.res b/packages/DOM/src/HTMLInputElement.res similarity index 75% rename from src/DOMAPI/HTMLInputElement.res rename to packages/DOM/src/HTMLInputElement.res index c538847a..13d16fab 100644 --- a/src/DOMAPI/HTMLInputElement.res +++ b/packages/DOM/src/HTMLInputElement.res @@ -1,6 +1,4 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlInputElement}) +include HTMLElement.Impl({type t = Types.htmlInputElement}) /** Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. @@ -8,7 +6,7 @@ Increments a range input control's value by the value given by the Step attribut [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/stepUp) */ @send -external stepUp: (htmlInputElement, ~n: int=?) => unit = "stepUp" +external stepUp: (Types.htmlInputElement, ~n: int=?) => unit = "stepUp" /** Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. @@ -16,20 +14,20 @@ Decrements a range input control's value by the value given by the Step attribut [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/stepDown) */ @send -external stepDown: (htmlInputElement, ~n: int=?) => unit = "stepDown" +external stepDown: (Types.htmlInputElement, ~n: int=?) => unit = "stepDown" /** Returns whether a form will validate when it is submitted, without having to submit it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/checkValidity) */ @send -external checkValidity: htmlInputElement => bool = "checkValidity" +external checkValidity: Types.htmlInputElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/reportValidity) */ @send -external reportValidity: htmlInputElement => bool = "reportValidity" +external reportValidity: Types.htmlInputElement => bool = "reportValidity" /** Sets a custom error message that is displayed when a form is submitted. @@ -37,31 +35,31 @@ Sets a custom error message that is displayed when a form is submitted. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setCustomValidity) */ @send -external setCustomValidity: (htmlInputElement, string) => unit = "setCustomValidity" +external setCustomValidity: (Types.htmlInputElement, string) => unit = "setCustomValidity" /** Makes the selection equal to the current object. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/select) */ @send -external select: htmlInputElement => unit = "select" +external select: Types.htmlInputElement => unit = "select" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setRangeText) */ @send -external setRangeText: (htmlInputElement, string) => unit = "setRangeText" +external setRangeText: (Types.htmlInputElement, string) => unit = "setRangeText" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/setRangeText) */ @send external setRangeText2: ( - htmlInputElement, + Types.htmlInputElement, ~replacement: string, ~start: int, ~end: int, - ~selectionMode: selectionMode=?, + ~selectionMode: Types.selectionMode=?, ) => unit = "setRangeText" /** @@ -73,7 +71,7 @@ Sets the start and end positions of a selection in a text field. */ @send external setSelectionRange: ( - htmlInputElement, + Types.htmlInputElement, ~start: int, ~end: int, ~direction: string=?, @@ -83,4 +81,4 @@ external setSelectionRange: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/showPicker) */ @send -external showPicker: htmlInputElement => unit = "showPicker" +external showPicker: Types.htmlInputElement => unit = "showPicker" diff --git a/packages/DOM/src/HTMLLIElement.js b/packages/DOM/src/HTMLLIElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLLIElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLLIElement.res b/packages/DOM/src/HTMLLIElement.res new file mode 100644 index 00000000..cbf76f46 --- /dev/null +++ b/packages/DOM/src/HTMLLIElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlliElement}) diff --git a/packages/DOM/src/HTMLLabelElement.js b/packages/DOM/src/HTMLLabelElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLLabelElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLLabelElement.res b/packages/DOM/src/HTMLLabelElement.res new file mode 100644 index 00000000..9b02a020 --- /dev/null +++ b/packages/DOM/src/HTMLLabelElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlLabelElement}) diff --git a/packages/DOM/src/HTMLLegendElement.js b/packages/DOM/src/HTMLLegendElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLLegendElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLLegendElement.res b/packages/DOM/src/HTMLLegendElement.res new file mode 100644 index 00000000..aa727c73 --- /dev/null +++ b/packages/DOM/src/HTMLLegendElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlLegendElement}) diff --git a/packages/DOM/src/HTMLLinkElement.js b/packages/DOM/src/HTMLLinkElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLLinkElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLLinkElement.res b/packages/DOM/src/HTMLLinkElement.res new file mode 100644 index 00000000..6ed981b7 --- /dev/null +++ b/packages/DOM/src/HTMLLinkElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlLinkElement}) diff --git a/packages/DOM/src/HTMLMapElement.js b/packages/DOM/src/HTMLMapElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLMapElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLMapElement.res b/packages/DOM/src/HTMLMapElement.res new file mode 100644 index 00000000..ec7c9f7c --- /dev/null +++ b/packages/DOM/src/HTMLMapElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlMapElement}) diff --git a/packages/DOM/src/HTMLMediaElement.js b/packages/DOM/src/HTMLMediaElement.js new file mode 100644 index 00000000..a25b3115 --- /dev/null +++ b/packages/DOM/src/HTMLMediaElement.js @@ -0,0 +1,15 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +function Impl(T) { + HTMLElement$DOM.Impl({}); + return {}; +} + +HTMLElement$DOM.Impl({}); + +export { + Impl, +} +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLMediaElement.res b/packages/DOM/src/HTMLMediaElement.res similarity index 71% rename from src/DOMAPI/HTMLMediaElement.res rename to packages/DOM/src/HTMLMediaElement.res index a616d366..b4c9b0e4 100644 --- a/src/DOMAPI/HTMLMediaElement.res +++ b/packages/DOM/src/HTMLMediaElement.res @@ -1,15 +1,11 @@ -open DOMAPI -open WebVTTAPI -open EncryptedMediaExtensionsAPI - module Impl = ( T: { type t }, ) => { - include HTMLElement.Impl({type t = htmlMediaElement}) + include HTMLElement.Impl({type t = Types.htmlMediaElement}) - external asHTMLMediaElement: T.t => htmlMediaElement = "%identity" + external asHTMLMediaElement: T.t => Types.htmlMediaElement = "%identity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/addTextTrack) @@ -17,17 +13,17 @@ module Impl = ( @send external addTextTrack: ( T.t, - ~kind: textTrackKind, + ~kind: WebVTT.Types.textTrackKind, ~label: string=?, ~language: string=?, - ) => textTrack = "addTextTrack" + ) => WebVTT.Types.textTrack = "addTextTrack" /** Returns a string that specifies whether the client can play a given media resource type. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/canPlayType) */ @send - external canPlayType: (T.t, string) => canPlayTypeResult = "canPlayType" + external canPlayType: (T.t, string) => Types.canPlayTypeResult = "canPlayType" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/fastSeek) @@ -56,12 +52,6 @@ Loads and starts playback of a media resource. @send external play: T.t => promise = "play" - /** -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setMediaKeys) -*/ - @send - external setMediaKeys: (T.t, mediaKeys) => promise = "setMediaKeys" - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/setSinkId) */ @@ -69,4 +59,4 @@ Loads and starts playback of a media resource. external setSinkId: (T.t, string) => promise = "setSinkId" } -include Impl({type t = htmlMediaElement}) +include Impl({type t = Types.htmlMediaElement}) diff --git a/packages/DOM/src/HTMLMenuElement.js b/packages/DOM/src/HTMLMenuElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLMenuElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLMenuElement.res b/packages/DOM/src/HTMLMenuElement.res new file mode 100644 index 00000000..1015ce32 --- /dev/null +++ b/packages/DOM/src/HTMLMenuElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlMenuElement}) diff --git a/packages/DOM/src/HTMLMetaElement.js b/packages/DOM/src/HTMLMetaElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLMetaElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLMetaElement.res b/packages/DOM/src/HTMLMetaElement.res new file mode 100644 index 00000000..883342d3 --- /dev/null +++ b/packages/DOM/src/HTMLMetaElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlMetaElement}) diff --git a/packages/DOM/src/HTMLMeterElement.js b/packages/DOM/src/HTMLMeterElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLMeterElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLMeterElement.res b/packages/DOM/src/HTMLMeterElement.res new file mode 100644 index 00000000..8d3ba7b9 --- /dev/null +++ b/packages/DOM/src/HTMLMeterElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlMeterElement}) diff --git a/packages/DOM/src/HTMLModElement.js b/packages/DOM/src/HTMLModElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLModElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLModElement.res b/packages/DOM/src/HTMLModElement.res new file mode 100644 index 00000000..a337135a --- /dev/null +++ b/packages/DOM/src/HTMLModElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlModElement}) diff --git a/packages/DOM/src/HTMLOListElement.js b/packages/DOM/src/HTMLOListElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLOListElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLOListElement.res b/packages/DOM/src/HTMLOListElement.res new file mode 100644 index 00000000..4aeac356 --- /dev/null +++ b/packages/DOM/src/HTMLOListElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmloListElement}) diff --git a/packages/DOM/src/HTMLObjectElement.js b/packages/DOM/src/HTMLObjectElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLObjectElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLObjectElement.res b/packages/DOM/src/HTMLObjectElement.res similarity index 60% rename from src/DOMAPI/HTMLObjectElement.res rename to packages/DOM/src/HTMLObjectElement.res index 06b59bec..80f121e9 100644 --- a/src/DOMAPI/HTMLObjectElement.res +++ b/packages/DOM/src/HTMLObjectElement.res @@ -1,22 +1,20 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlObjectElement}) +include HTMLElement.Impl({type t = Types.htmlObjectElement}) @send -external getSVGDocument: htmlObjectElement => document = "getSVGDocument" +external getSVGDocument: Types.htmlObjectElement => Types.document = "getSVGDocument" /** Returns whether a form will validate when it is submitted, without having to submit it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLObjectElement/checkValidity) */ @send -external checkValidity: htmlObjectElement => bool = "checkValidity" +external checkValidity: Types.htmlObjectElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLObjectElement/reportValidity) */ @send -external reportValidity: htmlObjectElement => bool = "reportValidity" +external reportValidity: Types.htmlObjectElement => bool = "reportValidity" /** Sets a custom error message that is displayed when a form is submitted. @@ -24,4 +22,4 @@ Sets a custom error message that is displayed when a form is submitted. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLObjectElement/setCustomValidity) */ @send -external setCustomValidity: (htmlObjectElement, string) => unit = "setCustomValidity" +external setCustomValidity: (Types.htmlObjectElement, string) => unit = "setCustomValidity" diff --git a/packages/DOM/src/HTMLOptGroupElement.js b/packages/DOM/src/HTMLOptGroupElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLOptGroupElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLOptGroupElement.res b/packages/DOM/src/HTMLOptGroupElement.res new file mode 100644 index 00000000..3b2b9f20 --- /dev/null +++ b/packages/DOM/src/HTMLOptGroupElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlOptGroupElement}) diff --git a/packages/DOM/src/HTMLOptionElement.js b/packages/DOM/src/HTMLOptionElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLOptionElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLOptionElement.res b/packages/DOM/src/HTMLOptionElement.res new file mode 100644 index 00000000..11e2b30f --- /dev/null +++ b/packages/DOM/src/HTMLOptionElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlOptionElement}) diff --git a/src/DOMAPI/HTMLOptionsCollection.js b/packages/DOM/src/HTMLOptionsCollection.js similarity index 100% rename from src/DOMAPI/HTMLOptionsCollection.js rename to packages/DOM/src/HTMLOptionsCollection.js diff --git a/src/DOMAPI/HTMLOptionsCollection.res b/packages/DOM/src/HTMLOptionsCollection.res similarity index 75% rename from src/DOMAPI/HTMLOptionsCollection.res rename to packages/DOM/src/HTMLOptionsCollection.res index b4390c9e..ee75d58b 100644 --- a/src/DOMAPI/HTMLOptionsCollection.res +++ b/packages/DOM/src/HTMLOptionsCollection.res @@ -1,7 +1,5 @@ -open DOMAPI - /** -Inserts element before the node given by before. +Inserts element before the Types.node given by before. The before argument can be a number, in which case element is inserted before the item with that number, or an element from the collection, in which case element is inserted before that element. @@ -11,11 +9,11 @@ This method will throw a "HierarchyRequestError" DOMException if element is an a [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOptionsCollection/add) */ @send -external add: (htmlOptionsCollection, ~element: unknown, ~before: unknown=?) => unit = "add" +external add: (Types.htmlOptionsCollection, ~element: unknown, ~before: unknown=?) => unit = "add" /** Removes the item with index index from the collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOptionsCollection/remove) */ @send -external remove: (htmlOptionsCollection, int) => unit = "remove" +external remove: (Types.htmlOptionsCollection, int) => unit = "remove" diff --git a/packages/DOM/src/HTMLOutputElement.js b/packages/DOM/src/HTMLOutputElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLOutputElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLOutputElement.res b/packages/DOM/src/HTMLOutputElement.res similarity index 52% rename from src/DOMAPI/HTMLOutputElement.res rename to packages/DOM/src/HTMLOutputElement.res index e8194c77..16aa2d59 100644 --- a/src/DOMAPI/HTMLOutputElement.res +++ b/packages/DOM/src/HTMLOutputElement.res @@ -1,21 +1,19 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlOutputElement}) +include HTMLElement.Impl({type t = Types.htmlOutputElement}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/checkValidity) */ @send -external checkValidity: htmlOutputElement => bool = "checkValidity" +external checkValidity: Types.htmlOutputElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/reportValidity) */ @send -external reportValidity: htmlOutputElement => bool = "reportValidity" +external reportValidity: Types.htmlOutputElement => bool = "reportValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/setCustomValidity) */ @send -external setCustomValidity: (htmlOutputElement, string) => unit = "setCustomValidity" +external setCustomValidity: (Types.htmlOutputElement, string) => unit = "setCustomValidity" diff --git a/packages/DOM/src/HTMLParagraphElement.js b/packages/DOM/src/HTMLParagraphElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLParagraphElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLParagraphElement.res b/packages/DOM/src/HTMLParagraphElement.res new file mode 100644 index 00000000..e22f47a5 --- /dev/null +++ b/packages/DOM/src/HTMLParagraphElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlParagraphElement}) diff --git a/packages/DOM/src/HTMLPictureElement.js b/packages/DOM/src/HTMLPictureElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLPictureElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLPictureElement.res b/packages/DOM/src/HTMLPictureElement.res new file mode 100644 index 00000000..2d245073 --- /dev/null +++ b/packages/DOM/src/HTMLPictureElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlPictureElement}) diff --git a/packages/DOM/src/HTMLPreElement.js b/packages/DOM/src/HTMLPreElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLPreElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLPreElement.res b/packages/DOM/src/HTMLPreElement.res new file mode 100644 index 00000000..13ca9cba --- /dev/null +++ b/packages/DOM/src/HTMLPreElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlPreElement}) diff --git a/packages/DOM/src/HTMLProgressElement.js b/packages/DOM/src/HTMLProgressElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLProgressElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLProgressElement.res b/packages/DOM/src/HTMLProgressElement.res new file mode 100644 index 00000000..d434c5f4 --- /dev/null +++ b/packages/DOM/src/HTMLProgressElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlProgressElement}) diff --git a/packages/DOM/src/HTMLQuoteElement.js b/packages/DOM/src/HTMLQuoteElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLQuoteElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLQuoteElement.res b/packages/DOM/src/HTMLQuoteElement.res new file mode 100644 index 00000000..5a66af0a --- /dev/null +++ b/packages/DOM/src/HTMLQuoteElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlQuoteElement}) diff --git a/packages/DOM/src/HTMLScriptElement.js b/packages/DOM/src/HTMLScriptElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLScriptElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLScriptElement.res b/packages/DOM/src/HTMLScriptElement.res similarity index 72% rename from src/DOMAPI/HTMLScriptElement.res rename to packages/DOM/src/HTMLScriptElement.res index 68e36c19..e71cb1f4 100644 --- a/src/DOMAPI/HTMLScriptElement.res +++ b/packages/DOM/src/HTMLScriptElement.res @@ -1,6 +1,4 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlScriptElement}) +include HTMLElement.Impl({type t = Types.htmlScriptElement}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLScriptElement/supports_static) diff --git a/packages/DOM/src/HTMLSelectElement.js b/packages/DOM/src/HTMLSelectElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLSelectElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLSelectElement.res b/packages/DOM/src/HTMLSelectElement.res similarity index 77% rename from src/DOMAPI/HTMLSelectElement.res rename to packages/DOM/src/HTMLSelectElement.res index 8e05f4be..58f39d49 100644 --- a/src/DOMAPI/HTMLSelectElement.res +++ b/packages/DOM/src/HTMLSelectElement.res @@ -1,5 +1,3 @@ -open DOMAPI - /** Retrieves a select object or an object from an options collection. @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. @@ -7,7 +5,7 @@ Retrieves a select object or an object from an options collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/item) */ @send -external item: (htmlSelectElement, int) => htmlOptionElement = "item" +external item: (Types.htmlSelectElement, int) => Types.htmlOptionElement = "item" /** Retrieves a select object or an object from an options collection. @@ -15,7 +13,7 @@ Retrieves a select object or an object from an options collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/namedItem) */ @send -external namedItem: (htmlSelectElement, string) => htmlOptionElement = "namedItem" +external namedItem: (Types.htmlSelectElement, string) => Types.htmlOptionElement = "namedItem" /** Adds an element to the areas, controlRange, or options collection. @@ -24,7 +22,7 @@ Adds an element to the areas, controlRange, or options collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/add) */ @send -external add: (htmlSelectElement, ~element: unknown, ~before: unknown=?) => unit = "add" +external add: (Types.htmlSelectElement, ~element: unknown, ~before: unknown=?) => unit = "add" /** Removes an element from the collection. @@ -32,7 +30,7 @@ Removes an element from the collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/remove) */ @send -external removeH: htmlSelectElement => unit = "remove" +external removeH: Types.htmlSelectElement => unit = "remove" /** Removes an element from the collection. @@ -40,20 +38,20 @@ Removes an element from the collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/remove) */ @send -external removeH2: (htmlSelectElement, int) => unit = "remove" +external removeH2: (Types.htmlSelectElement, int) => unit = "remove" /** Returns whether a form will validate when it is submitted, without having to submit it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/checkValidity) */ @send -external checkValidity: htmlSelectElement => bool = "checkValidity" +external checkValidity: Types.htmlSelectElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/reportValidity) */ @send -external reportValidity: htmlSelectElement => bool = "reportValidity" +external reportValidity: Types.htmlSelectElement => bool = "reportValidity" /** Sets a custom error message that is displayed when a form is submitted. @@ -61,12 +59,12 @@ Sets a custom error message that is displayed when a form is submitted. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/setCustomValidity) */ @send -external setCustomValidity: (htmlSelectElement, string) => unit = "setCustomValidity" +external setCustomValidity: (Types.htmlSelectElement, string) => unit = "setCustomValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/showPicker) */ @send -external showPicker: htmlSelectElement => unit = "showPicker" +external showPicker: Types.htmlSelectElement => unit = "showPicker" -include HTMLElement.Impl({type t = htmlSelectElement}) +include HTMLElement.Impl({type t = Types.htmlSelectElement}) diff --git a/packages/DOM/src/HTMLSlotElement.js b/packages/DOM/src/HTMLSlotElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLSlotElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLSlotElement.res b/packages/DOM/src/HTMLSlotElement.res similarity index 51% rename from src/DOMAPI/HTMLSlotElement.res rename to packages/DOM/src/HTMLSlotElement.res index 2ae008f8..9b0aff60 100644 --- a/src/DOMAPI/HTMLSlotElement.res +++ b/packages/DOM/src/HTMLSlotElement.res @@ -1,29 +1,27 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlSlotElement}) +include HTMLElement.Impl({type t = Types.htmlSlotElement}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSlotElement/assignedNodes) */ @send -external assignedNodes: (htmlSlotElement, ~options: assignedNodesOptions=?) => array = +external assignedNodes: (Types.htmlSlotElement, ~options: Types.assignedNodesOptions=?) => array = "assignedNodes" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSlotElement/assignedElements) */ @send -external assignedElements: (htmlSlotElement, ~options: assignedNodesOptions=?) => array = +external assignedElements: (Types.htmlSlotElement, ~options: Types.assignedNodesOptions=?) => array = "assignedElements" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSlotElement/assign) */ @send -external assign: (htmlSlotElement, element) => unit = "assign" +external assign: (Types.htmlSlotElement, Types.element) => unit = "assign" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSlotElement/assign) */ @send -external assign2: (htmlSlotElement, text) => unit = "assign" +external assign2: (Types.htmlSlotElement, Types.text) => unit = "assign" diff --git a/packages/DOM/src/HTMLSourceElement.js b/packages/DOM/src/HTMLSourceElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLSourceElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLSourceElement.res b/packages/DOM/src/HTMLSourceElement.res new file mode 100644 index 00000000..fba7a318 --- /dev/null +++ b/packages/DOM/src/HTMLSourceElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlSourceElement}) diff --git a/packages/DOM/src/HTMLSpanElement.js b/packages/DOM/src/HTMLSpanElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLSpanElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLSpanElement.res b/packages/DOM/src/HTMLSpanElement.res new file mode 100644 index 00000000..6653b8ba --- /dev/null +++ b/packages/DOM/src/HTMLSpanElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlSpanElement}) diff --git a/packages/DOM/src/HTMLStyleElement.js b/packages/DOM/src/HTMLStyleElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLStyleElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLStyleElement.res b/packages/DOM/src/HTMLStyleElement.res new file mode 100644 index 00000000..71021b40 --- /dev/null +++ b/packages/DOM/src/HTMLStyleElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlStyleElement}) diff --git a/packages/DOM/src/HTMLTableCaptionElement.js b/packages/DOM/src/HTMLTableCaptionElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTableCaptionElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLTableCaptionElement.res b/packages/DOM/src/HTMLTableCaptionElement.res new file mode 100644 index 00000000..a315b6ff --- /dev/null +++ b/packages/DOM/src/HTMLTableCaptionElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlTableCaptionElement}) diff --git a/packages/DOM/src/HTMLTableCellElement.js b/packages/DOM/src/HTMLTableCellElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTableCellElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLTableCellElement.res b/packages/DOM/src/HTMLTableCellElement.res new file mode 100644 index 00000000..404cb6e2 --- /dev/null +++ b/packages/DOM/src/HTMLTableCellElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlTableCellElement}) diff --git a/packages/DOM/src/HTMLTableElement.js b/packages/DOM/src/HTMLTableElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTableElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableElement.res b/packages/DOM/src/HTMLTableElement.res similarity index 68% rename from src/DOMAPI/HTMLTableElement.res rename to packages/DOM/src/HTMLTableElement.res index e2002927..84e6d97c 100644 --- a/src/DOMAPI/HTMLTableElement.res +++ b/packages/DOM/src/HTMLTableElement.res @@ -1,55 +1,53 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlTableElement}) +include HTMLElement.Impl({type t = Types.htmlTableElement}) /** Creates an empty caption element in the table. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/createCaption) */ @send -external createCaption: htmlTableElement => htmlTableCaptionElement = "createCaption" +external createCaption: Types.htmlTableElement => Types.htmlTableCaptionElement = "createCaption" /** Deletes the caption element and its contents from the table. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/deleteCaption) */ @send -external deleteCaption: htmlTableElement => unit = "deleteCaption" +external deleteCaption: Types.htmlTableElement => unit = "deleteCaption" /** Returns the tHead element object if successful, or null otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/createTHead) */ @send -external createTHead: htmlTableElement => htmlTableSectionElement = "createTHead" +external createTHead: Types.htmlTableElement => Types.htmlTableSectionElement = "createTHead" /** Deletes the tHead element and its contents from the table. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/deleteTHead) */ @send -external deleteTHead: htmlTableElement => unit = "deleteTHead" +external deleteTHead: Types.htmlTableElement => unit = "deleteTHead" /** Creates an empty tFoot element in the table. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/createTFoot) */ @send -external createTFoot: htmlTableElement => htmlTableSectionElement = "createTFoot" +external createTFoot: Types.htmlTableElement => Types.htmlTableSectionElement = "createTFoot" /** Deletes the tFoot element and its contents from the table. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/deleteTFoot) */ @send -external deleteTFoot: htmlTableElement => unit = "deleteTFoot" +external deleteTFoot: Types.htmlTableElement => unit = "deleteTFoot" /** Creates an empty tBody element in the table. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/createTBody) */ @send -external createTBody: htmlTableElement => htmlTableSectionElement = "createTBody" +external createTBody: Types.htmlTableElement => Types.htmlTableSectionElement = "createTBody" /** Creates a new row (tr) in the table, and adds the row to the rows collection. @@ -57,7 +55,7 @@ Creates a new row (tr) in the table, and adds the row to the rows collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/insertRow) */ @send -external insertRow: (htmlTableElement, ~index: int=?) => htmlTableRowElement = "insertRow" +external insertRow: (Types.htmlTableElement, ~index: int=?) => Types.htmlTableRowElement = "insertRow" /** Removes the specified row (tr) from the element and from the rows collection. @@ -65,4 +63,4 @@ Removes the specified row (tr) from the element and from the rows collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/deleteRow) */ @send -external deleteRow: (htmlTableElement, int) => unit = "deleteRow" +external deleteRow: (Types.htmlTableElement, int) => unit = "deleteRow" diff --git a/packages/DOM/src/HTMLTableRowElement.js b/packages/DOM/src/HTMLTableRowElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTableRowElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableRowElement.res b/packages/DOM/src/HTMLTableRowElement.res similarity index 74% rename from src/DOMAPI/HTMLTableRowElement.res rename to packages/DOM/src/HTMLTableRowElement.res index 40c786f4..e5a000da 100644 --- a/src/DOMAPI/HTMLTableRowElement.res +++ b/packages/DOM/src/HTMLTableRowElement.res @@ -1,6 +1,4 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlTableRowElement}) +include HTMLElement.Impl({type t = Types.htmlTableRowElement}) /** Creates a new cell in the table row, and adds the cell to the cells collection. @@ -8,7 +6,7 @@ Creates a new cell in the table row, and adds the cell to the cells collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableRowElement/insertCell) */ @send -external insertCell: (htmlTableRowElement, ~index: int=?) => htmlTableCellElement = "insertCell" +external insertCell: (Types.htmlTableRowElement, ~index: int=?) => Types.htmlTableCellElement = "insertCell" /** Removes the specified cell from the table row, as well as from the cells collection. @@ -16,4 +14,4 @@ Removes the specified cell from the table row, as well as from the cells collect [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableRowElement/deleteCell) */ @send -external deleteCell: (htmlTableRowElement, int) => unit = "deleteCell" +external deleteCell: (Types.htmlTableRowElement, int) => unit = "deleteCell" diff --git a/packages/DOM/src/HTMLTableSectionElement.js b/packages/DOM/src/HTMLTableSectionElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTableSectionElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTableSectionElement.res b/packages/DOM/src/HTMLTableSectionElement.res similarity index 71% rename from src/DOMAPI/HTMLTableSectionElement.res rename to packages/DOM/src/HTMLTableSectionElement.res index db748f1e..0306fec3 100644 --- a/src/DOMAPI/HTMLTableSectionElement.res +++ b/packages/DOM/src/HTMLTableSectionElement.res @@ -1,6 +1,4 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlTableSectionElement}) +include HTMLElement.Impl({type t = Types.htmlTableSectionElement}) /** Creates a new row (tr) in the table, and adds the row to the rows collection. @@ -8,7 +6,7 @@ Creates a new row (tr) in the table, and adds the row to the rows collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableSectionElement/insertRow) */ @send -external insertRow: (htmlTableSectionElement, ~index: int=?) => htmlTableRowElement = "insertRow" +external insertRow: (Types.htmlTableSectionElement, ~index: int=?) => Types.htmlTableRowElement = "insertRow" /** Removes the specified row (tr) from the element and from the rows collection. @@ -16,4 +14,4 @@ Removes the specified row (tr) from the element and from the rows collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableSectionElement/deleteRow) */ @send -external deleteRow: (htmlTableSectionElement, int) => unit = "deleteRow" +external deleteRow: (Types.htmlTableSectionElement, int) => unit = "deleteRow" diff --git a/packages/DOM/src/HTMLTemplateElement.js b/packages/DOM/src/HTMLTemplateElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTemplateElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLTemplateElement.res b/packages/DOM/src/HTMLTemplateElement.res new file mode 100644 index 00000000..e62437c7 --- /dev/null +++ b/packages/DOM/src/HTMLTemplateElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlTemplateElement}) diff --git a/packages/DOM/src/HTMLTextAreaElement.js b/packages/DOM/src/HTMLTextAreaElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTextAreaElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/HTMLTextAreaElement.res b/packages/DOM/src/HTMLTextAreaElement.res similarity index 73% rename from src/DOMAPI/HTMLTextAreaElement.res rename to packages/DOM/src/HTMLTextAreaElement.res index df950aff..06f0ff43 100644 --- a/src/DOMAPI/HTMLTextAreaElement.res +++ b/packages/DOM/src/HTMLTextAreaElement.res @@ -1,19 +1,17 @@ -open DOMAPI - -include HTMLElement.Impl({type t = htmlTextAreaElement}) +include HTMLElement.Impl({type t = Types.htmlTextAreaElement}) /** Returns whether a form will validate when it is submitted, without having to submit it. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/checkValidity) */ @send -external checkValidity: htmlTextAreaElement => bool = "checkValidity" +external checkValidity: Types.htmlTextAreaElement => bool = "checkValidity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/reportValidity) */ @send -external reportValidity: htmlTextAreaElement => bool = "reportValidity" +external reportValidity: Types.htmlTextAreaElement => bool = "reportValidity" /** Sets a custom error message that is displayed when a form is submitted. @@ -21,31 +19,31 @@ Sets a custom error message that is displayed when a form is submitted. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/setCustomValidity) */ @send -external setCustomValidity: (htmlTextAreaElement, string) => unit = "setCustomValidity" +external setCustomValidity: (Types.htmlTextAreaElement, string) => unit = "setCustomValidity" /** Highlights the input area of a form element. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/select) */ @send -external select: htmlTextAreaElement => unit = "select" +external select: Types.htmlTextAreaElement => unit = "select" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/setRangeText) */ @send -external setRangeText: (htmlTextAreaElement, string) => unit = "setRangeText" +external setRangeText: (Types.htmlTextAreaElement, string) => unit = "setRangeText" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/setRangeText) */ @send external setRangeText2: ( - htmlTextAreaElement, + Types.htmlTextAreaElement, ~replacement: string, ~start: int, ~end: int, - ~selectionMode: selectionMode=?, + ~selectionMode: Types.selectionMode=?, ) => unit = "setRangeText" /** @@ -57,7 +55,7 @@ Sets the start and end positions of a selection in a text field. */ @send external setSelectionRange: ( - htmlTextAreaElement, + Types.htmlTextAreaElement, ~start: int, ~end: int, ~direction: string=?, diff --git a/packages/DOM/src/HTMLTimeElement.js b/packages/DOM/src/HTMLTimeElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTimeElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLTimeElement.res b/packages/DOM/src/HTMLTimeElement.res new file mode 100644 index 00000000..a7d18248 --- /dev/null +++ b/packages/DOM/src/HTMLTimeElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlTimeElement}) diff --git a/packages/DOM/src/HTMLTitleElement.js b/packages/DOM/src/HTMLTitleElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTitleElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLTitleElement.res b/packages/DOM/src/HTMLTitleElement.res new file mode 100644 index 00000000..56ae8e75 --- /dev/null +++ b/packages/DOM/src/HTMLTitleElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlTitleElement}) diff --git a/packages/DOM/src/HTMLTrackElement.js b/packages/DOM/src/HTMLTrackElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLTrackElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLTrackElement.res b/packages/DOM/src/HTMLTrackElement.res new file mode 100644 index 00000000..eb52ee4f --- /dev/null +++ b/packages/DOM/src/HTMLTrackElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmlTrackElement}) diff --git a/packages/DOM/src/HTMLUListElement.js b/packages/DOM/src/HTMLUListElement.js new file mode 100644 index 00000000..abea42e3 --- /dev/null +++ b/packages/DOM/src/HTMLUListElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLElement$DOM from "./HTMLElement.js"; + +HTMLElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLUListElement.res b/packages/DOM/src/HTMLUListElement.res new file mode 100644 index 00000000..1983a1c7 --- /dev/null +++ b/packages/DOM/src/HTMLUListElement.res @@ -0,0 +1 @@ +include HTMLElement.Impl({type t = Types.htmluListElement}) diff --git a/packages/DOM/src/HTMLVideoElement.js b/packages/DOM/src/HTMLVideoElement.js new file mode 100644 index 00000000..b8a2d987 --- /dev/null +++ b/packages/DOM/src/HTMLVideoElement.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as HTMLMediaElement$DOM from "./HTMLMediaElement.js"; + +HTMLMediaElement$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/HTMLVideoElement.res b/packages/DOM/src/HTMLVideoElement.res new file mode 100644 index 00000000..200c24a7 --- /dev/null +++ b/packages/DOM/src/HTMLVideoElement.res @@ -0,0 +1,32 @@ +include HTMLMediaElement.Impl({type t = Types.htmlVideoElement}) + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement/getVideoPlaybackQuality) +*/ +@send +external getVideoPlaybackQuality: Types.htmlVideoElement => Types.videoPlaybackQuality = + "getVideoPlaybackQuality" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement/requestPictureInPicture) +*/ +@send +external requestPictureInPicture: Types.htmlVideoElement => promise< + PictureInPicture.Types.pictureInPictureWindow, +> = "requestPictureInPicture" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement/requestVideoFrameCallback) +*/ +@send +external requestVideoFrameCallback: ( + Types.htmlVideoElement, + (float, Types.videoFrameCallbackMetadata) => unit, +) => int = "requestVideoFrameCallback" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement/cancelVideoFrameCallback) +*/ +@send +external cancelVideoFrameCallback: (Types.htmlVideoElement, int) => unit = + "cancelVideoFrameCallback" diff --git a/src/DOMAPI/IdleDeadline.js b/packages/DOM/src/IdleDeadline.js similarity index 100% rename from src/DOMAPI/IdleDeadline.js rename to packages/DOM/src/IdleDeadline.js diff --git a/src/DOMAPI/IdleDeadline.res b/packages/DOM/src/IdleDeadline.res similarity index 56% rename from src/DOMAPI/IdleDeadline.res rename to packages/DOM/src/IdleDeadline.res index a1ed548b..93a8870e 100644 --- a/src/DOMAPI/IdleDeadline.res +++ b/packages/DOM/src/IdleDeadline.res @@ -1,7 +1,5 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/IdleDeadline/timeRemaining) */ @send -external timeRemaining: idleDeadline => float = "timeRemaining" +external timeRemaining: Prelude.Types.idleDeadline => float = "timeRemaining" diff --git a/src/DOMAPI/ImageData.js b/packages/DOM/src/ImageData.js similarity index 100% rename from src/DOMAPI/ImageData.js rename to packages/DOM/src/ImageData.js diff --git a/src/DOMAPI/ImageData.res b/packages/DOM/src/ImageData.res similarity index 58% rename from src/DOMAPI/ImageData.res rename to packages/DOM/src/ImageData.res index 7cd8701e..c7bd834e 100644 --- a/src/DOMAPI/ImageData.res +++ b/packages/DOM/src/ImageData.res @@ -1,10 +1,8 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData) */ @new -external make: (~sw: int, ~sh: int, ~settings: imageDataSettings=?) => imageData = "ImageData" +external make: (~sw: int, ~sh: int, ~settings: Types.imageDataSettings=?) => Types.imageData = "ImageData" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ImageData) @@ -14,5 +12,5 @@ external makeWithData: ( ~data: Uint8ClampedArray.t, ~sw: int, ~sh: int=?, - ~settings: imageDataSettings=?, -) => imageData = "ImageData" + ~settings: Types.imageDataSettings=?, +) => Types.imageData = "ImageData" diff --git a/src/DOMAPI/Location.js b/packages/DOM/src/Location.js similarity index 100% rename from src/DOMAPI/Location.js rename to packages/DOM/src/Location.js diff --git a/src/DOMAPI/Location.res b/packages/DOM/src/Location.res similarity index 70% rename from src/DOMAPI/Location.res rename to packages/DOM/src/Location.res index ef3b13e2..db2a882b 100644 --- a/src/DOMAPI/Location.res +++ b/packages/DOM/src/Location.res @@ -1,22 +1,20 @@ -open DOMAPI - /** Navigates to the given URL. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/assign) */ @send -external assign: (location, string) => unit = "assign" +external assign: (Types.location, string) => unit = "assign" /** Removes the current page from the session history and navigates to the given URL. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/replace) */ @send -external replace: (location, string) => unit = "replace" +external replace: (Types.location, string) => unit = "replace" /** Reloads the current page. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Location/reload) */ @send -external reload: location => unit = "reload" +external reload: Types.location => unit = "reload" diff --git a/src/DOMAPI/MediaList.js b/packages/DOM/src/MediaList.js similarity index 100% rename from src/DOMAPI/MediaList.js rename to packages/DOM/src/MediaList.js diff --git a/src/DOMAPI/MediaList.res b/packages/DOM/src/MediaList.res similarity index 58% rename from src/DOMAPI/MediaList.res rename to packages/DOM/src/MediaList.res index 42d85231..93b88377 100644 --- a/src/DOMAPI/MediaList.res +++ b/packages/DOM/src/MediaList.res @@ -1,19 +1,17 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/item) */ @send -external item: (mediaList, int) => string = "item" +external item: (Types.mediaList, int) => string = "item" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/appendMedium) */ @send -external appendMedium: (mediaList, string) => unit = "appendMedium" +external appendMedium: (Types.mediaList, string) => unit = "appendMedium" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/deleteMedium) */ @send -external deleteMedium: (mediaList, string) => unit = "deleteMedium" +external deleteMedium: (Types.mediaList, string) => unit = "deleteMedium" diff --git a/packages/DOM/src/MediaQueryList.js b/packages/DOM/src/MediaQueryList.js new file mode 100644 index 00000000..d8fc27bc --- /dev/null +++ b/packages/DOM/src/MediaQueryList.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +EventTarget$Event.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/MediaQueryList.res b/packages/DOM/src/MediaQueryList.res new file mode 100644 index 00000000..57fe2143 --- /dev/null +++ b/packages/DOM/src/MediaQueryList.res @@ -0,0 +1 @@ +include Event.EventTarget.Impl({type t = Types.mediaQueryList}) diff --git a/src/DOMAPI/NamedNodeMap.js b/packages/DOM/src/NamedNodeMap.js similarity index 100% rename from src/DOMAPI/NamedNodeMap.js rename to packages/DOM/src/NamedNodeMap.js diff --git a/src/DOMAPI/NamedNodeMap.res b/packages/DOM/src/NamedNodeMap.res similarity index 51% rename from src/DOMAPI/NamedNodeMap.res rename to packages/DOM/src/NamedNodeMap.res index 5b56bec7..d1464c11 100644 --- a/src/DOMAPI/NamedNodeMap.res +++ b/packages/DOM/src/NamedNodeMap.res @@ -1,45 +1,49 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/item) */ @send -external item: (namedNodeMap, int) => attr = "item" +external item: (Types.namedNodeMap, int) => Prelude.Types.attr = "item" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/getNamedItem) */ @send -external getNamedItem: (namedNodeMap, string) => attr = "getNamedItem" +external getNamedItem: (Types.namedNodeMap, string) => Types.attr = "getNamedItem" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/getNamedItemNS) */ @send -external getNamedItemNS: (namedNodeMap, ~namespace: string, ~localName: string) => attr = - "getNamedItemNS" +external getNamedItemNS: ( + Types.namedNodeMap, + ~namespace: string, + ~localName: string, +) => Types.attr = "getNamedItemNS" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/setNamedItem) */ @send -external setNamedItem: (namedNodeMap, attr) => attr = "setNamedItem" +external setNamedItem: (Types.namedNodeMap, Types.attr) => Types.attr = "setNamedItem" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/setNamedItemNS) */ @send -external setNamedItemNS: (namedNodeMap, attr) => attr = "setNamedItemNS" +external setNamedItemNS: (Types.namedNodeMap, Types.attr) => Types.attr = "setNamedItemNS" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/removeNamedItem) */ @send -external removeNamedItem: (namedNodeMap, string) => attr = "removeNamedItem" +external removeNamedItem: (Types.namedNodeMap, string) => Types.attr = "removeNamedItem" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/removeNamedItemNS) */ @send -external removeNamedItemNS: (namedNodeMap, ~namespace: string, ~localName: string) => attr = - "removeNamedItemNS" +external removeNamedItemNS: ( + Types.namedNodeMap, + ~namespace: string, + ~localName: string, +) => Types.attr = "removeNamedItemNS" diff --git a/src/DOMAPI/Navigator.js b/packages/DOM/src/Navigator.js similarity index 100% rename from src/DOMAPI/Navigator.js rename to packages/DOM/src/Navigator.js diff --git a/packages/DOM/src/Navigator.res b/packages/DOM/src/Navigator.res new file mode 100644 index 00000000..e69de29b diff --git a/packages/DOM/src/Node.js b/packages/DOM/src/Node.js new file mode 100644 index 00000000..974c1ed0 --- /dev/null +++ b/packages/DOM/src/Node.js @@ -0,0 +1,15 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +function Impl(T) { + EventTarget$Event.Impl({}); + return {}; +} + +EventTarget$Event.Impl({}); + +export { + Impl, +} +/* Not a pure module */ diff --git a/src/DOMAPI/Node.res b/packages/DOM/src/Node.res similarity index 79% rename from src/DOMAPI/Node.res rename to packages/DOM/src/Node.res index db1019b0..a211f0d6 100644 --- a/src/DOMAPI/Node.res +++ b/packages/DOM/src/Node.res @@ -1,20 +1,18 @@ -open DOMAPI - module Impl = ( T: { type t }, ) => { - include EventTarget.Impl({type t = T.t}) + include Event.EventTarget.Impl({type t = T.t}) - external asNode: T.t => node = "%identity" + external asNode: T.t => Types.node = "%identity" /** Returns node's root. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/getRootNode) */ @send - external getRootNode: (T.t, ~options: getRootNodeOptions=?) => node = "getRootNode" + external getRootNode: (T.t, ~options: Types.getRootNodeOptions=?) => Types.node = "getRootNode" /** Returns whether node has children. @@ -42,27 +40,27 @@ Returns whether node and otherNode have the same properties. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isEqualNode) */ @send - external isEqualNode: (T.t, node) => bool = "isEqualNode" + external isEqualNode: (T.t, Types.node) => bool = "isEqualNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/isSameNode) */ @send - external isSameNode: (T.t, node) => bool = "isSameNode" + external isSameNode: (T.t, Types.node) => bool = "isSameNode" /** Returns a bitmask indicating the position of other relative to node. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/compareDocumentPosition) */ @send - external compareDocumentPosition: (T.t, node) => int = "compareDocumentPosition" + external compareDocumentPosition: (T.t, Types.node) => int = "compareDocumentPosition" /** Returns true if other is an inclusive descendant of node, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/contains) */ @send - external contains: (T.t, node) => bool = "contains" + external contains: (T.t, Types.node) => bool = "contains" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/lookupPrefix) @@ -86,7 +84,7 @@ Returns true if other is an inclusive descendant of node, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/insertBefore) */ @send - external insertBefore: (T.t, 't, ~child: node) => 't = "insertBefore" + external insertBefore: (T.t, 't, ~child: Types.node) => 't = "insertBefore" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/appendChild) @@ -98,7 +96,7 @@ Returns true if other is an inclusive descendant of node, and false otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/replaceChild) */ @send - external replaceChild: (T.t, ~node: node, 't) => 't = "replaceChild" + external replaceChild: (T.t, ~node: Types.node, 't) => 't = "replaceChild" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/removeChild) @@ -107,4 +105,4 @@ Returns true if other is an inclusive descendant of node, and false otherwise. external removeChild: (T.t, 't) => 't = "removeChild" } -include Impl({type t = node}) +include Impl({type t = Types.node}) diff --git a/src/DOMAPI/NodeFilter.js b/packages/DOM/src/NodeFilter.js similarity index 100% rename from src/DOMAPI/NodeFilter.js rename to packages/DOM/src/NodeFilter.js diff --git a/packages/DOM/src/NodeFilter.res b/packages/DOM/src/NodeFilter.res new file mode 100644 index 00000000..fdadeb82 --- /dev/null +++ b/packages/DOM/src/NodeFilter.res @@ -0,0 +1,2 @@ +@send +external acceptNode: (Types.nodeFilter, Types.node) => int = "acceptNode" diff --git a/src/DOMAPI/NodeIterator.js b/packages/DOM/src/NodeIterator.js similarity index 100% rename from src/DOMAPI/NodeIterator.js rename to packages/DOM/src/NodeIterator.js diff --git a/src/DOMAPI/NodeIterator.res b/packages/DOM/src/NodeIterator.res similarity index 59% rename from src/DOMAPI/NodeIterator.res rename to packages/DOM/src/NodeIterator.res index cfd0fd17..44073747 100644 --- a/src/DOMAPI/NodeIterator.res +++ b/packages/DOM/src/NodeIterator.res @@ -1,13 +1,11 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeIterator/nextNode) */ @send -external nextNode: nodeIterator => node = "nextNode" +external nextNode: Types.nodeIterator => Types.node = "nextNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeIterator/previousNode) */ @send -external previousNode: nodeIterator => node = "previousNode" +external previousNode: Types.nodeIterator => Types.node = "previousNode" diff --git a/src/DOMAPI/NodeList.js b/packages/DOM/src/NodeList.js similarity index 100% rename from src/DOMAPI/NodeList.js rename to packages/DOM/src/NodeList.js diff --git a/src/DOMAPI/NodeList.res b/packages/DOM/src/NodeList.res similarity index 71% rename from src/DOMAPI/NodeList.res rename to packages/DOM/src/NodeList.res index 526b4294..1f8ea784 100644 --- a/src/DOMAPI/NodeList.res +++ b/packages/DOM/src/NodeList.res @@ -1,8 +1,6 @@ -open DOMAPI - /** Returns the node with index index from the collection. The nodes are sorted in tree order. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeList/item) */ @send -external item: (nodeList<'tNode>, int) => 'tNode = "item" +external item: (Types.nodeList<'tNode>, int) => 'tNode = "item" diff --git a/src/DOMAPI/Range.js b/packages/DOM/src/Range.js similarity index 100% rename from src/DOMAPI/Range.js rename to packages/DOM/src/Range.js diff --git a/src/DOMAPI/Range.res b/packages/DOM/src/Range.res similarity index 56% rename from src/DOMAPI/Range.res rename to packages/DOM/src/Range.res index f0cdd60d..9803571e 100644 --- a/src/DOMAPI/Range.res +++ b/packages/DOM/src/Range.res @@ -1,149 +1,148 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range) */ @new -external make: unit => range = "Range" +external make: unit => Types.range = "Range" -external asAbstractRange: range => abstractRange = "%identity" +external asAbstractRange: Prelude.Types.range => Types.abstractRange = "%identity" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/setStart) */ @send -external setStart: (range, ~node: node, ~offset: int) => unit = "setStart" +external setStart: (Types.range, ~node: Types.node, ~offset: int) => unit = "setStart" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/setEnd) */ @send -external setEnd: (range, ~node: node, ~offset: int) => unit = "setEnd" +external setEnd: (Types.range, ~node: Types.node, ~offset: int) => unit = "setEnd" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/setStartBefore) */ @send -external setStartBefore: (range, node) => unit = "setStartBefore" +external setStartBefore: (Types.range, Types.node) => unit = "setStartBefore" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/setStartAfter) */ @send -external setStartAfter: (range, node) => unit = "setStartAfter" +external setStartAfter: (Types.range, Types.node) => unit = "setStartAfter" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/setEndBefore) */ @send -external setEndBefore: (range, node) => unit = "setEndBefore" +external setEndBefore: (Types.range, Types.node) => unit = "setEndBefore" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/setEndAfter) */ @send -external setEndAfter: (range, node) => unit = "setEndAfter" +external setEndAfter: (Types.range, Types.node) => unit = "setEndAfter" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/collapse) */ @send -external collapse: (range, ~toStart: bool=?) => unit = "collapse" +external collapse: (Types.range, ~toStart: bool=?) => unit = "collapse" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/selectNode) */ @send -external selectNode: (range, node) => unit = "selectNode" +external selectNode: (Types.range, Types.node) => unit = "selectNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/selectNodeContents) */ @send -external selectNodeContents: (range, node) => unit = "selectNodeContents" +external selectNodeContents: (Types.range, Types.node) => unit = "selectNodeContents" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/compareBoundaryPoints) */ @send -external compareBoundaryPoints: (range, ~how: int, ~sourceRange: range) => int = +external compareBoundaryPoints: (Types.range, ~how: int, ~sourceRange: Types.range) => int = "compareBoundaryPoints" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/deleteContents) */ @send -external deleteContents: range => unit = "deleteContents" +external deleteContents: Types.range => unit = "deleteContents" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/extractContents) */ @send -external extractContents: range => documentFragment = "extractContents" +external extractContents: Types.range => Types.documentFragment = "extractContents" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/cloneContents) */ @send -external cloneContents: range => documentFragment = "cloneContents" +external cloneContents: Types.range => Types.documentFragment = "cloneContents" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/insertNode) */ @send -external insertNode: (range, node) => unit = "insertNode" +external insertNode: (Types.range, Types.node) => unit = "insertNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/surroundContents) */ @send -external surroundContents: (range, node) => unit = "surroundContents" +external surroundContents: (Types.range, Types.node) => unit = "surroundContents" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/cloneRange) */ @send -external cloneRange: range => range = "cloneRange" +external cloneRange: Types.range => Types.range = "cloneRange" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/detach) */ @send -external detach: range => unit = "detach" +external detach: Types.range => unit = "detach" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/isPointInRange) */ @send -external isPointInRange: (range, ~node: node, ~offset: int) => bool = "isPointInRange" +external isPointInRange: (Types.range, ~node: Types.node, ~offset: int) => bool = "isPointInRange" /** Returns −1 if the point is before the range, 0 if the point is in the range, and 1 if the point is after the range. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/comparePoint) */ @send -external comparePoint: (range, ~node: node, ~offset: int) => int = "comparePoint" +external comparePoint: (Types.range, ~node: Types.node, ~offset: int) => int = "comparePoint" /** Returns whether range intersects node. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/intersectsNode) */ @send -external intersectsNode: (range, node) => bool = "intersectsNode" +external intersectsNode: (Types.range, Types.node) => bool = "intersectsNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/getClientRects) */ @send -external getClientRects: range => domRectList = "getClientRects" +external getClientRects: Types.range => Types.domRectList = "getClientRects" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/getBoundingClientRect) */ @send -external getBoundingClientRect: range => domRect = "getBoundingClientRect" +external getBoundingClientRect: Types.range => Types.domRect = "getBoundingClientRect" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Range/createContextualFragment) */ @send -external createContextualFragment: (range, string) => documentFragment = "createContextualFragment" +external createContextualFragment: (Types.range, string) => Types.documentFragment = + "createContextualFragment" diff --git a/src/DOMAPI/SVGGraphicsElement.js b/packages/DOM/src/SVGGraphicsElement.js similarity index 51% rename from src/DOMAPI/SVGGraphicsElement.js rename to packages/DOM/src/SVGGraphicsElement.js index c4f06872..04f05627 100644 --- a/src/DOMAPI/SVGGraphicsElement.js +++ b/packages/DOM/src/SVGGraphicsElement.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Element$WebAPI from "./Element.js"; +import * as Element$DOM from "./Element.js"; -Element$WebAPI.Impl({}); +Element$DOM.Impl({}); /* Not a pure module */ diff --git a/packages/DOM/src/SVGGraphicsElement.res b/packages/DOM/src/SVGGraphicsElement.res new file mode 100644 index 00000000..9447df78 --- /dev/null +++ b/packages/DOM/src/SVGGraphicsElement.res @@ -0,0 +1,15 @@ +include Element.Impl({type t = Types.svgGraphicsElement}) + +external asSVGElement: Types.svgGraphicsElement => Types.svgElement = "%identity" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/SVGGraphicsElement/getBBox) +*/ +@send +external getBBox: (Types.svgGraphicsElement, ~options: Types.svgBoundingBoxOptions=?) => Types.domRect = "getBBox" + +@send +external getCTM: Types.svgGraphicsElement => Types.domMatrix = "getCTM" + +@send +external getScreenCTM: Types.svgGraphicsElement => Types.domMatrix = "getScreenCTM" diff --git a/src/DOMAPI/SVGLength.js b/packages/DOM/src/SVGLength.js similarity index 100% rename from src/DOMAPI/SVGLength.js rename to packages/DOM/src/SVGLength.js diff --git a/src/DOMAPI/SVGLength.res b/packages/DOM/src/SVGLength.res similarity index 54% rename from src/DOMAPI/SVGLength.res rename to packages/DOM/src/SVGLength.res index 6d9ac017..41af6bc8 100644 --- a/src/DOMAPI/SVGLength.res +++ b/packages/DOM/src/SVGLength.res @@ -1,11 +1,9 @@ -open DOMAPI - @send external newValueSpecifiedUnits: ( - svgLength, + Types.svgLength, ~unitType: int, ~valueInSpecifiedUnits: float, ) => unit = "newValueSpecifiedUnits" @send -external convertToSpecifiedUnits: (svgLength, int) => unit = "convertToSpecifiedUnits" +external convertToSpecifiedUnits: (Types.svgLength, int) => unit = "convertToSpecifiedUnits" diff --git a/packages/DOM/src/ScreenOrientation.js b/packages/DOM/src/ScreenOrientation.js new file mode 100644 index 00000000..d8fc27bc --- /dev/null +++ b/packages/DOM/src/ScreenOrientation.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +EventTarget$Event.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/ScreenOrientation.res b/packages/DOM/src/ScreenOrientation.res new file mode 100644 index 00000000..f064ae03 --- /dev/null +++ b/packages/DOM/src/ScreenOrientation.res @@ -0,0 +1,7 @@ +include Event.EventTarget.Impl({type t = Types.screenOrientation}) + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ScreenOrientation/unlock) +*/ +@send +external unlock: Types.screenOrientation => unit = "unlock" diff --git a/src/DOMAPI/Selection.js b/packages/DOM/src/Selection.js similarity index 100% rename from src/DOMAPI/Selection.js rename to packages/DOM/src/Selection.js diff --git a/src/DOMAPI/Selection.res b/packages/DOM/src/Selection.res similarity index 60% rename from src/DOMAPI/Selection.res rename to packages/DOM/src/Selection.res index 101ca031..c264f110 100644 --- a/src/DOMAPI/Selection.res +++ b/packages/DOM/src/Selection.res @@ -1,74 +1,72 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/getRangeAt) */ @send -external getRangeAt: (selection, int) => range = "getRangeAt" +external getRangeAt: (Types.selection, int) => Types.range = "getRangeAt" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/addRange) */ @send -external addRange: (selection, range) => unit = "addRange" +external addRange: (Types.selection, Types.range) => unit = "addRange" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/removeRange) */ @send -external removeRange: (selection, range) => unit = "removeRange" +external removeRange: (Types.selection, Types.range) => unit = "removeRange" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/removeAllRanges) */ @send -external removeAllRanges: selection => unit = "removeAllRanges" +external removeAllRanges: Types.selection => unit = "removeAllRanges" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/removeAllRanges) */ @send -external empty: selection => unit = "empty" +external empty: Types.selection => unit = "empty" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/collapse) */ @send -external collapse: (selection, ~node: node, ~offset: int=?) => unit = "collapse" +external collapse: (Types.selection, ~node: Types.node, ~offset: int=?) => unit = "collapse" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/collapse) */ @send -external setPosition: (selection, ~node: node, ~offset: int=?) => unit = "setPosition" +external setPosition: (Types.selection, ~node: Types.node, ~offset: int=?) => unit = "setPosition" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/collapseToStart) */ @send -external collapseToStart: selection => unit = "collapseToStart" +external collapseToStart: Types.selection => unit = "collapseToStart" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/collapseToEnd) */ @send -external collapseToEnd: selection => unit = "collapseToEnd" +external collapseToEnd: Types.selection => unit = "collapseToEnd" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/extend) */ @send -external extend: (selection, ~node: node, ~offset: int=?) => unit = "extend" +external extend: (Types.selection, ~node: Types.node, ~offset: int=?) => unit = "extend" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/setBaseAndExtent) */ @send external setBaseAndExtent: ( - selection, - ~anchorNode: node, + Types.selection, + ~anchorNode: Types.node, ~anchorOffset: int, - ~focusNode: node, + ~focusNode: Types.node, ~focusOffset: int, ) => unit = "setBaseAndExtent" @@ -76,14 +74,14 @@ external setBaseAndExtent: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/selectAllChildren) */ @send -external selectAllChildren: (selection, node) => unit = "selectAllChildren" +external selectAllChildren: (Types.selection, Types.node) => unit = "selectAllChildren" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/modify) */ @send external modify: ( - selection, + Types.selection, ~alter: string=?, ~direction: string=?, ~granularity: string=?, @@ -93,11 +91,11 @@ external modify: ( [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/deleteFromDocument) */ @send -external deleteFromDocument: selection => unit = "deleteFromDocument" +external deleteFromDocument: Types.selection => unit = "deleteFromDocument" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Selection/containsNode) */ @send -external containsNode: (selection, ~node: node, ~allowPartialContainment: bool=?) => bool = +external containsNode: (Types.selection, ~node: Types.node, ~allowPartialContainment: bool=?) => bool = "containsNode" diff --git a/packages/DOM/src/ShadowRoot.js b/packages/DOM/src/ShadowRoot.js new file mode 100644 index 00000000..64345120 --- /dev/null +++ b/packages/DOM/src/ShadowRoot.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as DocumentFragment$DOM from "./DocumentFragment.js"; + +DocumentFragment$DOM.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/ShadowRoot.res b/packages/DOM/src/ShadowRoot.res new file mode 100644 index 00000000..576938ee --- /dev/null +++ b/packages/DOM/src/ShadowRoot.res @@ -0,0 +1,19 @@ +include DocumentFragment.Impl({type t = Types.shadowRoot}) + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getAnimations) +*/ +@send +external getAnimations: Types.shadowRoot => array = "getAnimations" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ShadowRoot/setHTMLUnsafe) +*/ +@send +external setHTMLUnsafe: (Types.shadowRoot, string) => unit = "setHTMLUnsafe" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ShadowRoot/getHTML) +*/ +@send +external getHTML: (Types.shadowRoot, ~options: Types.getHTMLOptions=?) => string = "getHTML" diff --git a/src/DOMAPI/StylePropertyMap.js b/packages/DOM/src/StylePropertyMap.js similarity index 100% rename from src/DOMAPI/StylePropertyMap.js rename to packages/DOM/src/StylePropertyMap.js diff --git a/packages/DOM/src/StylePropertyMap.res b/packages/DOM/src/StylePropertyMap.res new file mode 100644 index 00000000..3dbde3f9 --- /dev/null +++ b/packages/DOM/src/StylePropertyMap.res @@ -0,0 +1,54 @@ +external asStylePropertyMapReadOnly: Types.stylePropertyMap => Types.stylePropertyMapReadOnly = + "%identity" +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll) +*/ +@send +external getAll: (Types.stylePropertyMap, string) => array = "getAll" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has) +*/ +@send +external has: (Types.stylePropertyMap, string) => bool = "has" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/set) +*/ +@send +external set: ( + Types.stylePropertyMap, + ~property: string, + ~values: Prelude.Types.cssStyleValue, +) => unit = "set" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/set) +*/ +@send +external set2: (Types.stylePropertyMap, ~property: string, ~values: string) => unit = "set" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/append) +*/ +@send +external append: (Types.stylePropertyMap, ~property: string, ~values: Types.cssStyleValue) => unit = + "append" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/append) +*/ +@send +external append2: (Types.stylePropertyMap, ~property: string, ~values: string) => unit = "append" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/delete) +*/ +@send +external delete: (Types.stylePropertyMap, string) => unit = "delete" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/clear) +*/ +@send +external clear: Types.stylePropertyMap => unit = "clear" diff --git a/src/DOMAPI/StylePropertyMapReadOnly.js b/packages/DOM/src/StylePropertyMapReadOnly.js similarity index 100% rename from src/DOMAPI/StylePropertyMapReadOnly.js rename to packages/DOM/src/StylePropertyMapReadOnly.js diff --git a/src/DOMAPI/StylePropertyMapReadOnly.res b/packages/DOM/src/StylePropertyMapReadOnly.res similarity index 55% rename from src/DOMAPI/StylePropertyMapReadOnly.res rename to packages/DOM/src/StylePropertyMapReadOnly.res index a228314a..611edd27 100644 --- a/src/DOMAPI/StylePropertyMapReadOnly.res +++ b/packages/DOM/src/StylePropertyMapReadOnly.res @@ -1,13 +1,11 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll) */ @send -external getAll: (stylePropertyMapReadOnly, string) => array = "getAll" +external getAll: (Types.stylePropertyMapReadOnly, string) => array = "getAll" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has) */ @send -external has: (stylePropertyMapReadOnly, string) => bool = "has" +external has: (Types.stylePropertyMapReadOnly, string) => bool = "has" diff --git a/src/DOMAPI/StyleSheetList.js b/packages/DOM/src/StyleSheetList.js similarity index 100% rename from src/DOMAPI/StyleSheetList.js rename to packages/DOM/src/StyleSheetList.js diff --git a/src/DOMAPI/StyleSheetList.res b/packages/DOM/src/StyleSheetList.res similarity index 55% rename from src/DOMAPI/StyleSheetList.res rename to packages/DOM/src/StyleSheetList.res index 86e3680d..9d684af0 100644 --- a/src/DOMAPI/StyleSheetList.res +++ b/packages/DOM/src/StyleSheetList.res @@ -1,7 +1,5 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheetList/item) */ @send -external item: (styleSheetList, int) => cssStyleSheet = "item" +external item: (Types.styleSheetList, int) => Types.cssStyleSheet = "item" diff --git a/packages/DOM/src/Text.js b/packages/DOM/src/Text.js new file mode 100644 index 00000000..966c8ebb --- /dev/null +++ b/packages/DOM/src/Text.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as CharacterData$DOM from "./CharacterData.js"; + +CharacterData$DOM.Impl({}); + +/* Not a pure module */ diff --git a/src/DOMAPI/Text.res b/packages/DOM/src/Text.res similarity index 58% rename from src/DOMAPI/Text.res rename to packages/DOM/src/Text.res index 9d0c30da..79f2ab8c 100644 --- a/src/DOMAPI/Text.res +++ b/packages/DOM/src/Text.res @@ -1,16 +1,14 @@ -open DOMAPI - -include CharacterData.Impl({type t = text}) +include CharacterData.Impl({type t = Types.text}) /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Text) */ @new -external make: (~data: string=?) => text = "Text" +external make: (~data: string=?) => Types.text = "Text" /** Splits data at the given offset and returns the remainder as Text node. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Text/splitText) */ @send -external splitText: (text, int) => text = "splitText" +external splitText: (Types.text, int) => Types.text = "splitText" diff --git a/packages/DOM/src/TextTrackList.js b/packages/DOM/src/TextTrackList.js new file mode 100644 index 00000000..d8fc27bc --- /dev/null +++ b/packages/DOM/src/TextTrackList.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as EventTarget$Event from "@rescript-webapi/event/src/EventTarget.js"; + +EventTarget$Event.Impl({}); + +/* Not a pure module */ diff --git a/packages/DOM/src/TextTrackList.res b/packages/DOM/src/TextTrackList.res new file mode 100644 index 00000000..1c80cc93 --- /dev/null +++ b/packages/DOM/src/TextTrackList.res @@ -0,0 +1,7 @@ +include Event.EventTarget.Impl({type t = Types.textTrackList}) + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TextTrackList/getTrackById) +*/ +@send +external getTrackById: (Types.textTrackList, string) => WebVTT.Types.textTrack = "getTrackById" diff --git a/src/DOMAPI/TimeRanges.js b/packages/DOM/src/TimeRanges.js similarity index 100% rename from src/DOMAPI/TimeRanges.js rename to packages/DOM/src/TimeRanges.js diff --git a/src/DOMAPI/TimeRanges.res b/packages/DOM/src/TimeRanges.res similarity index 79% rename from src/DOMAPI/TimeRanges.res rename to packages/DOM/src/TimeRanges.res index d0dbf0b7..6f92754a 100644 --- a/src/DOMAPI/TimeRanges.res +++ b/packages/DOM/src/TimeRanges.res @@ -1,5 +1,3 @@ -open DOMAPI - /** Returns the time for the start of the range with the given index. @@ -7,7 +5,7 @@ Throws an "IndexSizeError" DOMException if the index is out of range. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TimeRanges/start) */ @send -external start: (timeRanges, int) => float = "start" +external start: (Types.timeRanges, int) => float = "start" /** Returns the time for the end of the range with the given index. @@ -16,4 +14,4 @@ Throws an "IndexSizeError" DOMException if the index is out of range. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TimeRanges/end) */ @send -external end: (timeRanges, int) => float = "end" +external end: (Types.timeRanges, int) => float = "end" diff --git a/src/DOMAPI/TreeWalker.js b/packages/DOM/src/TreeWalker.js similarity index 100% rename from src/DOMAPI/TreeWalker.js rename to packages/DOM/src/TreeWalker.js diff --git a/src/DOMAPI/TreeWalker.res b/packages/DOM/src/TreeWalker.res similarity index 58% rename from src/DOMAPI/TreeWalker.res rename to packages/DOM/src/TreeWalker.res index 270d73c6..b09978e7 100644 --- a/src/DOMAPI/TreeWalker.res +++ b/packages/DOM/src/TreeWalker.res @@ -1,43 +1,41 @@ -open DOMAPI - /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TreeWalker/parentNode) */ @send -external parentNode: treeWalker => node = "parentNode" +external parentNode: Prelude.Types.treeWalker => Types.node = "parentNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TreeWalker/firstChild) */ @send -external firstChild: treeWalker => node = "firstChild" +external firstChild: Prelude.Types.treeWalker => Types.node = "firstChild" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TreeWalker/lastChild) */ @send -external lastChild: treeWalker => node = "lastChild" +external lastChild: Types.treeWalker => Types.node = "lastChild" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TreeWalker/previousSibling) */ @send -external previousSibling: treeWalker => node = "previousSibling" +external previousSibling: Types.treeWalker => Types.node = "previousSibling" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TreeWalker/nextSibling) */ @send -external nextSibling: treeWalker => node = "nextSibling" +external nextSibling: Types.treeWalker => Types.node = "nextSibling" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TreeWalker/previousNode) */ @send -external previousNode: treeWalker => node = "previousNode" +external previousNode: Types.treeWalker => Types.node = "previousNode" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TreeWalker/nextNode) */ @send -external nextNode: treeWalker => node = "nextNode" +external nextNode: Types.treeWalker => Types.node = "nextNode" diff --git a/src/DOMAPI/VideoColorSpace.js b/packages/DOM/src/Types.js similarity index 100% rename from src/DOMAPI/VideoColorSpace.js rename to packages/DOM/src/Types.js diff --git a/packages/DOM/src/Types.res b/packages/DOM/src/Types.res new file mode 100644 index 00000000..4c8696c7 --- /dev/null +++ b/packages/DOM/src/Types.res @@ -0,0 +1,2079 @@ +@@warning("-30") + +type domStringList = Prelude.Types.domStringList +type eventTarget = Event.Types.eventTarget +type eventType = Event.Types.eventType +type file = File.Types.file +type blob = File.Types.blob +type fileSystemEntry = FileAndDirectoryEntries.Types.fileSystemEntry +type remotePlayback = RemotePlayback.Types.remotePlayback +type fontFaceSet = CSSFontLoading.Types.fontFaceSet +type structuredSerializeOptions = ChannelMessaging.Types.structuredSerializeOptions + +type htmlElement = Prelude.Types.htmlElement +type mediaError = Prelude.Types.mediaError +type timeRanges = Prelude.Types.timeRanges +type textTrackList = Prelude.Types.textTrackList +type htmlFormElement = Prelude.Types.htmlFormElement +type htmlCollection<'a> = Prelude.Types.htmlCollection<'a> +type element = Prelude.Types.element +type validityState = Prelude.Types.validityState +type document = Prelude.Types.document +type cssStyleSheet = Prelude.Types.cssStyleSheet +type nodeList<'a> = Prelude.Types.nodeList<'a> +type htmlLabelElement = Prelude.Types.htmlLabelElement +type documentFragment = Prelude.Types.documentFragment +type node = Prelude.Types.node +type cssStyleDeclaration = Prelude.Types.cssStyleDeclaration +type domRectReadOnly = Prelude.Types.domRectReadOnly +type shadowRoot = Prelude.Types.shadowRoot +type styleSheet = Prelude.Types.styleSheet +type mediaQueryList = Prelude.Types.mediaQueryList +type domRect = Prelude.Types.domRect +type range = Prelude.Types.range +type documentType = Prelude.Types.documentType +type cssStyleValue = Prelude.Types.cssStyleValue +type treeWalker = Prelude.Types.treeWalker +type selection = Prelude.Types.selection +type abstractRange = Prelude.Types.abstractRange +type htmlOptionsCollection = Prelude.Types.htmlOptionsCollection +type styleSheetList = Prelude.Types.styleSheetList +type elementInternals = Prelude.Types.elementInternals +type nodeFilter = Prelude.Types.nodeFilter +type fileList = Prelude.Types.fileList +type cssRule = Prelude.Types.cssRule +type attr = Prelude.Types.attr +type domRectList = Prelude.Types.domRectList +type htmlFormControlsCollection = Prelude.Types.htmlFormControlsCollection +type domImplementation = Prelude.Types.domImplementation +type nodeIterator = Prelude.Types.nodeIterator +type xmlDocument = Prelude.Types.xmlDocument +type characterData = Prelude.Types.characterData +type text = Prelude.Types.text +type cdataSection = Prelude.Types.cdataSection +type comment = Prelude.Types.comment +type processingInstruction = Prelude.Types.processingInstruction +type caretPosition = Prelude.Types.caretPosition +type htmlTableElement = Prelude.Types.htmlTableElement +type htmlOutputElement = Prelude.Types.htmlOutputElement +type htmlTableCellElement = Prelude.Types.htmlTableCellElement +type htmlHeadElement = Prelude.Types.htmlHeadElement +type htmlSelectElement = Prelude.Types.htmlSelectElement +type htmlButtonElement = Prelude.Types.htmlButtonElement +type htmlTableSectionElement = Prelude.Types.htmlTableSectionElement +type htmlOptionElement = Prelude.Types.htmlOptionElement +type htmlEmbedElement = Prelude.Types.htmlEmbedElement +type htmlTextAreaElement = Prelude.Types.htmlTextAreaElement +type htmlTableCaptionElement = Prelude.Types.htmlTableCaptionElement +type htmlSlotElement = Prelude.Types.htmlSlotElement +type htmlDataListElement = Prelude.Types.htmlDataListElement +type htmlInputElement = Prelude.Types.htmlInputElement +type htmlScriptElement = Prelude.Types.htmlScriptElement +type htmlAnchorElement = Prelude.Types.htmlAnchorElement +type htmlTableRowElement = Prelude.Types.htmlTableRowElement +type htmlImageElement = Prelude.Types.htmlImageElement +type htmlAreaElement = Prelude.Types.htmlAreaElement +type videoPlaybackQuality = Prelude.Types.videoPlaybackQuality +type idleDeadline = Prelude.Types.idleDeadline + +/** +A window containing a DOM document; the document property points to the DOM document loaded in that window. +[See Window on MDN](https://developer.mozilla.org/docs/Web/API/Window) +*/ +@editor.completeFrom(Window) type window = Prelude.Types.window + +type shadowRootMode = + | @as("closed") Closed + | @as("open") Open + +type slotAssignmentMode = + | @as("manual") Manual + | @as("named") Named + +type autoFillBase = + | @as("off") Off + | @as("on") On + +type documentReadyState = + | @as("complete") Complete + | @as("interactive") Interactive + | @as("loading") Loading + +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 insertPosition = + | @as("afterbegin") Afterbegin + | @as("afterend") Afterend + | @as("beforebegin") Beforebegin + | @as("beforeend") Beforeend + +type scrollBehavior = + | @as("auto") Auto + | @as("instant") Instant + | @as("smooth") Smooth + +type fullscreenNavigationUI = + | @as("auto") Auto + | @as("hide") Hide + | @as("show") Show + +type remotePlaybackState = + | @as("connected") Connected + | @as("connecting") Connecting + | @as("disconnected") Disconnected + +type referrerPolicy = + | @as("no-referrer") NoReferrer + | @as("no-referrer-when-downgrade") NoReferrerWhenDowngrade + | @as("origin") Origin + | @as("origin-when-cross-origin") OriginWhenCrossOrigin + | @as("same-origin") SameOrigin + | @as("strict-origin") StrictOrigin + | @as("strict-origin-when-cross-origin") StrictOriginWhenCrossOrigin + | @as("unsafe-url") UnsafeUrl + +type canPlayTypeResult = + | @as("maybe") Maybe + | @as("probably") Probably + +type animationPlayState = + | @as("finished") Finished + | @as("idle") Idle + | @as("paused") Paused + | @as("running") Running + +type animationReplaceState = + | @as("active") Active + | @as("persisted") Persisted + | @as("removed") Removed + +type fillMode = + | @as("auto") Auto + | @as("backwards") Backwards + | @as("both") Both + | @as("forwards") Forwards + | @as("none") None + +type playbackDirection = + | @as("alternate") Alternate + | @as("alternate-reverse") AlternateReverse + | @as("normal") Normal + | @as("reverse") Reverse + +type imageOrientation = + | @as("flipY") FlipY + | @as("from-image") FromImage + | @as("none") None + +type premultiplyAlpha = + | @as("default") Default + | @as("none") None + | @as("premultiply") Premultiply + +type colorSpaceConversion = + | @as("default") Default + | @as("none") None + +type resizeQuality = + | @as("high") High + | @as("low") Low + | @as("medium") Medium + | @as("pixelated") Pixelated + +type scrollLogicalPosition = + | @as("center") Center + | @as("end") End + | @as("nearest") Nearest + | @as("start") Start + +type selectionMode = + | @as("end") End + | @as("preserve") Preserve + | @as("select") Select + | @as("start") Start + +type compositeOperation = + | @as("accumulate") Accumulate + | @as("add") Add + | @as("replace") Replace + +type iterationCompositeOperation = + | @as("accumulate") Accumulate + | @as("replace") Replace + +type videoPixelFormat = + | BGRA + | BGRX + | I420 + | I420A + | I422 + | I444 + | NV12 + | RGBA + | RGBX + +type videoColorPrimaries = + | @as("bt470bg") Bt470bg + | @as("bt709") Bt709 + | @as("smpte170m") Smpte170m + +type videoTransferCharacteristics = + | @as("bt709") Bt709 + | @as("iec61966-2-1") Iec6196621 + | @as("smpte170m") Smpte170m + +type videoMatrixCoefficients = + | @as("bt470bg") Bt470bg + | @as("bt709") Bt709 + | @as("rgb") Rgb + | @as("smpte170m") Smpte170m + +type alphaOption = + | @as("discard") Discard + | @as("keep") Keep + +type predefinedColorSpace = + | @as("display-p3") DisplayP3 + | @as("srgb") Srgb + +type shareData = { + mutable files?: array, + mutable title?: string, + mutable text?: string, + mutable url?: string, +} + +/** +@editor.completeFrom(Window) The location (URL) 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) +*/ +@editor.completeFrom(Location) +type location = Prelude.Types.location = {...Prelude.Types.location} + +/** +[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(Navigator) +type navigator = Prelude.Types.navigator + +@editor.completeFrom(DOMTokenList) +type domTokenList = { + /** + Returns the number of tokens. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/length) + */ + length: int, + /** + Returns the associated set as string. + +Can be set, to change the associated attribute. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMTokenList/value) + */ + mutable value: string, +} + +/** +A collection of Attr objects. Objects inside a NamedNodeMap are not in any particular order, unlike NodeList, although they may be accessed by an index as in an array. +[See NamedNodeMap on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap) +*/ +@editor.completeFrom(NamedNodeMap) +type namedNodeMap = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/NamedNodeMap/length) + */ + length: int, +} + +/** +[See FragmentDirective on MDN](https://developer.mozilla.org/docs/Web/API/FragmentDirective) +*/ +type fragmentDirective = {} + +/** +[See CustomElementRegistry on MDN](https://developer.mozilla.org/docs/Web/API/CustomElementRegistry) +*/ +@editor.completeFrom(CustomElementRegistry) +type customElementRegistry = {} + +/** +[See BarProp on MDN](https://developer.mozilla.org/docs/Web/API/BarProp) +*/ +type barProp = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/BarProp/visible) + */ + visible: bool, +} + +/** +[See ScreenOrientation on MDN](https://developer.mozilla.org/docs/Web/API/ScreenOrientation) +*/ +@editor.completeFrom(ScreenOrientation) +type screenOrientation = { + ...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, +} + +/** +A screen, usually the one on which the current window is being rendered, and is obtained using window.screen. +[See Screen on MDN](https://developer.mozilla.org/docs/Web/API/Screen) +*/ +type screen = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Screen/availWidth) + */ + availWidth: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Screen/availHeight) + */ + availHeight: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Screen/width) + */ + width: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Screen/height) + */ + height: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Screen/colorDepth) + */ + colorDepth: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Screen/pixelDepth) + */ + pixelDepth: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Screen/orientation) + */ + orientation: screenOrientation, +} + +@unboxed +type vibratePattern = + | Int(int) + | IntArray(array) + +type renderingContext = unknown + +type offscreenRenderingContext = unknown + +/** +[See AnimationTimeline on MDN](https://developer.mozilla.org/docs/Web/API/AnimationTimeline) +*/ +@editor.completeFrom(Animation) +type rec animationTimeline = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime) + */ + currentTime: Null.t, +} + +/** +[See DocumentTimeline on MDN](https://developer.mozilla.org/docs/Web/API/DocumentTimeline) +*/ +@editor.completeFrom(DocumentTimeline) and documentTimeline = { + // Base properties from AnimationTimeline + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/AnimationTimeline/currentTime) + */ + currentTime: Null.t, + // End base properties from AnimationTimeline +} + +/** +[See MediaList on MDN](https://developer.mozilla.org/docs/Web/API/MediaList) +*/ +@editor.completeFrom(MediaList) +type mediaList = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/mediaText) + */ + mutable mediaText: string, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/length) + */ + length: int, +} + +/** +[See StylePropertyMapReadOnly on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly) +*/ +@editor.completeFrom(StylePropertyMapReadOnly) +type stylePropertyMapReadOnly = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/size) + */ + size: int, +} + +/** +[See StylePropertyMap on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap) +*/ +@editor.completeFrom(StylePropertyMap) +type stylePropertyMap = { + ...stylePropertyMapReadOnly, +} + +/** +Used by the dataset HTML attribute to represent data for custom attributes added to elements. +[See DOMStringMap on MDN](https://developer.mozilla.org/docs/Web/API/DOMStringMap) +*/ +type domStringMap = {} + +type mediaProvider = unknown + +/** +Adds to HTMLElement the properties and methods needed to support basic media-related capabilities that are common to audio and video. +[See HTMLMediaElement on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement) +*/ +@editor.completeFrom(HTMLMediaElement) +type htmlMediaElement = { + ...htmlElement, + /** + Returns an object representing the current error state of the audio or video element. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/error) + */ + error: Null.t, + /** + The address or URL of the a media resource that is to be considered. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/src) + */ + mutable src: string, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/srcObject) + */ + mutable srcObject: Null.t, + /** + Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/currentSrc) + */ + currentSrc: string, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/crossOrigin) + */ + mutable crossOrigin: Null.t, + /** + Gets the current network activity for the element. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/networkState) + */ + networkState: int, + /** + Gets or sets a value indicating what data should be preloaded, if any. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/preload) + */ + mutable preload: string, + /** + Gets a collection of buffered time ranges. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/buffered) + */ + buffered: timeRanges, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/readyState) + */ + readyState: int, + /** + Gets or sets the current playback position, in seconds. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/currentTime) + */ + mutable currentTime: float, + /** + Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/duration) + */ + duration: float, + /** + Gets a flag that specifies whether playback is paused. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/paused) + */ + paused: bool, + /** + Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/defaultPlaybackRate) + */ + mutable defaultPlaybackRate: float, + /** + Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/playbackRate) + */ + mutable playbackRate: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/preservesPitch) + */ + mutable preservesPitch: bool, + /** + Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/seekable) + */ + seekable: timeRanges, + /** + Gets information about whether the playback has ended or not. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/ended) + */ + ended: bool, + /** + Gets or sets a value that indicates whether to start playing the media automatically. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/autoplay) + */ + mutable autoplay: bool, + /** + Gets or sets a flag to specify whether playback should restart after it completes. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/loop) + */ + mutable loop: bool, + /** + Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/controls) + */ + mutable controls: bool, + /** + Gets or sets the volume level for audio portions of the media element. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/volume) + */ + mutable volume: float, + /** + Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/muted) + */ + mutable muted: bool, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/defaultMuted) + */ + mutable defaultMuted: bool, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/textTracks) + */ + textTracks: textTrackList, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/sinkId) + */ + sinkId: string, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/remote) + */ + remote: remotePlayback, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMediaElement/disableRemotePlayback) + */ + mutable disableRemotePlayback: bool, +} + +/** +Provides access to the properties of