Skip to content

Commit 2cadbcd

Browse files
committed
remove htmlCollectionOf
1 parent e9e0d90 commit 2cadbcd

File tree

6 files changed

+29
-54
lines changed

6 files changed

+29
-54
lines changed

src/DOMAPI.res

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ Element is the most general base class from which all objects in a Document inhe
26632663
Returns the child elements.
26642664
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children)
26652665
*/
2666-
children: htmlCollection,
2666+
children: htmlCollection<element>,
26672667
/**
26682668
Returns the first child that is an element, and null otherwise.
26692669
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild)
@@ -3001,24 +3001,14 @@ Similarly, when the focused element is in a different node tree than documentOrS
30013001
A generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list.
30023002
[See HTMLCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection)
30033003
*/
3004-
@editor.completeFrom(HTMLCollection) and htmlCollection = {
3004+
@editor.completeFrom(HTMLCollection) and htmlCollection<'t> = {
30053005
/**
30063006
Sets or retrieves the number of objects in a collection.
30073007
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/length)
30083008
*/
30093009
length: int,
30103010
}
30113011

3012-
and htmlCollectionOf<'t> = {
3013-
// Base properties from HTMLCollection
3014-
/**
3015-
Sets or retrieves the number of objects in a collection.
3016-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/length)
3017-
*/
3018-
length: int,
3019-
// End base properties from HTMLCollection
3020-
}
3021-
30223012
/**
30233013
A collection of HTML form control elements.
30243014
[See HTMLFormControlsCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormControlsCollection)
@@ -5808,32 +5798,32 @@ If the contents are sandboxed into a unique origin (e.g. in an iframe with the s
58085798
Retrieves a collection, in source order, of img objects in the document.
58095799
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/images)
58105800
*/
5811-
images: htmlCollectionOf<htmlImageElement>,
5801+
images: htmlCollection<htmlImageElement>,
58125802
/**
58135803
Retrieves a collection of all embed objects in the document.
58145804
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/embeds)
58155805
*/
5816-
embeds: htmlCollectionOf<htmlEmbedElement>,
5806+
embeds: htmlCollection<htmlEmbedElement>,
58175807
/**
58185808
Return an HTMLCollection of the embed elements in the Document.
58195809
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/plugins)
58205810
*/
5821-
plugins: htmlCollectionOf<htmlEmbedElement>,
5811+
plugins: htmlCollection<htmlEmbedElement>,
58225812
/**
58235813
Retrieves a collection of all a objects that specify the href property and all area objects in the document.
58245814
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/links)
58255815
*/
5826-
links: htmlCollectionOf<any>,
5816+
links: htmlCollection<element>,
58275817
/**
58285818
Retrieves a collection, in source order, of all form objects in the document.
58295819
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/forms)
58305820
*/
5831-
forms: htmlCollectionOf<htmlFormElement>,
5821+
forms: htmlCollection<htmlFormElement>,
58325822
/**
58335823
Retrieves a collection of all script objects in the document.
58345824
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/scripts)
58355825
*/
5836-
scripts: htmlCollectionOf<htmlScriptElement>,
5826+
scripts: htmlCollection<htmlScriptElement>,
58375827
/**
58385828
Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.
58395829
@@ -5910,7 +5900,7 @@ Similarly, when the focused element is in a different node tree than documentOrS
59105900
Returns the child elements.
59115901
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children)
59125902
*/
5913-
children: htmlCollection,
5903+
children: htmlCollection<element>,
59145904
/**
59155905
Returns the first child that is an element, and null otherwise.
59165906
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild)
@@ -6453,7 +6443,7 @@ A minimal document object that has no parent. It is used as a lightweight versio
64536443
Returns the child elements.
64546444
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children)
64556445
*/
6456-
children: htmlCollection,
6446+
children: htmlCollection<element>,
64576447
/**
64586448
Returns the first child that is an element, and null otherwise.
64596449
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild)
@@ -7383,12 +7373,12 @@ type rec htmlTableElement = {
73837373
Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.
73847374
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/tBodies)
73857375
*/
7386-
tBodies: htmlCollectionOf<htmlTableSectionElement>,
7376+
tBodies: htmlCollection<htmlTableSectionElement>,
73877377
/**
73887378
Sets or retrieves the number of horizontal rows contained in the object.
73897379
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/rows)
73907380
*/
7391-
rows: htmlCollectionOf<htmlTableRowElement>,
7381+
rows: htmlCollection<htmlTableRowElement>,
73927382
}
73937383

73947384
/**
@@ -7409,7 +7399,7 @@ Provides special properties and methods (beyond the HTMLElement interface it als
74097399
Sets or retrieves the number of horizontal rows contained in the object.
74107400
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableSectionElement/rows)
74117401
*/
7412-
rows: htmlCollectionOf<htmlTableRowElement>,
7402+
rows: htmlCollection<htmlTableRowElement>,
74137403
}
74147404

74157405
/**
@@ -7470,7 +7460,7 @@ Provides special properties and methods (beyond the HTMLElement interface it als
74707460
Retrieves a collection of all cells in the table row.
74717461
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableRowElement/cells)
74727462
*/
7473-
cells: htmlCollectionOf<htmlTableCellElement>,
7463+
cells: htmlCollection<htmlTableCellElement>,
74747464
}
74757465

74767466
/**
@@ -7976,7 +7966,7 @@ Provides special properties (beyond the HTMLElement object interface it also has
79767966
Returns an HTMLCollection of the option elements of the datalist element.
79777967
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLDataListElement/options)
79787968
*/
7979-
options: htmlCollectionOf<htmlOptionElement>,
7969+
options: htmlCollection<htmlOptionElement>,
79807970
}
79817971

79827972
/**
@@ -8033,7 +8023,7 @@ A <select> HTML Element. These elements also share all of the properties and met
80338023
/**
80348024
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/selectedOptions)
80358025
*/
8036-
selectedOptions: htmlCollectionOf<htmlOptionElement>,
8026+
selectedOptions: htmlCollection<htmlOptionElement>,
80378027
/**
80388028
Sets or retrieves the index of the selected option in a select object.
80398029
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLSelectElement/selectedIndex)
@@ -8117,7 +8107,7 @@ HTMLOptionsCollection is an interface representing a collection of HTML option e
81178107
[See HTMLOptionsCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLOptionsCollection)
81188108
*/
81198109
@editor.completeFrom(HTMLOptionsCollection) and htmlOptionsCollection = {
8120-
...htmlCollectionOf<htmlOptionElement>,
8110+
...htmlCollection<htmlOptionElement>,
81218111
/**
81228112
Returns the index of the first selected item, if any, or −1 if there is no selected item.
81238113
@@ -8411,7 +8401,7 @@ type htmlFieldSetElement = {
84118401
Returns an HTMLCollection of the form controls in the element.
84128402
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFieldSetElement/elements)
84138403
*/
8414-
elements: htmlCollection,
8404+
elements: htmlCollection<element>,
84158405
/**
84168406
Returns whether an element will successfully validate based on forms validation rules and constraints.
84178407
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFieldSetElement/willValidate)
@@ -8636,7 +8626,7 @@ type htmlMapElement = {
86368626
Retrieves a collection of the area objects defined for the given map object.
86378627
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLMapElement/areas)
86388628
*/
8639-
areas: htmlCollection,
8629+
areas: htmlCollection<element>,
86408630
}
86418631

86428632
/**

src/DOMAPI/Document.res

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
/**

src/DOMAPI/Element.res

Lines changed: 3 additions & 3 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)

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)

0 commit comments

Comments
 (0)