|
1 | 1 | open DOMAPI |
2 | 2 | open EventAPI |
3 | 3 |
|
4 | | -include Node.Impl({ |
5 | | - type t = characterData |
6 | | -}) |
| 4 | +module Impl = ( |
| 5 | + T: { |
| 6 | + type t |
| 7 | + }, |
| 8 | +) => { |
| 9 | + include Node.Impl({ |
| 10 | + type t = T.t |
| 11 | + }) |
| 12 | + |
| 13 | + external asCharacterData: T.t => characterData = "%identity" |
| 14 | + |
| 15 | + /** |
| 16 | +Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. |
| 17 | +
|
| 18 | +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
| 19 | +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) |
| 20 | +*/ |
| 21 | + @send |
| 22 | + external after: (T.t, node) => unit = "after" |
| 23 | + |
| 24 | + /** |
| 25 | +Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. |
7 | 26 |
|
8 | | -/** |
| 27 | +Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
| 28 | +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) |
| 29 | +*/ |
| 30 | + @send |
| 31 | + external after2: (T.t, string) => unit = "after" |
| 32 | + |
| 33 | + /** |
| 34 | +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) |
| 35 | +*/ |
| 36 | + @send |
| 37 | + external appendData: (T.t, string) => unit = "appendData" |
| 38 | + |
| 39 | + /** |
9 | 40 | Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. |
10 | 41 |
|
11 | 42 | Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
12 | 43 | [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) |
13 | 44 | */ |
14 | | -@send |
15 | | -external before: (characterData, node) => unit = "before" |
| 45 | + @send |
| 46 | + external before: (T.t, node) => unit = "before" |
16 | 47 |
|
17 | | -/** |
| 48 | + /** |
18 | 49 | Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. |
19 | 50 |
|
20 | 51 | Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
21 | 52 | [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before) |
22 | 53 | */ |
23 | | -@send |
24 | | -external before2: (characterData, string) => unit = "before" |
| 54 | + @send |
| 55 | + external before2: (T.t, string) => unit = "before" |
25 | 56 |
|
26 | | -/** |
27 | | -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. |
| 57 | + /** |
| 58 | +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) |
| 59 | +*/ |
| 60 | + @send |
| 61 | + external deleteData: (T.t, ~offset: int, ~count: int) => unit = "deleteData" |
28 | 62 |
|
29 | | -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
30 | | -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) |
| 63 | + /** |
| 64 | +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) |
31 | 65 | */ |
32 | | -@send |
33 | | -external after: (characterData, node) => unit = "after" |
| 66 | + @send |
| 67 | + external insertData: (T.t, ~offset: int, ~data: string) => unit = "insertData" |
34 | 68 |
|
35 | | -/** |
36 | | -Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. |
| 69 | + /** |
| 70 | +Removes node. |
| 71 | +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) |
| 72 | +*/ |
| 73 | + @send |
| 74 | + external remove: T.t => unit = "remove" |
37 | 75 |
|
38 | | -Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
39 | | -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/after) |
| 76 | + /** |
| 77 | +[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) |
40 | 78 | */ |
41 | | -@send |
42 | | -external after2: (characterData, string) => unit = "after" |
| 79 | + @send |
| 80 | + external replaceData: (T.t, ~offset: int, ~count: int, ~data: string) => unit = "replaceData" |
43 | 81 |
|
44 | | -/** |
| 82 | + /** |
45 | 83 | Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. |
46 | 84 |
|
47 | 85 | Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
48 | 86 | [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) |
49 | 87 | */ |
50 | | -@send |
51 | | -external replaceWith: (characterData, node) => unit = "replaceWith" |
| 88 | + @send |
| 89 | + external replaceWith: (T.t, node) => unit = "replaceWith" |
52 | 90 |
|
53 | | -/** |
| 91 | + /** |
54 | 92 | Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. |
55 | 93 |
|
56 | 94 | Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. |
57 | 95 | [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith) |
58 | 96 | */ |
59 | | -@send |
60 | | -external replaceWith2: (characterData, string) => unit = "replaceWith" |
| 97 | + @send |
| 98 | + external replaceWith2: (T.t, string) => unit = "replaceWith" |
61 | 99 |
|
62 | | -/** |
63 | | -Removes node. |
64 | | -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/remove) |
65 | | -*/ |
66 | | -@send |
67 | | -external remove: characterData => unit = "remove" |
68 | | - |
69 | | -/** |
| 100 | + /** |
70 | 101 | [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData) |
71 | 102 | */ |
72 | | -@send |
73 | | -external substringData: (characterData, ~offset: int, ~count: int) => string = "substringData" |
| 103 | + @send |
| 104 | + external substringData: (T.t, ~offset: int, ~count: int) => string = "substringData" |
| 105 | +} |
74 | 106 |
|
75 | | -/** |
76 | | -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/appendData) |
77 | | -*/ |
78 | | -@send |
79 | | -external appendData: (characterData, string) => unit = "appendData" |
80 | | - |
81 | | -/** |
82 | | -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/insertData) |
83 | | -*/ |
84 | | -@send |
85 | | -external insertData: (characterData, ~offset: int, ~data: string) => unit = "insertData" |
86 | | - |
87 | | -/** |
88 | | -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/deleteData) |
89 | | -*/ |
90 | | -@send |
91 | | -external deleteData: (characterData, ~offset: int, ~count: int) => unit = "deleteData" |
92 | | - |
93 | | -/** |
94 | | -[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceData) |
95 | | -*/ |
96 | | -@send |
97 | | -external replaceData: (characterData, ~offset: int, ~count: int, ~data: string) => unit = |
98 | | - "replaceData" |
| 107 | +include Impl({ |
| 108 | + type t = characterData |
| 109 | +}) |
0 commit comments