Skip to content

Commit 10fbef1

Browse files
committed
remove nodeListOf
1 parent 2cadbcd commit 10fbef1

File tree

7 files changed

+33
-54
lines changed

7 files changed

+33
-54
lines changed

src/DOMAPI.res

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,7 +2433,7 @@ type rec node = {
24332433
Returns the children.
24342434
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
24352435
*/
2436-
childNodes: nodeListOf<node>,
2436+
childNodes: nodeList<node>,
24372437
/**
24382438
Returns the first child.
24392439
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -2468,24 +2468,14 @@ type rec node = {
24682468
NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll().
24692469
[See NodeList on MDN](https://developer.mozilla.org/docs/Web/API/NodeList)
24702470
*/
2471-
@editor.completeFrom(NodeList) and nodeList = {
2471+
@editor.completeFrom(NodeList) and nodeList<'tNode> = {
24722472
/**
24732473
Returns the number of nodes in the collection.
24742474
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeList/length)
24752475
*/
24762476
length: int,
24772477
}
24782478

2479-
and nodeListOf<'tNode> = {
2480-
// Base properties from NodeList
2481-
/**
2482-
Returns the number of nodes in the collection.
2483-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/NodeList/length)
2484-
*/
2485-
length: int,
2486-
// End base properties from NodeList
2487-
}
2488-
24892479
/**
24902480
Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element.
24912481
[See Element on MDN](https://developer.mozilla.org/docs/Web/API/Element)
@@ -2531,7 +2521,7 @@ Element is the most general base class from which all objects in a Document inhe
25312521
Returns the children.
25322522
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
25332523
*/
2534-
childNodes: nodeListOf<node>,
2524+
childNodes: nodeList<node>,
25352525
/**
25362526
Returns the first child.
25372527
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -2905,7 +2895,7 @@ Element is the most general base class from which all objects in a Document inhe
29052895
Returns the children.
29062896
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
29072897
*/
2908-
childNodes: nodeListOf<node>,
2898+
childNodes: nodeList<node>,
29092899
/**
29102900
Returns the first child.
29112901
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -3168,7 +3158,7 @@ Any HTML element. Some elements directly implement this interface, while others
31683158
Returns the children.
31693159
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
31703160
*/
3171-
childNodes: nodeListOf<node>,
3161+
childNodes: nodeList<node>,
31723162
/**
31733163
Returns the first child.
31743164
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -3541,7 +3531,7 @@ Contains the descriptive information, or metadata, for a document. This object i
35413531
Returns the children.
35423532
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
35433533
*/
3544-
childNodes: nodeListOf<node>,
3534+
childNodes: nodeList<node>,
35453535
/**
35463536
Returns the first child.
35473537
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -3797,7 +3787,7 @@ A <form> element in the DOM; it allows access to and in some cases modification
37973787
Returns the children.
37983788
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
37993789
*/
3800-
childNodes: nodeListOf<node>,
3790+
childNodes: nodeList<node>,
38013791
/**
38023792
Returns the first child.
38033793
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -4104,7 +4094,7 @@ Provides special properties and methods for manipulating <img> elements.
41044094
Returns the children.
41054095
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
41064096
*/
4107-
childNodes: nodeListOf<node>,
4097+
childNodes: nodeList<node>,
41084098
/**
41094099
Returns the first child.
41104100
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -4447,7 +4437,7 @@ Provides special properties (beyond the regular HTMLElement interface it also ha
44474437
Returns the children.
44484438
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
44494439
*/
4450-
childNodes: nodeListOf<node>,
4440+
childNodes: nodeList<node>,
44514441
/**
44524442
Returns the first child.
44534443
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -4719,7 +4709,7 @@ Hyperlink elements and provides special properties and methods (beyond those of
47194709
Returns the children.
47204710
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
47214711
*/
4722-
childNodes: nodeListOf<node>,
4712+
childNodes: nodeList<node>,
47234713
/**
47244714
Returns the first child.
47254715
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -5092,7 +5082,7 @@ Provides special properties and methods (beyond those of the regular object HTML
50925082
Returns the children.
50935083
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
50945084
*/
5095-
childNodes: nodeListOf<node>,
5085+
childNodes: nodeList<node>,
50965086
/**
50975087
Returns the first child.
50985088
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -5445,7 +5435,7 @@ HTML <script> elements expose the HTMLScriptElement interface, which provides sp
54455435
Returns the children.
54465436
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
54475437
*/
5448-
childNodes: nodeListOf<node>,
5438+
childNodes: nodeList<node>,
54495439
/**
54505440
Returns the first child.
54515441
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -5574,7 +5564,7 @@ and documentType = {
55745564
Returns the children.
55755565
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
55765566
*/
5577-
childNodes: nodeListOf<node>,
5567+
childNodes: nodeList<node>,
55785568
/**
55795569
Returns the first child.
55805570
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -5664,7 +5654,7 @@ Any web page loaded in the browser and serves as an entry point into the web pag
56645654
Returns the children.
56655655
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
56665656
*/
5667-
childNodes: nodeListOf<node>,
5657+
childNodes: nodeList<node>,
56685658
/**
56695659
Returns the first child.
56705660
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -6132,12 +6122,12 @@ and mutationRecord = {
61326122
Return the nodes added and removed respectively.
61336123
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MutationRecord/addedNodes)
61346124
*/
6135-
addedNodes: nodeList,
6125+
addedNodes: nodeList<node>,
61366126
/**
61376127
Return the nodes added and removed respectively.
61386128
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MutationRecord/removedNodes)
61396129
*/
6140-
removedNodes: nodeList,
6130+
removedNodes: nodeList<node>,
61416131
/**
61426132
Return the previous and next sibling respectively of the added or removed nodes, and null otherwise.
61436133
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MutationRecord/previousSibling)
@@ -6210,7 +6200,7 @@ and attr = {
62106200
Returns the children.
62116201
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
62126202
*/
6213-
childNodes: nodeListOf<node>,
6203+
childNodes: nodeList<node>,
62146204
/**
62156205
Returns the first child.
62166206
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -6312,7 +6302,7 @@ The CharacterData abstract interface represents a Node object that contains char
63126302
Returns the children.
63136303
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
63146304
*/
6315-
childNodes: nodeListOf<node>,
6305+
childNodes: nodeList<node>,
63166306
/**
63176307
Returns the first child.
63186308
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -6408,7 +6398,7 @@ A minimal document object that has no parent. It is used as a lightweight versio
64086398
Returns the children.
64096399
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
64106400
*/
6411-
childNodes: nodeListOf<node>,
6401+
childNodes: nodeList<node>,
64126402
/**
64136403
Returns the first child.
64146404
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -6683,7 +6673,7 @@ A minimal document object that has no parent. It is used as a lightweight versio
66836673
Returns the children.
66846674
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/childNodes)
66856675
*/
6686-
childNodes: nodeListOf<node>,
6676+
childNodes: nodeList<node>,
66876677
/**
66886678
Returns the first child.
66896679
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Node/firstChild)
@@ -6859,7 +6849,7 @@ type elementInternals = {
68596849
Returns a NodeList of all the label elements that internals's target element is associated with.
68606850
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/labels)
68616851
*/
6862-
labels: nodeList,
6852+
labels: nodeList<any>,
68636853
/**
68646854
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/ElementInternals/states)
68656855
*/
@@ -7528,7 +7518,7 @@ type rec htmlButtonElement = {
75287518
/**
75297519
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/labels)
75307520
*/
7531-
labels: nodeListOf<htmlLabelElement>,
7521+
labels: nodeList<htmlLabelElement>,
75327522
/**
75337523
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLButtonElement/popoverTargetElement)
75347524
*/
@@ -7663,7 +7653,7 @@ Provides special properties and methods for manipulating the layout and presenta
76637653
/**
76647654
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/labels)
76657655
*/
7666-
labels: nodeListOf<htmlLabelElement>,
7656+
labels: nodeList<htmlLabelElement>,
76677657
/**
76687658
Gets or sets the starting position or offset of a text selection.
76697659
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTextAreaElement/selectionStart)
@@ -7730,7 +7720,7 @@ Can be set, to change the value.
77307720
/**
77317721
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOutputElement/labels)
77327722
*/
7733-
labels: nodeListOf<htmlLabelElement>,
7723+
labels: nodeList<htmlLabelElement>,
77347724
}
77357725

