pseudo-dom 0.8.0 → 0.9.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.
Files changed (30) hide show
  1. package/README.md +206 -1
  2. package/browser/pseudo-dom.js +813 -470
  3. package/browser/pseudo-dom.min.js +1 -1
  4. package/dist/classes/PseudoHTMLDocument.d.ts +41 -41
  5. package/dist/classes/PseudoHTMLDocument.js +74 -74
  6. package/dist/factories/createDataset.d.ts +10 -0
  7. package/dist/factories/createDataset.js +78 -0
  8. package/dist/factories/createDataset.min.js +1 -0
  9. package/dist/factories/createStyleDeclaration.d.ts +30 -0
  10. package/dist/factories/createStyleDeclaration.js +64 -0
  11. package/dist/factories/createStyleDeclaration.min.js +1 -0
  12. package/dist/functions/getElementById.d.ts +13 -13
  13. package/dist/functions/getElementById.js +33 -33
  14. package/dist/interfaces/PseudoCSSStyleDeclaration.d.ts +14 -0
  15. package/dist/interfaces/PseudoCSSStyleDeclaration.js +5 -0
  16. package/dist/interfaces/PseudoCSSStyleDeclaration.min.js +1 -0
  17. package/dist/interfaces/PseudoDocument.d.ts +35 -35
  18. package/dist/interfaces/PseudoDocumentFragment.d.ts +10 -10
  19. package/dist/interfaces/PseudoHTMLElement.d.ts +33 -22
  20. package/dist/services/CSSStyleDeclarationService.d.ts +73 -0
  21. package/dist/services/CSSStyleDeclarationService.js +156 -0
  22. package/dist/services/CSSStyleDeclarationService.min.js +1 -0
  23. package/dist/services/DocumentFragmentService.d.ts +21 -21
  24. package/dist/services/DocumentFragmentService.js +42 -42
  25. package/dist/services/DocumentService.d.ts +46 -46
  26. package/dist/services/DocumentService.js +95 -95
  27. package/dist/services/HTMLElementService.d.ts +87 -57
  28. package/dist/services/HTMLElementService.js +202 -163
  29. package/dist/services/HTMLElementService.min.js +1 -1
  30. package/package.json +1 -1
