diff --git a/src/CredentialManagementAPI/CredentialsContainer.res b/src/CredentialManagementAPI/CredentialsContainer.res index f5b7bba..32fc0c3 100644 --- a/src/CredentialManagementAPI/CredentialsContainer.res +++ b/src/CredentialManagementAPI/CredentialsContainer.res @@ -4,10 +4,8 @@ open CredentialManagementAPI [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get) */ @send -external get: ( - credentialsContainer, - ~options: credentialRequestOptions=?, -) => promise = "get" +external get: (credentialsContainer, ~options: credentialRequestOptions=?) => promise = + "get" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store) diff --git a/src/EncryptedMediaExtensionsAPI/MediaKeys.res b/src/EncryptedMediaExtensionsAPI/MediaKeys.res index 1a9a4a4..a77ddf1 100644 --- a/src/EncryptedMediaExtensionsAPI/MediaKeys.res +++ b/src/EncryptedMediaExtensionsAPI/MediaKeys.res @@ -24,5 +24,4 @@ external setServerCertificate: (mediaKeys, DataView.t) => promise = "setSe [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaKeys/setServerCertificate) */ @send -external setServerCertificate2: (mediaKeys, ArrayBuffer.t) => promise = - "setServerCertificate" +external setServerCertificate2: (mediaKeys, ArrayBuffer.t) => promise = "setServerCertificate" diff --git a/src/FileAPI/FileSystemDirectoryHandle.res b/src/FileAPI/FileSystemDirectoryHandle.res index 37fed09..a7ffa2a 100644 --- a/src/FileAPI/FileSystemDirectoryHandle.res +++ b/src/FileAPI/FileSystemDirectoryHandle.res @@ -5,8 +5,7 @@ external asFileSystemHandle: fileSystemDirectoryHandle => fileSystemHandle = "%i [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/isSameEntry) */ @send -external isSameEntry: (fileSystemDirectoryHandle, fileSystemHandle) => promise = - "isSameEntry" +external isSameEntry: (fileSystemDirectoryHandle, fileSystemHandle) => promise = "isSameEntry" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getFileHandle) diff --git a/src/UIEventsAPI.res b/src/UIEventsAPI.res index 2c43f58..71e490c 100644 --- a/src/UIEventsAPI.res +++ b/src/UIEventsAPI.res @@ -3,6 +3,10 @@ open EventAPI open DOMAPI +type touchType = + | @as("direct") Direct + | @as("stylus") Stylus + /** Simple user interface events. [See UIEvent on MDN](https://developer.mozilla.org/docs/Web/API/UIEvent) @@ -296,6 +300,164 @@ type wheelEvent = { deltaMode: int, } +/** +A single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad. +[See Touch on MDN](https://developer.mozilla.org/docs/Web/API/Touch) +*/ +type touch = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/identifier) + */ + identifier: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/target) + */ + target: eventTarget, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/screenX) + */ + screenX: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/screenY) + */ + screenY: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/clientX) + */ + clientX: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/clientY) + */ + clientY: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/pageX) + */ + pageX: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/pageY) + */ + pageY: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/radiusX) + */ + radiusX: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/radiusY) + */ + radiusY: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/rotationAngle) + */ + rotationAngle: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/force) + */ + force: float, +} + +/** +A list of contact points on a touch surface. For example, if the user has three fingers on the touch surface (such as a screen or trackpad), the corresponding TouchList object would have one Touch object for each finger, for a total of three entries. +[See TouchList on MDN](https://developer.mozilla.org/docs/Web/API/TouchList) +*/ +type touchList = { + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchList/length) + */ + length: int, +} + +/** +An event sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. +[See TouchEvent on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent) +*/ +type touchEvent = { + ...uiEvent, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/touches) + */ + touches: touchList, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/targetTouches) + */ + targetTouches: touchList, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/changedTouches) + */ + changedTouches: touchList, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/altKey) + */ + altKey: bool, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/metaKey) + */ + metaKey: bool, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/ctrlKey) + */ + ctrlKey: bool, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/shiftKey) + */ + shiftKey: bool, +} + +/** +The state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc. +[See PointerEvent on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent) +*/ +type pointerEvent = { + ...mouseEvent, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/pointerId) + */ + pointerId: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/width) + */ + width: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/height) + */ + height: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/pressure) + */ + pressure: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/tangentialPressure) + */ + tangentialPressure: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/tiltX) + */ + tiltX: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/tiltY) + */ + tiltY: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/twist) + */ + twist: int, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/altitudeAngle) + */ + altitudeAngle: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/azimuthAngle) + */ + azimuthAngle: float, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/pointerType) + */ + pointerType: string, + /** + [Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/isPrimary) + */ + isPrimary: bool, +} + type uiEventInit = { ...eventInit, mutable view?: Null.t, @@ -371,3 +533,46 @@ type inputEventInit = { mutable dataTransfer?: Null.t, mutable targetRanges?: array, } + +type touchInit = { + mutable identifier: int, + mutable target: eventTarget, + mutable clientX?: float, + mutable clientY?: float, + mutable screenX?: float, + mutable screenY?: float, + mutable pageX?: float, + mutable pageY?: float, + mutable radiusX?: float, + mutable radiusY?: float, + mutable rotationAngle?: float, + mutable force?: float, + mutable altitudeAngle?: float, + mutable azimuthAngle?: float, + mutable touchType?: touchType, +} + +type pointerEventInit = { + ...mouseEventInit, + mutable pointerId?: int, + mutable width?: float, + mutable height?: float, + mutable pressure?: float, + mutable tangentialPressure?: float, + mutable tiltX?: int, + mutable tiltY?: int, + mutable twist?: int, + mutable altitudeAngle?: float, + mutable azimuthAngle?: float, + mutable pointerType?: string, + mutable isPrimary?: bool, + mutable coalescedEvents?: array, + mutable predictedEvents?: array, +} + +type touchEventInit = { + ...eventModifierInit, + mutable touches?: array, + mutable targetTouches?: array, + mutable changedTouches?: array, +} diff --git a/src/UIEventsAPI/PointerEvent.js b/src/UIEventsAPI/PointerEvent.js new file mode 100644 index 0000000..3b36f96 --- /dev/null +++ b/src/UIEventsAPI/PointerEvent.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as MouseEvent$WebAPI from "./MouseEvent.js"; + +MouseEvent$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/UIEventsAPI/PointerEvent.res b/src/UIEventsAPI/PointerEvent.res new file mode 100644 index 0000000..9c319d1 --- /dev/null +++ b/src/UIEventsAPI/PointerEvent.res @@ -0,0 +1,23 @@ +open UIEventsAPI + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent) +*/ +@new +external make: (~type_: string, ~eventInitDict: pointerEventInit=?) => pointerEvent = "PointerEvent" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/getCoalescedEvents) +*/ +@send +external getCoalescedEvents: pointerEvent => array = "getCoalescedEvents" + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/getPredictedEvents) +*/ +@send +external getPredictedEvents: pointerEvent => array = "getPredictedEvents" + +include MouseEvent.Impl({ + type t = pointerEvent +}) diff --git a/src/UIEventsAPI/Touch.js b/src/UIEventsAPI/Touch.js new file mode 100644 index 0000000..d856702 --- /dev/null +++ b/src/UIEventsAPI/Touch.js @@ -0,0 +1,2 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/src/UIEventsAPI/Touch.res b/src/UIEventsAPI/Touch.res new file mode 100644 index 0000000..4b75f5e --- /dev/null +++ b/src/UIEventsAPI/Touch.res @@ -0,0 +1,7 @@ +open UIEventsAPI + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch) +*/ +@new +external make: touchInit => touch = "Touch" diff --git a/src/UIEventsAPI/TouchEvent.js b/src/UIEventsAPI/TouchEvent.js new file mode 100644 index 0000000..4d4d54b --- /dev/null +++ b/src/UIEventsAPI/TouchEvent.js @@ -0,0 +1,7 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as UIEvent$WebAPI from "./UIEvent.js"; + +UIEvent$WebAPI.Impl({}); + +/* Not a pure module */ diff --git a/src/UIEventsAPI/TouchEvent.res b/src/UIEventsAPI/TouchEvent.res new file mode 100644 index 0000000..8404376 --- /dev/null +++ b/src/UIEventsAPI/TouchEvent.res @@ -0,0 +1,11 @@ +open UIEventsAPI + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent) +*/ +@new +external make: (~type_: string, ~eventInitDict: touchEventInit=?) => touchEvent = "TouchEvent" + +include UIEvent.Impl({ + type t = touchEvent +}) diff --git a/src/UIEventsAPI/TouchList.js b/src/UIEventsAPI/TouchList.js new file mode 100644 index 0000000..d856702 --- /dev/null +++ b/src/UIEventsAPI/TouchList.js @@ -0,0 +1,2 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/src/UIEventsAPI/TouchList.res b/src/UIEventsAPI/TouchList.res new file mode 100644 index 0000000..318da92 --- /dev/null +++ b/src/UIEventsAPI/TouchList.res @@ -0,0 +1,7 @@ +open UIEventsAPI + +/** +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchList/item) +*/ +@send +external item: (touchList, int) => touch = "item" diff --git a/src/WebLocksAPI/LockManager.res b/src/WebLocksAPI/LockManager.res index 6c89bb2..5db3ae3 100644 --- a/src/WebLocksAPI/LockManager.res +++ b/src/WebLocksAPI/LockManager.res @@ -5,11 +5,8 @@ open WebLocksAPI [Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request) */ @send -external request: ( - lockManager, - ~name: string, - ~callback: lockGrantedCallback, -) => promise = "request" +external request: (lockManager, ~name: string, ~callback: lockGrantedCallback) => promise = + "request" /** [Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)