Skip to content

Commit befe659

Browse files
committed
Extract CharacterData
1 parent 73fb51d commit befe659

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+201
-446
lines changed

src/CSSFontLoadingAPI/FontFaceSet.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CanvasAPI/OffscreenCanvas.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ChannelMessagingAPI/MessagePort.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ClipboardAPI/Clipboard.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/Animation.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/CharacterData.js

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/CharacterData.res

Lines changed: 72 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,109 @@
11
open DOMAPI
22
open EventAPI
33

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.
726
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+
/**
940
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
1041
1142
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
1243
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
1344
*/
14-
@send
15-
external before: (characterData, node) => unit = "before"
45+
@send
46+
external before: (T.t, node) => unit = "before"
1647

17-
/**
48+
/**
1849
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
1950
2051
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
2152
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/before)
2253
*/
23-
@send
24-
external before2: (characterData, string) => unit = "before"
54+
@send
55+
external before2: (T.t, string) => unit = "before"
2556

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"
2862

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)
3165
*/
32-
@send
33-
external after: (characterData, node) => unit = "after"
66+
@send
67+
external insertData: (T.t, ~offset: int, ~data: string) => unit = "insertData"
3468

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"
3775

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)
4078
*/
41-
@send
42-
external after2: (characterData, string) => unit = "after"
79+
@send
80+
external replaceData: (T.t, ~offset: int, ~count: int, ~data: string) => unit = "replaceData"
4381

44-
/**
82+
/**
4583
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
4684
4785
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
4886
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
4987
*/
50-
@send
51-
external replaceWith: (characterData, node) => unit = "replaceWith"
88+
@send
89+
external replaceWith: (T.t, node) => unit = "replaceWith"
5290

53-
/**
91+
/**
5492
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
5593
5694
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
5795
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/replaceWith)
5896
*/
59-
@send
60-
external replaceWith2: (characterData, string) => unit = "replaceWith"
97+
@send
98+
external replaceWith2: (T.t, string) => unit = "replaceWith"
6199

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+
/**
70101
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CharacterData/substringData)
71102
*/
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+
}
74106

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+
})

src/DOMAPI/Document.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/DocumentFragment.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/Element.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/FillStyle.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLButtonElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLCanvasElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLDialogElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLElement.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLEmbedElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLFieldSetElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLFormElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLIFrameElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DOMAPI/HTMLImageElement.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)