pseudo-dom 0.6.0 → 0.7.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 (122) hide show
  1. package/README.md +432 -13
  2. package/browser/pseudo-dom.js +3364 -603
  3. package/browser/pseudo-dom.min.js +1 -1
  4. package/dist/classes/PseudoEventListener.d.ts +96 -96
  5. package/dist/classes/PseudoEventListener.js +151 -151
  6. package/dist/classes/PseudoHTMLDocument.d.ts +67 -67
  7. package/dist/classes/PseudoHTMLDocument.js +144 -144
  8. package/dist/classes/PseudoNodeList.d.ts +34 -34
  9. package/dist/classes/PseudoNodeList.js +71 -71
  10. package/dist/classes.d.ts +20 -20
  11. package/dist/classes.js +31 -31
  12. package/dist/factories/createEvent.d.ts +28 -28
  13. package/dist/factories/createEvent.js +56 -56
  14. package/dist/factories/cssSelectAdapter.d.ts +23 -0
  15. package/dist/factories/cssSelectAdapter.js +87 -0
  16. package/dist/factories/cssSelectAdapter.min.js +1 -0
  17. package/dist/factories/eventDefaults.d.ts +31 -31
  18. package/dist/factories/eventDefaults.js +105 -105
  19. package/dist/factories/generateDocument.d.ts +11 -11
  20. package/dist/factories/generateDocument.js +65 -65
  21. package/dist/factories/generateNode.d.ts +32 -32
  22. package/dist/factories/generateNode.js +85 -85
  23. package/dist/factories/generateNodeList.d.ts +9 -9
  24. package/dist/factories/generateNodeList.js +13 -13
  25. package/dist/factories/query.d.ts +33 -0
  26. package/dist/factories/query.js +66 -0
  27. package/dist/factories/query.min.js +1 -0
  28. package/dist/factories.d.ts +11 -11
  29. package/dist/factories.js +27 -27
  30. package/dist/functions/activeElement.d.ts +14 -14
  31. package/dist/functions/activeElement.js +33 -33
  32. package/dist/functions/getParentNodes.d.ts +11 -11
  33. package/dist/functions/getParentNodes.js +22 -22
  34. package/dist/functions/getParentNodesFromAttribute.d.ts +14 -14
  35. package/dist/functions/getParentNodesFromAttribute.js +29 -29
  36. package/dist/functions/modifierState.d.ts +29 -29
  37. package/dist/functions/modifierState.js +41 -41
  38. package/dist/functions.d.ts +5 -5
  39. package/dist/functions.js +23 -23
  40. package/dist/interfaces/PseudoAnimation.d.ts +3 -3
  41. package/dist/interfaces/PseudoAnimation.js +5 -5
  42. package/dist/interfaces/PseudoAttr.d.ts +11 -11
  43. package/dist/interfaces/PseudoAttr.js +5 -5
  44. package/dist/interfaces/PseudoDOMTokenList.d.ts +16 -16
  45. package/dist/interfaces/PseudoDOMTokenList.js +5 -5
  46. package/dist/interfaces/PseudoDocument.d.ts +7 -0
  47. package/dist/interfaces/PseudoDocument.js +5 -5
  48. package/dist/interfaces/PseudoDocumentFragment.d.ts +3 -3
  49. package/dist/interfaces/PseudoDocumentFragment.js +5 -5
  50. package/dist/interfaces/PseudoElement.d.ts +20 -7
  51. package/dist/interfaces/PseudoElement.js +5 -5
  52. package/dist/interfaces/PseudoEvent.d.ts +79 -79
  53. package/dist/interfaces/PseudoEvent.js +10 -10
  54. package/dist/interfaces/PseudoEventTarget.d.ts +46 -46
  55. package/dist/interfaces/PseudoEventTarget.js +5 -5
  56. package/dist/interfaces/PseudoHTMLCollection.d.ts +23 -23
  57. package/dist/interfaces/PseudoHTMLCollection.js +5 -5
  58. package/dist/interfaces/PseudoHTMLElement.d.ts +22 -22
  59. package/dist/interfaces/PseudoHTMLElement.js +5 -5
  60. package/dist/interfaces/PseudoHTMLSlotElement.d.ts +3 -3
  61. package/dist/interfaces/PseudoHTMLSlotElement.js +5 -5
  62. package/dist/interfaces/PseudoNamedNodeMap.d.ts +11 -11
  63. package/dist/interfaces/PseudoNamedNodeMap.js +5 -5
  64. package/dist/interfaces/PseudoNode.d.ts +179 -179
  65. package/dist/interfaces/PseudoNode.js +5 -5
  66. package/dist/interfaces/PseudoShadowRoot.d.ts +3 -3
  67. package/dist/interfaces/PseudoShadowRoot.js +5 -5
  68. package/dist/main.d.ts +63 -63
  69. package/dist/main.js +155 -155
  70. package/dist/services/AnimationService.d.ts +4 -4
  71. package/dist/services/AnimationService.js +16 -16
  72. package/dist/services/AttrService.d.ts +37 -37
  73. package/dist/services/AttrService.js +81 -81
  74. package/dist/services/CommentService.d.ts +1 -1
  75. package/dist/services/CommentService.js +13 -13
  76. package/dist/services/CustomEventService.d.ts +37 -37
  77. package/dist/services/CustomEventService.js +35 -35
  78. package/dist/services/DOMTokenListService.d.ts +33 -33
  79. package/dist/services/DOMTokenListService.js +117 -117
  80. package/dist/services/DocumentFragmentService.d.ts +13 -13
  81. package/dist/services/DocumentFragmentService.js +24 -24
  82. package/dist/services/DocumentService.d.ts +7 -0
  83. package/dist/services/DocumentService.js +23 -0
  84. package/dist/services/DocumentService.min.js +1 -1
  85. package/dist/services/ElementService.d.ts +13 -0
  86. package/dist/services/ElementService.js +20 -0
  87. package/dist/services/ElementService.min.js +1 -1
  88. package/dist/services/EventService.d.ts +120 -120
  89. package/dist/services/EventService.js +250 -250
  90. package/dist/services/EventTargetService.d.ts +84 -84
  91. package/dist/services/EventTargetService.js +232 -232
  92. package/dist/services/FocusEventService.d.ts +32 -32
  93. package/dist/services/FocusEventService.js +35 -35
  94. package/dist/services/HTMLCollectionService.d.ts +11 -6
  95. package/dist/services/HTMLCollectionService.js +25 -8
  96. package/dist/services/HTMLCollectionService.min.js +1 -1
  97. package/dist/services/HTMLElementService.d.ts +57 -57
  98. package/dist/services/HTMLElementService.js +163 -163
  99. package/dist/services/HTMLSlotElementService.d.ts +4 -4
  100. package/dist/services/HTMLSlotElementService.js +9 -9
  101. package/dist/services/InputEventService.d.ts +41 -41
  102. package/dist/services/InputEventService.js +47 -47
  103. package/dist/services/KeyboardEventService.d.ts +70 -70
  104. package/dist/services/KeyboardEventService.js +86 -86
  105. package/dist/services/MouseEventService.d.ts +80 -80
  106. package/dist/services/MouseEventService.js +108 -108
  107. package/dist/services/NamedNodeMapService.d.ts +23 -23
  108. package/dist/services/NamedNodeMapService.js +77 -77
  109. package/dist/services/NodeService.d.ts +26 -0
  110. package/dist/services/NodeService.js +42 -0
  111. package/dist/services/NodeService.min.js +1 -1
  112. package/dist/services/PointerEventService.d.ts +51 -51
  113. package/dist/services/PointerEventService.js +67 -67
  114. package/dist/services/ShadowRootService.d.ts +4 -4
  115. package/dist/services/ShadowRootService.js +9 -9
  116. package/dist/services/TextService.d.ts +1 -1
  117. package/dist/services/TextService.js +13 -13
  118. package/dist/services/UIEventService.d.ts +43 -43
  119. package/dist/services/UIEventService.js +42 -42
  120. package/dist/simulate.d.ts +32 -32
  121. package/dist/simulate.js +115 -115
  122. package/package.json +3 -2
