@testing-library/user-event 14.0.0-beta.7 → 14.0.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 (52) hide show
  1. package/README.md +6 -193
  2. package/dist/index.cjs +995 -1040
  3. package/dist/index.mjs +988 -1028
  4. package/dist/types/event/behavior/click.d.ts +1 -0
  5. package/dist/types/event/behavior/cut.d.ts +1 -0
  6. package/dist/types/event/behavior/index.d.ts +8 -0
  7. package/dist/types/event/behavior/keydown.d.ts +1 -0
  8. package/dist/types/event/behavior/keypress.d.ts +1 -0
  9. package/dist/types/event/behavior/keyup.d.ts +1 -0
  10. package/dist/types/event/behavior/paste.d.ts +1 -0
  11. package/dist/types/event/behavior/registry.d.ts +9 -0
  12. package/dist/types/event/createEvent.d.ts +8 -0
  13. package/dist/types/event/dispatchEvent.d.ts +2 -0
  14. package/dist/types/event/eventMap.d.ts +361 -0
  15. package/dist/types/event/eventTypes.d.ts +2 -0
  16. package/dist/types/event/index.d.ts +6 -0
  17. package/dist/types/event/types.d.ts +13 -0
  18. package/dist/types/event/wrapEvent.d.ts +1 -0
  19. package/dist/types/keyboard/modifiers.d.ts +9 -0
  20. package/dist/types/keyboard/types.d.ts +0 -5
  21. package/dist/types/pointer/firePointerEvents.d.ts +11 -0
  22. package/dist/types/pointer/types.d.ts +2 -1
  23. package/dist/types/setup/index.d.ts +2 -0
  24. package/dist/types/setup/setup.d.ts +1 -0
  25. package/dist/types/utility/clear.d.ts +1 -1
  26. package/dist/types/utils/edit/input.d.ts +2 -0
  27. package/dist/types/utils/edit/isValidDateOrTimeValue.d.ts +3 -0
  28. package/dist/types/utils/focus/focus.d.ts +3 -0
  29. package/dist/types/utils/focus/selection.d.ts +4 -0
  30. package/dist/types/utils/index.d.ts +2 -9
  31. package/dist/types/utils/keyDef/readNextDescriptor.d.ts +3 -1
  32. package/dist/types/utils/keyboard/getKeyEventProps.d.ts +2 -14
  33. package/dist/types/utils/misc/cloneEvent.d.ts +1 -0
  34. package/dist/types/utils/misc/findClosest.d.ts +1 -1
  35. package/package.json +10 -13
  36. package/CHANGELOG.md +0 -5
  37. package/dist/types/keyboard/plugins/arrow.d.ts +0 -6
  38. package/dist/types/keyboard/plugins/character.d.ts +0 -5
  39. package/dist/types/keyboard/plugins/combination.d.ts +0 -5
  40. package/dist/types/keyboard/plugins/control.d.ts +0 -6
  41. package/dist/types/keyboard/plugins/functional.d.ts +0 -8
  42. package/dist/types/keyboard/plugins/index.d.ts +0 -7
  43. package/dist/types/keyboard/plugins/modifiers.d.ts +0 -8
  44. package/dist/types/keyboard/shared/fireChangeForInputTimeIfValid.d.ts +0 -3
  45. package/dist/types/keyboard/shared/index.d.ts +0 -1
  46. package/dist/types/utils/edit/calculateNewValue.d.ts +0 -14
  47. package/dist/types/utils/edit/editInputElement.d.ts +0 -16
  48. package/dist/types/utils/edit/isValidDateValue.d.ts +0 -3
  49. package/dist/types/utils/edit/isValidInputTimeValue.d.ts +0 -3
  50. package/dist/types/utils/edit/prepareInput.d.ts +0 -7
  51. package/dist/types/utils/misc/hasFormSubmit.d.ts +0 -1
  52. package/dist/types/utils/pointer/firePointerEvents.d.ts +0 -25
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import './click';
2
+ import './cut';
3
+ import './keydown';
4
+ import './keypress';
5
+ import './keyup';
6
+ import './paste';
7
+ export { behavior } from './registry';
8
+ export type { BehaviorPlugin } from './registry';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Config } from '../../setup';
2
+ import { EventType } from '../types';
3
+ export interface BehaviorPlugin<Type extends EventType> {
4
+ (event: DocumentEventMap[Type], target: Element, config: Config): // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
5
+ void | (() => void);
6
+ }
7
+ export declare const behavior: {
8
+ [Type in EventType]?: BehaviorPlugin<Type>;
9
+ };
@@ -0,0 +1,8 @@
1
+ import { EventType } from './types';
2
+ export declare type EventTypeInit<K extends EventType> = SpecificEventInit<FixedDocumentEventMap[K]>;
3
+ interface FixedDocumentEventMap extends DocumentEventMap {
4
+ input: InputEvent;
5
+ }
6
+ declare type SpecificEventInit<E extends Event> = E extends InputEvent ? InputEventInit : E extends ClipboardEvent ? ClipboardEventInit : E extends KeyboardEvent ? KeyboardEventInit : E extends PointerEvent ? PointerEventInit : E extends MouseEvent ? MouseEventInit : E extends UIEvent ? UIEventInit : EventInit;
7
+ export declare function createEvent<K extends EventType>(type: K, target: Element, init?: EventTypeInit<K>): DocumentEventMap[K];
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Config } from '../setup';
2
+ export declare function dispatchEvent(config: Config, target: Element, event: Event, preventDefault?: boolean): boolean;
@@ -0,0 +1,361 @@
1
+ export declare const eventMap: {
2
+ beforeInput: {
3
+ EventType: string;
4
+ defaultInit: {
5
+ bubbles: boolean;
6
+ cancelable: boolean;
7
+ composed: boolean;
8
+ };
9
+ };
10
+ input: {
11
+ EventType: string;
12
+ defaultInit: EventInit;
13
+ };
14
+ progress: {
15
+ EventType: string;
16
+ defaultInit: EventInit;
17
+ };
18
+ select: {
19
+ EventType: string;
20
+ defaultInit: EventInit;
21
+ };
22
+ scroll: {
23
+ EventType: string;
24
+ defaultInit: EventInit;
25
+ };
26
+ reset: {
27
+ EventType: string;
28
+ defaultInit: EventInit;
29
+ };
30
+ submit: {
31
+ EventType: string;
32
+ defaultInit: EventInit;
33
+ };
34
+ copy: {
35
+ EventType: string;
36
+ defaultInit: EventInit;
37
+ };
38
+ click: {
39
+ EventType: string;
40
+ defaultInit: EventInit;
41
+ };
42
+ blur: {
43
+ EventType: string;
44
+ defaultInit: EventInit;
45
+ };
46
+ focus: {
47
+ EventType: string;
48
+ defaultInit: EventInit;
49
+ };
50
+ cut: {
51
+ EventType: string;
52
+ defaultInit: EventInit;
53
+ };
54
+ paste: {
55
+ EventType: string;
56
+ defaultInit: EventInit;
57
+ };
58
+ abort: {
59
+ EventType: string;
60
+ defaultInit: EventInit;
61
+ };
62
+ change: {
63
+ EventType: string;
64
+ defaultInit: EventInit;
65
+ };
66
+ drag: {
67
+ EventType: string;
68
+ defaultInit: EventInit;
69
+ };
70
+ drop: {
71
+ EventType: string;
72
+ defaultInit: EventInit;
73
+ };
74
+ emptied: {
75
+ EventType: string;
76
+ defaultInit: EventInit;
77
+ };
78
+ ended: {
79
+ EventType: string;
80
+ defaultInit: EventInit;
81
+ };
82
+ error: {
83
+ EventType: string;
84
+ defaultInit: EventInit;
85
+ };
86
+ invalid: {
87
+ EventType: string;
88
+ defaultInit: EventInit;
89
+ };
90
+ load: {
91
+ EventType: string;
92
+ defaultInit: EventInit;
93
+ };
94
+ pause: {
95
+ EventType: string;
96
+ defaultInit: EventInit;
97
+ };
98
+ play: {
99
+ EventType: string;
100
+ defaultInit: EventInit;
101
+ };
102
+ playing: {
103
+ EventType: string;
104
+ defaultInit: EventInit;
105
+ };
106
+ resize: {
107
+ EventType: string;
108
+ defaultInit: EventInit;
109
+ };
110
+ seeked: {
111
+ EventType: string;
112
+ defaultInit: EventInit;
113
+ };
114
+ seeking: {
115
+ EventType: string;
116
+ defaultInit: EventInit;
117
+ };
118
+ stalled: {
119
+ EventType: string;
120
+ defaultInit: EventInit;
121
+ };
122
+ suspend: {
123
+ EventType: string;
124
+ defaultInit: EventInit;
125
+ };
126
+ waiting: {
127
+ EventType: string;
128
+ defaultInit: EventInit;
129
+ };
130
+ wheel: {
131
+ EventType: string;
132
+ defaultInit: EventInit;
133
+ };
134
+ compositionEnd: {
135
+ EventType: string;
136
+ defaultInit: EventInit;
137
+ };
138
+ compositionStart: {
139
+ EventType: string;
140
+ defaultInit: EventInit;
141
+ };
142
+ compositionUpdate: {
143
+ EventType: string;
144
+ defaultInit: EventInit;
145
+ };
146
+ keyDown: {
147
+ EventType: string;
148
+ defaultInit: EventInit;
149
+ };
150
+ keyPress: {
151
+ EventType: string;
152
+ defaultInit: EventInit;
153
+ };
154
+ keyUp: {
155
+ EventType: string;
156
+ defaultInit: EventInit;
157
+ };
158
+ focusIn: {
159
+ EventType: string;
160
+ defaultInit: EventInit;
161
+ };
162
+ focusOut: {
163
+ EventType: string;
164
+ defaultInit: EventInit;
165
+ };
166
+ contextMenu: {
167
+ EventType: string;
168
+ defaultInit: EventInit;
169
+ };
170
+ dblClick: {
171
+ EventType: string;
172
+ defaultInit: EventInit;
173
+ };
174
+ dragEnd: {
175
+ EventType: string;
176
+ defaultInit: EventInit;
177
+ };
178
+ dragEnter: {
179
+ EventType: string;
180
+ defaultInit: EventInit;
181
+ };
182
+ dragExit: {
183
+ EventType: string;
184
+ defaultInit: EventInit;
185
+ };
186
+ dragLeave: {
187
+ EventType: string;
188
+ defaultInit: EventInit;
189
+ };
190
+ dragOver: {
191
+ EventType: string;
192
+ defaultInit: EventInit;
193
+ };
194
+ dragStart: {
195
+ EventType: string;
196
+ defaultInit: EventInit;
197
+ };
198
+ mouseDown: {
199
+ EventType: string;
200
+ defaultInit: EventInit;
201
+ };
202
+ mouseEnter: {
203
+ EventType: string;
204
+ defaultInit: EventInit;
205
+ };
206
+ mouseLeave: {
207
+ EventType: string;
208
+ defaultInit: EventInit;
209
+ };
210
+ mouseMove: {
211
+ EventType: string;
212
+ defaultInit: EventInit;
213
+ };
214
+ mouseOut: {
215
+ EventType: string;
216
+ defaultInit: EventInit;
217
+ };
218
+ mouseOver: {
219
+ EventType: string;
220
+ defaultInit: EventInit;
221
+ };
222
+ mouseUp: {
223
+ EventType: string;
224
+ defaultInit: EventInit;
225
+ };
226
+ popState: {
227
+ EventType: string;
228
+ defaultInit: EventInit;
229
+ };
230
+ touchCancel: {
231
+ EventType: string;
232
+ defaultInit: EventInit;
233
+ };
234
+ touchEnd: {
235
+ EventType: string;
236
+ defaultInit: EventInit;
237
+ };
238
+ touchMove: {
239
+ EventType: string;
240
+ defaultInit: EventInit;
241
+ };
242
+ touchStart: {
243
+ EventType: string;
244
+ defaultInit: EventInit;
245
+ };
246
+ canPlay: {
247
+ EventType: string;
248
+ defaultInit: EventInit;
249
+ };
250
+ canPlayThrough: {
251
+ EventType: string;
252
+ defaultInit: EventInit;
253
+ };
254
+ durationChange: {
255
+ EventType: string;
256
+ defaultInit: EventInit;
257
+ };
258
+ encrypted: {
259
+ EventType: string;
260
+ defaultInit: EventInit;
261
+ };
262
+ loadedData: {
263
+ EventType: string;
264
+ defaultInit: EventInit;
265
+ };
266
+ loadedMetadata: {
267
+ EventType: string;
268
+ defaultInit: EventInit;
269
+ };
270
+ loadStart: {
271
+ EventType: string;
272
+ defaultInit: EventInit;
273
+ };
274
+ rateChange: {
275
+ EventType: string;
276
+ defaultInit: EventInit;
277
+ };
278
+ timeUpdate: {
279
+ EventType: string;
280
+ defaultInit: EventInit;
281
+ };
282
+ volumeChange: {
283
+ EventType: string;
284
+ defaultInit: EventInit;
285
+ };
286
+ animationStart: {
287
+ EventType: string;
288
+ defaultInit: EventInit;
289
+ };
290
+ animationEnd: {
291
+ EventType: string;
292
+ defaultInit: EventInit;
293
+ };
294
+ animationIteration: {
295
+ EventType: string;
296
+ defaultInit: EventInit;
297
+ };
298
+ transitionCancel: {
299
+ EventType: string;
300
+ defaultInit: EventInit;
301
+ };
302
+ transitionEnd: {
303
+ EventType: string;
304
+ defaultInit: EventInit;
305
+ };
306
+ transitionRun: {
307
+ EventType: string;
308
+ defaultInit: EventInit;
309
+ };
310
+ transitionStart: {
311
+ EventType: string;
312
+ defaultInit: EventInit;
313
+ };
314
+ doubleClick: {
315
+ EventType: string;
316
+ defaultInit: EventInit;
317
+ };
318
+ pointerOver: {
319
+ EventType: string;
320
+ defaultInit: EventInit;
321
+ };
322
+ pointerEnter: {
323
+ EventType: string;
324
+ defaultInit: EventInit;
325
+ };
326
+ pointerDown: {
327
+ EventType: string;
328
+ defaultInit: EventInit;
329
+ };
330
+ pointerMove: {
331
+ EventType: string;
332
+ defaultInit: EventInit;
333
+ };
334
+ pointerUp: {
335
+ EventType: string;
336
+ defaultInit: EventInit;
337
+ };
338
+ pointerCancel: {
339
+ EventType: string;
340
+ defaultInit: EventInit;
341
+ };
342
+ pointerOut: {
343
+ EventType: string;
344
+ defaultInit: EventInit;
345
+ };
346
+ pointerLeave: {
347
+ EventType: string;
348
+ defaultInit: EventInit;
349
+ };
350
+ gotPointerCapture: {
351
+ EventType: string;
352
+ defaultInit: EventInit;
353
+ };
354
+ lostPointerCapture: {
355
+ EventType: string;
356
+ defaultInit: EventInit;
357
+ };
358
+ };
359
+ export declare const eventMapKeys: {
360
+ [k in keyof DocumentEventMap]?: keyof typeof eventMap;
361
+ };
@@ -0,0 +1,2 @@
1
+ export declare function isMouseEvent(type: keyof DocumentEventMap): boolean;
2
+ export declare function isKeyboardEvent(type: keyof DocumentEventMap): boolean;
@@ -0,0 +1,6 @@
1
+ import { Config } from '../setup';
2
+ import { EventTypeInit } from './createEvent';
3
+ import { EventType, PointerCoords } from './types';
4
+ export type { EventType, PointerCoords };
5
+ export declare function dispatchUIEvent<K extends EventType>(config: Config, target: Element, type: K, init?: EventTypeInit<K>, preventDefault?: boolean): boolean;
6
+ export declare function bindDispatchUIEvent(config: Config): (target: Element, type: keyof DocumentEventMap, init?: InputEventInit | UIEventInit | EventInit | ClipboardEventInit | MouseEventInit | PointerEventInit | KeyboardEventInit | undefined, preventDefault?: boolean | undefined) => boolean;
@@ -0,0 +1,13 @@
1
+ export declare type EventType = keyof DocumentEventMap;
2
+ export interface PointerCoords {
3
+ x?: number;
4
+ y?: number;
5
+ clientX?: number;
6
+ clientY?: number;
7
+ offsetX?: number;
8
+ offsetY?: number;
9
+ pageX?: number;
10
+ pageY?: number;
11
+ screenX?: number;
12
+ screenY?: number;
13
+ }
@@ -0,0 +1 @@
1
+ export declare function wrapEvent<R>(cb: () => R, _element: Element): R;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file should contain behavior for modifier keys:
3
+ * https://www.w3.org/TR/uievents-key/#keys-modifier
4
+ */
5
+ import { Config } from '../setup';
6
+ import { keyboardKey } from '.';
7
+ export declare function preKeydownBehavior(config: Config, { key }: keyboardKey, element: Element): void;
8
+ export declare function preKeyupBehavior(config: Config, { key }: keyboardKey): void;
9
+ export declare function postKeyupBehavior(config: Config, { key }: keyboardKey, element: Element): void;
@@ -1,4 +1,3 @@
1
- import { Config } from '../setup';
2
1
  /**
3
2
  * @internal Do not create/alter this by yourself as this type might be subject to changes.
4
3
  */
