Skip to content

Commit

Permalink
Update formating with 3.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Jun 30, 2023
1 parent 44b1210 commit a621f41
Show file tree
Hide file tree
Showing 24 changed files with 70 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] external data: T.t => string = "data";
[@bs.get] external length: T.t => int = "length";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* Mixin */
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.send.pipe: T.t] external remove: unit = "remove";
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
external asDocument: T.t => Dom.document = "%identity";

let asHtmlDocument: T.t => option(Dom.htmlDocument) = [%raw
Expand Down Expand Up @@ -164,7 +166,7 @@ include Webapi__Dom__EventTarget.Impl({
include Webapi__Dom__NonElementParentNode.Impl({
type nonrec t = t;
});
include Webapi__Dom__DocumentOrShadowRoot.Impl({});
include Webapi__Dom__DocumentOrShadowRoot.Impl();
include Webapi__Dom__ParentNode.Impl({
type nonrec t = t;
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* Mixin */
module Impl = (T: {}) => {
/* TODO: Implemented in Shadow DOM spec */
};
/* TODO: Implemented in Shadow DOM spec */
module Impl = (T: {}) => {};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ let ofNode = (node: Dom.node): option('a) =>
Webapi__Dom__Node.nodeType(node) == Webapi__Dom__Types.Element
? Some(Obj.magic(node)) : None;

module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
let asHtmlElement: T.t => option(Dom.htmlElement) = [%raw
{|
function(element) {
Expand Down
4 changes: 3 additions & 1 deletion packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Event.re
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] external bubbles: T.t => bool = "bubbles";
[@bs.get] external cancelable: T.t => bool = "cancelable";
[@bs.get] external composed: T.t => bool = "composed";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
external asEventTarget: T.t => Dom.eventTarget = "%identity";

[@bs.send.pipe: T.t]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Mixin */
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.send.pipe: T.t]
external addSelectionChangeEventListener:
([@bs.as "selectionchange"] _, Dom.focusEvent => unit) => unit =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
type t_htmlDocument = T.t;

[@bs.get] [@bs.return nullable]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
type t_htmlElement = T.t;

let ofElement = Webapi__Dom__Element.asHtmlElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* MDN: https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement
*/

module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
type t_htmlFormElement = T.t;

/* TODO: elements: HTMLFormControlsCollection */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
* MDN: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement
*/

module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
type t_htmlInputElement = T.t;

[@bs.get] [@bs.return nullable]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] external altKey: T.t => bool = "altKey";
[@bs.get] external button: T.t => int = "button";
[@bs.get] external buttons: T.t => int /* bitmask */ = "buttons";
Expand Down
4 changes: 3 additions & 1 deletion packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Node.re
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
external asNode: T.t => Dom.node = "%identity";

/* baseURI */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Mixin */
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] [@bs.return nullable]
external previousElementSibling: T.t => option(Dom.element) =
"previousElementSibling";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Mixin */
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.send.pipe: T.t] [@bs.return nullable]
external getElementById: string => option(Dom.element) = "getElementById";
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Mixin */
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] external children: T.t => Dom.htmlCollection = "children";
[@bs.get] [@bs.return nullable]
external firstElementChild: T.t => option(Dom.element) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include Webapi__Dom__EventTarget.Impl({
include Webapi__Dom__NonElementParentNode.Impl({
type nonrec t = t;
});
include Webapi__Dom__DocumentOrShadowRoot.Impl({});
include Webapi__Dom__DocumentOrShadowRoot.Impl();
include Webapi__Dom__ParentNode.Impl({
type nonrec t = t;
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Mixin */
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] [@bs.return nullable]
external assignedSlot: T.t => option(Dom.htmlSlotElement) = "assignedSlot";
};
4 changes: 3 additions & 1 deletion packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Text.re
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ let ofNode = (node: Dom.node): option('a) =>
Webapi__Dom__Node.nodeType(node) == Webapi__Dom__Types.Text
? Some(Obj.magic(node)) : None;

module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
let ofNode: Dom.node => option(T.t) = ofNode;

[@bs.send.pipe: T.t]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
type touchList; /* TODO, Touch Events */

module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] external altKey: T.t => bool = "altKey";
[@bs.get] external changedTouches: T.t => touchList = "changedTouches";
[@bs.get] external ctrlKey: T.t => bool = "ctrlKey";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
[@bs.get] external detail: T.t => int = "detail";
[@bs.get] external view: T.t => Dom.window = "view"; /* technically returns a `WindowProxy` */
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ type transferable;

type idleCallbackId; /* used by requestIdleCallback and cancelIdleCallback */

module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
type t_window = T.t;

/* A lot of this isn't really "dom", but rather global exports */
Expand Down
4 changes: 3 additions & 1 deletion packages/melange-webapi/src/Webapi/Webapi__Blob.re
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Impl = (T: {type t;}) => {
module Impl = (T: {
type t;
}) => {
/* [@bs.send] external arrayBuffer: T.t => Js.Promise.t(Js.Typed_array.ArrayBuffer.t) =
"arrayBuffer"; */

Expand Down

0 comments on commit a621f41

Please sign in to comment.