Skip to content

Commit cf878fa

Browse files
authored
Merge pull request #220 from Freddy03h/nodelistof-htmlcollectionof
Remove nodeListOf and htmlCollectionOf
2 parents e9e0d90 + 10fbef1 commit cf878fa

File tree

10 files changed

+62
-108
lines changed

10 files changed

+62
-108
lines changed

src/DOMAPI.res

Lines changed: 47 additions & 67 deletions
Large diffs are not rendered by default.

src/DOMAPI/Document.res

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Returns all element descendants of node that match selectors.
8989
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll)
9090
*/
9191
@send
92-
external querySelectorAll: (document, string) => nodeList = "querySelectorAll"
92+
external querySelectorAll: (document, string) => nodeList<element> = "querySelectorAll"
9393

9494
/**
9595
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/createExpression)
@@ -120,7 +120,8 @@ Retrieves a collection of objects based on the specified element name.
120120
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementsByTagName)
121121
*/
122122
@send
123-
external getElementsByTagName: (document, string) => htmlCollection = "getElementsByTagName"
123+
external getElementsByTagName: (document, string) => htmlCollection<element> =
124+
"getElementsByTagName"
124125

125126
/**
126127
If namespace and localName are "*" returns a HTMLCollection of all descendant elements.
@@ -137,14 +138,14 @@ external getElementsByTagNameNS: (
137138
document,
138139
~namespace: string,
139140
~localName: string,
140-
) => htmlCollectionOf<element> = "getElementsByTagNameNS"
141+
) => htmlCollection<element> = "getElementsByTagNameNS"
141142

142143
/**
143144
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.
144145
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementsByClassName)
145146
*/
146147
@send
147-
external getElementsByClassName: (document, string) => htmlCollectionOf<element> =
148+
external getElementsByClassName: (document, string) => htmlCollection<element> =
148149
"getElementsByClassName"
149150

150151
/**
@@ -371,7 +372,7 @@ Gets a collection of objects based on the value of the NAME or ID attribute.
371372
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementsByName)
372373
*/
373374
@send
374-
external getElementsByName: (document, string) => nodeListOf<htmlElement> = "getElementsByName"
375+
external getElementsByName: (document, string) => nodeList<htmlElement> = "getElementsByName"
375376

376377
/**
377378
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.

src/DOMAPI/DocumentFragment.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Returns all element descendants of node that match selectors.
7070
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelectorAll)
7171
*/
7272
@send
73-
external querySelectorAll: (T.t, string) => nodeList = "querySelectorAll"
73+
external querySelectorAll: (T.t, string) => nodeList<element> = "querySelectorAll"
7474

7575
/**
7676
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.

src/DOMAPI/Element.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ Returns a HTMLCollection of the elements in the object on which the method was i
162162
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByClassName)
163163
*/
164164
@send
165-
external getElementsByClassName: (T.t, string) => htmlCollectionOf<element> =
165+
external getElementsByClassName: (T.t, string) => htmlCollection<element> =
166166
"getElementsByClassName"
167167

168168
/**
169169
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getElementsByTagName)
170170
*/
171171
@send
172-
external getElementsByTagName: (T.t, string) => htmlCollection = "getElementsByTagName"
172+
external getElementsByTagName: (T.t, string) => htmlCollection<element> = "getElementsByTagName"
173173

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

184184
/**
185185
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/getHTML)
@@ -272,7 +272,7 @@ Returns all element descendants of node that match selectors.
272272
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll)
273273
*/
274274
@send
275-
external querySelectorAll: (T.t, string) => nodeList = "querySelectorAll"
275+
external querySelectorAll: (T.t, string) => nodeList<element> = "querySelectorAll"
276276

277277
/**
278278
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/releasePointerCapture)

src/DOMAPI/HTMLCollection.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Retrieves an object from various collections.
55
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item)
66
*/
77
@send
8-
external item: (htmlCollection, int) => element = "item"
8+
external item: (htmlCollection<'t>, int) => 't = "item"
99

1010
/**
1111
Retrieves a select object or an object from an options collection.
1212
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/namedItem)
1313
*/
1414
@send
15-
external namedItem: (htmlCollection, string) => element = "namedItem"
15+
external namedItem: (htmlCollection<'t>, string) => 't = "namedItem"

src/DOMAPI/HTMLCollectionOf.res

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/DOMAPI/HTMLFormControlsCollection.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
open DOMAPI
22

3-
external asHTMLCollection: htmlFormControlsCollection => htmlCollection = "%identity"
3+
external asHTMLCollection: htmlFormControlsCollection => htmlCollection<element> = "%identity"
44
/**
55
Retrieves an object from various collections.
66
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/item)

src/DOMAPI/NodeList.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Returns the node with index index from the collection. The nodes are sorted in t
55
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeList/item)
66
*/
77
@send
8-
external item: (nodeList, int) => node = "item"
8+
external item: (nodeList<'tNode>, int) => 'tNode = "item"

src/DOMAPI/NodeListOf.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/DOMAPI/NodeListOf.res

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)