happy-dom 2.27.0 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of happy-dom might be problematic. Click here for more details.

Files changed (48) hide show
  1. package/lib/nodes/character-data/CharacterData.d.ts +137 -0
  2. package/lib/nodes/character-data/CharacterData.js +265 -0
  3. package/lib/nodes/character-data/CharacterData.js.map +1 -0
  4. package/lib/nodes/character-data/ICharacterData.d.ts +3 -2
  5. package/lib/nodes/comment/Comment.d.ts +2 -121
  6. package/lib/nodes/comment/Comment.js +5 -221
  7. package/lib/nodes/comment/Comment.js.map +1 -1
  8. package/lib/nodes/comment/IComment.d.ts +1 -1
  9. package/lib/nodes/document/Document.d.ts +4 -3
  10. package/lib/nodes/document/Document.js.map +1 -1
  11. package/lib/nodes/element/HTMLCollection.d.ts +13 -0
  12. package/lib/nodes/element/HTMLCollection.js +37 -0
  13. package/lib/nodes/element/HTMLCollection.js.map +1 -0
  14. package/lib/nodes/html-style-element/HTMLStyleElement.d.ts +1 -0
  15. package/lib/nodes/html-style-element/HTMLStyleElement.js +8 -4
  16. package/lib/nodes/html-style-element/HTMLStyleElement.js.map +1 -1
  17. package/lib/nodes/node/INode.d.ts +3 -2
  18. package/lib/nodes/node/Node.d.ts +4 -0
  19. package/lib/nodes/node/Node.js +6 -0
  20. package/lib/nodes/node/Node.js.map +1 -1
  21. package/lib/nodes/node/NodeList.d.ts +13 -0
  22. package/lib/nodes/node/NodeList.js +37 -0
  23. package/lib/nodes/node/NodeList.js.map +1 -0
  24. package/lib/nodes/text/IText.d.ts +1 -1
  25. package/lib/nodes/text/Text.d.ts +2 -121
  26. package/lib/nodes/text/Text.js +5 -221
  27. package/lib/nodes/text/Text.js.map +1 -1
  28. package/lib/window/IWindow.d.ts +10 -0
  29. package/lib/window/Window.d.ts +6 -0
  30. package/lib/window/Window.js +6 -0
  31. package/lib/window/Window.js.map +1 -1
  32. package/lib/xml-serializer/XMLSerializer.js +1 -1
  33. package/package.json +2 -2
  34. package/src/nodes/character-data/CharacterData.ts +221 -0
  35. package/src/nodes/character-data/ICharacterData.ts +3 -2
  36. package/src/nodes/comment/Comment.ts +3 -202
  37. package/src/nodes/comment/IComment.ts +1 -1
  38. package/src/nodes/document/Document.ts +4 -3
  39. package/src/nodes/element/HTMLCollection.ts +16 -0
  40. package/src/nodes/html-style-element/HTMLStyleElement.ts +7 -3
  41. package/src/nodes/node/INode.ts +3 -2
  42. package/src/nodes/node/Node.ts +7 -0
  43. package/src/nodes/node/NodeList.ts +16 -0
  44. package/src/nodes/text/IText.ts +1 -1
  45. package/src/nodes/text/Text.ts +3 -202
  46. package/src/window/IWindow.ts +10 -0
  47. package/src/window/Window.ts +6 -0
  48. package/src/xml-serializer/XMLSerializer.ts +2 -2