77367726
/**
@@ -7919,7 +7909,7 @@ Provides special properties and methods for manipulating the options, layout, an
79197909
/**
79207910
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/labels)
79217911
*/
7922-
labels: Null.t<nodeListOf<htmlLabelElement>>,
7912+
labels: Null.t<nodeList<htmlLabelElement>>,
79237913
/**
79247914
Gets or sets the starting position or offset of a text selection.
79257915
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/selectionStart)
@@ -8052,7 +8042,7 @@ A <select> HTML Element. These elements also share all of the properties and met
80528042
/**
80538043
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/labels)
80548044
*/
8055-
labels: nodeListOf<htmlLabelElement>,
8045+
labels: nodeList<htmlLabelElement>,
80568046
}
80578047

80588048
/**
@@ -8699,7 +8689,7 @@ type htmlMeterElement = {
86998689
/**
87008690
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMeterElement/labels)
87018691
*/
8702-
labels: nodeListOf<htmlLabelElement>,
8692+
labels: nodeList<htmlLabelElement>,
87038693
}
87048694

87058695
/**
@@ -8868,7 +8858,7 @@ type htmlProgressElement = {
88688858
/**
88698859
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLProgressElement/labels)
88708860
*/
8871-
labels: nodeListOf<htmlLabelElement>,
8861+
labels: nodeList<htmlLabelElement>,
88728862
}
88738863

88748864
/**

src/DOMAPI/Document.res

Lines changed: 2 additions & 2 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)
@@ -372,7 +372,7 @@ Gets a collection of objects based on the value of the NAME or ID attribute.
372372
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementsByName)
373373
*/
374374
@send
375-
external getElementsByName: (document, string) => nodeListOf<htmlElement> = "getElementsByName"
375+
external getElementsByName: (document, string) => nodeList<htmlElement> = "getElementsByName"
376376

377377
/**
378378
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/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)