@@ -1,179 +1,179 @@
1
- /**
2
- * @file Substitute for the DOM Node Class.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.0.0
5
- */
6
- import { PseudoEventTarget } from './PseudoEventTarget';
7
- import { PseudoNodeList } from '../classes/PseudoNodeList';
8
- import { LinkedTreeList } from 'collect-your-stuff/dist/collections/linked-tree-list/LinkedTreeList';
9
- import { PseudoDocument } from './PseudoDocument';
10
- import { PseudoElement } from './PseudoElement';
11
- import { PseudoDocumentFragment } from './PseudoDocumentFragment';
12
- /**
13
- * Simulate the behaviour of the Node Class when there is no DOM available.
14
- * @author Joshua Heagle <joshuaheagle@gmail.com>
15
- * @class
16
- * @augments PseudoEventTarget
17
- * @property {string} name
18
- * @property {function} appendChild
19
- * @property {function} removeChild
20
- */
21
- export interface PseudoNode extends PseudoEventTarget {
22
- /**
23
- * Returns a string representing the base URL of the document containing the Node.
24
- */
25
- get baseURI(): Location | string;
26
- /**
27
- * Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
28
- */
29
- get childNodes(): PseudoNodeList | LinkedTreeList;
30
- /**
31
- * Returns a Node representing the first direct child node of the node, or null if the node has no child.
32
- */
33
- get firstChild(): PseudoNode | null;
34
- /**
35
- * A boolean indicating whether or not the Node is connected (directly or indirectly) to the context object, e.g. the Document object in the case of the normal DOM, or the ShadowRoot in the case of a shadow DOM.
36
- */
37
- get isConnected(): boolean;
38
- /**
39
- * Returns a Node representing the last direct child node of the node, or null if the node has no child.
40
- */
41
- get lastChild(): PseudoNode | null;
42
- /**
43
- * Returns a Node representing the next node in the tree, or null if there isn't such node.
44
- */
45
- get nextSibling(): PseudoNode | null;
46
- /**
47
- * Returns a string containing the name of the Node. The structure of the name will differ with the node type. E.g. An HTMLElement will contain the name of the corresponding tag, like 'audio' for an HTMLAudioElement, a Text node will have the '#text' string, or a Document node will have the '#document' string.
48
- */
49
- get nodeName(): string;
50
- /**
51
- * Returns an unsigned short representing the type of the node. Possible values are:
52
- * ________________________________________
53
- * | Name | Value |
54
- * |----------------------------------------
55
- * | ELEMENT_NODE | 1 |
56
- * | ATTRIBUTE_NODE | 2 |
57
- * | TEXT_NODE | 3 |
58
- * | CDATA_SECTION_NODE | 4 |
59
- * | PROCESSING_INSTRUCTION_NODE | 7 |
60
- * | COMMENT_NODE | 8 |
61
- * | DOCUMENT_NODE | 9 |
62
- * | DOCUMENT_TYPE_NODE | 10 |
63
- * | DOCUMENT_FRAGMENT_NODE | 11 |
64
- */
65
- get nodeType(): number;
66
- /**
67
- * Returns the value of the current node.
68
- */
69
- get nodeValue(): string | null;
70
- /**
71
- * Sets the value of the current node.
72
- * @param value
73
- */
74
- set nodeValue(value: string | null);
75
- /**
76
- * Returns the Document that this node belongs to. If the node is itself a document, returns null.
77
- */
78
- get ownerDocument(): PseudoDocument | null;
79
- /**
80
- * Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
81
- */
82
- get parentNode(): PseudoNode | null;
83
- /**
84
- * Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
85
- */
86
- get parentElement(): PseudoElement | null;
87
- /**
88
- * Returns a Node representing the previous node in the tree, or null if there isn't such node.
89
- */
90
- get previousSibling(): PseudoNode | null;
91
- /**
92
- * Returns the textual content of an element and all its descendants.
93
- */
94
- get textContent(): string | null;
95
- /**
96
- * Sets the textual content of an element and all its descendants.
97
- * @param text
98
- */
99
- set textContent(text: string | null);
100
- /**
101
- * Adds the specified childNode argument as the last child to the current node. If the argument referenced an existing node on the DOM tree, the node will be detached from its current position and attached at the new position.
102
- * @param {PseudoNode} childNode
103
- * @returns {PseudoNode}
104
- */
105
- appendChild(childNode: PseudoNode): PseudoNode;
106
- /**
107
- * Clone a Node, and optionally, all of its contents. By default, it clones the content of the node.
108
- * @param deep
109
- */
110
- cloneNode(deep: boolean): PseudoNode;
111
- /**
112
- * Compares the position of the current node against another node in any other document.
113
- * @param otherNode
114
- */
115
- compareDocumentPosition(otherNode: PseudoNode): number;
116
- /**
117
- * Returns true or false value indicating whether or not a node is a descendant of the calling node.
118
- * @param otherNode
119
- */
120
- contains(otherNode: PseudoNode): boolean;
121
- /**
122
- * Returns the context object's root which optionally includes the shadow root if it is available.
123
- * @param options
124
- */
125
- getRootNode(options: {
126
- composed: boolean;
127
- }): PseudoNode;
128
- /**
129
- * Returns a boolean value indicating whether the element has any child nodes.
130
- */
131
- hasChildNodes(): boolean;
132
- /**
133
- * Inserts a Node before the reference node as a child of a specified parent node.
134
- * @param newNode
135
- * @param referenceNode
136
- */
137
- insertBefore(newNode: PseudoNode, referenceNode: PseudoNode | null): PseudoNode | PseudoDocumentFragment;
138
- /**
139
- * Accepts a namespace URI as an argument and returns a boolean value with a value of true if the namespace is the default namespace on the given node or false if not.
140
- * @param namespaceURI
141
- */
142
- isDefaultNamespace(namespaceURI: string | null): boolean;
143
- /**
144
- * Returns a boolean value which indicates whether two nodes are of the same type and all their defining data points match.
145
- * @param otherNode
146
- */
147
- isEqualNode(otherNode: PseudoNode): boolean;
148
- /**
149
- * Returns a boolean value indicating whether the two nodes are the same (that is, they reference the same object).
150
- * @param otherNode
151
- */
152
- isSameNode(otherNode: PseudoNode): boolean;
153
- /**
154
- * Returns a string containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.
155
- * @param namespace
156
- */
157
- lookupPrefix(namespace: string): string | null;
158
- /**
159
- * Accepts a prefix and returns the namespace URI associated with it on the given node if found (and null if not). Supplying null for the prefix will return the default namespace.
160
- * @param prefix
161
- */
162
- lookupNamespaceURI(prefix: string): string | null;
163
- /**
164
- * Clean up all the text nodes under this element (merge adjacent, remove empty).
165
- */
166
- normalize(): void;
167
- /**
168
- * Removes a child node from the current element, which must be a child of the current node.
169
- * @param {PseudoNode} child
170
- * @returns {PseudoNode}
171
- */
172
- removeChild(child: PseudoNode): PseudoNode;
173
- /**
174
- * Replaces one child Node of the current one with the second one given in parameter.
175
- * @param newChild
176
- * @param oldChild
177
- */
178
- replaceChild(newChild: PseudoNode, oldChild: PseudoNode): PseudoNode;
179
- }
1
+ /**
2
+ * @file Substitute for the DOM Node Class.
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.0.0
5
+ */
6
+ import { PseudoEventTarget } from './PseudoEventTarget';
7
+ import { PseudoNodeList } from '../classes/PseudoNodeList';
8
+ import { LinkedTreeList } from 'collect-your-stuff/dist/collections/linked-tree-list/LinkedTreeList';
9
+ import { PseudoDocument } from './PseudoDocument';
10
+ import { PseudoElement } from './PseudoElement';
11
+ import { PseudoDocumentFragment } from './PseudoDocumentFragment';
12
+ /**
13
+ * Simulate the behaviour of the Node Class when there is no DOM available.
14
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
15
+ * @class
16
+ * @augments PseudoEventTarget
17
+ * @property {string} name
18
+ * @property {function} appendChild
19
+ * @property {function} removeChild
20
+ */
21
+ export interface PseudoNode extends PseudoEventTarget {
22
+ /**
23
+ * Returns a string representing the base URL of the document containing the Node.
24
+ */
25
+ get baseURI(): Location | string;
26
+ /**
27
+ * Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
28
+ */
29
+ get childNodes(): PseudoNodeList | LinkedTreeList;
30
+ /**
31
+ * Returns a Node representing the first direct child node of the node, or null if the node has no child.
32
+ */
33
+ get firstChild(): PseudoNode | null;
34
+ /**
35
+ * A boolean indicating whether or not the Node is connected (directly or indirectly) to the context object, e.g. the Document object in the case of the normal DOM, or the ShadowRoot in the case of a shadow DOM.
36
+ */
37
+ get isConnected(): boolean;
38
+ /**
39
+ * Returns a Node representing the last direct child node of the node, or null if the node has no child.
40
+ */
41
+ get lastChild(): PseudoNode | null;
42
+ /**
43
+ * Returns a Node representing the next node in the tree, or null if there isn't such node.
44
+ */
45
+ get nextSibling(): PseudoNode | null;
46
+ /**
47
+ * Returns a string containing the name of the Node. The structure of the name will differ with the node type. E.g. An HTMLElement will contain the name of the corresponding tag, like 'audio' for an HTMLAudioElement, a Text node will have the '#text' string, or a Document node will have the '#document' string.
48
+ */
49
+ get nodeName(): string;
50
+ /**
51
+ * Returns an unsigned short representing the type of the node. Possible values are:
52
+ * ________________________________________
53
+ * | Name | Value |
54
+ * |----------------------------------------
55
+ * | ELEMENT_NODE | 1 |
56
+ * | ATTRIBUTE_NODE | 2 |
57
+ * | TEXT_NODE | 3 |
58
+ * | CDATA_SECTION_NODE | 4 |
59
+ * | PROCESSING_INSTRUCTION_NODE | 7 |
60
+ * | COMMENT_NODE | 8 |
61
+ * | DOCUMENT_NODE | 9 |
62
+ * | DOCUMENT_TYPE_NODE | 10 |
63
+ * | DOCUMENT_FRAGMENT_NODE | 11 |
64
+ */
65
+ get nodeType(): number;
66
+ /**
67
+ * Returns the value of the current node.
68
+ */
69
+ get nodeValue(): string | null;
70
+ /**
71
+ * Sets the value of the current node.
72
+ * @param value
73
+ */
74
+ set nodeValue(value: string | null);
75
+ /**
76
+ * Returns the Document that this node belongs to. If the node is itself a document, returns null.
77
+ */
78
+ get ownerDocument(): PseudoDocument | null;
79
+ /**
80
+ * Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
81
+ */
82
+ get parentNode(): PseudoNode | null;
83
+ /**
84
+ * Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
85
+ */
86
+ get parentElement(): PseudoElement | null;
87
+ /**
88
+ * Returns a Node representing the previous node in the tree, or null if there isn't such node.
89
+ */
90
+ get previousSibling(): PseudoNode | null;
91
+ /**
92
+ * Returns the textual content of an element and all its descendants.
93
+ */
94
+ get textContent(): string | null;
95
+ /**
96
+ * Sets the textual content of an element and all its descendants.
97
+ * @param text
98
+ */
99
+ set textContent(text: string | null);
100
+ /**
101
+ * Adds the specified childNode argument as the last child to the current node. If the argument referenced an existing node on the DOM tree, the node will be detached from its current position and attached at the new position.
102
+ * @param {PseudoNode} childNode
103
+ * @returns {PseudoNode}
104
+ */
105
+ appendChild(childNode: PseudoNode): PseudoNode;
106
+ /**
107
+ * Clone a Node, and optionally, all of its contents. By default, it clones the content of the node.
108
+ * @param deep
109
+ */
110
+ cloneNode(deep: boolean): PseudoNode;
111
+ /**
112
+ * Compares the position of the current node against another node in any other document.
113
+ * @param otherNode
114
+ */
115
+ compareDocumentPosition(otherNode: PseudoNode): number;
116
+ /**
117
+ * Returns true or false value indicating whether or not a node is a descendant of the calling node.
118
+ * @param otherNode
119
+ */
120
+ contains(otherNode: PseudoNode): boolean;
121
+ /**
122
+ * Returns the context object's root which optionally includes the shadow root if it is available.
123
+ * @param options
124
+ */
125
+ getRootNode(options: {
126
+ composed: boolean;
127
+ }): PseudoNode;
128
+ /**
129
+ * Returns a boolean value indicating whether the element has any child nodes.
130
+ */
131
+ hasChildNodes(): boolean;
132
+ /**
133
+ * Inserts a Node before the reference node as a child of a specified parent node.
134
+ * @param newNode
135
+ * @param referenceNode
136
+ */
137
+ insertBefore(newNode: PseudoNode, referenceNode: PseudoNode | null): PseudoNode | PseudoDocumentFragment;
138
+ /**
139
+ * Accepts a namespace URI as an argument and returns a boolean value with a value of true if the namespace is the default namespace on the given node or false if not.
140
+ * @param namespaceURI
141
+ */
142
+ isDefaultNamespace(namespaceURI: string | null): boolean;
143
+ /**
144
+ * Returns a boolean value which indicates whether two nodes are of the same type and all their defining data points match.
145
+ * @param otherNode
146
+ */
147
+ isEqualNode(otherNode: PseudoNode): boolean;
148
+ /**
149
+ * Returns a boolean value indicating whether the two nodes are the same (that is, they reference the same object).
150
+ * @param otherNode
151
+ */
152
+ isSameNode(otherNode: PseudoNode): boolean;
153
+ /**
154
+ * Returns a string containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.
155
+ * @param namespace
156
+ */
157
+ lookupPrefix(namespace: string): string | null;
158
+ /**
159
+ * Accepts a prefix and returns the namespace URI associated with it on the given node if found (and null if not). Supplying null for the prefix will return the default namespace.
160
+ * @param prefix
161
+ */
162
+ lookupNamespaceURI(prefix: string): string | null;
163
+ /**
164
+ * Clean up all the text nodes under this element (merge adjacent, remove empty).
165
+ */
166
+ normalize(): void;
167
+ /**
168
+ * Removes a child node from the current element, which must be a child of the current node.
169
+ * @param {PseudoNode} child
170
+ * @returns {PseudoNode}
171
+ */
172
+ removeChild(child: PseudoNode): PseudoNode;
173
+ /**
174
+ * Replaces one child Node of the current one with the second one given in parameter.
175
+ * @param newChild
176
+ * @param oldChild
177
+ */
178
+ replaceChild(newChild: PseudoNode, oldChild: PseudoNode): PseudoNode;
179
+ }
@@ -1,5 +1,5 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
@@ -1,3 +1,3 @@
1
- import { PseudoDocumentFragment } from './PseudoDocumentFragment';
2
- export interface PseudoShadowRoot extends PseudoDocumentFragment {
3
- }
1
+ import { PseudoDocumentFragment } from './PseudoDocumentFragment';
2
+ export interface PseudoShadowRoot extends PseudoDocumentFragment {
3
+ }
@@ -1,5 +1,5 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
package/dist/main.d.ts CHANGED
@@ -1,63 +1,63 @@
1
- /**
2
- * @file All of the Pseudo Dom Helper Objects functions for simulating parts of the DOM when running scripts in NodeJs.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.0.0
5
- */
6
- import { EventService as PseudoEvent } from './services/EventService';
7
- import PseudoEventTarget from './services/EventTargetService';
8
- import { NodeService as PseudoNode } from './services/NodeService';
9
- import { ElementService as PseudoElement } from './services/ElementService';
10
- import { HTMLElementService as PseudoHTMLElement } from './services/HTMLElementService';
11
- import PseudoHTMLDocument from './classes/PseudoHTMLDocument';
12
- import generateDocument from './factories/generateDocument';
13
- import createEvent from './factories/createEvent';
14
- import eventDefaults from './factories/eventDefaults';
15
- import { UIEventService as PseudoUIEvent } from './services/UIEventService';
16
- import { MouseEventService as PseudoMouseEvent } from './services/MouseEventService';
17
- import { PointerEventService as PseudoPointerEvent } from './services/PointerEventService';
18
- import { KeyboardEventService as PseudoKeyboardEvent } from './services/KeyboardEventService';
19
- import { FocusEventService as PseudoFocusEvent } from './services/FocusEventService';
20
- import { InputEventService as PseudoInputEvent } from './services/InputEventService';
21
- import { CustomEventService as PseudoCustomEvent } from './services/CustomEventService';
22
- import simulate from './simulate';
23
- import { TextService as PseudoText, CommentService as PseudoComment } from './services/NodeService';
24
- /**
25
- * All methods exported from this module are encapsulated within pseudoDom.
26
- * @author Joshua Heagle <joshuaheagle@gmail.com>
27
- * @typedef {Object} pseudoDom
28
- * @module pseudoDom/objects
29
- */
30
- declare const pseudoDom: {
31
- generateDocument: (root: Window | any, context?: object) => Window | PseudoEventTarget;
32
- createEvent: (type: string, init?: {
33
- [option: string]: any;
34
- }, { browser, trusted }?: import("./factories/createEvent").CreateEventOptions) => PseudoEvent;
35
- eventDefaults: {
36
- [type: string]: import("./factories/eventDefaults").EventDefinition;
37
- };
38
- simulate: {
39
- click: (element: any, init?: {
40
- [option: string]: any;
41
- }) => boolean;
42
- keyPress: (element: any, key: string, init?: {
43
- [option: string]: any;
44
- }) => boolean;
45
- };
46
- PseudoEvent: typeof PseudoEvent;
47
- PseudoUIEvent: typeof PseudoUIEvent;
48
- PseudoMouseEvent: typeof PseudoMouseEvent;
49
- PseudoPointerEvent: typeof PseudoPointerEvent;
50
- PseudoKeyboardEvent: typeof PseudoKeyboardEvent;
51
- PseudoFocusEvent: typeof PseudoFocusEvent;
52
- PseudoInputEvent: typeof PseudoInputEvent;
53
- PseudoCustomEvent: typeof PseudoCustomEvent;
54
- PseudoEventTarget: typeof PseudoEventTarget;
55
- PseudoNode: typeof PseudoNode;
56
- PseudoText: typeof PseudoText;
57
- PseudoComment: typeof PseudoComment;
58
- PseudoElement: typeof PseudoElement;
59
- PseudoHTMLElement: typeof PseudoHTMLElement;
60
- PseudoHTMLDocument: typeof PseudoHTMLDocument;
61
- };
62
- export { generateDocument, createEvent, eventDefaults, simulate, PseudoEvent, PseudoUIEvent, PseudoMouseEvent, PseudoPointerEvent, PseudoKeyboardEvent, PseudoFocusEvent, PseudoInputEvent, PseudoCustomEvent, PseudoEventTarget, PseudoNode, PseudoText, PseudoComment, PseudoElement, PseudoHTMLElement, PseudoHTMLDocument };
63
- export default pseudoDom;
1
+ /**
2
+ * @file All of the Pseudo Dom Helper Objects functions for simulating parts of the DOM when running scripts in NodeJs.
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.0.0
5
+ */
6
+ import { EventService as PseudoEvent } from './services/EventService';
7
+ import PseudoEventTarget from './services/EventTargetService';
8
+ import { NodeService as PseudoNode } from './services/NodeService';
9
+ import { ElementService as PseudoElement } from './services/ElementService';
10
+ import { HTMLElementService as PseudoHTMLElement } from './services/HTMLElementService';
11
+ import PseudoHTMLDocument from './classes/PseudoHTMLDocument';
12
+ import generateDocument from './factories/generateDocument';
13
+ import createEvent from './factories/createEvent';
14
+ import eventDefaults from './factories/eventDefaults';
15
+ import { UIEventService as PseudoUIEvent } from './services/UIEventService';
16
+ import { MouseEventService as PseudoMouseEvent } from './services/MouseEventService';
17
+ import { PointerEventService as PseudoPointerEvent } from './services/PointerEventService';
18
+ import { KeyboardEventService as PseudoKeyboardEvent } from './services/KeyboardEventService';
19
+ import { FocusEventService as PseudoFocusEvent } from './services/FocusEventService';
20
+ import { InputEventService as PseudoInputEvent } from './services/InputEventService';
21
+ import { CustomEventService as PseudoCustomEvent } from './services/CustomEventService';
22
+ import simulate from './simulate';
23
+ import { TextService as PseudoText, CommentService as PseudoComment } from './services/NodeService';
24
+ /**
25
+ * All methods exported from this module are encapsulated within pseudoDom.
26
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
27
+ * @typedef {Object} pseudoDom
28
+ * @module pseudoDom/objects
29
+ */
30
+ declare const pseudoDom: {
31
+ generateDocument: (root: Window | any, context?: object) => Window | PseudoEventTarget;
32
+ createEvent: (type: string, init?: {
33
+ [option: string]: any;
34
+ }, { browser, trusted }?: import("./factories/createEvent").CreateEventOptions) => PseudoEvent;
35
+ eventDefaults: {
36
+ [type: string]: import("./factories/eventDefaults").EventDefinition;
37
+ };
38
+ simulate: {
39
+ click: (element: any, init?: {
40
+ [option: string]: any;
41
+ }) => boolean;
42
+ keyPress: (element: any, key: string, init?: {
43
+ [option: string]: any;
44
+ }) => boolean;
45
+ };
46
+ PseudoEvent: typeof PseudoEvent;
47
+ PseudoUIEvent: typeof PseudoUIEvent;
48
+ PseudoMouseEvent: typeof PseudoMouseEvent;
49
+ PseudoPointerEvent: typeof PseudoPointerEvent;
50
+ PseudoKeyboardEvent: typeof PseudoKeyboardEvent;
51
+ PseudoFocusEvent: typeof PseudoFocusEvent;
52
+ PseudoInputEvent: typeof PseudoInputEvent;
53
+ PseudoCustomEvent: typeof PseudoCustomEvent;
54
+ PseudoEventTarget: typeof PseudoEventTarget;
55
+ PseudoNode: typeof PseudoNode;
56
+ PseudoText: typeof PseudoText;
57
+ PseudoComment: typeof PseudoComment;
58
+ PseudoElement: typeof PseudoElement;
59
+ PseudoHTMLElement: typeof PseudoHTMLElement;
60
+ PseudoHTMLDocument: typeof PseudoHTMLDocument;
61
+ };
62
+ export { generateDocument, createEvent, eventDefaults, simulate, PseudoEvent, PseudoUIEvent, PseudoMouseEvent, PseudoPointerEvent, PseudoKeyboardEvent, PseudoFocusEvent, PseudoInputEvent, PseudoCustomEvent, PseudoEventTarget, PseudoNode, PseudoText, PseudoComment, PseudoElement, PseudoHTMLElement, PseudoHTMLDocument };
63
+ export default pseudoDom;