@@ -0,0 +1,137 @@
1
+ import Node from '../node/Node';
2
+ import ICharacterData from './ICharacterData';
3
+ import IElement from '../element/IElement';
4
+ /**
5
+ * Character data base class.
6
+ *
7
+ * Reference:
8
+ * https://developer.mozilla.org/en-US/docs/Web/API/CharacterData.
9
+ */
10
+ export default abstract class CharacterData extends Node implements ICharacterData {
11
+ protected _data: string;
12
+ /**
13
+ * Constructor.
14
+ *
15
+ * @param [data] Data.
16
+ */
17
+ constructor(data?: string);
18
+ /**
19
+ * Returns text content.
20
+ *
21
+ * @returns Text content.
22
+ */
23
+ get length(): number;
24
+ /**
25
+ * Returns text content.
26
+ *
27
+ * @returns Text content.
28
+ */
29
+ get data(): string;
30
+ /**
31
+ * Sets text content.
32
+ *
33
+ * @param textContent Text content.
34
+ */
35
+ set data(data: string);
36
+ /**
37
+ * Returns text content.
38
+ *
39
+ * @returns Text content.
40
+ */
41
+ get textContent(): string;
42
+ /**
43
+ * Sets text content.
44
+ *
45
+ * @param textContent Text content.
46
+ */
47
+ set textContent(textContent: string);
48
+ /**
49
+ * Returns node value.
50
+ *
51
+ * @returns Node value.
52
+ */
53
+ get nodeValue(): string;
54
+ /**
55
+ * Sets node value.
56
+ *
57
+ * @param nodeValue Node value.
58
+ */
59
+ set nodeValue(nodeValue: string);
60
+ /**
61
+ * Appends the given DOMString to the CharacterData.data string; when this method returns, data contains the concatenated DOMString.
62
+ *
63
+ * @param data Data.
64
+ */
65
+ appendData(data: string): void;
66
+ /**
67
+ * Removes the specified amount of characters, starting at the specified offset, from the CharacterData.data string; when this method returns, data contains the shortened DOMString.
68
+ *
69
+ * @param offset Offset.
70
+ * @param count Count.
71
+ */
72
+ deleteData(offset: number, count: number): void;
73
+ /**
74
+ * Inserts the specified characters, at the specified offset, in the CharacterData.data string; when this method returns, data contains the modified DOMString.
75
+ *
76
+ * @param offset Offset.
77
+ * @param data Data.
78
+ */
79
+ insertData(offset: number, data: string): void;
80
+ /**
81
+ * Replaces the specified amount of characters, starting at the specified offset, with the specified DOMString; when this method returns, data contains the modified DOMString.
82
+ *
83
+ * @param offset Offset.
84
+ * @param count Count.
85
+ * @param data Data.
86
+ */
87
+ replaceData(offset: number, count: number, data: string): void;
88
+ /**
89
+ * Returns a DOMString containing the part of CharacterData.data of the specified length and starting at the specified offset.
90
+ *
91
+ * @param offset Offset.
92
+ * @param count Count.
93
+ */
94
+ substringData(offset: number, count: number): string;
95
+ /**
96
+ * Previous element sibling.
97
+ *
98
+ * @returns Element.
99
+ */
100
+ get previousElementSibling(): IElement;
101
+ /**
102
+ * Next element sibling.
103
+ *
104
+ * @returns Element.
105
+ */
106
+ get nextElementSibling(): IElement;
107
+ /**
108
+ * Removes the object from its parent children list.
109
+ */
110
+ remove(): void;
111
+ /**
112
+ * The Node.replaceWith() method replaces this Node in the children list of its parent with a set of Node or DOMString objects.
113
+ *
114
+ * @param nodes List of Node or DOMString.
115
+ */
116
+ replaceWith(...nodes: (Node | string)[]): void;
117
+ /**
118
+ * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just before this ChildNode. DOMString objects are inserted as equivalent Text nodes.
119
+ *
120
+ * @param nodes List of Node or DOMString.
121
+ */
122
+ before(...nodes: (string | Node)[]): void;
123
+ /**
124
+ * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just after this ChildNode. DOMString objects are inserted as equivalent Text nodes.
125
+ *
126
+ * @param nodes List of Node or DOMString.
127
+ */
128
+ after(...nodes: (string | Node)[]): void;
129
+ /**
130
+ * Clones a node.
131
+ *
132
+ * @override
133
+ * @param [deep=false] "true" to clone deep.
134
+ * @returns Cloned node.
135
+ */
136
+ cloneNode(deep?: boolean): ICharacterData;
137
+ }
@@ -0,0 +1,265 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
18
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
19
+ to[j] = from[i];
20
+ return to;
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ var Node_1 = __importDefault(require("../node/Node"));
27
+ var CharacterDataUtility_1 = __importDefault(require("./CharacterDataUtility"));
28
+ var NonDocumentChildNodeUtility_1 = __importDefault(require("../child-node/NonDocumentChildNodeUtility"));
29
+ var ChildNodeUtility_1 = __importDefault(require("../child-node/ChildNodeUtility"));
30
+ var MutationRecord_1 = __importDefault(require("../../mutation-observer/MutationRecord"));
31
+ var MutationTypeEnum_1 = __importDefault(require("../../mutation-observer/MutationTypeEnum"));
32
+ /**
33
+ * Character data base class.
34
+ *
35
+ * Reference:
36
+ * https://developer.mozilla.org/en-US/docs/Web/API/CharacterData.
37
+ */
38
+ var CharacterData = /** @class */ (function (_super) {
39
+ __extends(CharacterData, _super);
40
+ /**
41
+ * Constructor.
42
+ *
43
+ * @param [data] Data.
44
+ */
45
+ function CharacterData(data) {
46
+ var _this = _super.call(this) || this;
47
+ _this._data = '';
48
+ if (data) {
49
+ _this._data = data;
50
+ }
51
+ return _this;
52
+ }
53
+ Object.defineProperty(CharacterData.prototype, "length", {
54
+ /**
55
+ * Returns text content.
56
+ *
57
+ * @returns Text content.
58
+ */
59
+ get: function () {
60
+ return this._data.length;
61
+ },
62
+ enumerable: false,
63
+ configurable: true
64
+ });
65
+ Object.defineProperty(CharacterData.prototype, "data", {
66
+ /**
67
+ * Returns text content.
68
+ *
69
+ * @returns Text content.
70
+ */
71
+ get: function () {
72
+ return this._data;
73
+ },
74
+ /**
75
+ * Sets text content.
76
+ *
77
+ * @param textContent Text content.
78
+ */
79
+ set: function (data) {
80
+ var oldValue = this._data;
81
+ this._data = data;
82
+ // MutationObserver
83
+ if (this._observers.length > 0) {
84
+ for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
85
+ var observer = _a[_i];
86
+ if (observer.options.characterData) {
87
+ var record = new MutationRecord_1.default();
88
+ record.type = MutationTypeEnum_1.default.characterData;
89
+ record.oldValue = observer.options.characterDataOldValue ? oldValue : null;
90
+ observer.callback([record]);
91
+ }
92
+ }
93
+ }
94
+ },
95
+ enumerable: false,
96
+ configurable: true
97
+ });
98
+ Object.defineProperty(CharacterData.prototype, "textContent", {
99
+ /**
100
+ * Returns text content.
101
+ *
102
+ * @returns Text content.
103
+ */
104
+ get: function () {
105
+ return this._data;
106
+ },
107
+ /**
108
+ * Sets text content.
109
+ *
110
+ * @param textContent Text content.
111
+ */
112
+ set: function (textContent) {
113
+ this.data = textContent;
114
+ },
115
+ enumerable: false,
116
+ configurable: true
117
+ });
118
+ Object.defineProperty(CharacterData.prototype, "nodeValue", {
119
+ /**
120
+ * Returns node value.
121
+ *
122
+ * @returns Node value.
123
+ */
124
+ get: function () {
125
+ return this._data;
126
+ },
127
+ /**
128
+ * Sets node value.
129
+ *
130
+ * @param nodeValue Node value.
131
+ */
132
+ set: function (nodeValue) {
133
+ this.textContent = nodeValue;
134
+ },
135
+ enumerable: false,
136
+ configurable: true
137
+ });
138
+ /**
139
+ * Appends the given DOMString to the CharacterData.data string; when this method returns, data contains the concatenated DOMString.
140
+ *
141
+ * @param data Data.
142
+ */
143
+ CharacterData.prototype.appendData = function (data) {
144
+ CharacterDataUtility_1.default.appendData(this, data);
145
+ };
146
+ /**
147
+ * Removes the specified amount of characters, starting at the specified offset, from the CharacterData.data string; when this method returns, data contains the shortened DOMString.
148
+ *
149
+ * @param offset Offset.
150
+ * @param count Count.
151
+ */
152
+ CharacterData.prototype.deleteData = function (offset, count) {
153
+ CharacterDataUtility_1.default.deleteData(this, offset, count);
154
+ };
155
+ /**
156
+ * Inserts the specified characters, at the specified offset, in the CharacterData.data string; when this method returns, data contains the modified DOMString.
157
+ *
158
+ * @param offset Offset.
159
+ * @param data Data.
160
+ */
161
+ CharacterData.prototype.insertData = function (offset, data) {
162
+ CharacterDataUtility_1.default.insertData(this, offset, data);
163
+ };
164
+ /**
165
+ * Replaces the specified amount of characters, starting at the specified offset, with the specified DOMString; when this method returns, data contains the modified DOMString.
166
+ *
167
+ * @param offset Offset.
168
+ * @param count Count.
169
+ * @param data Data.
170
+ */
171
+ CharacterData.prototype.replaceData = function (offset, count, data) {
172
+ CharacterDataUtility_1.default.replaceData(this, offset, count, data);
173
+ };
174
+ /**
175
+ * Returns a DOMString containing the part of CharacterData.data of the specified length and starting at the specified offset.
176
+ *
177
+ * @param offset Offset.
178
+ * @param count Count.
179
+ */
180
+ CharacterData.prototype.substringData = function (offset, count) {
181
+ return CharacterDataUtility_1.default.substringData(this, offset, count);
182
+ };
183
+ Object.defineProperty(CharacterData.prototype, "previousElementSibling", {
184
+ /**
185
+ * Previous element sibling.
186
+ *
187
+ * @returns Element.
188
+ */
189
+ get: function () {
190
+ return NonDocumentChildNodeUtility_1.default.previousElementSibling(this);
191
+ },
192
+ enumerable: false,
193
+ configurable: true
194
+ });
195
+ Object.defineProperty(CharacterData.prototype, "nextElementSibling", {
196
+ /**
197
+ * Next element sibling.
198
+ *
199
+ * @returns Element.
200
+ */
201
+ get: function () {
202
+ return NonDocumentChildNodeUtility_1.default.nextElementSibling(this);
203
+ },
204
+ enumerable: false,
205
+ configurable: true
206
+ });
207
+ /**
208
+ * Removes the object from its parent children list.
209
+ */
210
+ CharacterData.prototype.remove = function () {
211
+ ChildNodeUtility_1.default.remove(this);
212
+ };
213
+ /**
214
+ * The Node.replaceWith() method replaces this Node in the children list of its parent with a set of Node or DOMString objects.
215
+ *
216
+ * @param nodes List of Node or DOMString.
217
+ */
218
+ CharacterData.prototype.replaceWith = function () {
219
+ var nodes = [];
220
+ for (var _i = 0; _i < arguments.length; _i++) {
221
+ nodes[_i] = arguments[_i];
222
+ }
223
+ ChildNodeUtility_1.default.replaceWith.apply(ChildNodeUtility_1.default, __spreadArray([this], nodes));
224
+ };
225
+ /**
226
+ * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just before this ChildNode. DOMString objects are inserted as equivalent Text nodes.
227
+ *
228
+ * @param nodes List of Node or DOMString.
229
+ */
230
+ CharacterData.prototype.before = function () {
231
+ var nodes = [];
232
+ for (var _i = 0; _i < arguments.length; _i++) {
233
+ nodes[_i] = arguments[_i];
234
+ }
235
+ ChildNodeUtility_1.default.before.apply(ChildNodeUtility_1.default, __spreadArray([this], nodes));
236
+ };
237
+ /**
238
+ * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just after this ChildNode. DOMString objects are inserted as equivalent Text nodes.
239
+ *
240
+ * @param nodes List of Node or DOMString.
241
+ */
242
+ CharacterData.prototype.after = function () {
243
+ var nodes = [];
244
+ for (var _i = 0; _i < arguments.length; _i++) {
245
+ nodes[_i] = arguments[_i];
246
+ }
247
+ ChildNodeUtility_1.default.after.apply(ChildNodeUtility_1.default, __spreadArray([this], nodes));
248
+ };
249
+ /**
250
+ * Clones a node.
251
+ *
252
+ * @override
253
+ * @param [deep=false] "true" to clone deep.
254
+ * @returns Cloned node.
255
+ */
256
+ CharacterData.prototype.cloneNode = function (deep) {
257
+ if (deep === void 0) { deep = false; }
258
+ var clone = _super.prototype.cloneNode.call(this, deep);
259
+ clone._data = this._data;
260
+ return clone;
261
+ };
262
+ return CharacterData;
263
+ }(Node_1.default));
264
+ exports.default = CharacterData;
265
+ //# sourceMappingURL=CharacterData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CharacterData.js","sourceRoot":"","sources":["../../../src/nodes/character-data/CharacterData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAgC;AAChC,gFAA0D;AAG1D,0GAAoF;AACpF,oFAA8D;AAC9D,0FAAoE;AACpE,8FAAwE;AAExE;;;;;GAKG;AACH;IAAoD,iCAAI;IAGvD;;;;OAIG;IACH,uBAAY,IAAa;QAAzB,YACC,iBAAO,SAKP;QAbS,WAAK,GAAG,EAAE,CAAC;QAUpB,IAAI,IAAI,EAAE;YACT,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC;SAClB;;IACF,CAAC;IAOD,sBAAW,iCAAM;QALjB;;;;WAIG;aACH;YACC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAC1B,CAAC;;;OAAA;IAOD,sBAAW,+BAAI;QALf;;;;WAIG;aACH;YACC,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;QAED;;;;WAIG;aACH,UAAgB,IAAY;YAC3B,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;YAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAElB,mBAAmB;YACnB,IAAI,IAAI,CAAC,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B;YAA3B,0BAA2B;;QACvC,0BAAgB,CAAC,KAAK,OAAtB,0BAAgB,iBAAO,IAAI,GAAK,KAAK,GAAE;IACxC,CAAC;IAED;;;;;;OAMG;IACI,iCAAS,GAAhB,UAAiB,IAAY;QAAZ,qBAAA,EAAA,YAAY;QAC5B,IAAM,KAAK,GAAkB,iBAAM,SAAS,YAAC,IAAI,CAAC,CAAC;QACnD,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;IACF,oBAAC;AAAD,CAAC,AA7MD,CAAoD,cAAI,GA6MvD"}
@@ -1,6 +1,7 @@
1
+ import INode from '../node/INode';
1
2
  import IChildNode from '../child-node/IChildNode';
