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,51 +1,51 @@
1
- /**
2
- * @file Substitute for the DOM PointerEvent Class.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.0.0
5
- */
6
- import { MouseEventInit, MouseEventService } from './MouseEventService';
7
- /**
8
- * The options for creating a pointer event, on top of the ones every mouse event has.
9
- * @typedef {Object} PointerEventInit
10
- * @property {number} [pointerId=0]
11
- * @property {number} [width=1]
12
- * @property {number} [height=1]
13
- * @property {number} [pressure=0]
14
- * @property {string} [pointerType=''] mouse, pen or touch
15
- * @property {boolean} [isPrimary=false]
16
- */
17
- export type PointerEventInit = MouseEventInit & {
18
- pointerId?: number;
19
- width?: number;
20
- height?: number;
21
- pressure?: number;
22
- pointerType?: string;
23
- isPrimary?: boolean;
24
- };
25
- /**
26
- * Simulate the behaviour of the PointerEvent Class when there is no DOM available.
27
- * @author Joshua Heagle <joshuaheagle@gmail.com>
28
- * @class
29
- * @augments MouseEventService
30
- * @property {number} pointerId
31
- * @property {number} width
32
- * @property {number} height
33
- * @property {number} pressure
34
- * @property {string} pointerType
35
- * @property {boolean} isPrimary
36
- */
37
- export declare class PointerEventService extends MouseEventService {
38
- private readonly pointer;
39
- /**
40
- * @param {string} [typeArg=''] The type of the event
41
- * @param {PointerEventInit} [init={}] The options for the event
42
- * @constructor
43
- */
44
- constructor(typeArg?: string, init?: PointerEventInit);
45
- get pointerId(): number;
46
- get width(): number;
47
- get height(): number;
48
- get pressure(): number;
49
- get pointerType(): string;
50
- get isPrimary(): boolean;
51
- }
1
+ /**
2
+ * @file Substitute for the DOM PointerEvent Class.
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.0.0
5
+ */
6
+ import { MouseEventInit, MouseEventService } from './MouseEventService';
7
+ /**
8
+ * The options for creating a pointer event, on top of the ones every mouse event has.
9
+ * @typedef {Object} PointerEventInit
10
+ * @property {number} [pointerId=0]
11
+ * @property {number} [width=1]
12
+ * @property {number} [height=1]
13
+ * @property {number} [pressure=0]
14
+ * @property {string} [pointerType=''] mouse, pen or touch
15
+ * @property {boolean} [isPrimary=false]
16
+ */
17
+ export type PointerEventInit = MouseEventInit & {
18
+ pointerId?: number;
19
+ width?: number;
20
+ height?: number;
21
+ pressure?: number;
22
+ pointerType?: string;
23
+ isPrimary?: boolean;
24
+ };
25
+ /**
26
+ * Simulate the behaviour of the PointerEvent Class when there is no DOM available.
27
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
28
+ * @class
29
+ * @augments MouseEventService
30
+ * @property {number} pointerId
31
+ * @property {number} width
32
+ * @property {number} height
33
+ * @property {number} pressure
34
+ * @property {string} pointerType
35
+ * @property {boolean} isPrimary
36
+ */
37
+ export declare class PointerEventService extends MouseEventService {
38
+ private readonly pointer;
39
+ /**
40
+ * @param {string} [typeArg=''] The type of the event
41
+ * @param {PointerEventInit} [init={}] The options for the event
42
+ * @constructor
43
+ */
44
+ constructor(typeArg?: string, init?: PointerEventInit);
45
+ get pointerId(): number;
46
+ get width(): number;
47
+ get height(): number;
48
+ get pressure(): number;
49
+ get pointerType(): string;
50
+ get isPrimary(): boolean;
51
+ }
@@ -1,67 +1,67 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.PointerEventService = void 0
7
- /**
8
- * @file Substitute for the DOM PointerEvent Class.
9
- * @author Joshua Heagle <joshuaheagle@gmail.com>
10
- * @version 1.0.0
11
- */
12
- const MouseEventService_1 = require('./MouseEventService')
13
- /**
14
- * Simulate the behaviour of the PointerEvent Class when there is no DOM available.
15
- * @author Joshua Heagle <joshuaheagle@gmail.com>
16
- * @class
17
- * @augments MouseEventService
18
- * @property {number} pointerId
19
- * @property {number} width
20
- * @property {number} height
21
- * @property {number} pressure
22
- * @property {string} pointerType
23
- * @property {boolean} isPrimary
24
- */
25
- class PointerEventService extends MouseEventService_1.MouseEventService {
26
- /**
27
- * @param {string} [typeArg=''] The type of the event
28
- * @param {PointerEventInit} [init={}] The options for the event
29
- * @constructor
30
- */
31
- constructor (typeArg = '', init = {}) {
32
- super(typeArg, init)
33
- this.pointer = {
34
- pointerId: init.pointerId || 0,
35
- width: typeof init.width === 'number' ? init.width : 1,
36
- height: typeof init.height === 'number' ? init.height : 1,
37
- pressure: init.pressure || 0,
38
- pointerType: init.pointerType || '',
39
- isPrimary: !!init.isPrimary
40
- }
41
- }
42
-
43
- get pointerId () {
44
- return this.pointer.pointerId
45
- }
46
-
47
- get width () {
48
- return this.pointer.width
49
- }
50
-
51
- get height () {
52
- return this.pointer.height
53
- }
54
-
55
- get pressure () {
56
- return this.pointer.pressure
57
- }
58
-
59
- get pointerType () {
60
- return this.pointer.pointerType
61
- }
62
-
63
- get isPrimary () {
64
- return this.pointer.isPrimary
65
- }
66
- }
67
- exports.PointerEventService = PointerEventService
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.PointerEventService = void 0
7
+ /**
8
+ * @file Substitute for the DOM PointerEvent Class.
9
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
10
+ * @version 1.0.0
11
+ */
12
+ const MouseEventService_1 = require('./MouseEventService')
13
+ /**
14
+ * Simulate the behaviour of the PointerEvent Class when there is no DOM available.
15
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
16
+ * @class
17
+ * @augments MouseEventService
18
+ * @property {number} pointerId
19
+ * @property {number} width
20
+ * @property {number} height
21
+ * @property {number} pressure
22
+ * @property {string} pointerType
23
+ * @property {boolean} isPrimary
24
+ */
25
+ class PointerEventService extends MouseEventService_1.MouseEventService {
26
+ /**
27
+ * @param {string} [typeArg=''] The type of the event
28
+ * @param {PointerEventInit} [init={}] The options for the event
29
+ * @constructor
30
+ */
31
+ constructor (typeArg = '', init = {}) {
32
+ super(typeArg, init)
33
+ this.pointer = {
34
+ pointerId: init.pointerId || 0,
35
+ width: typeof init.width === 'number' ? init.width : 1,
36
+ height: typeof init.height === 'number' ? init.height : 1,
37
+ pressure: init.pressure || 0,
38
+ pointerType: init.pointerType || '',
39
+ isPrimary: !!init.isPrimary
40
+ }
41
+ }
42
+
43
+ get pointerId () {
44
+ return this.pointer.pointerId
45
+ }
46
+
47
+ get width () {
48
+ return this.pointer.width
49
+ }
50
+
51
+ get height () {
52
+ return this.pointer.height
53
+ }
54
+
55
+ get pressure () {
56
+ return this.pointer.pressure
57
+ }
58
+
59
+ get pointerType () {
60
+ return this.pointer.pointerType
61
+ }
62
+
63
+ get isPrimary () {
64
+ return this.pointer.isPrimary
65
+ }
66
+ }
67
+ exports.PointerEventService = PointerEventService
@@ -1,4 +1,4 @@
1
- import { DocumentFragmentService } from './DocumentFragmentService';
2
- import { PseudoShadowRoot } from '../interfaces/PseudoShadowRoot';
3
- export declare class ShadowRootService extends DocumentFragmentService implements PseudoShadowRoot {
4
- }
1
+ import { DocumentFragmentService } from './DocumentFragmentService';
2
+ import { PseudoShadowRoot } from '../interfaces/PseudoShadowRoot';
3
+ export declare class ShadowRootService extends DocumentFragmentService implements PseudoShadowRoot {
4
+ }
@@ -1,9 +1,9 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.ShadowRootService = void 0
7
- const DocumentFragmentService_1 = require('./DocumentFragmentService')
8
- class ShadowRootService extends DocumentFragmentService_1.DocumentFragmentService {}
9
- exports.ShadowRootService = ShadowRootService
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.ShadowRootService = void 0
7
+ const DocumentFragmentService_1 = require('./DocumentFragmentService')
8
+ class ShadowRootService extends DocumentFragmentService_1.DocumentFragmentService {}
9
+ exports.ShadowRootService = ShadowRootService
@@ -1 +1 @@
1
- export { TextService } from './NodeService';
1
+ export { TextService } from './NodeService';
@@ -1,13 +1,13 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.TextService = void 0
7
- const NodeService_1 = require('./NodeService')
8
- Object.defineProperty(exports, 'TextService', {
9
- enumerable: true,
10
- get: function () {
11
- return NodeService_1.TextService
12
- }
13
- })
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.TextService = void 0
7
+ const NodeService_1 = require('./NodeService')
8
+ Object.defineProperty(exports, 'TextService', {
9
+ enumerable: true,
10
+ get: function () {
11
+ return NodeService_1.TextService
12
+ }
13
+ })
@@ -1,43 +1,43 @@
1
- /**
2
- * @file Substitute for the DOM UIEvent Class.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.0.0
5
- */
6
- import { EventService } from './EventService';
7
- /**
8
- * The options for creating an event, on top of the ones every event has.
9
- * @typedef {Object} UIEventInit
10
- * @property {boolean} [bubbles=false]
11
- * @property {boolean} [cancelable=false]
12
- * @property {boolean} [composed=false]
13
- * @property {number} [detail=0] Details about the event, such as how many times the mouse was clicked
14
- * @property {*} [view=null] The window the event happened in
15
- */
16
- export type UIEventInit = {
17
- bubbles?: boolean;
18
- cancelable?: boolean;
19
- composed?: boolean;
20
- detail?: number;
21
- view?: any;
22
- };
23
- /**
24
- * Simulate the behaviour of the UIEvent Class when there is no DOM available: the events which come from a user
25
- * interface (the mouse, the keyboard, focus and input).
26
- * @author Joshua Heagle <joshuaheagle@gmail.com>
27
- * @class
28
- * @augments EventService
29
- * @property {number} detail
30
- * @property {*} view
31
- */
32
- export declare class UIEventService extends EventService {
33
- private readonly uiDetail;
34
- private readonly uiView;
35
- /**
36
- * @param {string} [typeArg=''] The type of the event
37
- * @param {UIEventInit} [init={}] The options for the event
38
- * @constructor
39
- */
40
- constructor(typeArg?: string, init?: UIEventInit);
41
- get detail(): number;
42
- get view(): any;
43
- }
1
+ /**
2
+ * @file Substitute for the DOM UIEvent Class.
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.0.0
5
+ */
6
+ import { EventService } from './EventService';
7
+ /**
8
+ * The options for creating an event, on top of the ones every event has.
9
+ * @typedef {Object} UIEventInit
10
+ * @property {boolean} [bubbles=false]
11
+ * @property {boolean} [cancelable=false]
12
+ * @property {boolean} [composed=false]
13
+ * @property {number} [detail=0] Details about the event, such as how many times the mouse was clicked
14
+ * @property {*} [view=null] The window the event happened in
15
+ */
16
+ export type UIEventInit = {
17
+ bubbles?: boolean;
18
+ cancelable?: boolean;
19
+ composed?: boolean;
20
+ detail?: number;
21
+ view?: any;
22
+ };
23
+ /**
24
+ * Simulate the behaviour of the UIEvent Class when there is no DOM available: the events which come from a user
25
+ * interface (the mouse, the keyboard, focus and input).
26
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
27
+ * @class
28
+ * @augments EventService
29
+ * @property {number} detail
30
+ * @property {*} view
31
+ */
32
+ export declare class UIEventService extends EventService {
33
+ private readonly uiDetail;
34
+ private readonly uiView;
35
+ /**
36
+ * @param {string} [typeArg=''] The type of the event
37
+ * @param {UIEventInit} [init={}] The options for the event
38
+ * @constructor
39
+ */
40
+ constructor(typeArg?: string, init?: UIEventInit);
41
+ get detail(): number;
42
+ get view(): any;
43
+ }
@@ -1,42 +1,42 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.UIEventService = void 0
7
- /**
8
- * @file Substitute for the DOM UIEvent Class.
9
- * @author Joshua Heagle <joshuaheagle@gmail.com>
10
- * @version 1.0.0
11
- */
12
- const EventService_1 = require('./EventService')
13
- /**
14
- * Simulate the behaviour of the UIEvent Class when there is no DOM available: the events which come from a user
15
- * interface (the mouse, the keyboard, focus and input).
16
- * @author Joshua Heagle <joshuaheagle@gmail.com>
17
- * @class
18
- * @augments EventService
19
- * @property {number} detail
20
- * @property {*} view
21
- */
22
- class UIEventService extends EventService_1.EventService {
23
- /**
24
- * @param {string} [typeArg=''] The type of the event
25
- * @param {UIEventInit} [init={}] The options for the event
26
- * @constructor
27
- */
28
- constructor (typeArg = '', init = {}) {
29
- super(typeArg, init)
30
- this.uiDetail = init.detail || 0
31
- this.uiView = init.view || null
32
- }
33
-
34
- get detail () {
35
- return this.uiDetail
36
- }
37
-
38
- get view () {
39
- return this.uiView
40
- }
41
- }
42
- exports.UIEventService = UIEventService
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.UIEventService = void 0
7
+ /**
8
+ * @file Substitute for the DOM UIEvent Class.
9
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
10
+ * @version 1.0.0
11
+ */
12
+ const EventService_1 = require('./EventService')
13
+ /**
14
+ * Simulate the behaviour of the UIEvent Class when there is no DOM available: the events which come from a user
15
+ * interface (the mouse, the keyboard, focus and input).
16
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
17
+ * @class
18
+ * @augments EventService
19
+ * @property {number} detail
20
+ * @property {*} view
21
+ */
22
+ class UIEventService extends EventService_1.EventService {
23
+ /**
24
+ * @param {string} [typeArg=''] The type of the event
25
+ * @param {UIEventInit} [init={}] The options for the event
26
+ * @constructor
27
+ */
28
+ constructor (typeArg = '', init = {}) {
29
+ super(typeArg, init)
30
+ this.uiDetail = init.detail || 0
31
+ this.uiView = init.view || null
32
+ }
33
+
34
+ get detail () {
35
+ return this.uiDetail
36
+ }
37
+
38
+ get view () {
39
+ return this.uiView
40
+ }
41
+ }
42
+ exports.UIEventService = UIEventService
@@ -1,32 +1,32 @@
1
- /**
2
- * Click an element the way a user does: pointerdown and mousedown, then the focus moves to the nearest element which
3
- * can have it (or is taken away from the one which had it) unless mousedown was cancelled, then pointerup, mouseup
4
- * and finally click. Every event is trusted and has the options the browser gives it. A disabled element gets nothing.
5
- * @function click
6
- * @param {*} element The element to click
7
- * @param {Object} [init={}] Options for the events (for example clientX, clientY, shiftKey)
8
- * @returns {boolean} False when the click was cancelled (or the element is disabled), so its default action did not happen
9
- */
10
- export declare const click: (element: any, init?: {
11
- [option: string]: any;
12
- }) => boolean;
13
- /**
14
- * Press and release a key on an element (the element which has the focus, or one given): keydown and then keyup.
15
- * @function keyPress
16
- * @param {*} element The element which gets the key
17
- * @param {string} key The value of the key, such as a or Enter
18
- * @param {Object} [init={}] Options for the events (for example code, shiftKey)
19
- * @returns {boolean} False when keydown was cancelled, so its default action did not happen
20
- */
21
- export declare const keyPress: (element: any, key: string, init?: {
22
- [option: string]: any;
23
- }) => boolean;
24
- declare const _default: {
25
- click: (element: any, init?: {
26
- [option: string]: any;
27
- }) => boolean;
28
- keyPress: (element: any, key: string, init?: {
29
- [option: string]: any;
30
- }) => boolean;
31
- };
32
- export default _default;
1
+ /**
2
+ * Click an element the way a user does: pointerdown and mousedown, then the focus moves to the nearest element which
3
+ * can have it (or is taken away from the one which had it) unless mousedown was cancelled, then pointerup, mouseup
4
+ * and finally click. Every event is trusted and has the options the browser gives it. A disabled element gets nothing.
5
+ * @function click
6
+ * @param {*} element The element to click
7
+ * @param {Object} [init={}] Options for the events (for example clientX, clientY, shiftKey)
8
+ * @returns {boolean} False when the click was cancelled (or the element is disabled), so its default action did not happen
9
+ */
10
+ export declare const click: (element: any, init?: {
11
+ [option: string]: any;
12
+ }) => boolean;
13
+ /**
14
+ * Press and release a key on an element (the element which has the focus, or one given): keydown and then keyup.
15
+ * @function keyPress
16
+ * @param {*} element The element which gets the key
17
+ * @param {string} key The value of the key, such as a or Enter
18
+ * @param {Object} [init={}] Options for the events (for example code, shiftKey)
19
+ * @returns {boolean} False when keydown was cancelled, so its default action did not happen
20
+ */
21
+ export declare const keyPress: (element: any, key: string, init?: {
22
+ [option: string]: any;
23
+ }) => boolean;
24
+ declare const _default: {
25
+ click: (element: any, init?: {
26
+ [option: string]: any;
27
+ }) => boolean;
28
+ keyPress: (element: any, key: string, init?: {
29
+ [option: string]: any;
30
+ }) => boolean;
31
+ };
32
+ export default _default;