1 |
|
2 | export interface ITypeOpts {
|
3 | skipClick?: boolean
|
4 | skipAutoClose?: boolean
|
5 | delay?: number
|
6 | initialSelectionStart?: number
|
7 | initialSelectionEnd?: number
|
8 | }
|
9 |
|
10 | export interface ITabUserOptions {
|
11 | shift?: boolean
|
12 | focusTrap?: Document | Element
|
13 | }
|
14 |
|
15 | export type TargetElement = Element | Window
|
16 |
|
17 | export type FilesArgument = File | File[]
|
18 |
|
19 | export type UploadInitArgument = {
|
20 | clickInit?: MouseEventInit
|
21 | changeInit?: Event
|
22 | }
|
23 |
|
24 | export interface IClickOptions {
|
25 | skipHover?: boolean
|
26 | clickCount?: number
|
27 | }
|
28 |
|
29 | declare const userEvent: {
|
30 | clear: (element: TargetElement) => void
|
31 | click: (
|
32 | element: TargetElement,
|
33 | init?: MouseEventInit,
|
34 | options?: IClickOptions,
|
35 | ) => void
|
36 | dblClick: (
|
37 | element: TargetElement,
|
38 | init?: MouseEventInit,
|
39 | options?: IClickOptions,
|
40 | ) => void
|
41 | selectOptions: (
|
42 | element: TargetElement,
|
43 | values: string | string[] | HTMLElement | HTMLElement[],
|
44 | init?: MouseEventInit,
|
45 | ) => void
|
46 | deselectOptions: (
|
47 | element: TargetElement,
|
48 | values: string | string[] | HTMLElement | HTMLElement[],
|
49 | init?: MouseEventInit,
|
50 | ) => void
|
51 | upload: (
|
52 | element: TargetElement,
|
53 | files: FilesArgument,
|
54 | init?: UploadInitArgument,
|
55 | ) => void
|
56 | type: (
|
57 | element: TargetElement,
|
58 | text: string,
|
59 | userOpts?: ITypeOpts,
|
60 | ) => Promise<void>
|
61 | tab: (userOpts?: ITabUserOptions) => void
|
62 | paste: (
|
63 | element: TargetElement,
|
64 | init?: {},
|
65 | pasteOptions?: {
|
66 | initialSelectionStart?: number
|
67 | initialSelectionEnd?: number
|
68 | },
|
69 | ) => void
|
70 | hover: (element: TargetElement, init?: MouseEventInit) => void
|
71 | unhover: (element: TargetElement, init?: MouseEventInit) => void
|
72 | }
|
73 |
|
74 | export default userEvent
|