rescript-vitest-extras 0.1.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.
@@ -0,0 +1,201 @@
1
+ // =============================================================================
2
+ // Types
3
+ // =============================================================================
4
+
5
+ /**
6
+ * Vitest Browser React API bindings.
7
+ *
8
+ * Provides type-safe bindings for `vitest-browser-react`, including `render`,
9
+ * `renderHook`, `cleanup`, and the `Pure` submodule with `configure`.
10
+ * The `renderResult` type extends `LocatorSelectors` with query methods,
11
+ * property accessors, and lifecycle methods.
12
+ */
13
+ /** The result of rendering a component. Extends Locator with query methods. */
14
+ type renderResult
15
+
16
+ /** Options for rendering a component. */
17
+ type componentRenderOptions = {
18
+ container?: Dom.element,
19
+ baseElement?: Dom.element,
20
+ wrapper?: React.component<{children: React.element}>,
21
+ }
22
+
23
+ /** Options for `renderHook`. Extends `componentRenderOptions` with `initialProps`. */
24
+ type renderHookOptions<'props> = {
25
+ container?: Dom.element,
26
+ baseElement?: Dom.element,
27
+ wrapper?: React.component<{children: React.element}>,
28
+ initialProps?: 'props,
29
+ }
30
+
31
+ /** The result of rendering a hook. */
32
+ type renderHookResult<'result> = {
33
+ result: {current: 'result},
34
+ }
35
+
36
+ // =============================================================================
37
+ // renderResult — Query Methods
38
+ // =============================================================================
39
+
40
+ /** Returns a locator for the first element matching the given ARIA role. */
41
+ @send
42
+ external getByRole: (
43
+ renderResult,
44
+ VitestExtras__BrowserLocator.ariaRole,
45
+ ~options: VitestExtras__BrowserLocator.locatorByRoleOptions=?,
46
+ ) => VitestExtras__BrowserLocator.t = "getByRole"
47
+
48
+ /** Returns a locator for the first element matching the given text content. */
49
+ @send
50
+ external getByText: (
51
+ renderResult,
52
+ VitestExtras__BrowserLocator.stringOrRegExp,
53
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
54
+ ) => VitestExtras__BrowserLocator.t = "getByText"
55
+
56
+ /** Returns a locator for the first element matching the given label text. */
57
+ @send
58
+ external getByLabelText: (
59
+ renderResult,
60
+ VitestExtras__BrowserLocator.stringOrRegExp,
61
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
62
+ ) => VitestExtras__BrowserLocator.t = "getByLabelText"
63
+
64
+ /** Returns a locator for the first element matching the given placeholder text. */
65
+ @send
66
+ external getByPlaceholder: (
67
+ renderResult,
68
+ VitestExtras__BrowserLocator.stringOrRegExp,
69
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
70
+ ) => VitestExtras__BrowserLocator.t = "getByPlaceholder"
71
+
72
+ /** Returns a locator for the first element matching the given alt text. */
73
+ @send
74
+ external getByAltText: (
75
+ renderResult,
76
+ VitestExtras__BrowserLocator.stringOrRegExp,
77
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
78
+ ) => VitestExtras__BrowserLocator.t = "getByAltText"
79
+
80
+ /** Returns a locator for the first element matching the given `data-testid` attribute. */
81
+ @send
82
+ external getByTestId: (
83
+ renderResult,
84
+ VitestExtras__BrowserLocator.stringOrRegExp,
85
+ ) => VitestExtras__BrowserLocator.t = "getByTestId"
86
+
87
+ /** Returns a locator for the first element matching the given title attribute. */
88
+ @send
89
+ external getByTitle: (
90
+ renderResult,
91
+ VitestExtras__BrowserLocator.stringOrRegExp,
92
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
93
+ ) => VitestExtras__BrowserLocator.t = "getByTitle"
94
+
95
+ // =============================================================================
96
+ // renderResult — Property Accessors
97
+ // =============================================================================
98
+
99
+ /** The container DOM element that the component was rendered into. */
100
+ @get
101
+ external container: renderResult => Dom.element = "container"
102
+
103
+ /** The base element for queries. Defaults to `document.body`. */
104
+ @get
105
+ external baseElement: renderResult => Dom.element = "baseElement"
106
+
107
+ /** The root Locator for the rendered output. */
108
+ @get
109
+ external locator: renderResult => VitestExtras__BrowserLocator.t = "locator"
110
+
111
+ // =============================================================================
112
+ // renderResult — Lifecycle Methods
113
+ // =============================================================================
114
+
115
+ /** Unmounts the rendered component. */
116
+ @send
117
+ external unmount: renderResult => promise<unit> = "unmount"
118
+
119
+ /** Re-renders the component with new props by passing a new React element. */
120
+ @send
121
+ external rerender: (renderResult, React.element) => promise<unit> = "rerender"
122
+
123
+ /** Returns a `DocumentFragment` of the rendered output. */
124
+ @send
125
+ external asFragment: renderResult => Dom.element = "asFragment"
126
+
127
+ // =============================================================================
128
+ // renderResult — Escape Hatch
129
+ // =============================================================================
130
+
131
+ /** Casts a `renderResult` to a `VitestExtras__BrowserLocator.t` for use with Locator APIs. */
132
+ external toLocator: renderResult => VitestExtras__BrowserLocator.t = "%identity"
133
+
134
+ // =============================================================================
135
+ // renderHookResult — Methods (nested to avoid name collisions)
136
+ // =============================================================================
137
+
138
+ /** Methods on `renderHookResult`. Nested to avoid name collisions with `renderResult` methods. */
139
+ module HookResult = {
140
+ /** Runs the given callback inside `act()`. */
141
+ @send
142
+ external act: (renderHookResult<'result>, unit => promise<unit>) => promise<unit> = "act"
143
+
144
+ /** Re-renders the hook with new props. */
145
+ @send
146
+ external rerender: (renderHookResult<'result>, 'props) => promise<unit> = "rerender"
147
+
148
+ /** Unmounts the rendered hook. */
149
+ @send
150
+ external unmount: renderHookResult<'result> => promise<unit> = "unmount"
151
+ }
152
+
153
+ // =============================================================================
154
+ // Top-level Functions (auto-cleanup via vitest-browser-react)
155
+ // =============================================================================
156
+
157
+ /** Renders a React element into the DOM and returns a `renderResult`. Uses auto-cleanup. */
158
+ @module("vitest-browser-react")
159
+ external render: (React.element, ~options: componentRenderOptions=?) => promise<renderResult> =
160
+ "render"
161
+
162
+ /** Renders a custom hook and returns its result. Uses auto-cleanup. */
163
+ @module("vitest-browser-react")
164
+ external renderHook: (
165
+ 'props => 'result,
166
+ ~options: renderHookOptions<'props>=?,
167
+ ) => promise<renderHookResult<'result>> = "renderHook"
168
+
169
+ /** Unmounts all rendered components. Normally called automatically after each test. */
170
+ @module("vitest-browser-react")
171
+ external cleanup: unit => promise<unit> = "cleanup"
172
+
173
+ // =============================================================================
174
+ // Pure Submodule (no auto-cleanup, manual control)
175
+ // =============================================================================
176
+
177
+ /** Pure exports from `vitest-browser-react/pure`. No auto-cleanup; call `cleanup` manually. */
178
+ module Pure = {
179
+ /** Configuration options for the React renderer. */
180
+ type configOptions = {reactStrictMode?: bool}
181
+
182
+ /** Renders a React element into the DOM and returns a `renderResult`. No auto-cleanup. */
183
+ @module("vitest-browser-react/pure")
184
+ external render: (React.element, ~options: componentRenderOptions=?) => promise<renderResult> =
185
+ "render"
186
+
187
+ /** Renders a custom hook and returns its result. No auto-cleanup. */
188
+ @module("vitest-browser-react/pure")
189
+ external renderHook: (
190
+ 'props => 'result,
191
+ ~options: renderHookOptions<'props>=?,
192
+ ) => promise<renderHookResult<'result>> = "renderHook"
193
+
194
+ /** Unmounts all rendered components. Must be called manually when using `Pure`. */
195
+ @module("vitest-browser-react/pure")
196
+ external cleanup: unit => promise<unit> = "cleanup"
197
+
198
+ /** Configures the React renderer (e.g., enabling strict mode). */
199
+ @module("vitest-browser-react/pure")
200
+ external configure: configOptions => unit = "configure"
201
+ }
@@ -0,0 +1,201 @@
1
+ // =============================================================================
2
+ // Types
3
+ // =============================================================================
4
+
5
+ /**
6
+ * Vitest Browser React API bindings.
7
+ *
8
+ * Provides type-safe bindings for `vitest-browser-react`, including `render`,
9
+ * `renderHook`, `cleanup`, and the `Pure` submodule with `configure`.
10
+ * The `renderResult` type extends `LocatorSelectors` with query methods,
11
+ * property accessors, and lifecycle methods.
12
+ */
13
+ /** The result of rendering a component. Extends Locator with query methods. */
14
+ type renderResult
15
+
16
+ /** Options for rendering a component. */
17
+ type componentRenderOptions = {
18
+ container?: Dom.element,
19
+ baseElement?: Dom.element,
20
+ wrapper?: React.component<{children: React.element}>,
21
+ }
22
+
23
+ /** Options for `renderHook`. Extends `componentRenderOptions` with `initialProps`. */
24
+ type renderHookOptions<'props> = {
25
+ container?: Dom.element,
26
+ baseElement?: Dom.element,
27
+ wrapper?: React.component<{children: React.element}>,
28
+ initialProps?: 'props,
29
+ }
30
+
31
+ /** The result of rendering a hook. */
32
+ type renderHookResult<'result> = {
33
+ result: {current: 'result},
34
+ }
35
+
36
+ // =============================================================================
37
+ // renderResult — Query Methods
38
+ // =============================================================================
39
+
40
+ /** Returns a locator for the first element matching the given ARIA role. */
41
+ @send
42
+ external getByRole: (
43
+ renderResult,
44
+ VitestExtras__BrowserLocator.ariaRole,
45
+ ~options: VitestExtras__BrowserLocator.locatorByRoleOptions=?,
46
+ ) => VitestExtras__BrowserLocator.t = "getByRole"
47
+
48
+ /** Returns a locator for the first element matching the given text content. */
49
+ @send
50
+ external getByText: (
51
+ renderResult,
52
+ VitestExtras__BrowserLocator.stringOrRegExp,
53
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
54
+ ) => VitestExtras__BrowserLocator.t = "getByText"
55
+
56
+ /** Returns a locator for the first element matching the given label text. */
57
+ @send
58
+ external getByLabelText: (
59
+ renderResult,
60
+ VitestExtras__BrowserLocator.stringOrRegExp,
61
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
62
+ ) => VitestExtras__BrowserLocator.t = "getByLabelText"
63
+
64
+ /** Returns a locator for the first element matching the given placeholder text. */
65
+ @send
66
+ external getByPlaceholder: (
67
+ renderResult,
68
+ VitestExtras__BrowserLocator.stringOrRegExp,
69
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
70
+ ) => VitestExtras__BrowserLocator.t = "getByPlaceholder"
71
+
72
+ /** Returns a locator for the first element matching the given alt text. */
73
+ @send
74
+ external getByAltText: (
75
+ renderResult,
76
+ VitestExtras__BrowserLocator.stringOrRegExp,
77
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
78
+ ) => VitestExtras__BrowserLocator.t = "getByAltText"
79
+
80
+ /** Returns a locator for the first element matching the given `data-testid` attribute. */
81
+ @send
82
+ external getByTestId: (
83
+ renderResult,
84
+ VitestExtras__BrowserLocator.stringOrRegExp,
85
+ ) => VitestExtras__BrowserLocator.t = "getByTestId"
86
+
87
+ /** Returns a locator for the first element matching the given title attribute. */
88
+ @send
89
+ external getByTitle: (
90
+ renderResult,
91
+ VitestExtras__BrowserLocator.stringOrRegExp,
92
+ ~options: VitestExtras__BrowserLocator.locatorFilterOptions=?,
93
+ ) => VitestExtras__BrowserLocator.t = "getByTitle"
94
+
95
+ // =============================================================================
96
+ // renderResult — Property Accessors
97
+ // =============================================================================
98
+
99
+ /** The container DOM element that the component was rendered into. */
100
+ @get
101
+ external container: renderResult => Dom.element = "container"
102
+
103
+ /** The base element for queries. Defaults to `document.body`. */
104
+ @get
105
+ external baseElement: renderResult => Dom.element = "baseElement"
106
+
107
+ /** The root Locator for the rendered output. */
108
+ @get
109
+ external locator: renderResult => VitestExtras__BrowserLocator.t = "locator"
110
+
111
+ // =============================================================================
112
+ // renderResult — Lifecycle Methods
113
+ // =============================================================================
114
+
115
+ /** Unmounts the rendered component. */
116
+ @send
117
+ external unmount: renderResult => promise<unit> = "unmount"
118
+
119
+ /** Re-renders the component with new props by passing a new React element. */
120
+ @send
121
+ external rerender: (renderResult, React.element) => promise<unit> = "rerender"
122
+
123
+ /** Returns a `DocumentFragment` of the rendered output. */
124
+ @send
125
+ external asFragment: renderResult => Dom.element = "asFragment"
126
+
127
+ // =============================================================================
128
+ // renderResult — Escape Hatch
129
+ // =============================================================================
130
+
131
+ /** Casts a `renderResult` to a `VitestExtras__BrowserLocator.t` for use with Locator APIs. */
132
+ external toLocator: renderResult => VitestExtras__BrowserLocator.t = "%identity"
133
+
134
+ // =============================================================================
135
+ // renderHookResult — Methods (nested to avoid name collisions)
136
+ // =============================================================================
137
+
138
+ /** Methods on `renderHookResult`. Nested to avoid name collisions with `renderResult` methods. */
139
+ module HookResult: {
140
+ /** Runs the given callback inside `act()`. */
141
+ @send
142
+ external act: (renderHookResult<'result>, unit => promise<unit>) => promise<unit> = "act"
143
+
144
+ /** Re-renders the hook with new props. */
145
+ @send
146
+ external rerender: (renderHookResult<'result>, 'props) => promise<unit> = "rerender"
147
+
148
+ /** Unmounts the rendered hook. */
149
+ @send
150
+ external unmount: renderHookResult<'result> => promise<unit> = "unmount"
151
+ }
152
+
153
+ // =============================================================================
154
+ // Top-level Functions (auto-cleanup via vitest-browser-react)
155
+ // =============================================================================
156
+
157
+ /** Renders a React element into the DOM and returns a `renderResult`. Uses auto-cleanup. */
158
+ @module("vitest-browser-react")
159
+ external render: (React.element, ~options: componentRenderOptions=?) => promise<renderResult> =
160
+ "render"
161
+
162
+ /** Renders a custom hook and returns its result. Uses auto-cleanup. */
163
+ @module("vitest-browser-react")
164
+ external renderHook: (
165
+ 'props => 'result,
166
+ ~options: renderHookOptions<'props>=?,
167
+ ) => promise<renderHookResult<'result>> = "renderHook"
168
+
169
+ /** Unmounts all rendered components. Normally called automatically after each test. */
170
+ @module("vitest-browser-react")
171
+ external cleanup: unit => promise<unit> = "cleanup"
172
+
173
+ // =============================================================================
174
+ // Pure Submodule (no auto-cleanup, manual control)
175
+ // =============================================================================
176
+
177
+ /** Pure exports from `vitest-browser-react/pure`. No auto-cleanup; call `cleanup` manually. */
178
+ module Pure: {
179
+ /** Configuration options for the React renderer. */
180
+ type configOptions = {reactStrictMode?: bool}
181
+
182
+ /** Renders a React element into the DOM and returns a `renderResult`. No auto-cleanup. */
183
+ @module("vitest-browser-react/pure")
184
+ external render: (React.element, ~options: componentRenderOptions=?) => promise<renderResult> =
185
+ "render"
186
+
187
+ /** Renders a custom hook and returns its result. No auto-cleanup. */
188
+ @module("vitest-browser-react/pure")
189
+ external renderHook: (
190
+ 'props => 'result,
191
+ ~options: renderHookOptions<'props>=?,
192
+ ) => promise<renderHookResult<'result>> = "renderHook"
193
+
194
+ /** Unmounts all rendered components. Must be called manually when using `Pure`. */
195
+ @module("vitest-browser-react/pure")
196
+ external cleanup: unit => promise<unit> = "cleanup"
197
+
198
+ /** Configures the React renderer (e.g., enabling strict mode). */
199
+ @module("vitest-browser-react/pure")
200
+ external configure: configOptions => unit = "configure"
201
+ }
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Vitest Browser UserEvent API bindings.
3
+ *
4
+ * These bindings wrap Vitest's browser-mode `userEvent` singleton with ergonomic
5
+ * ReScript types. Each method is bound via `@send` with a `Binding` suffix, then
6
+ * re-exported as an `@inline` convenience wrapper that pipes through the global
7
+ * singleton.
8
+ */
9
+ /** Abstract type for a UserEvent instance from `vitest/browser`. */
10
+ type t
11
+
12
+ @module("vitest/browser") @val external userEvent: t = "userEvent"
13
+
14
+ // =============================================================================
15
+ // Setup
16
+ // =============================================================================
17
+
18
+ @send external setupBinding: t => t = "setup"
19
+
20
+ /** Creates a new, independent UserEvent instance. */
21
+ @inline
22
+ let setup = () => userEvent->setupBinding
23
+
24
+ // =============================================================================
25
+ // Click Operations
26
+ // =============================================================================
27
+
28
+ @send
29
+ external clickBinding: (t, VitestExtras__BrowserLocator.t, ~options: {..}=?) => promise<unit> =
30
+ "click"
31
+
32
+ /** Clicks the given element. */
33
+ @inline
34
+ let click = (~options=?, locator) => userEvent->clickBinding(locator, ~options?)
35
+
36
+ @send
37
+ external dblClickBinding: (t, VitestExtras__BrowserLocator.t, ~options: {..}=?) => promise<unit> =
38
+ "dblClick"
39
+
40
+ /** Double-clicks the given element. */
41
+ @inline
42
+ let dblClick = (~options=?, locator) => userEvent->dblClickBinding(locator, ~options?)
43
+
44
+ @send
45
+ external tripleClickBinding: (
46
+ t,
47
+ VitestExtras__BrowserLocator.t,
48
+ ~options: {..}=?,
49
+ ) => promise<unit> = "tripleClick"
50
+
51
+ /** Triple-clicks the given element. */
52
+ @inline
53
+ let tripleClick = (~options=?, locator) => userEvent->tripleClickBinding(locator, ~options?)
54
+
55
+ // =============================================================================
56
+ // Input Operations
57
+ // =============================================================================
58
+
59
+ @send
60
+ external fillBinding: (t, VitestExtras__BrowserLocator.t, string) => promise<unit> = "fill"
61
+
62
+ /** Sets the value of an input element. Unlike `type_`, this does not simulate
63
+ individual keystrokes and has no options parameter. */
64
+ @inline
65
+ let fill = (locator, text) => userEvent->fillBinding(locator, text)
66
+
67
+ @send
68
+ external typeBinding: (
69
+ t,
70
+ VitestExtras__BrowserLocator.t,
71
+ string,
72
+ ~options: {..}=?,
73
+ ) => promise<unit> = "type"
74
+
75
+ /** Types text into the given element character by character, simulating real keyboard input.
76
+ Named `type_` because `type` is a reserved word in ReScript. */
77
+ @inline
78
+ let type_ = (~options=?, locator, text) => userEvent->typeBinding(locator, text, ~options?)
79
+
80
+ @send
81
+ external clearBinding: (t, VitestExtras__BrowserLocator.t, ~options: {..}=?) => promise<unit> =
82
+ "clear"
83
+
84
+ /** Clears the value of the given input element. */
85
+ @inline
86
+ let clear = (~options=?, locator) => userEvent->clearBinding(locator, ~options?)
87
+
88
+ // =============================================================================
89
+ // Keyboard
90
+ // =============================================================================
91
+
92
+ @send
93
+ external keyboardBinding: (t, string) => promise<unit> = "keyboard"
94
+
95
+ /** Sends keyboard input without targeting a specific element.
96
+ Uses the same key syntax as `@testing-library/user-event`
97
+ (e.g., `"{Enter}"`, `"{Shift>}A{/Shift}"`). */
98
+ @inline
99
+ let keyboard = text => userEvent->keyboardBinding(text)
100
+
101
+ @send
102
+ external tabBinding: (t, ~options: {..}=?) => promise<unit> = "tab"
103
+
104
+ /** Presses the Tab key, optionally with modifier options (e.g., `{"shift": true}`). */
105
+ @inline
106
+ let tab = (~options=?) => userEvent->tabBinding(~options?)
107
+
108
+ // =============================================================================
109
+ // Hover
110
+ // =============================================================================
111
+
112
+ @send
113
+ external hoverBinding: (t, VitestExtras__BrowserLocator.t, ~options: {..}=?) => promise<unit> =
114
+ "hover"
115
+
116
+ /** Hovers over the given element. */
117
+ @inline
118
+ let hover = (~options=?, locator) => userEvent->hoverBinding(locator, ~options?)
119
+
120
+ @send
121
+ external unhoverBinding: (t, VitestExtras__BrowserLocator.t, ~options: {..}=?) => promise<unit> =
122
+ "unhover"
123
+
124
+ /** Moves the pointer away from the given element. */
125
+ @inline
126
+ let unhover = (~options=?, locator) => userEvent->unhoverBinding(locator, ~options?)
127
+
128
+ // =============================================================================
129
+ // Selection
130
+ // =============================================================================
131
+
132
+ @send
133
+ external selectOptionsBinding: (
134
+ t,
135
+ VitestExtras__BrowserLocator.t,
136
+ 'a,
137
+ ~options: {..}=?,
138
+ ) => promise<unit> = "selectOptions"
139
+
140
+ /** Selects the given option(s) in a `<select>` element. The `values` parameter is
141
+ intentionally polymorphic to support `string`, `array<string>`, `Locator`,
142
+ `array<Locator>`, `Dom.element`, or `array<Dom.element>`. */
143
+ @inline
144
+ let selectOptions = (~options=?, locator, values) =>
145
+ userEvent->selectOptionsBinding(locator, values, ~options?)
146
+
147
+ // =============================================================================
148
+ // File Upload
149
+ // =============================================================================
150
+
151
+ @send
152
+ external uploadBinding: (t, VitestExtras__BrowserLocator.t, 'a, ~options: {..}=?) => promise<unit> =
153
+ "upload"
154
+
155
+ /** Uploads file(s) to an input element. The `files` parameter is intentionally
156
+ polymorphic to support `string`, `array<string>`, `File`, or `array<File>`. */
157
+ @inline
158
+ let upload = (~options=?, locator, files) => userEvent->uploadBinding(locator, files, ~options?)
159
+
160
+ // =============================================================================
161
+ // Drag and Drop
162
+ // =============================================================================
163
+
164
+ @send
165
+ external dragAndDropBinding: (
166
+ t,
167
+ VitestExtras__BrowserLocator.t,
168
+ VitestExtras__BrowserLocator.t,
169
+ ~options: {..}=?,
170
+ ) => promise<unit> = "dragAndDrop"
171
+
172
+ /** Drags the source element and drops it onto the target element. */
173
+ @inline
174
+ let dragAndDrop = (~options=?, source, target) =>
175
+ userEvent->dragAndDropBinding(source, target, ~options?)
176
+
177
+ // =============================================================================
178
+ // Clipboard
179
+ // =============================================================================
180
+
181
+ @send
182
+ external copyBinding: t => promise<unit> = "copy"
183
+
184
+ /** Copies the current selection to the clipboard. */
185
+ @inline
186
+ let copy = () => userEvent->copyBinding
187
+
188
+ @send
189
+ external cutBinding: t => promise<unit> = "cut"
190
+
191
+ /** Cuts the current selection to the clipboard. */
192
+ @inline
193
+ let cut = () => userEvent->cutBinding
194
+
195
+ @send
196
+ external pasteBinding: t => promise<unit> = "paste"
197
+
198
+ /** Pastes the clipboard contents at the current cursor position. */
199
+ @inline
200
+ let paste = () => userEvent->pasteBinding