pseudo-dom 0.3.0 → 0.5.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.
- package/README.md +1632 -111
- package/browser/pseudo-dom.js +23759 -1844
- package/browser/pseudo-dom.min.js +1 -1
- package/dist/classes/PseudoHTMLDocument.d.ts +33 -1
- package/dist/classes/PseudoHTMLDocument.js +80 -2
- package/dist/classes/PseudoHTMLDocument.min.js +1 -1
- package/dist/factories/createEvent.d.ts +28 -0
- package/dist/factories/createEvent.js +56 -0
- package/dist/factories/createEvent.min.js +1 -0
- package/dist/factories/eventDefaults.d.ts +31 -0
- package/dist/factories/eventDefaults.js +105 -0
- package/dist/factories/eventDefaults.min.js +1 -0
- package/dist/factories.d.ts +6 -0
- package/dist/factories.js +5 -1
- package/dist/factories.min.js +1 -1
- package/dist/functions/activeElement.d.ts +14 -0
- package/dist/functions/activeElement.js +33 -0
- package/dist/functions/activeElement.min.js +1 -0
- package/dist/functions/modifierState.d.ts +29 -0
- package/dist/functions/modifierState.js +41 -0
- package/dist/functions/modifierState.min.js +1 -0
- package/dist/main.d.ts +35 -1
- package/dist/main.js +81 -1
- package/dist/main.min.js +1 -1
- package/dist/services/AttrService.d.ts +6 -0
- package/dist/services/AttrService.js +24 -0
- package/dist/services/AttrService.min.js +1 -1
- package/dist/services/CommentService.d.ts +1 -0
- package/dist/services/CommentService.js +13 -0
- package/dist/services/CommentService.min.js +1 -0
- package/dist/services/CustomEventService.d.ts +37 -0
- package/dist/services/CustomEventService.js +35 -0
- package/dist/services/CustomEventService.min.js +1 -0
- package/dist/services/ElementService.d.ts +20 -0
- package/dist/services/ElementService.js +82 -15
- package/dist/services/ElementService.min.js +1 -1
- package/dist/services/EventService.d.ts +2 -0
- package/dist/services/EventService.js +7 -1
- package/dist/services/EventService.min.js +1 -1
- package/dist/services/FocusEventService.d.ts +32 -0
- package/dist/services/FocusEventService.js +35 -0
- package/dist/services/FocusEventService.min.js +1 -0
- package/dist/services/HTMLElementService.d.ts +20 -0
- package/dist/services/HTMLElementService.js +95 -0
- package/dist/services/HTMLElementService.min.js +1 -1
- package/dist/services/InputEventService.d.ts +41 -0
- package/dist/services/InputEventService.js +47 -0
- package/dist/services/InputEventService.min.js +1 -0
- package/dist/services/KeyboardEventService.d.ts +70 -0
- package/dist/services/KeyboardEventService.js +86 -0
- package/dist/services/KeyboardEventService.min.js +1 -0
- package/dist/services/MouseEventService.d.ts +80 -0
- package/dist/services/MouseEventService.js +108 -0
- package/dist/services/MouseEventService.min.js +1 -0
- package/dist/services/NodeService.d.ts +105 -8
- package/dist/services/NodeService.js +313 -17
- package/dist/services/NodeService.min.js +1 -1
- package/dist/services/PointerEventService.d.ts +51 -0
- package/dist/services/PointerEventService.js +67 -0
- package/dist/services/PointerEventService.min.js +1 -0
- package/dist/services/TextService.d.ts +1 -0
- package/dist/services/TextService.js +13 -0
- package/dist/services/TextService.min.js +1 -0
- package/dist/services/UIEventService.d.ts +43 -0
- package/dist/services/UIEventService.js +42 -0
- package/dist/services/UIEventService.min.js +1 -0
- package/dist/simulate.d.ts +32 -0
- package/dist/simulate.js +115 -0
- package/dist/simulate.min.js +1 -0
- package/package.json +3 -2
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* @type {PseudoHTMLElement}
|
|
9
9
|
*/
|
|
10
10
|
import { HTMLElementService as PseudoHTMLElement } from '../services/HTMLElementService';
|
|
11
|
+
import { TextService, CommentService } from '../services/NodeService';
|
|
12
|
+
import { DocumentFragmentService } from '../services/DocumentFragmentService';
|
|
13
|
+
import { PseudoNode } from '../interfaces/PseudoNode';
|
|
11
14
|
/**
|
|
12
15
|
* Simulate the behaviour of the HTMLDocument Class when there is no DOM available.
|
|
13
16
|
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
@@ -25,11 +28,40 @@ declare class PseudoHTMLDocument extends PseudoHTMLElement {
|
|
|
25
28
|
* @constructor
|
|
26
29
|
*/
|
|
27
30
|
constructor();
|
|
31
|
+
get nodeName(): string;
|
|
32
|
+
get nodeType(): number;
|
|
33
|
+
get textContent(): string | null;
|
|
34
|
+
set textContent(text: string | null);
|
|
28
35
|
/**
|
|
29
|
-
*
|
|
36
|
+
* Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
|
|
30
37
|
* @param {string} tagName - Tag Name is a string representing the type of Dom element this represents
|
|
31
38
|
* @returns {PseudoHTMLElement}
|
|
32
39
|
*/
|
|
33
40
|
createElement(tagName?: string): PseudoHTMLElement;
|
|
41
|
+
/**
|
|
42
|
+
* Make a text node which belongs to this document.
|
|
43
|
+
* @param {string} [data=''] The text
|
|
44
|
+
* @returns {TextService}
|
|
45
|
+
*/
|
|
46
|
+
createTextNode(data?: string): TextService;
|
|
47
|
+
/**
|
|
48
|
+
* Make a comment which belongs to this document.
|
|
49
|
+
* @param {string} [data=''] The comment
|
|
50
|
+
* @returns {CommentService}
|
|
51
|
+
*/
|
|
52
|
+
createComment(data?: string): CommentService;
|
|
53
|
+
/**
|
|
54
|
+
* Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
|
|
55
|
+
* then inserted in one go.
|
|
56
|
+
* @returns {DocumentFragmentService}
|
|
57
|
+
*/
|
|
58
|
+
createDocumentFragment(): DocumentFragmentService;
|
|
59
|
+
/**
|
|
60
|
+
* Make a copy of this document. The copy has no parent or listeners, and a deep copy has copies of everything in the
|
|
61
|
+
* document (a shallow one is an empty document).
|
|
62
|
+
* @param {boolean} [deep=false] Copy everything in the document as well
|
|
63
|
+
* @returns {PseudoNode}
|
|
64
|
+
*/
|
|
65
|
+
cloneNode(deep?: boolean): PseudoNode;
|
|
34
66
|
}
|
|
35
67
|
export default PseudoHTMLDocument;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
require('core-js/modules/esnext.iterator.constructor.js')
|
|
4
|
+
require('core-js/modules/esnext.iterator.find.js')
|
|
5
|
+
require('core-js/modules/esnext.iterator.for-each.js')
|
|
3
6
|
Object.defineProperty(exports, '__esModule', {
|
|
4
7
|
value: true
|
|
5
8
|
})
|
|
@@ -13,6 +16,8 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
13
16
|
* @type {PseudoHTMLElement}
|
|
14
17
|
*/
|
|
15
18
|
const HTMLElementService_1 = require('../services/HTMLElementService')
|
|
19
|
+
const NodeService_1 = require('../services/NodeService')
|
|
20
|
+
const DocumentFragmentService_1 = require('../services/DocumentFragmentService')
|
|
16
21
|
/**
|
|
17
22
|
* Simulate the behaviour of the HTMLDocument Class when there is no DOM available.
|
|
18
23
|
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
@@ -51,16 +56,89 @@ class PseudoHTMLDocument extends HTMLElementService_1.HTMLElementService {
|
|
|
51
56
|
html.appendChild(this.body)
|
|
52
57
|
}
|
|
53
58
|
|
|
59
|
+
get nodeName () {
|
|
60
|
+
return '#document'
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get nodeType () {
|
|
64
|
+
return NodeService_1.NodeService.DOCUMENT_NODE
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// A document has no text of its own, and setting it does nothing
|
|
68
|
+
get textContent () {
|
|
69
|
+
return null
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
set textContent (text) {}
|
|
54
73
|
/**
|
|
55
|
-
*
|
|
74
|
+
* Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
|
|
56
75
|
* @param {string} tagName - Tag Name is a string representing the type of Dom element this represents
|
|
57
76
|
* @returns {PseudoHTMLElement}
|
|
58
77
|
*/
|
|
59
78
|
createElement (tagName = 'div') {
|
|
60
79
|
// Like the DOM, the new element is not added anywhere: it has no parent until it is appended
|
|
61
|
-
|
|
80
|
+
const element = new HTMLElementService_1.HTMLElementService({
|
|
62
81
|
tagName
|
|
63
82
|
})
|
|
83
|
+
element.ownerDocumentStore = this
|
|
84
|
+
return element
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Make a text node which belongs to this document.
|
|
89
|
+
* @param {string} [data=''] The text
|
|
90
|
+
* @returns {TextService}
|
|
91
|
+
*/
|
|
92
|
+
createTextNode (data = '') {
|
|
93
|
+
const text = new NodeService_1.TextService(data)
|
|
94
|
+
text.ownerDocumentStore = this
|
|
95
|
+
return text
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Make a comment which belongs to this document.
|
|
100
|
+
* @param {string} [data=''] The comment
|
|
101
|
+
* @returns {CommentService}
|
|
102
|
+
*/
|
|
103
|
+
createComment (data = '') {
|
|
104
|
+
const comment = new NodeService_1.CommentService(data)
|
|
105
|
+
comment.ownerDocumentStore = this
|
|
106
|
+
return comment
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
|
|
111
|
+
* then inserted in one go.
|
|
112
|
+
* @returns {DocumentFragmentService}
|
|
113
|
+
*/
|
|
114
|
+
createDocumentFragment () {
|
|
115
|
+
const fragment = new DocumentFragmentService_1.DocumentFragmentService()
|
|
116
|
+
fragment.ownerDocumentStore = this
|
|
117
|
+
return fragment
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Make a copy of this document. The copy has no parent or listeners, and a deep copy has copies of everything in the
|
|
122
|
+
* document (a shallow one is an empty document).
|
|
123
|
+
* @param {boolean} [deep=false] Copy everything in the document as well
|
|
124
|
+
* @returns {PseudoNode}
|
|
125
|
+
*/
|
|
126
|
+
cloneNode (deep = false) {
|
|
127
|
+
const copy = new PseudoHTMLDocument()
|
|
128
|
+
// The new document starts out with its own html, head and body, a copy has only what was copied from this one
|
|
129
|
+
while (copy.firstChild) {
|
|
130
|
+
copy.removeChild(copy.firstChild)
|
|
131
|
+
}
|
|
132
|
+
copy.head = null
|
|
133
|
+
copy.body = null
|
|
134
|
+
if (deep) {
|
|
135
|
+
Array.from(this.childNodes).forEach(child => copy.appendChild(child.cloneNode(true)))
|
|
136
|
+
const html = Array.from(copy.childNodes).find(child => child.tagName === 'html')
|
|
137
|
+
const inHtml = tagName => html ? Array.from(html.childNodes).find(child => child.tagName === tagName) || null : null
|
|
138
|
+
copy.head = inHtml('head')
|
|
139
|
+
copy.body = inHtml('body')
|
|
140
|
+
}
|
|
141
|
+
return copy
|
|
64
142
|
}
|
|
65
143
|
}
|
|
66
144
|
exports.default = PseudoHTMLDocument
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const HTMLElementService_1=require("../services/HTMLElementService");class PseudoHTMLDocument extends HTMLElementService_1.HTMLElementService{constructor(){super();const e=new HTMLElementService_1.HTMLElementService({tagName:"html"});this.appendChild(e),this.head=new HTMLElementService_1.HTMLElementService({tagName:"head"}),e.appendChild(this.head),this.body=new HTMLElementService_1.HTMLElementService({tagName:"body"}),e.appendChild(this.body)}createElement(e="div"){
|
|
1
|
+
"use strict";require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.find.js"),require("core-js/modules/esnext.iterator.for-each.js"),Object.defineProperty(exports,"__esModule",{value:!0});const HTMLElementService_1=require("../services/HTMLElementService"),NodeService_1=require("../services/NodeService"),DocumentFragmentService_1=require("../services/DocumentFragmentService");class PseudoHTMLDocument extends HTMLElementService_1.HTMLElementService{constructor(){super();const e=new HTMLElementService_1.HTMLElementService({tagName:"html"});this.appendChild(e),this.head=new HTMLElementService_1.HTMLElementService({tagName:"head"}),e.appendChild(this.head),this.body=new HTMLElementService_1.HTMLElementService({tagName:"body"}),e.appendChild(this.body)}get nodeName(){return"#document"}get nodeType(){return NodeService_1.NodeService.DOCUMENT_NODE}get textContent(){return null}set textContent(e){}createElement(e="div"){const t=new HTMLElementService_1.HTMLElementService({tagName:e});return t.ownerDocumentStore=this,t}createTextNode(e=""){const t=new NodeService_1.TextService(e);return t.ownerDocumentStore=this,t}createComment(e=""){const t=new NodeService_1.CommentService(e);return t.ownerDocumentStore=this,t}createDocumentFragment(){const e=new DocumentFragmentService_1.DocumentFragmentService;return e.ownerDocumentStore=this,e}cloneNode(e=!1){const t=new PseudoHTMLDocument;for(;t.firstChild;)t.removeChild(t.firstChild);if(t.head=null,t.body=null,e){Array.from(this.childNodes).forEach(e=>t.appendChild(e.cloneNode(!0)));const e=Array.from(t.childNodes).find(e=>"html"===e.tagName),r=t=>e&&Array.from(e.childNodes).find(e=>e.tagName===t)||null;t.head=r("head"),t.body=r("body")}return t}}exports.default=PseudoHTMLDocument;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EventService } from '../services/EventService';
|
|
2
|
+
/**
|
|
3
|
+
* How the event is being created.
|
|
4
|
+
* @typedef {Object} CreateEventOptions
|
|
5
|
+
* @property {boolean} [browser=false] The browser is creating the event (for a user action, or for something like
|
|
6
|
+
* element.click()), so the standard options for the type of event apply where the init does not give its own
|
|
7
|
+
* @property {boolean} [trusted=false] The event comes from a real user action rather than from a script (isTrusted)
|
|
8
|
+
*/
|
|
9
|
+
export type CreateEventOptions = {
|
|
10
|
+
browser?: boolean;
|
|
11
|
+
trusted?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Create an event of the kind which suits its type (a click is a MouseEvent, a keydown a KeyboardEvent, ...).
|
|
15
|
+
* By default this is like using the constructor of the event in a script: nothing bubbles or can be cancelled unless
|
|
16
|
+
* the init says so, and the event is not trusted. With browser: true the event is created the way the browser creates
|
|
17
|
+
* it, using the standard options for its type (see eventDefaults), and trusted: true makes it look like it came from a
|
|
18
|
+
* real user action (isTrusted).
|
|
19
|
+
* @function createEvent
|
|
20
|
+
* @param {string} type The type of the event, such as click
|
|
21
|
+
* @param {Object} [init={}] The options for the event (bubbles, cancelable, composed and those of its kind of event)
|
|
22
|
+
* @param {CreateEventOptions} [options={}] Whether the browser is creating the event, and whether it is trusted
|
|
23
|
+
* @returns {EventService}
|
|
24
|
+
*/
|
|
25
|
+
export declare const createEvent: (type: string, init?: {
|
|
26
|
+
[option: string]: any;
|
|
27
|
+
}, { browser, trusted }?: CreateEventOptions) => EventService;
|
|
28
|
+
export default createEvent;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.createEvent = void 0
|
|
7
|
+
const EventService_1 = require('../services/EventService')
|
|
8
|
+
const UIEventService_1 = require('../services/UIEventService')
|
|
9
|
+
const MouseEventService_1 = require('../services/MouseEventService')
|
|
10
|
+
const PointerEventService_1 = require('../services/PointerEventService')
|
|
11
|
+
const KeyboardEventService_1 = require('../services/KeyboardEventService')
|
|
12
|
+
const FocusEventService_1 = require('../services/FocusEventService')
|
|
13
|
+
const InputEventService_1 = require('../services/InputEventService')
|
|
14
|
+
const CustomEventService_1 = require('../services/CustomEventService')
|
|
15
|
+
const eventDefaults_1 = require('./eventDefaults')
|
|
16
|
+
const eventClasses = {
|
|
17
|
+
Event: EventService_1.EventService,
|
|
18
|
+
UIEvent: UIEventService_1.UIEventService,
|
|
19
|
+
MouseEvent: MouseEventService_1.MouseEventService,
|
|
20
|
+
PointerEvent: PointerEventService_1.PointerEventService,
|
|
21
|
+
KeyboardEvent: KeyboardEventService_1.KeyboardEventService,
|
|
22
|
+
FocusEvent: FocusEventService_1.FocusEventService,
|
|
23
|
+
InputEvent: InputEventService_1.InputEventService,
|
|
24
|
+
CustomEvent: CustomEventService_1.CustomEventService
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create an event of the kind which suits its type (a click is a MouseEvent, a keydown a KeyboardEvent, ...).
|
|
28
|
+
* By default this is like using the constructor of the event in a script: nothing bubbles or can be cancelled unless
|
|
29
|
+
* the init says so, and the event is not trusted. With browser: true the event is created the way the browser creates
|
|
30
|
+
* it, using the standard options for its type (see eventDefaults), and trusted: true makes it look like it came from a
|
|
31
|
+
* real user action (isTrusted).
|
|
32
|
+
* @function createEvent
|
|
33
|
+
* @param {string} type The type of the event, such as click
|
|
34
|
+
* @param {Object} [init={}] The options for the event (bubbles, cancelable, composed and those of its kind of event)
|
|
35
|
+
* @param {CreateEventOptions} [options={}] Whether the browser is creating the event, and whether it is trusted
|
|
36
|
+
* @returns {EventService}
|
|
37
|
+
*/
|
|
38
|
+
const createEvent = (type, init = {}, {
|
|
39
|
+
browser = false,
|
|
40
|
+
trusted = false
|
|
41
|
+
} = {}) => {
|
|
42
|
+
const definition = eventDefaults_1.eventDefaults[type]
|
|
43
|
+
const options = browser && definition
|
|
44
|
+
? Object.assign({
|
|
45
|
+
bubbles: definition.bubbles,
|
|
46
|
+
cancelable: definition.cancelable,
|
|
47
|
+
composed: definition.composed
|
|
48
|
+
}, init)
|
|
49
|
+
: init
|
|
50
|
+
const EventClass = eventClasses[definition ? definition.interface : 'Event']
|
|
51
|
+
const event = new EventClass(type, options)
|
|
52
|
+
event.inner.trusted = trusted
|
|
53
|
+
return event
|
|
54
|
+
}
|
|
55
|
+
exports.createEvent = createEvent
|
|
56
|
+
exports.default = exports.createEvent
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createEvent=void 0;const EventService_1=require("../services/EventService"),UIEventService_1=require("../services/UIEventService"),MouseEventService_1=require("../services/MouseEventService"),PointerEventService_1=require("../services/PointerEventService"),KeyboardEventService_1=require("../services/KeyboardEventService"),FocusEventService_1=require("../services/FocusEventService"),InputEventService_1=require("../services/InputEventService"),CustomEventService_1=require("../services/CustomEventService"),eventDefaults_1=require("./eventDefaults"),eventClasses={Event:EventService_1.EventService,UIEvent:UIEventService_1.UIEventService,MouseEvent:MouseEventService_1.MouseEventService,PointerEvent:PointerEventService_1.PointerEventService,KeyboardEvent:KeyboardEventService_1.KeyboardEventService,FocusEvent:FocusEventService_1.FocusEventService,InputEvent:InputEventService_1.InputEventService,CustomEvent:CustomEventService_1.CustomEventService},createEvent=(e,t={},{browser:v=!1,trusted:r=!1}={})=>{const n=eventDefaults_1.eventDefaults[e],c=v&&n?Object.assign({bubbles:n.bubbles,cancelable:n.cancelable,composed:n.composed},t):t,i=new(0,eventClasses[n?n.interface:"Event"])(e,c);return i.inner.trusted=r,i};exports.createEvent=createEvent,exports.default=exports.createEvent;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The standard event types of the browser, and how the browser creates them.
|
|
3
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
+
* @version 1.0.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* How the browser creates an event of a standard type: whether it bubbles, whether it can be cancelled, whether it
|
|
8
|
+
* crosses the boundary of a shadow tree, and which kind of event object it is.
|
|
9
|
+
* @typedef {Object} EventDefinition
|
|
10
|
+
* @property {boolean} bubbles - After the target, the event goes back up through the ancestors (the capture phase, going down, always happens)
|
|
11
|
+
* @property {boolean} cancelable - preventDefault() can stop the default action
|
|
12
|
+
* @property {boolean} composed - The event crosses the boundary of a shadow tree
|
|
13
|
+
* @property {string} interface - The kind of event object: Event, UIEvent, MouseEvent, PointerEvent, KeyboardEvent, FocusEvent, InputEvent or CustomEvent
|
|
14
|
+
*/
|
|
15
|
+
export type EventDefinition = {
|
|
16
|
+
bubbles: boolean;
|
|
17
|
+
cancelable: boolean;
|
|
18
|
+
composed: boolean;
|
|
19
|
+
interface: 'Event' | 'UIEvent' | 'MouseEvent' | 'PointerEvent' | 'KeyboardEvent' | 'FocusEvent' | 'InputEvent' | 'CustomEvent';
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The events which the browser itself creates (for a user action, or for something like element.click()) have these
|
|
23
|
+
* options. A script which creates an event with the constructor gets none of them (everything is false) unless it asks
|
|
24
|
+
* for them, which is why createEvent only uses this table when it is told the browser is creating the event.
|
|
25
|
+
* The values follow the UI Events, HTML, Pointer Events, Clipboard, Drag and Drop, Touch and CSS specifications.
|
|
26
|
+
* @type {Object.<string, EventDefinition>}
|
|
27
|
+
*/
|
|
28
|
+
export declare const eventDefaults: {
|
|
29
|
+
[type: string]: EventDefinition;
|
|
30
|
+
};
|
|
31
|
+
export default eventDefaults;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The standard event types of the browser, and how the browser creates them.
|
|
5
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
6
|
+
* @version 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
})
|
|
11
|
+
exports.eventDefaults = void 0
|
|
12
|
+
const define = (bubbles, cancelable, composed, eventInterface = 'Event') => ({
|
|
13
|
+
bubbles,
|
|
14
|
+
cancelable,
|
|
15
|
+
composed,
|
|
16
|
+
interface: eventInterface
|
|
17
|
+
})
|
|
18
|
+
/**
|
|
19
|
+
* The events which the browser itself creates (for a user action, or for something like element.click()) have these
|
|
20
|
+
* options. A script which creates an event with the constructor gets none of them (everything is false) unless it asks
|
|
21
|
+
* for them, which is why createEvent only uses this table when it is told the browser is creating the event.
|
|
22
|
+
* The values follow the UI Events, HTML, Pointer Events, Clipboard, Drag and Drop, Touch and CSS specifications.
|
|
23
|
+
* @type {Object.<string, EventDefinition>}
|
|
24
|
+
*/
|
|
25
|
+
exports.eventDefaults = {
|
|
26
|
+
// Mouse (UI Events)
|
|
27
|
+
click: define(true, true, true, 'MouseEvent'),
|
|
28
|
+
auxclick: define(true, true, true, 'MouseEvent'),
|
|
29
|
+
dblclick: define(true, true, true, 'MouseEvent'),
|
|
30
|
+
contextmenu: define(true, true, true, 'MouseEvent'),
|
|
31
|
+
mousedown: define(true, true, true, 'MouseEvent'),
|
|
32
|
+
mouseup: define(true, true, true, 'MouseEvent'),
|
|
33
|
+
mousemove: define(true, true, true, 'MouseEvent'),
|
|
34
|
+
mouseover: define(true, true, true, 'MouseEvent'),
|
|
35
|
+
mouseout: define(true, true, true, 'MouseEvent'),
|
|
36
|
+
mouseenter: define(false, false, true, 'MouseEvent'),
|
|
37
|
+
mouseleave: define(false, false, true, 'MouseEvent'),
|
|
38
|
+
wheel: define(true, true, true, 'MouseEvent'),
|
|
39
|
+
// Pointer (Pointer Events)
|
|
40
|
+
pointerdown: define(true, true, true, 'PointerEvent'),
|
|
41
|
+
pointerup: define(true, true, true, 'PointerEvent'),
|
|
42
|
+
pointermove: define(true, true, true, 'PointerEvent'),
|
|
43
|
+
pointerover: define(true, true, true, 'PointerEvent'),
|
|
44
|
+
pointerout: define(true, true, true, 'PointerEvent'),
|
|
45
|
+
pointerenter: define(false, false, true, 'PointerEvent'),
|
|
46
|
+
pointerleave: define(false, false, true, 'PointerEvent'),
|
|
47
|
+
pointercancel: define(true, false, true, 'PointerEvent'),
|
|
48
|
+
gotpointercapture: define(true, false, true, 'PointerEvent'),
|
|
49
|
+
lostpointercapture: define(true, false, true, 'PointerEvent'),
|
|
50
|
+
// Keyboard (UI Events)
|
|
51
|
+
keydown: define(true, true, true, 'KeyboardEvent'),
|
|
52
|
+
keypress: define(true, true, true, 'KeyboardEvent'),
|
|
53
|
+
keyup: define(true, true, true, 'KeyboardEvent'),
|
|
54
|
+
// Focus (UI Events): focus and blur do not bubble, focusin and focusout do
|
|
55
|
+
focus: define(false, false, true, 'FocusEvent'),
|
|
56
|
+
blur: define(false, false, true, 'FocusEvent'),
|
|
57
|
+
focusin: define(true, false, true, 'FocusEvent'),
|
|
58
|
+
focusout: define(true, false, true, 'FocusEvent'),
|
|
59
|
+
// Forms (HTML, Input Events)
|
|
60
|
+
beforeinput: define(true, true, true, 'InputEvent'),
|
|
61
|
+
input: define(true, false, true, 'InputEvent'),
|
|
62
|
+
change: define(true, false, false),
|
|
63
|
+
select: define(true, false, false),
|
|
64
|
+
submit: define(true, true, false),
|
|
65
|
+
reset: define(true, true, false),
|
|
66
|
+
invalid: define(false, true, false),
|
|
67
|
+
toggle: define(false, false, false),
|
|
68
|
+
// Loading and the page (HTML)
|
|
69
|
+
load: define(false, false, false),
|
|
70
|
+
error: define(false, false, false),
|
|
71
|
+
abort: define(false, false, false),
|
|
72
|
+
scroll: define(false, false, false),
|
|
73
|
+
scrollend: define(false, false, false),
|
|
74
|
+
resize: define(false, false, false),
|
|
75
|
+
DOMContentLoaded: define(true, false, false),
|
|
76
|
+
readystatechange: define(false, false, false),
|
|
77
|
+
visibilitychange: define(true, false, false),
|
|
78
|
+
// Clipboard
|
|
79
|
+
copy: define(true, true, true),
|
|
80
|
+
cut: define(true, true, true),
|
|
81
|
+
paste: define(true, true, true),
|
|
82
|
+
// Drag and drop
|
|
83
|
+
drag: define(true, true, true, 'MouseEvent'),
|
|
84
|
+
dragstart: define(true, true, true, 'MouseEvent'),
|
|
85
|
+
dragend: define(true, false, true, 'MouseEvent'),
|
|
86
|
+
dragenter: define(true, true, true, 'MouseEvent'),
|
|
87
|
+
dragover: define(true, true, true, 'MouseEvent'),
|
|
88
|
+
dragleave: define(true, false, true, 'MouseEvent'),
|
|
89
|
+
drop: define(true, true, true, 'MouseEvent'),
|
|
90
|
+
// Touch
|
|
91
|
+
touchstart: define(true, true, true, 'UIEvent'),
|
|
92
|
+
touchmove: define(true, true, true, 'UIEvent'),
|
|
93
|
+
touchend: define(true, true, true, 'UIEvent'),
|
|
94
|
+
touchcancel: define(true, false, true, 'UIEvent'),
|
|
95
|
+
// Animations and transitions (CSS)
|
|
96
|
+
animationstart: define(true, false, false),
|
|
97
|
+
animationiteration: define(true, false, false),
|
|
98
|
+
animationend: define(true, false, false),
|
|
99
|
+
animationcancel: define(true, false, false),
|
|
100
|
+
transitionrun: define(true, false, false),
|
|
101
|
+
transitionstart: define(true, false, false),
|
|
102
|
+
transitionend: define(true, false, false),
|
|
103
|
+
transitioncancel: define(true, false, false)
|
|
104
|
+
}
|
|
105
|
+
exports.default = exports.eventDefaults
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.eventDefaults=void 0;const define=(e,n,t,i="Event")=>({bubbles:e,cancelable:n,composed:t,interface:i});exports.eventDefaults={click:define(!0,!0,!0,"MouseEvent"),auxclick:define(!0,!0,!0,"MouseEvent"),dblclick:define(!0,!0,!0,"MouseEvent"),contextmenu:define(!0,!0,!0,"MouseEvent"),mousedown:define(!0,!0,!0,"MouseEvent"),mouseup:define(!0,!0,!0,"MouseEvent"),mousemove:define(!0,!0,!0,"MouseEvent"),mouseover:define(!0,!0,!0,"MouseEvent"),mouseout:define(!0,!0,!0,"MouseEvent"),mouseenter:define(!1,!1,!0,"MouseEvent"),mouseleave:define(!1,!1,!0,"MouseEvent"),wheel:define(!0,!0,!0,"MouseEvent"),pointerdown:define(!0,!0,!0,"PointerEvent"),pointerup:define(!0,!0,!0,"PointerEvent"),pointermove:define(!0,!0,!0,"PointerEvent"),pointerover:define(!0,!0,!0,"PointerEvent"),pointerout:define(!0,!0,!0,"PointerEvent"),pointerenter:define(!1,!1,!0,"PointerEvent"),pointerleave:define(!1,!1,!0,"PointerEvent"),pointercancel:define(!0,!1,!0,"PointerEvent"),gotpointercapture:define(!0,!1,!0,"PointerEvent"),lostpointercapture:define(!0,!1,!0,"PointerEvent"),keydown:define(!0,!0,!0,"KeyboardEvent"),keypress:define(!0,!0,!0,"KeyboardEvent"),keyup:define(!0,!0,!0,"KeyboardEvent"),focus:define(!1,!1,!0,"FocusEvent"),blur:define(!1,!1,!0,"FocusEvent"),focusin:define(!0,!1,!0,"FocusEvent"),focusout:define(!0,!1,!0,"FocusEvent"),beforeinput:define(!0,!0,!0,"InputEvent"),input:define(!0,!1,!0,"InputEvent"),change:define(!0,!1,!1),select:define(!0,!1,!1),submit:define(!0,!0,!1),reset:define(!0,!0,!1),invalid:define(!1,!0,!1),toggle:define(!1,!1,!1),load:define(!1,!1,!1),error:define(!1,!1,!1),abort:define(!1,!1,!1),scroll:define(!1,!1,!1),scrollend:define(!1,!1,!1),resize:define(!1,!1,!1),DOMContentLoaded:define(!0,!1,!1),readystatechange:define(!1,!1,!1),visibilitychange:define(!0,!1,!1),copy:define(!0,!0,!0),cut:define(!0,!0,!0),paste:define(!0,!0,!0),drag:define(!0,!0,!0,"MouseEvent"),dragstart:define(!0,!0,!0,"MouseEvent"),dragend:define(!0,!1,!0,"MouseEvent"),dragenter:define(!0,!0,!0,"MouseEvent"),dragover:define(!0,!0,!0,"MouseEvent"),dragleave:define(!0,!1,!0,"MouseEvent"),drop:define(!0,!0,!0,"MouseEvent"),touchstart:define(!0,!0,!0,"UIEvent"),touchmove:define(!0,!0,!0,"UIEvent"),touchend:define(!0,!0,!0,"UIEvent"),touchcancel:define(!0,!1,!0,"UIEvent"),animationstart:define(!0,!1,!1),animationiteration:define(!0,!1,!1),animationend:define(!0,!1,!1),animationcancel:define(!0,!1,!1),transitionrun:define(!0,!1,!1),transitionstart:define(!0,!1,!1),transitionend:define(!0,!1,!1),transitioncancel:define(!0,!1,!1)},exports.default=exports.eventDefaults;
|
package/dist/factories.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
generateNode: () => typeof import("./factories/generateNode").NodeFactory;
|
|
3
3
|
nodeListFactory: (innerList?: import("collect-your-stuff/dist/collections/linked-tree-list/TreeLinker").TreeLinker | null) => import("./classes/PseudoNodeList").PseudoNodeList;
|
|
4
|
+
createEvent: (type: string, init?: {
|
|
5
|
+
[option: string]: any;
|
|
6
|
+
}, { browser, trusted }?: import("./factories/createEvent").CreateEventOptions) => import("./main").PseudoEvent;
|
|
7
|
+
eventDefaults: {
|
|
8
|
+
[type: string]: import("./factories/eventDefaults").EventDefinition;
|
|
9
|
+
};
|
|
4
10
|
};
|
|
5
11
|
export default _default;
|
package/dist/factories.js
CHANGED
|
@@ -17,7 +17,11 @@ Object.defineProperty(exports, '__esModule', {
|
|
|
17
17
|
*/
|
|
18
18
|
const generateNode_1 = __importDefault(require('./factories/generateNode'))
|
|
19
19
|
const generateNodeList_1 = __importDefault(require('./factories/generateNodeList'))
|
|
20
|
+
const createEvent_1 = __importDefault(require('./factories/createEvent'))
|
|
21
|
+
const eventDefaults_1 = __importDefault(require('./factories/eventDefaults'))
|
|
20
22
|
exports.default = {
|
|
21
23
|
generateNode: generateNode_1.default,
|
|
22
|
-
nodeListFactory: generateNodeList_1.default
|
|
24
|
+
nodeListFactory: generateNodeList_1.default,
|
|
25
|
+
createEvent: createEvent_1.default,
|
|
26
|
+
eventDefaults: eventDefaults_1.default
|
|
23
27
|
}
|
package/dist/factories.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const generateNode_1=__importDefault(require("./factories/generateNode")),generateNodeList_1=__importDefault(require("./factories/generateNodeList"));exports.default={generateNode:generateNode_1.default,nodeListFactory:generateNodeList_1.default};
|
|
1
|
+
"use strict";var __importDefault=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const generateNode_1=__importDefault(require("./factories/generateNode")),generateNodeList_1=__importDefault(require("./factories/generateNodeList")),createEvent_1=__importDefault(require("./factories/createEvent")),eventDefaults_1=__importDefault(require("./factories/eventDefaults"));exports.default={generateNode:generateNode_1.default,nodeListFactory:generateNodeList_1.default,createEvent:createEvent_1.default,eventDefaults:eventDefaults_1.default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the element which has the focus in a tree.
|
|
3
|
+
* @function getActiveElement
|
|
4
|
+
* @param {Object} root The root node of the tree
|
|
5
|
+
* @returns {Object|null}
|
|
6
|
+
*/
|
|
7
|
+
export declare const getActiveElement: (root: object) => any | null;
|
|
8
|
+
/**
|
|
9
|
+
* Remember the element which has the focus in a tree.
|
|
10
|
+
* @function setActiveElement
|
|
11
|
+
* @param {Object} root The root node of the tree
|
|
12
|
+
* @param {Object|null} element The element which now has the focus, or null when nothing has it
|
|
13
|
+
*/
|
|
14
|
+
export declare const setActiveElement: (root: object, element: any | null) => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.setActiveElement = exports.getActiveElement = void 0
|
|
8
|
+
/**
|
|
9
|
+
* The element which has the focus, kept for each tree (the root node of the tree it is in), like document.activeElement.
|
|
10
|
+
*/
|
|
11
|
+
const focused = new WeakMap()
|
|
12
|
+
/**
|
|
13
|
+
* Find the element which has the focus in a tree.
|
|
14
|
+
* @function getActiveElement
|
|
15
|
+
* @param {Object} root The root node of the tree
|
|
16
|
+
* @returns {Object|null}
|
|
17
|
+
*/
|
|
18
|
+
const getActiveElement = root => focused.get(root) || null
|
|
19
|
+
exports.getActiveElement = getActiveElement
|
|
20
|
+
/**
|
|
21
|
+
* Remember the element which has the focus in a tree.
|
|
22
|
+
* @function setActiveElement
|
|
23
|
+
* @param {Object} root The root node of the tree
|
|
24
|
+
* @param {Object|null} element The element which now has the focus, or null when nothing has it
|
|
25
|
+
*/
|
|
26
|
+
const setActiveElement = (root, element) => {
|
|
27
|
+
if (element === null) {
|
|
28
|
+
focused.delete(root)
|
|
29
|
+
} else {
|
|
30
|
+
focused.set(root, element)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.setActiveElement = setActiveElement
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.setActiveElement=exports.getActiveElement=void 0;const focused=new WeakMap,getActiveElement=e=>focused.get(e)||null;exports.getActiveElement=getActiveElement;const setActiveElement=(e,t)=>{null===t?focused.delete(e):focused.set(e,t)};exports.setActiveElement=setActiveElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The modifier keys which were held down when a mouse or keyboard event happened.
|
|
3
|
+
* @typedef {Object} ModifierKeys
|
|
4
|
+
* @property {boolean} ctrlKey
|
|
5
|
+
* @property {boolean} shiftKey
|
|
6
|
+
* @property {boolean} altKey
|
|
7
|
+
* @property {boolean} metaKey
|
|
8
|
+
*/
|
|
9
|
+
export type ModifierKeys = {
|
|
10
|
+
ctrlKey: boolean;
|
|
11
|
+
shiftKey: boolean;
|
|
12
|
+
altKey: boolean;
|
|
13
|
+
metaKey: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Pick the modifier keys out of the init object of an event.
|
|
17
|
+
* @function modifierKeys
|
|
18
|
+
* @param {Object} [init={}] The init of an event
|
|
19
|
+
* @returns {ModifierKeys}
|
|
20
|
+
*/
|
|
21
|
+
export declare const modifierKeys: (init?: any) => ModifierKeys;
|
|
22
|
+
/**
|
|
23
|
+
* Answer getModifierState for a set of held modifier keys.
|
|
24
|
+
* @function modifierState
|
|
25
|
+
* @param {ModifierKeys} keys The modifier keys which were held down
|
|
26
|
+
* @param {string} key The name of the modifier (Control, Shift, Alt or Meta)
|
|
27
|
+
* @returns {boolean}
|
|
28
|
+
*/
|
|
29
|
+
export declare const modifierState: (keys: ModifierKeys, key: string) => boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.modifierState = exports.modifierKeys = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Pick the modifier keys out of the init object of an event.
|
|
9
|
+
* @function modifierKeys
|
|
10
|
+
* @param {Object} [init={}] The init of an event
|
|
11
|
+
* @returns {ModifierKeys}
|
|
12
|
+
*/
|
|
13
|
+
const modifierKeys = (init = {}) => ({
|
|
14
|
+
ctrlKey: !!init.ctrlKey,
|
|
15
|
+
shiftKey: !!init.shiftKey,
|
|
16
|
+
altKey: !!init.altKey,
|
|
17
|
+
metaKey: !!init.metaKey
|
|
18
|
+
})
|
|
19
|
+
exports.modifierKeys = modifierKeys
|
|
20
|
+
/**
|
|
21
|
+
* Answer getModifierState for a set of held modifier keys.
|
|
22
|
+
* @function modifierState
|
|
23
|
+
* @param {ModifierKeys} keys The modifier keys which were held down
|
|
24
|
+
* @param {string} key The name of the modifier (Control, Shift, Alt or Meta)
|
|
25
|
+
* @returns {boolean}
|
|
26
|
+
*/
|
|
27
|
+
const modifierState = (keys, key) => {
|
|
28
|
+
switch (key) {
|
|
29
|
+
case 'Control':
|
|
30
|
+
return keys.ctrlKey
|
|
31
|
+
case 'Shift':
|
|
32
|
+
return keys.shiftKey
|
|
33
|
+
case 'Alt':
|
|
34
|
+
return keys.altKey
|
|
35
|
+
case 'Meta':
|
|
36
|
+
return keys.metaKey
|
|
37
|
+
default:
|
|
38
|
+
return false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.modifierState = modifierState
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.modifierState=exports.modifierKeys=void 0;const modifierKeys=(e={})=>({ctrlKey:!!e.ctrlKey,shiftKey:!!e.shiftKey,altKey:!!e.altKey,metaKey:!!e.metaKey});exports.modifierKeys=modifierKeys;const modifierState=(e,t)=>{switch(t){case"Control":return e.ctrlKey;case"Shift":return e.shiftKey;case"Alt":return e.altKey;case"Meta":return e.metaKey;default:return!1}};exports.modifierState=modifierState;
|
package/dist/main.d.ts
CHANGED
|
@@ -10,6 +10,17 @@ import { ElementService as PseudoElement } from './services/ElementService';
|
|
|
10
10
|
import { HTMLElementService as PseudoHTMLElement } from './services/HTMLElementService';
|
|
11
11
|
import PseudoHTMLDocument from './classes/PseudoHTMLDocument';
|
|
12
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';
|
|
13
24
|
/**
|
|
14
25
|
* All methods exported from this module are encapsulated within pseudoDom.
|
|
15
26
|
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
@@ -18,12 +29,35 @@ import generateDocument from './factories/generateDocument';
|
|
|
18
29
|
*/
|
|
19
30
|
declare const pseudoDom: {
|
|
20
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
|
+
};
|
|
21
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;
|
|
22
54
|
PseudoEventTarget: typeof PseudoEventTarget;
|
|
23
55
|
PseudoNode: typeof PseudoNode;
|
|
56
|
+
PseudoText: typeof PseudoText;
|
|
57
|
+
PseudoComment: typeof PseudoComment;
|
|
24
58
|
PseudoElement: typeof PseudoElement;
|
|
25
59
|
PseudoHTMLElement: typeof PseudoHTMLElement;
|
|
26
60
|
PseudoHTMLDocument: typeof PseudoHTMLDocument;
|
|
27
61
|
};
|
|
28
|
-
export { generateDocument, PseudoEvent, PseudoEventTarget, PseudoNode, PseudoElement, PseudoHTMLElement, PseudoHTMLDocument };
|
|
62
|
+
export { generateDocument, createEvent, eventDefaults, simulate, PseudoEvent, PseudoUIEvent, PseudoMouseEvent, PseudoPointerEvent, PseudoKeyboardEvent, PseudoFocusEvent, PseudoInputEvent, PseudoCustomEvent, PseudoEventTarget, PseudoNode, PseudoText, PseudoComment, PseudoElement, PseudoHTMLElement, PseudoHTMLDocument };
|
|
29
63
|
export default pseudoDom;
|