@@ -1,22 +1,33 @@
1
- /**
2
- * @file Substitute for the DOM HTMLElement Class.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.0.0
5
- */
6
- import { PseudoElement } from './PseudoElement';
7
- /**
8
- * Simulate the behaviour of the HTMLElement Class when there is no DOM available.
9
- * @author Joshua Heagle <joshuaheagle@gmail.com>
10
- * @class
11
- * @augments PseudoElement
12
- * @property {boolean} hidden - State of whether element is visible
13
- * @property {number} offsetHeight - The height of the element as offset by the parent element
14
- * @property {number} offsetLeft - The position of the left side of the element based on the parent element
15
- * @property {PseudoHTMLElement} offsetParent - A reference to the closest positioned parent element
16
- * @property {number} offsetTop - The position of the top side of the element based on the parent element
17
- * @property {number} offsetWidth - The width of the element as offset by the parent element
18
- * @property {Object} style - A container to define all applied inline-styles
19
- * @property {string} title - The title attribute which affects the text visible on hover
20
- */
21
- export interface PseudoHTMLElement extends PseudoElement {
22
- }
1
+ /**
2
+ * @file Substitute for the DOM HTMLElement Class.
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.0.0
5
+ */
6
+ import { PseudoElement } from './PseudoElement';
7
+ import { PseudoCSSStyleDeclaration } from './PseudoCSSStyleDeclaration';
8
+ /**
9
+ * Simulate the behaviour of the HTMLElement Class when there is no DOM available.
10
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
11
+ * @class
12
+ * @augments PseudoElement
13
+ * @property {boolean} hidden - State of whether element is visible
14
+ * @property {number} offsetHeight - The height of the element as offset by the parent element
15
+ * @property {number} offsetLeft - The position of the left side of the element based on the parent element
16
+ * @property {PseudoHTMLElement} offsetParent - A reference to the closest positioned parent element
17
+ * @property {number} offsetTop - The position of the top side of the element based on the parent element
18
+ * @property {number} offsetWidth - The width of the element as offset by the parent element
19
+ * @property {string} title - The title attribute which affects the text visible on hover
20
+ */
21
+ export interface PseudoHTMLElement extends PseudoElement {
22
+ /**
23
+ * The element's inline styles, live and settable per property (style.color = 'red') as well as through the real
24
+ * CSSStyleDeclaration methods (getPropertyValue, setProperty, removeProperty, cssText).
25
+ */
26
+ get style(): PseudoCSSStyleDeclaration;
27
+ /**
28
+ * The element's data-* attributes, live, under their camelCase names (data-foo-bar <-> dataset.fooBar).
29
+ */
30
+ get dataset(): {
31
+ [key: string]: string;
32
+ };
33
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @file Substitute for the DOM CSSStyleDeclaration Class (the object behind Element.style).
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.0.0
5
+ */
6
+ /**
7
+ * Simulate the behaviour of the CSSStyleDeclaration Class when there is no DOM available: an ordered map of CSS
8
+ * property/value pairs, parsed from and serialized back to a cssText string. Values are stored and returned as
9
+ * given, with no unit conversion, shorthand expansion or validation - this is a data structure, not a real CSS
10
+ * engine. Named property access (declaration.backgroundColor, camelCase) is added on top of this by
11
+ * createStyleDeclaration, which wraps an instance of this class in a Proxy.
12
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
13
+ * @class
14
+ */
15
+ export declare class CSSStyleDeclarationService {
16
+ private readonly properties;
17
+ /**
18
+ * @param {string} [cssText=''] Initial declarations, as CSS text ("color: red; font-size: 12px;")
19
+ * @constructor
20
+ */
21
+ constructor(cssText?: string);
22
+ /**
23
+ * How many properties are currently set.
24
+ * @returns {number}
25
+ */
26
+ get length(): number;
27
+ /**
28
+ * The name of the property at the given index, in the order it was set, or '' when there is none (matches the
29
+ * DOM's CSSStyleDeclaration, which is array-like).
30
+ * @param {number} index
31
+ * @returns {string}
32
+ */
33
+ item(index: number): string;
34
+ /**
35
+ * The value of the given property, or '' when it is not set.
36
+ * @param {string} property A CSS property name (kebab-case, e.g. "background-color")
37
+ * @returns {string}
38
+ */
39
+ getPropertyValue(property: string): string;
40
+ /**
41
+ * "important" when the property was set with !important, otherwise ''.
42
+ * @param {string} property A CSS property name (kebab-case)
43
+ * @returns {string}
44
+ */
45
+ getPropertyPriority(property: string): string;
46
+ /**
47
+ * Set a property's value (and optionally its priority). An empty, null or undefined value removes the property
48
+ * instead, like the DOM.
49
+ * @param {string} property A CSS property name (kebab-case)
50
+ * @param {string} value The value, or '' to remove the property
51
+ * @param {string} [priority=''] "important" to mark it !important
52
+ * @returns {undefined}
53
+ */
54
+ setProperty(property: string, value: string, priority?: string): void;
55
+ /**
56
+ * Remove a property, returning the value it had (or '' when it was not set).
57
+ * @param {string} property A CSS property name (kebab-case)
58
+ * @returns {string}
59
+ */
60
+ removeProperty(property: string): string;
61
+ /**
62
+ * All the declarations as one CSS text string.
63
+ * @returns {string}
64
+ */
65
+ get cssText(): string;
66
+ /**
67
+ * Replace every declaration by parsing a CSS text string ("color: red; font-size: 12px !important;").
68
+ * @param {string} cssText
69
+ * @returns {undefined}
70
+ */
71
+ set cssText(cssText: string);
72
+ }
73
+ export default CSSStyleDeclarationService;
@@ -0,0 +1,156 @@
1
+ 'use strict'
2
+
3
+ /**
4
+ * @file Substitute for the DOM CSSStyleDeclaration Class (the object behind Element.style).
5
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
6
+ * @version 1.0.0
7
+ */
8
+ require('core-js/modules/esnext.iterator.constructor.js')
9
+ require('core-js/modules/esnext.iterator.for-each.js')
10
+ require('core-js/modules/esnext.iterator.map.js')
11
+ require('core-js/modules/esnext.map.delete-all.js')
12
+ require('core-js/modules/esnext.map.every.js')
13
+ require('core-js/modules/esnext.map.filter.js')
14
+ require('core-js/modules/esnext.map.find.js')
15
+ require('core-js/modules/esnext.map.find-key.js')
16
+ require('core-js/modules/esnext.map.includes.js')
17
+ require('core-js/modules/esnext.map.key-of.js')
18
+ require('core-js/modules/esnext.map.map-keys.js')
19
+ require('core-js/modules/esnext.map.map-values.js')
20
+ require('core-js/modules/esnext.map.merge.js')
21
+ require('core-js/modules/esnext.map.reduce.js')
22
+ require('core-js/modules/esnext.map.some.js')
23
+ require('core-js/modules/esnext.map.update.js')
24
+ Object.defineProperty(exports, '__esModule', {
25
+ value: true
26
+ })
27
+ exports.CSSStyleDeclarationService = void 0
28
+ /**
29
+ * Simulate the behaviour of the CSSStyleDeclaration Class when there is no DOM available: an ordered map of CSS
30
+ * property/value pairs, parsed from and serialized back to a cssText string. Values are stored and returned as
31
+ * given, with no unit conversion, shorthand expansion or validation - this is a data structure, not a real CSS
32
+ * engine. Named property access (declaration.backgroundColor, camelCase) is added on top of this by
33
+ * createStyleDeclaration, which wraps an instance of this class in a Proxy.
34
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
35
+ * @class
36
+ */
37
+ class CSSStyleDeclarationService {
38
+ /**
39
+ * @param {string} [cssText=''] Initial declarations, as CSS text ("color: red; font-size: 12px;")
40
+ * @constructor
41
+ */
42
+ constructor (cssText = '') {
43
+ this.properties = new Map()
44
+ this.cssText = cssText
45
+ }
46
+
47
+ /**
48
+ * How many properties are currently set.
49
+ * @returns {number}
50
+ */
51
+ get length () {
52
+ return this.properties.size
53
+ }
54
+
55
+ /**
56
+ * The name of the property at the given index, in the order it was set, or '' when there is none (matches the
57
+ * DOM's CSSStyleDeclaration, which is array-like).
58
+ * @param {number} index
59
+ * @returns {string}
60
+ */
61
+ item (index) {
62
+ return Array.from(this.properties.keys())[index] || ''
63
+ }
64
+
65
+ /**
66
+ * The value of the given property, or '' when it is not set.
67
+ * @param {string} property A CSS property name (kebab-case, e.g. "background-color")
68
+ * @returns {string}
69
+ */
70
+ getPropertyValue (property) {
71
+ const entry = this.properties.get(property)
72
+ return entry ? entry.value : ''
73
+ }
74
+
75
+ /**
76
+ * "important" when the property was set with !important, otherwise ''.
77
+ * @param {string} property A CSS property name (kebab-case)
78
+ * @returns {string}
79
+ */
80
+ getPropertyPriority (property) {
81
+ const entry = this.properties.get(property)
82
+ return entry ? entry.priority : ''
83
+ }
84
+
85
+ /**
86
+ * Set a property's value (and optionally its priority). An empty, null or undefined value removes the property
87
+ * instead, like the DOM.
88
+ * @param {string} property A CSS property name (kebab-case)
89
+ * @param {string} value The value, or '' to remove the property
90
+ * @param {string} [priority=''] "important" to mark it !important
91
+ * @returns {undefined}
92
+ */
93
+ setProperty (property, value, priority = '') {
94
+ if (value === '' || value === null || typeof value === 'undefined') {
95
+ this.removeProperty(property)
96
+ return
97
+ }
98
+ this.properties.set(property, {
99
+ value: String(value),
100
+ priority
101
+ })
102
+ }
103
+
104
+ /**
105
+ * Remove a property, returning the value it had (or '' when it was not set).
106
+ * @param {string} property A CSS property name (kebab-case)
107
+ * @returns {string}
108
+ */
109
+ removeProperty (property) {
110
+ const value = this.getPropertyValue(property)
111
+ this.properties.delete(property)
112
+ return value
113
+ }
114
+
115
+ /**
116
+ * All the declarations as one CSS text string.
117
+ * @returns {string}
118
+ */
119
+ get cssText () {
120
+ return Array.from(this.properties.entries()).map(([property, {
121
+ value,
122
+ priority
123
+ }]) => `${property}: ${value}${priority ? ` !${priority}` : ''};`).join(' ')
124
+ }
125
+
126
+ /**
127
+ * Replace every declaration by parsing a CSS text string ("color: red; font-size: 12px !important;").
128
+ * @param {string} cssText
129
+ * @returns {undefined}
130
+ */
131
+ set cssText (cssText) {
132
+ this.properties.clear()
133
+ String(cssText || '').split(';').forEach(declaration => {
134
+ const colon = declaration.indexOf(':')
135
+ if (colon < 0) {
136
+ return
137
+ }
138
+ const property = declaration.slice(0, colon).trim()
139
+ let value = declaration.slice(colon + 1).trim()
140
+ let priority = ''
141
+ const important = value.match(/!\s*important\s*$/i)
142
+ if (important && typeof important.index === 'number') {
143
+ priority = 'important'
144
+ value = value.slice(0, important.index).trim()
145
+ }
146
+ if (property && value) {
147
+ this.properties.set(property, {
148
+ value,
149
+ priority
150
+ })
151
+ }
152
+ })
153
+ }
154
+ }
155
+ exports.CSSStyleDeclarationService = CSSStyleDeclarationService
156
+ exports.default = CSSStyleDeclarationService
@@ -0,0 +1 @@
1
+ "use strict";require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.for-each.js"),require("core-js/modules/esnext.iterator.map.js"),require("core-js/modules/esnext.map.delete-all.js"),require("core-js/modules/esnext.map.every.js"),require("core-js/modules/esnext.map.filter.js"),require("core-js/modules/esnext.map.find.js"),require("core-js/modules/esnext.map.find-key.js"),require("core-js/modules/esnext.map.includes.js"),require("core-js/modules/esnext.map.key-of.js"),require("core-js/modules/esnext.map.map-keys.js"),require("core-js/modules/esnext.map.map-values.js"),require("core-js/modules/esnext.map.merge.js"),require("core-js/modules/esnext.map.reduce.js"),require("core-js/modules/esnext.map.some.js"),require("core-js/modules/esnext.map.update.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.CSSStyleDeclarationService=void 0;class CSSStyleDeclarationService{constructor(e=""){this.properties=new Map,this.cssText=e}get length(){return this.properties.size}item(e){return Array.from(this.properties.keys())[e]||""}getPropertyValue(e){const r=this.properties.get(e);return r?r.value:""}getPropertyPriority(e){const r=this.properties.get(e);return r?r.priority:""}setProperty(e,r,s=""){""!==r&&null!=r?this.properties.set(e,{value:String(r),priority:s}):this.removeProperty(e)}removeProperty(e){const r=this.getPropertyValue(e);return this.properties.delete(e),r}get cssText(){return Array.from(this.properties.entries()).map(([e,{value:r,priority:s}])=>`${e}: ${r}${s?` !${s}`:""};`).join(" ")}set cssText(e){this.properties.clear(),String(e||"").split(";").forEach(e=>{const r=e.indexOf(":");if(r<0)return;const s=e.slice(0,r).trim();let t=e.slice(r+1).trim(),o="";const i=t.match(/!\s*important\s*$/i);i&&"number"==typeof i.index&&(o="important",t=t.slice(0,i.index).trim()),s&&t&&this.properties.set(s,{value:t,priority:o})})}}exports.CSSStyleDeclarationService=CSSStyleDeclarationService,exports.default=CSSStyleDeclarationService;
@@ -1,21 +1,21 @@
1
- import { NodeService } from './NodeService';
2
- import { PseudoDocumentFragment } from '../interfaces/PseudoDocumentFragment';
3
- import { PseudoElement } from '../interfaces/PseudoElement';
4
- /**
5
- * Simulate the behaviour of the DocumentFragment Class when there is no DOM available: a container for nodes which is
6
- * not part of a tree, when it is inserted its children are moved into the tree instead.
7
- * @author Joshua Heagle <joshuaheagle@gmail.com>
8
- * @class
9
- * @augments NodeService
10
- */
11
- export declare class DocumentFragmentService extends NodeService implements PseudoDocumentFragment {
12
- get nodeName(): string;
13
- get nodeType(): number;
14
- /**
15
- * The first element, in tree order, whose id matches the given value, or null when there is none (the DOM's
16
- * NonElementParentNode mixin, which Document and DocumentFragment both implement).
17
- * @param {string} id
18
- * @returns {PseudoElement|null}
19
- */
20
- getElementById(id: string): PseudoElement | null;
21
- }
1
+ import { NodeService } from './NodeService';
2
+ import { PseudoDocumentFragment } from '../interfaces/PseudoDocumentFragment';
3
+ import { PseudoElement } from '../interfaces/PseudoElement';
4
+ /**
5
+ * Simulate the behaviour of the DocumentFragment Class when there is no DOM available: a container for nodes which is
6
+ * not part of a tree, when it is inserted its children are moved into the tree instead.
7
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
8
+ * @class
9
+ * @augments NodeService
10
+ */
11
+ export declare class DocumentFragmentService extends NodeService implements PseudoDocumentFragment {
12
+ get nodeName(): string;
13
+ get nodeType(): number;
14
+ /**
15
+ * The first element, in tree order, whose id matches the given value, or null when there is none (the DOM's
16
+ * NonElementParentNode mixin, which Document and DocumentFragment both implement).
17
+ * @param {string} id
18
+ * @returns {PseudoElement|null}
19
+ */
20
+ getElementById(id: string): PseudoElement | null;
21
+ }
@@ -1,42 +1,42 @@
1
- 'use strict'
2
-
3
- const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
4
- return mod && mod.__esModule
5
- ? mod
6
- : {
7
- default: mod
8
- }
9
- }
10
- Object.defineProperty(exports, '__esModule', {
11
- value: true
12
- })
13
- exports.DocumentFragmentService = void 0
14
- const NodeService_1 = require('./NodeService')
15
- const getElementById_1 = __importDefault(require('../functions/getElementById'))
16
- /**
17
- * Simulate the behaviour of the DocumentFragment Class when there is no DOM available: a container for nodes which is
18
- * not part of a tree, when it is inserted its children are moved into the tree instead.
19
- * @author Joshua Heagle <joshuaheagle@gmail.com>
20
- * @class
21
- * @augments NodeService
22
- */
23
- class DocumentFragmentService extends NodeService_1.NodeService {
24
- get nodeName () {
25
- return '#document-fragment'
26
- }
27
-
28
- get nodeType () {
29
- return NodeService_1.NodeService.DOCUMENT_FRAGMENT_NODE
30
- }
31
-
32
- /**
33
- * The first element, in tree order, whose id matches the given value, or null when there is none (the DOM's
34
- * NonElementParentNode mixin, which Document and DocumentFragment both implement).
35
- * @param {string} id
36
- * @returns {PseudoElement|null}
37
- */
38
- getElementById (id) {
39
- return (0, getElementById_1.default)(this, id)
40
- }
41
- }
42
- exports.DocumentFragmentService = DocumentFragmentService
1
+ 'use strict'
2
+
3
+ const __importDefault = void 0 && (void 0).__importDefault || function (mod) {
4
+ return mod && mod.__esModule
5
+ ? mod
6
+ : {
7
+ default: mod
8
+ }
9
+ }
10
+ Object.defineProperty(exports, '__esModule', {
11
+ value: true
12
+ })
13
+ exports.DocumentFragmentService = void 0
14
+ const NodeService_1 = require('./NodeService')
15
+ const getElementById_1 = __importDefault(require('../functions/getElementById'))
16
+ /**
17
+ * Simulate the behaviour of the DocumentFragment Class when there is no DOM available: a container for nodes which is
18
+ * not part of a tree, when it is inserted its children are moved into the tree instead.
19
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
20
+ * @class
21
+ * @augments NodeService
22
+ */
23
+ class DocumentFragmentService extends NodeService_1.NodeService {
24
+ get nodeName () {
25
+ return '#document-fragment'
26
+ }
27
+
28
+ get nodeType () {
29
+ return NodeService_1.NodeService.DOCUMENT_FRAGMENT_NODE
30
+ }
31
+
32
+ /**
33
+ * The first element, in tree order, whose id matches the given value, or null when there is none (the DOM's
34
+ * NonElementParentNode mixin, which Document and DocumentFragment both implement).
35
+ * @param {string} id
36
+ * @returns {PseudoElement|null}
37
+ */
38
+ getElementById (id) {
39
+ return (0, getElementById_1.default)(this, id)
40
+ }
41
+ }
42
+ exports.DocumentFragmentService = DocumentFragmentService
@@ -1,46 +1,46 @@
1
- import { NodeService, TextService, CommentService } from './NodeService';
2
- import { PseudoDocument } from '../interfaces/PseudoDocument';
3
- import { PseudoElement } from '../interfaces/PseudoElement';
4
- import { DocumentFragmentService } from './DocumentFragmentService';
5
- /**
6
- * Simulate the behaviour of the Document Class when there is no DOM available.
7
- * @author Joshua Heagle <joshuaheagle@gmail.com>
8
- * @class
9
- * @augments NodeService
10
- */
11
- export declare class DocumentService extends NodeService implements PseudoDocument {
12
- get nodeName(): string;
13
- get nodeType(): number;
14
- get textContent(): string | null;
15
- set textContent(text: string | null);
16
- /**
17
- * The first element, in tree order, whose id matches the given value, or null when there is none.
18
- * @param {string} id
19
- * @returns {PseudoElement|null}
20
- */
21
- getElementById(id: string): PseudoElement | null;
22
- /**
23
- * Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
24
- * @param {string} [tagName='div'] The type of element to create
25
- * @returns {PseudoElement}
26
- */
27
- createElement(tagName?: string): PseudoElement;
28
- /**
29
- * Make a text node which belongs to this document.
30
- * @param {string} [data=''] The text
31
- * @returns {TextService}
32
- */
33
- createTextNode(data?: string): TextService;
34
- /**
35
- * Make a comment which belongs to this document.
36
- * @param {string} [data=''] The comment
37
- * @returns {CommentService}
38
- */
39
- createComment(data?: string): CommentService;
40
- /**
41
- * Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
42
- * then inserted in one go.
43
- * @returns {DocumentFragmentService}
44
- */
45
- createDocumentFragment(): DocumentFragmentService;
46
- }
1
+ import { NodeService, TextService, CommentService } from './NodeService';
2
+ import { PseudoDocument } from '../interfaces/PseudoDocument';
3
+ import { PseudoElement } from '../interfaces/PseudoElement';
4
+ import { DocumentFragmentService } from './DocumentFragmentService';
5
+ /**
6
+ * Simulate the behaviour of the Document Class when there is no DOM available.
7
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
8
+ * @class
9
+ * @augments NodeService
10
+ */
11
+ export declare class DocumentService extends NodeService implements PseudoDocument {
12
+ get nodeName(): string;
13
+ get nodeType(): number;
14
+ get textContent(): string | null;
15
+ set textContent(text: string | null);
16
+ /**
17
+ * The first element, in tree order, whose id matches the given value, or null when there is none.
18
+ * @param {string} id
19
+ * @returns {PseudoElement|null}
20
+ */
21
+ getElementById(id: string): PseudoElement | null;
22
+ /**
23
+ * Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
24
+ * @param {string} [tagName='div'] The type of element to create
25
+ * @returns {PseudoElement}
26
+ */
27
+ createElement(tagName?: string): PseudoElement;
28
+ /**
29
+ * Make a text node which belongs to this document.
30
+ * @param {string} [data=''] The text
31
+ * @returns {TextService}
32
+ */
33
+ createTextNode(data?: string): TextService;
34
+ /**
35
+ * Make a comment which belongs to this document.
36
+ * @param {string} [data=''] The comment
37
+ * @returns {CommentService}
38
+ */
39
+ createComment(data?: string): CommentService;
40
+ /**
41
+ * Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
42
+ * then inserted in one go.
43
+ * @returns {DocumentFragmentService}
44
+ */
45
+ createDocumentFragment(): DocumentFragmentService;
46
+ }