@@ -2,86 +2,98 @@ open DOMAPI
2
2
open EventAPI
3
3
4
4
/**
5
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment )
5
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragmentFragment )
6
6
*/
7
7
@new
8
8
external make : unit => documentFragment = "DocumentFragment"
9
9
10
- include Node .Impl ({
11
- type t = documentFragment
12
- })
10
+ module Impl = (
11
+ T : {
12
+ type t
13
+ },
14
+ ) => {
15
+ include Node .Impl ({
16
+ type t = T .t
17
+ })
13
18
14
- /**
15
- Returns the first element within node's descendants whose ID is elementId.
16
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/getElementById)
19
+ external asDocumentFragment : T .t => documentFragment = "%identity"
20
+
21
+ /**
22
+ Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
23
+
24
+ Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
25
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append)
17
26
*/
18
- @send
19
- external getElementById : (documentFragment , string ) => element = "getElementById "
27
+ @send
28
+ external append : (T . t , node ) => unit = "append "
20
29
21
- /**
22
- Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
30
+ /**
31
+ Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
23
32
24
33
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
25
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/prepend )
34
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/append )
26
35
*/
27
- @send
28
- external prepend : (documentFragment , node ) => unit = "prepend "
36
+ @send
37
+ external append2 : (T . t , string ) => unit = "append "
29
38
30
- /**
39
+ /**
40
+ Returns the first element within node's descendants whose ID is elementId.
41
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/getElementById)
42
+ */
43
+ @send
44
+ external getElementById : (T .t , string ) => element = "getElementById"
45
+
46
+ /**
31
47
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
32
48
33
49
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
34
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document /prepend)
50
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment /prepend)
35
51
*/
36
- @send
37
- external prepend2 : (documentFragment , string ) => unit = "prepend"
52
+ @send
53
+ external prepend : (T . t , node ) => unit = "prepend"
38
54
39
- /**
40
- Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
55
+ /**
56
+ Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
41
57
42
58
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
43
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append )
59
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/prepend )
44
60
*/
45
- @send
46
- external append : (documentFragment , node ) => unit = "append "
61
+ @send
62
+ external prepend2 : (T . t , string ) => unit = "prepend "
47
63
48
- /**
49
- Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
64
+ /**
65
+ Returns the first element that is a descendant of node that matches selectors.
66
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelector)
67
+ */
68
+ @send
69
+ external querySelector : (T .t , string ) => element = "querySelector"
50
70
51
- Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
52
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/append)
71
+ /**
72
+ Returns all element descendants of node that match selectors.
73
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelectorAll)
53
74
*/
54
- @send
55
- external append2 : (documentFragment , string ) => unit = "append "
75
+ @send
76
+ external querySelectorAll : (T . t , string ) => nodeList = "querySelectorAll "
56
77
57
- /**
78
+ /**
58
79
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
59
80
60
81
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
61
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document /replaceChildren)
82
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment /replaceChildren)
62
83
*/
63
- @send
64
- external replaceChildren : (documentFragment , node ) => unit = "replaceChildren"
84
+ @send
85
+ external replaceChildren : (T . t , node ) => unit = "replaceChildren"
65
86
66
- /**
87
+ /**
67
88
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
68
89
69
90
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
70
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document /replaceChildren)
91
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment /replaceChildren)
71
92
*/
72
- @send
73
- external replaceChildren2 : (documentFragment , string ) => unit = "replaceChildren"
93
+ @send
94
+ external replaceChildren2 : (T .t , string ) => unit = "replaceChildren"
95
+ }
74
96
75
- /**
76
- Returns the first element that is a descendant of node that matches selectors.
77
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
78
- */
79
- @send
80
- external querySelector : (documentFragment , string ) => element = "querySelector"
81
-
82
- /**
83
- Returns all element descendants of node that match selectors.
84
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelectorAll)
85
- */
86
- @send
87
- external querySelectorAll : (documentFragment , string ) => nodeList = "querySelectorAll"
97
+ include Impl ({
98
+ type t = documentFragment
99
+ })
0 commit comments