Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 47 additions & 67 deletions src/DOMAPI.res

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions src/DOMAPI/Document.res
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ 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: (document, string) => nodeList<element> = "querySelectorAll"

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createExpression)
Expand Down Expand Up @@ -120,7 +120,8 @@ 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 = "getElementsByTagName"
external getElementsByTagName: (document, string) => htmlCollection<element> =
"getElementsByTagName"

/**
If namespace and localName are "*" returns a HTMLCollection of all descendant elements.
Expand All @@ -137,14 +138,14 @@ external getElementsByTagNameNS: (
document,
~namespace: string,
~localName: string,
) => htmlCollectionOf<element> = "getElementsByTagNameNS"
) => htmlCollection<element> = "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) => htmlCollectionOf<element> =
external getElementsByClassName: (document, string) => htmlCollection<element> =
"getElementsByClassName"

/**
Expand Down Expand Up @@ -371,7 +372,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) => nodeListOf<htmlElement> = "getElementsByName"
external getElementsByName: (document, string) => nodeList<htmlElement> = "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.
Expand Down
2 changes: 1 addition & 1 deletion src/DOMAPI/DocumentFragment.res
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ 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) => nodeList<element> = "querySelectorAll"

/**
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Expand Down
8 changes: 4 additions & 4 deletions src/DOMAPI/Element.res
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ Returns a HTMLCollection of the elements in the object on which the method was i
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName)
*/
@send
external getElementsByClassName: (T.t, string) => htmlCollectionOf<element> =
external getElementsByClassName: (T.t, string) => htmlCollection<element> =
"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) => htmlCollection<element> = "getElementsByTagName"

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagNameNS)
Expand All @@ -179,7 +179,7 @@ Returns a HTMLCollection of the elements in the object on which the method was i
element,
~namespace: string,
~localName: string,
) => htmlCollectionOf<element> = "getElementsByTagNameNS"
) => htmlCollection<element> = "getElementsByTagNameNS"

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML)
Expand Down Expand Up @@ -272,7 +272,7 @@ 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) => nodeList<element> = "querySelectorAll"

/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture)
Expand Down
4 changes: 2 additions & 2 deletions src/DOMAPI/HTMLCollection.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Retrieves an object from various collections.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item)
*/
@send
external item: (htmlCollection, int) => element = "item"
external item: (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, string) => element = "namedItem"
external namedItem: (htmlCollection<'t>, string) => 't = "namedItem"
16 changes: 0 additions & 16 deletions src/DOMAPI/HTMLCollectionOf.res

This file was deleted.

2 changes: 1 addition & 1 deletion src/DOMAPI/HTMLFormControlsCollection.res
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open DOMAPI

external asHTMLCollection: htmlFormControlsCollection => htmlCollection = "%identity"
external asHTMLCollection: htmlFormControlsCollection => htmlCollection<element> = "%identity"
/**
Retrieves an object from various collections.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item)
Expand Down
2 changes: 1 addition & 1 deletion src/DOMAPI/NodeList.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Returns the node with index index from the collection. The nodes are sorted in t
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeList/item)
*/
@send
external item: (nodeList, int) => node = "item"
external item: (nodeList<'tNode>, int) => 'tNode = "item"
2 changes: 0 additions & 2 deletions src/DOMAPI/NodeListOf.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/DOMAPI/NodeListOf.res

This file was deleted.