@@ -72,7 +71,3 @@ export interface keyboardKey {
72
71
  /** Does the character in `key` require/imply a shiftKey to be pressed? */
73
72
  shift?: boolean;
74
73
  }
75
- export interface behaviorPlugin {
76
- matches: (keyDef: keyboardKey, element: Element, config: Config) => boolean;
77
- handle: (keyDef: keyboardKey, element: Element, config: Config) => void;
78
- }
@@ -0,0 +1,11 @@
1
+ import { EventType, PointerCoords } from '../event';
2
+ import { Config } from '../setup';
3
+ import { MouseButton } from '../utils';
4
+ export declare function firePointerEvent(config: Config, target: Element, type: EventType, { pointerType, button, coords, pointerId, isPrimary, clickCount, }: {
5
+ pointerType?: 'mouse' | 'pen' | 'touch';
6
+ button?: MouseButton;
7
+ coords?: PointerCoords;
8
+ pointerId?: number;
9
+ isPrimary?: boolean;
10
+ clickCount?: number;
11
+ }): boolean;
@@ -1,4 +1,5 @@
1
- import { PointerCoords, MouseButton } from '../utils';
1
+ import { PointerCoords } from '../event';
2
+ import { MouseButton } from '../utils';
2
3
  /**
3
4
  * @internal Do not create/alter this by yourself as this type might be subject to changes.
4
5
  */