2
3
  import INonDocumentTypeChildNode from '../child-node/INonDocumentTypeChildNode';
3
- export default interface ICharacterData extends IChildNode, INonDocumentTypeChildNode {
4
+ export default interface ICharacterData extends INode, IChildNode, INonDocumentTypeChildNode {
4
5
  data: string;
5
6
  readonly length: number;
6
7
  /**
@@ -45,5 +46,5 @@ export default interface ICharacterData extends IChildNode, INonDocumentTypeChil
45
46
  * @param [deep=false] "true" to clone deep.
46
47
  * @returns Cloned node.
47
48
  */
48
- cloneNode(deep: boolean): ICharacterData;
49
+ cloneNode(deep?: boolean): ICharacterData;
49
50
  }
@@ -1,141 +1,22 @@
1
- import Node from '../node/Node';
2
- import IElement from '../element/IElement';
1
+ import CharacterData from '../character-data/CharacterData';
3
2
  import IComment from './IComment';
4
3
  /**
5
4
  * Comment node.
6
5
  */
7
- export default class Comment extends Node implements IComment {
6
+ export default class Comment extends CharacterData implements IComment {
8
7
  readonly nodeType = 8;
9
- private _data;
10
- /**
11
- * Constructor.
12
- *
13
- * @param [comment] Comment.
14
- */
15
- constructor(comment?: string);
16
8
  /**
17
9
  * Node name.
18
10
  *
19
11
  * @returns Node name.
20
12
  */
21
13
  get nodeName(): string;
22
- /**
23
- * Returns text content.
24
- *
25
- * @returns Text content.
26
- */
27
- get length(): number;
28
- /**
29
- * Returns text content.
30
- *
31
- * @returns Text content.
32
- */
33
- get data(): string;
34
- /**
35
- * Sets text content.
36
- *
37
- * @param textContent Text content.
38
- */
39
- set data(data: string);
40
- /**
41
- * Returns text content.
42
- *
43
- * @returns Text content.
44
- */
45
- get textContent(): string;
46
- /**
47
- * Sets text content.
48
- *
49
- * @param textContent Text content.
50
- */
51
- set textContent(textContent: string);
52
- /**
53
- * Returns node value.
54
- *
55
- * @returns Node value.
56
- */
57
- get nodeValue(): string;
58
- /**
59
- * Sets node value.
60
- *
61
- * @param nodeValue Node value.
62
- */
63
- set nodeValue(nodeValue: string);
64
- /**
65
- * Previous element sibling.
66
- *
67
- * @returns Element.
68
- */
69
- get previousElementSibling(): IElement;
70
- /**
71
- * Next element sibling.
72
- *
73
- * @returns Element.
74
- */
75
- get nextElementSibling(): IElement;
76
14
  /**
77
15
  * Converts to string.
78
16
  *
79
17
  * @returns String.
80
18
  */
81
19
  toString(): string;
82
- /**
83
- * Appends the given DOMString to the CharacterData.data string; when this method returns, data contains the concatenated DOMString.
84
- *
85
- * @param data Data.
86
- */
87
- appendData(data: string): void;
88
- /**
89
- * Removes the specified amount of characters, starting at the specified offset, from the CharacterData.data string; when this method returns, data contains the shortened DOMString.
90
- *
91
- * @param offset Offset.
92
- * @param count Count.
93
- */
94
- deleteData(offset: number, count: number): void;
95
- /**
96
- * Inserts the specified characters, at the specified offset, in the CharacterData.data string; when this method returns, data contains the modified DOMString.
97
- *
98
- * @param offset Offset.
99
- * @param data Data.
100
- */
101
- insertData(offset: number, data: string): void;
102
- /**
103
- * Removes the object from its parent children list.
104
- */
105
- remove(): void;
106
- /**
107
- * The Node.replaceWith() method replaces this Node in the children list of its parent with a set of Node or DOMString objects.
108
- *
109
- * @param nodes List of Node or DOMString.
110
- */
111
- replaceWith(...nodes: (Node | string)[]): void;
112
- /**
113
- * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just before this ChildNode. DOMString objects are inserted as equivalent Text nodes.
114
- *
115
- * @param nodes List of Node or DOMString.
116
- */
117
- before(...nodes: (string | Node)[]): void;
118
- /**
119
- * Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just after this ChildNode. DOMString objects are inserted as equivalent Text nodes.
120
- *
121
- * @param nodes List of Node or DOMString.
122
- */
123
- after(...nodes: (string | Node)[]): void;
124
- /**
125
- * Replaces the specified amount of characters, starting at the specified offset, with the specified DOMString; when this method returns, data contains the modified DOMString.
126
- *
127
- * @param offset Offset.
128
- * @param count Count.
129
- * @param data Data.
130
- */
131
- replaceData(offset: number, count: number, data: string): void;
132
- /**
133
- * Returns a DOMString containing the part of CharacterData.data of the specified length and starting at the specified offset.
134
- *
135
- * @param offset Offset.
136
- * @param count Count.
137
- */
138
- substringData(offset: number, count: number): string;
139
20
  /**
140
21
  * Clones a node.
141
22
  *