@@ -1,3 +1,4 @@
1
+ import type { bindDispatchUIEvent } from '../event';
1
2
  import type * as userEventApi from './api';
2
3
  import { setupMain, setupSub } from './setup';
3
4
  import { Config, inputDeviceState } from './config';
@@ -7,6 +8,7 @@ export { Config };
7
8
  export declare type UserEventApi = typeof userEventApi;
8
9
  export declare type Instance = UserEventApi & {
9
10
  [Config]: Config;
11
+ dispatchUIEvent: ReturnType<typeof bindDispatchUIEvent>;
10
12
  };
11
13
  export declare type UserEvent = {
12
14
  readonly setup: (...args: Parameters<typeof setupSub>) => UserEvent;
@@ -1,6 +1,7 @@
1
1
  import { Options } from '../options';
2
2
  import type { Instance, UserEvent } from './index';
3
3
  import { Config } from './config';
4
+ export declare function createConfig(options?: Partial<Config>, defaults?: Required<Options>, node?: Node): Config;
4
5
  /**
5
6
  * Start a "session" with userEvent.
6
7
  * All APIs returned by this function share an input device state and a default configuration.
@@ -1,2 +1,2 @@
1
- import type { Instance } from '../setup';
1
+ import { Instance } from '../setup';
2
2
  export declare function clear(this: Instance, element: Element): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../setup';
2
+ export declare function input(config: Config, element: Element, data: string, inputType?: string): void;
@@ -0,0 +1,3 @@
1
+ export declare function isValidDateOrTimeValue(element: HTMLInputElement & {
2
+ type: 'date' | 'time';
3
+ }, value: string): boolean;
@@ -1,2 +1,5 @@
1
+ /**
2
+ * Focus closest focusable element.
3
+ */
1
4
  declare function focus(element: Element): void;
2
5
  export { focus };
@@ -40,3 +40,7 @@ export declare function setSelection({ focusNode, focusOffset, anchorNode, ancho
40
40
  focusNode: Node;
41
41
  focusOffset: number;
42
42
  }): void;
43
+ /**
44
+ * Move the selection
45
+ */
46
+ export declare function moveSelection(node: Element, direction: -1 | 1): void;
@@ -3,16 +3,10 @@ export * from './dataTransfer/Blob';
3
3
  export * from './dataTransfer/DataTransfer';
4
4
  export * from './dataTransfer/FileList';
5
5
  export * from './dataTransfer/Clipboard';
6
- export * from './edit/buildTimeValue';
7
- export * from './edit/calculateNewValue';
8
- export * from './edit/editInputElement';
9
6
  export * from './edit/getValue';
7
+ export * from './edit/input';
10
8
  export * from './edit/isContentEditable';
11
9
  export * from './edit/isEditable';
12
- export * from './edit/isValidDateValue';
13
- export * from './edit/isValidInputTimeValue';
14
- export * from './edit/maxLength';
15
- export * from './edit/prepareInput';
16
10
  export * from './edit/setFiles';
17
11
  export * from './focus/blur';
18
12
  export * from './focus/copySelection';
@@ -27,6 +21,7 @@ export * from './focus/selector';
27
21
  export * from './keyboard/getKeyEventProps';
28
22
  export * from './keyboard/getUIEventModifiers';
29
23
  export * from './keyDef/readNextDescriptor';
24
+ export * from './misc/cloneEvent';
30
25
  export * from './misc/eventWrapper';
31
26
  export * from './misc/findClosest';
32
27
  export * from './misc/getDocumentFromNode';
@@ -36,7 +31,5 @@ export * from './misc/isVisible';
36
31
  export * from './misc/isDisabled';
37
32
  export * from './misc/level';
38
33
  export * from './misc/wait';
39
- export * from './misc/hasFormSubmit';
40
34
  export * from './pointer/cssPointerEvents';
41
- export * from './pointer/firePointerEvents';
42
35
  export * from './pointer/mouseButtons';
@@ -1,3 +1,4 @@
1
+ declare type Context = 'pointer' | 'keyboard';
1
2
  /**
2
3
  * Read the next key definition from user input
3
4
  *
@@ -9,7 +10,7 @@
9
10
  * When keeping the key pressed you can choose how long the key is pressed `{descriptor>3}`.
10
11
  * You can then release the key per `{descriptor>3/}` or keep it pressed and continue with the next key.
11
12
  */
12
- export declare function readNextDescriptor(text: string): {
13
+ export declare function readNextDescriptor(text: string, context: Context): {
13
14
  consumedLength: number;
14
15
  descriptor: string;
15
16
  releasePrevious: boolean;
@@ -17,3 +18,4 @@ export declare function readNextDescriptor(text: string): {
17
18
  releaseSelf: boolean | undefined;
18
19
  type: string;
19
20
  };
21
+ export {};
@@ -1,17 +1,5 @@
1
- import { keyboardKey, keyboardState } from '../../keyboard/types';
2
- export declare function getKeyEventProps(keyDef: keyboardKey, state: keyboardState): {
3
- altKey: boolean;
4
- ctrlKey: boolean;
5
- metaKey: boolean;
6
- shiftKey: boolean;
7
- modifierAltGraph: boolean;
8
- modifierCapsLock: boolean;
9
- modifierFn: boolean;
10
- modifierFnLock: boolean;
11
- modifierNumLock: boolean;
12
- modifierScrollLock: boolean;
13
- modifierSymbol: boolean;
14
- modifierSymbolLock: boolean;
1
+ import { keyboardKey } from '../../keyboard/types';
2
+ export declare function getKeyEventProps(keyDef: keyboardKey): {
15
3
  key: string | undefined;
16
4
  code: string | undefined;
17
5
  };
@@ -0,0 +1 @@
1
+ export declare function cloneEvent<E extends Event>(event: E): E;
@@ -1 +1 @@
1
- export declare function findClosest(element: Element, callback: (e: Element) => boolean): Element | undefined;
1
+ export declare function findClosest<T extends Element>(element: Element, callback: (e: Element) => e is T): T | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testing-library/user-event",
3
- "version": "14.0.0-beta.7",
3
+ "version": "14.0.0",
4
4
  "description": "Fire events the same way the user does",
5
5
  "keywords": [
6
6
  "react-testing-library",
@@ -44,22 +44,19 @@
44
44
  "validate": "kcd-scripts validate",
45
45
  "typecheck": "kcd-scripts typecheck"
46
46
  },
47
- "dependencies": {
48
- "@babel/runtime": "^7.12.5"
49
- },
47
+ "dependencies": {},
50
48
  "devDependencies": {
51
- "@testing-library/dom": "^7.28.1",
52
- "@testing-library/jest-dom": "^5.11.6",
53
- "@testing-library/react": "^11.2.5",
54
- "@types/estree": "0.0.45",
49
+ "@testing-library/dom": "^8.11.4",
50
+ "@testing-library/jest-dom": "^5.16.3",
51
+ "@testing-library/react": "^12.1.4",
55
52
  "@types/jest-in-case": "^1.0.3",
56
- "@types/react": "^17.0.3",
57
- "esbuild": "^0.14.9",
58
- "eslint-import-resolver-typescript": "^2.5.0",
59
- "is-ci": "^2.0.0",
53
+ "@types/react": "^17.0.42",
54
+ "esbuild": "^0.14.27",
55
+ "eslint-import-resolver-typescript": "^2.7.0",
56
+ "is-ci": "^3.0.1",
60
57
  "jest-in-case": "^1.0.2",
61
58
  "jest-serializer-ansi": "^1.0.3",
62
- "kcd-scripts": "^11.1.0",
59
+ "kcd-scripts": "^12.1.0",
63
60
  "react": "^17.0.2",
64
61
  "react-dom": "^17.0.2",
65
62
  "typescript": "^4.1.2"
package/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- # CHANGELOG
2
-
3
- The changelog is automatically updated using
4
- [semantic-release](https://github.com/semantic-release/semantic-release). You
5
- can see it on the [releases page](../../releases).
@@ -1,6 +0,0 @@
1
- /**
2
- * This file should contain behavior for arrow keys as described here:
3
- * https://w3c.github.io/uievents-code/#key-arrowpad-section
4
- */
5
- import { behaviorPlugin } from '../types';
6
- export declare const keydownBehavior: behaviorPlugin[];