storybook 9.0.0-beta.1 → 9.0.0-beta.10
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/assets/server/base-preview-head.html +2 -1
- package/dist/actions/decorator.js +49 -52
- package/dist/actions/index.cjs +42 -44
- package/dist/actions/index.js +37 -40
- package/dist/actions/preview.cjs +44 -46
- package/dist/actions/preview.js +24 -27
- package/dist/babel/index.cjs +15060 -14974
- package/dist/babel/index.d.ts +37 -18
- package/dist/babel/index.js +15097 -15011
- package/dist/bin/index.cjs +44 -44
- package/dist/bin/index.js +44 -44
- package/dist/builder-manager/index.cjs +303 -283
- package/dist/builder-manager/index.js +545 -524
- package/dist/channels/index.js +919 -941
- package/dist/cli/bin/index.cjs +4185 -737
- package/dist/cli/bin/index.js +4199 -749
- package/dist/cli/index.cjs +26712 -23192
- package/dist/cli/index.d.ts +974 -1
- package/dist/cli/index.js +26765 -23243
- package/dist/client-logger/index.d.ts +2 -1
- package/dist/common/index.cjs +4785 -4693
- package/dist/common/index.d.ts +8 -2
- package/dist/common/index.js +5165 -5069
- package/dist/components/index.cjs +7905 -5600
- package/dist/components/index.d.ts +12 -12
- package/dist/components/index.js +4713 -3786
- package/dist/core-server/index.cjs +6793 -6702
- package/dist/core-server/index.d.ts +22 -22
- package/dist/core-server/index.js +6943 -6846
- package/dist/core-server/presets/common-manager.js +4526 -3375
- package/dist/core-server/presets/common-preset.cjs +2303 -2236
- package/dist/core-server/presets/common-preset.js +2391 -2320
- package/dist/docs-tools/index.cjs +484 -464
- package/dist/docs-tools/index.js +781 -768
- package/dist/highlight/index.cjs +19 -18
- package/dist/highlight/index.d.ts +4 -5
- package/dist/highlight/index.js +3 -2
- package/dist/highlight/preview.cjs +314 -310
- package/dist/highlight/preview.js +296 -292
- package/dist/instrumenter/index.cjs +561 -559
- package/dist/instrumenter/index.js +1564 -1516
- package/dist/manager/globals-module-info.cjs +1 -0
- package/dist/manager/globals-module-info.js +1 -0
- package/dist/manager/globals-runtime.js +21490 -21341
- package/dist/manager/runtime.js +5011 -4777
- package/dist/manager-api/index.cjs +2400 -2321
- package/dist/manager-api/index.d.ts +12 -1
- package/dist/manager-api/index.js +1951 -1903
- package/dist/manager-errors.js +37 -41
- package/dist/node-logger/index.cjs +25 -25
- package/dist/node-logger/index.js +25 -25
- package/dist/preview/runtime.js +14090 -14076
- package/dist/preview-api/index.cjs +1282 -1262
- package/dist/preview-api/index.js +1357 -1353
- package/dist/preview-errors.js +152 -173
- package/dist/router/index.cjs +1366 -1347
- package/dist/router/index.js +594 -575
- package/dist/server-errors.cjs +192 -177
- package/dist/server-errors.d.ts +11 -1
- package/dist/server-errors.js +173 -158
- package/dist/telemetry/index.cjs +4934 -1445
- package/dist/telemetry/index.d.ts +2 -1
- package/dist/telemetry/index.js +4966 -1475
- package/dist/test/index.cjs +69 -70
- package/dist/test/index.d.ts +1218 -80
- package/dist/test/index.js +9760 -9850
- package/dist/test/preview.cjs +664 -664
- package/dist/test/preview.js +3619 -3679
- package/dist/test/spy.cjs +112 -112
- package/dist/test/spy.d.ts +2 -6
- package/dist/test/spy.js +104 -104
- package/dist/theming/create.cjs +2244 -79
- package/dist/theming/create.js +951 -67
- package/dist/theming/index.cjs +3209 -1067
- package/dist/theming/index.js +1816 -947
- package/dist/types/index.cjs +4 -4
- package/dist/types/index.d.ts +2687 -2593
- package/package.json +13 -21
package/dist/test/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
|
|
2
2
|
import { AsymmetricMatchersContaining, JestAssertion, ExpectStatic, MatchersObject, MatcherState } from '@vitest/expect';
|
|
3
|
-
import * as domTestingLibrary from '@testing-library/dom';
|
|
4
|
-
import { BoundFunctions } from '@testing-library/dom';
|
|
5
3
|
import _userEvent, { userEvent as userEvent$1 } from '@testing-library/user-event';
|
|
6
|
-
import { MockInstance, spyOn as spyOn$1, Mock
|
|
4
|
+
import { MockInstance, spyOn as spyOn$1, Mock, MaybeMocked, MaybeMockedDeep, MaybePartiallyMocked, MaybePartiallyMockedDeep } from '@vitest/spy';
|
|
7
5
|
export * from '@vitest/spy';
|
|
8
6
|
export { isMockFunction, mocks } from '@vitest/spy';
|
|
9
7
|
|
|
@@ -34,78 +32,1222 @@ interface Expect extends AsymmetricMatchersContaining {
|
|
|
34
32
|
not: AsymmetricMatchersContaining;
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
35
|
+
// Disable automatic exports.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
type ARIAWidgetRole =
|
|
39
|
+
| "button"
|
|
40
|
+
| "checkbox"
|
|
41
|
+
| "gridcell"
|
|
42
|
+
| "link"
|
|
43
|
+
| "menuitem"
|
|
44
|
+
| "menuitemcheckbox"
|
|
45
|
+
| "menuitemradio"
|
|
46
|
+
| "option"
|
|
47
|
+
| "progressbar"
|
|
48
|
+
| "radio"
|
|
49
|
+
| "scrollbar"
|
|
50
|
+
| "searchbox"
|
|
51
|
+
| "slider"
|
|
52
|
+
| "spinbutton"
|
|
53
|
+
| "switch"
|
|
54
|
+
| "tab"
|
|
55
|
+
| "tabpanel"
|
|
56
|
+
| "textbox"
|
|
57
|
+
| "treeitem";
|
|
58
|
+
|
|
59
|
+
type ARIACompositeWidgetRole =
|
|
60
|
+
| "combobox"
|
|
61
|
+
| "grid"
|
|
62
|
+
| "listbox"
|
|
63
|
+
| "menu"
|
|
64
|
+
| "menubar"
|
|
65
|
+
| "radiogroup"
|
|
66
|
+
| "tablist"
|
|
67
|
+
| "tree"
|
|
68
|
+
| "treegrid";
|
|
69
|
+
|
|
70
|
+
type ARIADocumentStructureRole =
|
|
71
|
+
| "application"
|
|
72
|
+
| "article"
|
|
73
|
+
| "blockquote"
|
|
74
|
+
| "caption"
|
|
75
|
+
| "cell"
|
|
76
|
+
| "columnheader"
|
|
77
|
+
| "definition"
|
|
78
|
+
| "deletion"
|
|
79
|
+
| "directory"
|
|
80
|
+
| "document"
|
|
81
|
+
| "emphasis"
|
|
82
|
+
| "feed"
|
|
83
|
+
| "figure"
|
|
84
|
+
| "generic"
|
|
85
|
+
| "group"
|
|
86
|
+
| "heading"
|
|
87
|
+
| "img"
|
|
88
|
+
| "insertion"
|
|
89
|
+
| "list"
|
|
90
|
+
| "listitem"
|
|
91
|
+
| "math"
|
|
92
|
+
| "meter"
|
|
93
|
+
| "none"
|
|
94
|
+
| "note"
|
|
95
|
+
| "paragraph"
|
|
96
|
+
| "presentation"
|
|
97
|
+
| "row"
|
|
98
|
+
| "rowgroup"
|
|
99
|
+
| "rowheader"
|
|
100
|
+
| "separator"
|
|
101
|
+
| "strong"
|
|
102
|
+
| "subscript"
|
|
103
|
+
| "superscript"
|
|
104
|
+
| "table"
|
|
105
|
+
| "term"
|
|
106
|
+
| "time"
|
|
107
|
+
| "toolbar"
|
|
108
|
+
| "tooltip";
|
|
109
|
+
|
|
110
|
+
type ARIALandmarkRole =
|
|
111
|
+
| "banner"
|
|
112
|
+
| "complementary"
|
|
113
|
+
| "contentinfo"
|
|
114
|
+
| "form"
|
|
115
|
+
| "main"
|
|
116
|
+
| "navigation"
|
|
117
|
+
| "region"
|
|
118
|
+
| "search";
|
|
119
|
+
|
|
120
|
+
type ARIALiveRegionRole = "alert" | "log" | "marquee" | "status" | "timer";
|
|
121
|
+
|
|
122
|
+
type ARIAWindowRole = "alertdialog" | "dialog";
|
|
123
|
+
|
|
124
|
+
type ARIAUncategorizedRole = "code";
|
|
125
|
+
|
|
126
|
+
type ARIARole =
|
|
127
|
+
| ARIAWidgetRole
|
|
128
|
+
| ARIACompositeWidgetRole
|
|
129
|
+
| ARIADocumentStructureRole
|
|
130
|
+
| ARIALandmarkRole
|
|
131
|
+
| ARIALiveRegionRole
|
|
132
|
+
| ARIAWindowRole
|
|
133
|
+
| ARIAUncategorizedRole;
|
|
134
|
+
|
|
135
|
+
type MatcherFunction = (
|
|
136
|
+
content: string,
|
|
137
|
+
element: Element | null,
|
|
138
|
+
) => boolean
|
|
139
|
+
type Matcher = MatcherFunction | RegExp | number | string
|
|
140
|
+
|
|
141
|
+
// Get autocomplete for ARIARole union types, while still supporting another string
|
|
142
|
+
// Ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-567871939
|
|
143
|
+
type ByRoleMatcher = ARIARole | (string & {})
|
|
144
|
+
|
|
145
|
+
type NormalizerFn = (text: string) => string
|
|
146
|
+
|
|
147
|
+
interface MatcherOptions {
|
|
148
|
+
exact?: boolean
|
|
149
|
+
/** Use normalizer with getDefaultNormalizer instead */
|
|
150
|
+
trim?: boolean
|
|
151
|
+
/** Use normalizer with getDefaultNormalizer instead */
|
|
152
|
+
collapseWhitespace?: boolean
|
|
153
|
+
normalizer?: NormalizerFn
|
|
154
|
+
/** suppress suggestions for a specific query */
|
|
155
|
+
suggest?: boolean
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface DefaultNormalizerOptions {
|
|
159
|
+
trim?: boolean
|
|
160
|
+
collapseWhitespace?: boolean
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
declare function getDefaultNormalizer$1(
|
|
164
|
+
options?: DefaultNormalizerOptions,
|
|
165
|
+
): NormalizerFn
|
|
166
|
+
|
|
167
|
+
interface waitForOptions {
|
|
168
|
+
container?: HTMLElement
|
|
169
|
+
timeout?: number
|
|
170
|
+
interval?: number
|
|
171
|
+
onTimeout?: (error: Error) => Error
|
|
172
|
+
mutationObserverOptions?: MutationObserverInit
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare function waitFor$1<T>(
|
|
176
|
+
callback: () => Promise<T> | T,
|
|
177
|
+
options?: waitForOptions,
|
|
178
|
+
): Promise<T>
|
|
179
|
+
|
|
180
|
+
type WithSuggest = {suggest?: boolean}
|
|
181
|
+
|
|
182
|
+
type GetErrorFunction<Arguments extends any[] = [string]> = (
|
|
183
|
+
c: Element | null,
|
|
184
|
+
...args: Arguments
|
|
185
|
+
) => string
|
|
186
|
+
|
|
187
|
+
interface SelectorMatcherOptions extends MatcherOptions {
|
|
188
|
+
selector?: string
|
|
189
|
+
ignore?: boolean | string
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
type QueryByAttribute = (
|
|
193
|
+
attribute: string,
|
|
194
|
+
container: HTMLElement,
|
|
195
|
+
id: Matcher,
|
|
196
|
+
options?: MatcherOptions,
|
|
197
|
+
) => HTMLElement | null
|
|
198
|
+
|
|
199
|
+
type AllByAttribute = (
|
|
200
|
+
attribute: string,
|
|
201
|
+
container: HTMLElement,
|
|
202
|
+
id: Matcher,
|
|
203
|
+
options?: MatcherOptions,
|
|
204
|
+
) => HTMLElement[]
|
|
205
|
+
|
|
206
|
+
declare const queryByAttribute$1: QueryByAttribute
|
|
207
|
+
declare const queryAllByAttribute$1: AllByAttribute
|
|
208
|
+
declare function getElementError$1(
|
|
209
|
+
message: string | null,
|
|
210
|
+
container: HTMLElement,
|
|
211
|
+
): Error
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* query methods have a common call signature. Only the return type differs.
|
|
215
|
+
*/
|
|
216
|
+
type QueryMethod<Arguments extends any[], Return> = (
|
|
217
|
+
container: HTMLElement,
|
|
218
|
+
...args: Arguments
|
|
219
|
+
) => Return
|
|
220
|
+
type QueryBy<Arguments extends any[]> = QueryMethod<
|
|
221
|
+
Arguments,
|
|
222
|
+
HTMLElement | null
|
|
223
|
+
>
|
|
224
|
+
type GetAllBy<Arguments extends any[]> = QueryMethod<
|
|
225
|
+
Arguments,
|
|
226
|
+
HTMLElement[]
|
|
227
|
+
>
|
|
228
|
+
type FindAllBy<Arguments extends any[]> = QueryMethod<
|
|
229
|
+
[Arguments[0], Arguments[1]?, waitForOptions?],
|
|
230
|
+
Promise<HTMLElement[]>
|
|
231
|
+
>
|
|
232
|
+
type GetBy<Arguments extends any[]> = QueryMethod<Arguments, HTMLElement>
|
|
233
|
+
type FindBy<Arguments extends any[]> = QueryMethod<
|
|
234
|
+
[Arguments[0], Arguments[1]?, waitForOptions?],
|
|
235
|
+
Promise<HTMLElement>
|
|
236
|
+
>
|
|
237
|
+
|
|
238
|
+
type BuiltQueryMethods<Arguments extends any[]> = [
|
|
239
|
+
QueryBy<Arguments>,
|
|
240
|
+
GetAllBy<Arguments>,
|
|
241
|
+
GetBy<Arguments>,
|
|
242
|
+
FindAllBy<Arguments>,
|
|
243
|
+
FindBy<Arguments>,
|
|
244
|
+
]
|
|
245
|
+
|
|
246
|
+
declare function buildQueries$1<Arguments extends any[]>(
|
|
247
|
+
queryAllBy: GetAllBy<Arguments>,
|
|
248
|
+
getMultipleError: GetErrorFunction<Arguments>,
|
|
249
|
+
getMissingError: GetErrorFunction<Arguments>,
|
|
250
|
+
): BuiltQueryMethods<Arguments>
|
|
251
|
+
|
|
252
|
+
type queryHelpers_d_AllByAttribute = AllByAttribute;
|
|
253
|
+
type queryHelpers_d_BuiltQueryMethods<Arguments extends any[]> = BuiltQueryMethods<Arguments>;
|
|
254
|
+
type queryHelpers_d_FindAllBy<Arguments extends any[]> = FindAllBy<Arguments>;
|
|
255
|
+
type queryHelpers_d_FindBy<Arguments extends any[]> = FindBy<Arguments>;
|
|
256
|
+
type queryHelpers_d_GetAllBy<Arguments extends any[]> = GetAllBy<Arguments>;
|
|
257
|
+
type queryHelpers_d_GetBy<Arguments extends any[]> = GetBy<Arguments>;
|
|
258
|
+
type queryHelpers_d_GetErrorFunction<Arguments extends any[] = [string]> = GetErrorFunction<Arguments>;
|
|
259
|
+
type queryHelpers_d_QueryBy<Arguments extends any[]> = QueryBy<Arguments>;
|
|
260
|
+
type queryHelpers_d_QueryByAttribute = QueryByAttribute;
|
|
261
|
+
type queryHelpers_d_QueryMethod<Arguments extends any[], Return> = QueryMethod<Arguments, Return>;
|
|
262
|
+
type queryHelpers_d_SelectorMatcherOptions = SelectorMatcherOptions;
|
|
263
|
+
type queryHelpers_d_WithSuggest = WithSuggest;
|
|
264
|
+
declare namespace queryHelpers_d {
|
|
265
|
+
export { type queryHelpers_d_AllByAttribute as AllByAttribute, type queryHelpers_d_BuiltQueryMethods as BuiltQueryMethods, type queryHelpers_d_FindAllBy as FindAllBy, type queryHelpers_d_FindBy as FindBy, type queryHelpers_d_GetAllBy as GetAllBy, type queryHelpers_d_GetBy as GetBy, type queryHelpers_d_GetErrorFunction as GetErrorFunction, type queryHelpers_d_QueryBy as QueryBy, type queryHelpers_d_QueryByAttribute as QueryByAttribute, type queryHelpers_d_QueryMethod as QueryMethod, type queryHelpers_d_SelectorMatcherOptions as SelectorMatcherOptions, type queryHelpers_d_WithSuggest as WithSuggest, buildQueries$1 as buildQueries, getElementError$1 as getElementError, queryAllByAttribute$1 as queryAllByAttribute, queryByAttribute$1 as queryByAttribute };
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
type QueryByBoundAttribute<T extends HTMLElement = HTMLElement> = (
|
|
269
|
+
container: HTMLElement,
|
|
270
|
+
id: Matcher,
|
|
271
|
+
options?: MatcherOptions,
|
|
272
|
+
) => T | null
|
|
273
|
+
|
|
274
|
+
type AllByBoundAttribute<T extends HTMLElement = HTMLElement> = (
|
|
275
|
+
container: HTMLElement,
|
|
276
|
+
id: Matcher,
|
|
277
|
+
options?: MatcherOptions,
|
|
278
|
+
) => T[]
|
|
279
|
+
|
|
280
|
+
type FindAllByBoundAttribute<T extends HTMLElement = HTMLElement> = (
|
|
281
|
+
container: HTMLElement,
|
|
282
|
+
id: Matcher,
|
|
283
|
+
options?: MatcherOptions,
|
|
284
|
+
waitForElementOptions?: waitForOptions,
|
|
285
|
+
) => Promise<T[]>
|
|
286
|
+
|
|
287
|
+
type GetByBoundAttribute<T extends HTMLElement = HTMLElement> = (
|
|
288
|
+
container: HTMLElement,
|
|
289
|
+
id: Matcher,
|
|
290
|
+
options?: MatcherOptions,
|
|
291
|
+
) => T
|
|
292
|
+
|
|
293
|
+
type FindByBoundAttribute<T extends HTMLElement = HTMLElement> = (
|
|
294
|
+
container: HTMLElement,
|
|
295
|
+
id: Matcher,
|
|
296
|
+
options?: MatcherOptions,
|
|
297
|
+
waitForElementOptions?: waitForOptions,
|
|
298
|
+
) => Promise<T>
|
|
299
|
+
|
|
300
|
+
type QueryByText<T extends HTMLElement = HTMLElement> = (
|
|
301
|
+
container: HTMLElement,
|
|
302
|
+
id: Matcher,
|
|
303
|
+
options?: SelectorMatcherOptions,
|
|
304
|
+
) => T | null
|
|
305
|
+
|
|
306
|
+
type AllByText<T extends HTMLElement = HTMLElement> = (
|
|
307
|
+
container: HTMLElement,
|
|
308
|
+
id: Matcher,
|
|
309
|
+
options?: SelectorMatcherOptions,
|
|
310
|
+
) => T[]
|
|
311
|
+
|
|
312
|
+
type FindAllByText<T extends HTMLElement = HTMLElement> = (
|
|
313
|
+
container: HTMLElement,
|
|
314
|
+
id: Matcher,
|
|
315
|
+
options?: SelectorMatcherOptions,
|
|
316
|
+
waitForElementOptions?: waitForOptions,
|
|
317
|
+
) => Promise<T[]>
|
|
318
|
+
|
|
319
|
+
type GetByText<T extends HTMLElement = HTMLElement> = (
|
|
320
|
+
container: HTMLElement,
|
|
321
|
+
id: Matcher,
|
|
322
|
+
options?: SelectorMatcherOptions,
|
|
323
|
+
) => T
|
|
324
|
+
|
|
325
|
+
type FindByText<T extends HTMLElement = HTMLElement> = (
|
|
326
|
+
container: HTMLElement,
|
|
327
|
+
id: Matcher,
|
|
328
|
+
options?: SelectorMatcherOptions,
|
|
329
|
+
waitForElementOptions?: waitForOptions,
|
|
330
|
+
) => Promise<T>
|
|
331
|
+
|
|
332
|
+
interface ByRoleOptions {
|
|
333
|
+
/** suppress suggestions for a specific query */
|
|
334
|
+
suggest?: boolean
|
|
335
|
+
/**
|
|
336
|
+
* If true includes elements in the query set that are usually excluded from
|
|
337
|
+
* the accessibility tree. `role="none"` or `role="presentation"` are included
|
|
338
|
+
* in either case.
|
|
339
|
+
*/
|
|
340
|
+
hidden?: boolean
|
|
341
|
+
/**
|
|
342
|
+
* If true only includes elements in the query set that are marked as
|
|
343
|
+
* selected in the accessibility tree, i.e., `aria-selected="true"`
|
|
344
|
+
*/
|
|
345
|
+
selected?: boolean
|
|
346
|
+
/**
|
|
347
|
+
* If true only includes elements in the query set that are marked as
|
|
348
|
+
* busy in the accessibility tree, i.e., `aria-busy="true"`
|
|
349
|
+
*/
|
|
350
|
+
busy?: boolean
|
|
351
|
+
/**
|
|
352
|
+
* If true only includes elements in the query set that are marked as
|
|
353
|
+
* checked in the accessibility tree, i.e., `aria-checked="true"`
|
|
354
|
+
*/
|
|
355
|
+
checked?: boolean
|
|
356
|
+
/**
|
|
357
|
+
* If true only includes elements in the query set that are marked as
|
|
358
|
+
* pressed in the accessibility tree, i.e., `aria-pressed="true"`
|
|
359
|
+
*/
|
|
360
|
+
pressed?: boolean
|
|
361
|
+
/**
|
|
362
|
+
* Filters elements by their `aria-current` state. `true` and `false` match `aria-current="true"` and `aria-current="false"` (as well as a missing `aria-current` attribute) respectively.
|
|
363
|
+
*/
|
|
364
|
+
current?: boolean | string
|
|
365
|
+
/**
|
|
366
|
+
* If true only includes elements in the query set that are marked as
|
|
367
|
+
* expanded in the accessibility tree, i.e., `aria-expanded="true"`
|
|
368
|
+
*/
|
|
369
|
+
expanded?: boolean
|
|
370
|
+
/**
|
|
371
|
+
* Includes elements with the `"heading"` role matching the indicated level,
|
|
372
|
+
* either by the semantic HTML heading elements `<h1>-<h6>` or matching
|
|
373
|
+
* the `aria-level` attribute.
|
|
374
|
+
*/
|
|
375
|
+
level?: number
|
|
376
|
+
value?: {
|
|
377
|
+
now?: number
|
|
378
|
+
min?: number
|
|
379
|
+
max?: number
|
|
380
|
+
text?: Matcher
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Includes every role used in the `role` attribute
|
|
384
|
+
* For example *ByRole('progressbar', {queryFallbacks: true})` will find <div role="meter progressbar">`.
|
|
385
|
+
*/
|
|
386
|
+
queryFallbacks?: boolean
|
|
387
|
+
/**
|
|
388
|
+
* Only considers elements with the specified accessible name.
|
|
389
|
+
*/
|
|
390
|
+
name?:
|
|
391
|
+
| RegExp
|
|
392
|
+
| string
|
|
393
|
+
| ((accessibleName: string, element: Element) => boolean)
|
|
394
|
+
/**
|
|
395
|
+
* Only considers elements with the specified accessible description.
|
|
396
|
+
*/
|
|
397
|
+
description?:
|
|
398
|
+
| RegExp
|
|
399
|
+
| string
|
|
400
|
+
| ((accessibleDescription: string, element: Element) => boolean)
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
type AllByRole<T extends HTMLElement = HTMLElement> = (
|
|
404
|
+
container: HTMLElement,
|
|
405
|
+
role: ByRoleMatcher,
|
|
406
|
+
options?: ByRoleOptions,
|
|
407
|
+
) => T[]
|
|
408
|
+
|
|
409
|
+
type GetByRole<T extends HTMLElement = HTMLElement> = (
|
|
410
|
+
container: HTMLElement,
|
|
411
|
+
role: ByRoleMatcher,
|
|
412
|
+
options?: ByRoleOptions,
|
|
413
|
+
) => T
|
|
414
|
+
|
|
415
|
+
type QueryByRole<T extends HTMLElement = HTMLElement> = (
|
|
416
|
+
container: HTMLElement,
|
|
417
|
+
role: ByRoleMatcher,
|
|
418
|
+
options?: ByRoleOptions,
|
|
419
|
+
) => T | null
|
|
420
|
+
|
|
421
|
+
type FindByRole<T extends HTMLElement = HTMLElement> = (
|
|
422
|
+
container: HTMLElement,
|
|
423
|
+
role: ByRoleMatcher,
|
|
424
|
+
options?: ByRoleOptions,
|
|
425
|
+
waitForElementOptions?: waitForOptions,
|
|
426
|
+
) => Promise<T>
|
|
427
|
+
|
|
428
|
+
type FindAllByRole<T extends HTMLElement = HTMLElement> = (
|
|
429
|
+
container: HTMLElement,
|
|
430
|
+
role: ByRoleMatcher,
|
|
431
|
+
options?: ByRoleOptions,
|
|
432
|
+
waitForElementOptions?: waitForOptions,
|
|
433
|
+
) => Promise<T[]>
|
|
434
|
+
|
|
435
|
+
declare function getByLabelText$1<T extends HTMLElement = HTMLElement>(
|
|
436
|
+
...args: Parameters<GetByText<T>>
|
|
437
|
+
): ReturnType<GetByText<T>>
|
|
438
|
+
declare function getAllByLabelText$1<T extends HTMLElement = HTMLElement>(
|
|
439
|
+
...args: Parameters<AllByText<T>>
|
|
440
|
+
): ReturnType<AllByText<T>>
|
|
441
|
+
declare function queryByLabelText$1<T extends HTMLElement = HTMLElement>(
|
|
442
|
+
...args: Parameters<QueryByText<T>>
|
|
443
|
+
): ReturnType<QueryByText<T>>
|
|
444
|
+
declare function queryAllByLabelText$1<T extends HTMLElement = HTMLElement>(
|
|
445
|
+
...args: Parameters<AllByText<T>>
|
|
446
|
+
): ReturnType<AllByText<T>>
|
|
447
|
+
declare function findByLabelText$1<T extends HTMLElement = HTMLElement>(
|
|
448
|
+
...args: Parameters<FindByText<T>>
|
|
449
|
+
): ReturnType<FindByText<T>>
|
|
450
|
+
declare function findAllByLabelText$1<T extends HTMLElement = HTMLElement>(
|
|
451
|
+
...args: Parameters<FindAllByText<T>>
|
|
452
|
+
): ReturnType<FindAllByText<T>>
|
|
453
|
+
declare function getByPlaceholderText$1<T extends HTMLElement = HTMLElement>(
|
|
454
|
+
...args: Parameters<GetByBoundAttribute<T>>
|
|
455
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
456
|
+
declare function getAllByPlaceholderText$1<T extends HTMLElement = HTMLElement>(
|
|
457
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
458
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
459
|
+
declare function queryByPlaceholderText$1<T extends HTMLElement = HTMLElement>(
|
|
460
|
+
...args: Parameters<QueryByBoundAttribute<T>>
|
|
461
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
462
|
+
declare function queryAllByPlaceholderText$1<T extends HTMLElement = HTMLElement>(
|
|
463
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
464
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
465
|
+
declare function findByPlaceholderText$1<T extends HTMLElement = HTMLElement>(
|
|
466
|
+
...args: Parameters<FindByBoundAttribute<T>>
|
|
467
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
468
|
+
declare function findAllByPlaceholderText$1<T extends HTMLElement = HTMLElement>(
|
|
469
|
+
...args: Parameters<FindAllByBoundAttribute<T>>
|
|
470
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
471
|
+
declare function getByText$1<T extends HTMLElement = HTMLElement>(
|
|
472
|
+
...args: Parameters<GetByText<T>>
|
|
473
|
+
): ReturnType<GetByText<T>>
|
|
474
|
+
declare function getAllByText$1<T extends HTMLElement = HTMLElement>(
|
|
475
|
+
...args: Parameters<AllByText<T>>
|
|
476
|
+
): ReturnType<AllByText<T>>
|
|
477
|
+
declare function queryByText$1<T extends HTMLElement = HTMLElement>(
|
|
478
|
+
...args: Parameters<QueryByText<T>>
|
|
479
|
+
): ReturnType<QueryByText<T>>
|
|
480
|
+
declare function queryAllByText$1<T extends HTMLElement = HTMLElement>(
|
|
481
|
+
...args: Parameters<AllByText<T>>
|
|
482
|
+
): ReturnType<AllByText<T>>
|
|
483
|
+
declare function findByText$1<T extends HTMLElement = HTMLElement>(
|
|
484
|
+
...args: Parameters<FindByText<T>>
|
|
485
|
+
): ReturnType<FindByText<T>>
|
|
486
|
+
declare function findAllByText$1<T extends HTMLElement = HTMLElement>(
|
|
487
|
+
...args: Parameters<FindAllByText<T>>
|
|
488
|
+
): ReturnType<FindAllByText<T>>
|
|
489
|
+
declare function getByAltText$1<T extends HTMLElement = HTMLElement>(
|
|
490
|
+
...args: Parameters<GetByBoundAttribute<T>>
|
|
491
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
492
|
+
declare function getAllByAltText$1<T extends HTMLElement = HTMLElement>(
|
|
493
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
494
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
495
|
+
declare function queryByAltText$1<T extends HTMLElement = HTMLElement>(
|
|
496
|
+
...args: Parameters<QueryByBoundAttribute<T>>
|
|
497
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
498
|
+
declare function queryAllByAltText$1<T extends HTMLElement = HTMLElement>(
|
|
499
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
500
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
501
|
+
declare function findByAltText$1<T extends HTMLElement = HTMLElement>(
|
|
502
|
+
...args: Parameters<FindByBoundAttribute<T>>
|
|
503
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
504
|
+
declare function findAllByAltText$1<T extends HTMLElement = HTMLElement>(
|
|
505
|
+
...args: Parameters<FindAllByBoundAttribute<T>>
|
|
506
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
507
|
+
declare function getByTitle$1<T extends HTMLElement = HTMLElement>(
|
|
508
|
+
...args: Parameters<GetByBoundAttribute<T>>
|
|
509
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
510
|
+
declare function getAllByTitle$1<T extends HTMLElement = HTMLElement>(
|
|
511
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
512
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
513
|
+
declare function queryByTitle$1<T extends HTMLElement = HTMLElement>(
|
|
514
|
+
...args: Parameters<QueryByBoundAttribute<T>>
|
|
515
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
516
|
+
declare function queryAllByTitle$1<T extends HTMLElement = HTMLElement>(
|
|
517
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
518
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
519
|
+
declare function findByTitle$1<T extends HTMLElement = HTMLElement>(
|
|
520
|
+
...args: Parameters<FindByBoundAttribute<T>>
|
|
521
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
522
|
+
declare function findAllByTitle$1<T extends HTMLElement = HTMLElement>(
|
|
523
|
+
...args: Parameters<FindAllByBoundAttribute<T>>
|
|
524
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
525
|
+
declare function getByDisplayValue$1<T extends HTMLElement = HTMLElement>(
|
|
526
|
+
...args: Parameters<GetByBoundAttribute<T>>
|
|
527
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
528
|
+
declare function getAllByDisplayValue$1<T extends HTMLElement = HTMLElement>(
|
|
529
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
530
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
531
|
+
declare function queryByDisplayValue$1<T extends HTMLElement = HTMLElement>(
|
|
532
|
+
...args: Parameters<QueryByBoundAttribute<T>>
|
|
533
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
534
|
+
declare function queryAllByDisplayValue$1<T extends HTMLElement = HTMLElement>(
|
|
535
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
536
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
537
|
+
declare function findByDisplayValue$1<T extends HTMLElement = HTMLElement>(
|
|
538
|
+
...args: Parameters<FindByBoundAttribute<T>>
|
|
539
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
540
|
+
declare function findAllByDisplayValue$1<T extends HTMLElement = HTMLElement>(
|
|
541
|
+
...args: Parameters<FindAllByBoundAttribute<T>>
|
|
542
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
543
|
+
declare function getByRole$1<T extends HTMLElement = HTMLElement>(
|
|
544
|
+
...args: Parameters<GetByRole<T>>
|
|
545
|
+
): ReturnType<GetByRole<T>>
|
|
546
|
+
declare function getAllByRole$1<T extends HTMLElement = HTMLElement>(
|
|
547
|
+
...args: Parameters<AllByRole<T>>
|
|
548
|
+
): ReturnType<AllByRole<T>>
|
|
549
|
+
declare function queryByRole$1<T extends HTMLElement = HTMLElement>(
|
|
550
|
+
...args: Parameters<QueryByRole<T>>
|
|
551
|
+
): ReturnType<QueryByRole<T>>
|
|
552
|
+
declare function queryAllByRole$1<T extends HTMLElement = HTMLElement>(
|
|
553
|
+
...args: Parameters<AllByRole<T>>
|
|
554
|
+
): ReturnType<AllByRole<T>>
|
|
555
|
+
declare function findByRole$1<T extends HTMLElement = HTMLElement>(
|
|
556
|
+
...args: Parameters<FindByRole<T>>
|
|
557
|
+
): ReturnType<FindByRole<T>>
|
|
558
|
+
declare function findAllByRole$1<T extends HTMLElement = HTMLElement>(
|
|
559
|
+
...args: Parameters<FindAllByRole<T>>
|
|
560
|
+
): ReturnType<FindAllByRole<T>>
|
|
561
|
+
declare function getByTestId$1<T extends HTMLElement = HTMLElement>(
|
|
562
|
+
...args: Parameters<GetByBoundAttribute<T>>
|
|
563
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
564
|
+
declare function getAllByTestId$1<T extends HTMLElement = HTMLElement>(
|
|
565
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
566
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
567
|
+
declare function queryByTestId$1<T extends HTMLElement = HTMLElement>(
|
|
568
|
+
...args: Parameters<QueryByBoundAttribute<T>>
|
|
569
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
570
|
+
declare function queryAllByTestId$1<T extends HTMLElement = HTMLElement>(
|
|
571
|
+
...args: Parameters<AllByBoundAttribute<T>>
|
|
572
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
573
|
+
declare function findByTestId$1<T extends HTMLElement = HTMLElement>(
|
|
574
|
+
...args: Parameters<FindByBoundAttribute<T>>
|
|
575
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
576
|
+
declare function findAllByTestId$1<T extends HTMLElement = HTMLElement>(
|
|
577
|
+
...args: Parameters<FindAllByBoundAttribute<T>>
|
|
578
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
579
|
+
|
|
580
|
+
type queries$1_AllByBoundAttribute<T extends HTMLElement = HTMLElement> = AllByBoundAttribute<T>;
|
|
581
|
+
type queries$1_AllByRole<T extends HTMLElement = HTMLElement> = AllByRole<T>;
|
|
582
|
+
type queries$1_AllByText<T extends HTMLElement = HTMLElement> = AllByText<T>;
|
|
583
|
+
type queries$1_ByRoleOptions = ByRoleOptions;
|
|
584
|
+
type queries$1_FindAllByBoundAttribute<T extends HTMLElement = HTMLElement> = FindAllByBoundAttribute<T>;
|
|
585
|
+
type queries$1_FindAllByRole<T extends HTMLElement = HTMLElement> = FindAllByRole<T>;
|
|
586
|
+
type queries$1_FindAllByText<T extends HTMLElement = HTMLElement> = FindAllByText<T>;
|
|
587
|
+
type queries$1_FindByBoundAttribute<T extends HTMLElement = HTMLElement> = FindByBoundAttribute<T>;
|
|
588
|
+
type queries$1_FindByRole<T extends HTMLElement = HTMLElement> = FindByRole<T>;
|
|
589
|
+
type queries$1_FindByText<T extends HTMLElement = HTMLElement> = FindByText<T>;
|
|
590
|
+
type queries$1_GetByBoundAttribute<T extends HTMLElement = HTMLElement> = GetByBoundAttribute<T>;
|
|
591
|
+
type queries$1_GetByRole<T extends HTMLElement = HTMLElement> = GetByRole<T>;
|
|
592
|
+
type queries$1_GetByText<T extends HTMLElement = HTMLElement> = GetByText<T>;
|
|
593
|
+
type queries$1_QueryByBoundAttribute<T extends HTMLElement = HTMLElement> = QueryByBoundAttribute<T>;
|
|
594
|
+
type queries$1_QueryByRole<T extends HTMLElement = HTMLElement> = QueryByRole<T>;
|
|
595
|
+
type queries$1_QueryByText<T extends HTMLElement = HTMLElement> = QueryByText<T>;
|
|
596
|
+
declare namespace queries$1 {
|
|
597
|
+
export { type queries$1_AllByBoundAttribute as AllByBoundAttribute, type queries$1_AllByRole as AllByRole, type queries$1_AllByText as AllByText, type queries$1_ByRoleOptions as ByRoleOptions, type queries$1_FindAllByBoundAttribute as FindAllByBoundAttribute, type queries$1_FindAllByRole as FindAllByRole, type queries$1_FindAllByText as FindAllByText, type queries$1_FindByBoundAttribute as FindByBoundAttribute, type queries$1_FindByRole as FindByRole, type queries$1_FindByText as FindByText, type queries$1_GetByBoundAttribute as GetByBoundAttribute, type queries$1_GetByRole as GetByRole, type queries$1_GetByText as GetByText, type queries$1_QueryByBoundAttribute as QueryByBoundAttribute, type queries$1_QueryByRole as QueryByRole, type queries$1_QueryByText as QueryByText, findAllByAltText$1 as findAllByAltText, findAllByDisplayValue$1 as findAllByDisplayValue, findAllByLabelText$1 as findAllByLabelText, findAllByPlaceholderText$1 as findAllByPlaceholderText, findAllByRole$1 as findAllByRole, findAllByTestId$1 as findAllByTestId, findAllByText$1 as findAllByText, findAllByTitle$1 as findAllByTitle, findByAltText$1 as findByAltText, findByDisplayValue$1 as findByDisplayValue, findByLabelText$1 as findByLabelText, findByPlaceholderText$1 as findByPlaceholderText, findByRole$1 as findByRole, findByTestId$1 as findByTestId, findByText$1 as findByText, findByTitle$1 as findByTitle, getAllByAltText$1 as getAllByAltText, getAllByDisplayValue$1 as getAllByDisplayValue, getAllByLabelText$1 as getAllByLabelText, getAllByPlaceholderText$1 as getAllByPlaceholderText, getAllByRole$1 as getAllByRole, getAllByTestId$1 as getAllByTestId, getAllByText$1 as getAllByText, getAllByTitle$1 as getAllByTitle, getByAltText$1 as getByAltText, getByDisplayValue$1 as getByDisplayValue, getByLabelText$1 as getByLabelText, getByPlaceholderText$1 as getByPlaceholderText, getByRole$1 as getByRole, getByTestId$1 as getByTestId, getByText$1 as getByText, getByTitle$1 as getByTitle, queryAllByAltText$1 as queryAllByAltText, queryAllByDisplayValue$1 as queryAllByDisplayValue, queryAllByLabelText$1 as queryAllByLabelText, queryAllByPlaceholderText$1 as queryAllByPlaceholderText, queryAllByRole$1 as queryAllByRole, queryAllByTestId$1 as queryAllByTestId, queryAllByText$1 as queryAllByText, queryAllByTitle$1 as queryAllByTitle, queryByAltText$1 as queryByAltText, queryByDisplayValue$1 as queryByDisplayValue, queryByLabelText$1 as queryByLabelText, queryByPlaceholderText$1 as queryByPlaceholderText, queryByRole$1 as queryByRole, queryByTestId$1 as queryByTestId, queryByText$1 as queryByText, queryByTitle$1 as queryByTitle };
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
type BoundFunction<T> = T extends (
|
|
601
|
+
container: HTMLElement,
|
|
602
|
+
...args: infer P
|
|
603
|
+
) => infer R
|
|
604
|
+
? (...args: P) => R
|
|
605
|
+
: never
|
|
606
|
+
|
|
607
|
+
type BoundFunctions<Q> = Q extends typeof queries$1
|
|
608
|
+
? {
|
|
609
|
+
getByLabelText<T extends HTMLElement = HTMLElement>(
|
|
610
|
+
...args: Parameters<BoundFunction<GetByText<T>>>
|
|
611
|
+
): ReturnType<GetByText<T>>
|
|
612
|
+
getAllByLabelText<T extends HTMLElement = HTMLElement>(
|
|
613
|
+
...args: Parameters<BoundFunction<AllByText<T>>>
|
|
614
|
+
): ReturnType<AllByText<T>>
|
|
615
|
+
queryByLabelText<T extends HTMLElement = HTMLElement>(
|
|
616
|
+
...args: Parameters<BoundFunction<QueryByText<T>>>
|
|
617
|
+
): ReturnType<QueryByText<T>>
|
|
618
|
+
queryAllByLabelText<T extends HTMLElement = HTMLElement>(
|
|
619
|
+
...args: Parameters<BoundFunction<AllByText<T>>>
|
|
620
|
+
): ReturnType<AllByText<T>>
|
|
621
|
+
findByLabelText<T extends HTMLElement = HTMLElement>(
|
|
622
|
+
...args: Parameters<BoundFunction<FindByText<T>>>
|
|
623
|
+
): ReturnType<FindByText<T>>
|
|
624
|
+
findAllByLabelText<T extends HTMLElement = HTMLElement>(
|
|
625
|
+
...args: Parameters<BoundFunction<FindAllByText<T>>>
|
|
626
|
+
): ReturnType<FindAllByText<T>>
|
|
627
|
+
getByPlaceholderText<T extends HTMLElement = HTMLElement>(
|
|
628
|
+
...args: Parameters<BoundFunction<GetByBoundAttribute<T>>>
|
|
629
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
630
|
+
getAllByPlaceholderText<T extends HTMLElement = HTMLElement>(
|
|
631
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
632
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
633
|
+
queryByPlaceholderText<T extends HTMLElement = HTMLElement>(
|
|
634
|
+
...args: Parameters<BoundFunction<QueryByBoundAttribute<T>>>
|
|
635
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
636
|
+
queryAllByPlaceholderText<T extends HTMLElement = HTMLElement>(
|
|
637
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
638
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
639
|
+
findByPlaceholderText<T extends HTMLElement = HTMLElement>(
|
|
640
|
+
...args: Parameters<BoundFunction<FindByBoundAttribute<T>>>
|
|
641
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
642
|
+
findAllByPlaceholderText<T extends HTMLElement = HTMLElement>(
|
|
643
|
+
...args: Parameters<BoundFunction<FindAllByBoundAttribute<T>>>
|
|
644
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
645
|
+
getByText<T extends HTMLElement = HTMLElement>(
|
|
646
|
+
...args: Parameters<BoundFunction<GetByText<T>>>
|
|
647
|
+
): ReturnType<GetByText<T>>
|
|
648
|
+
getAllByText<T extends HTMLElement = HTMLElement>(
|
|
649
|
+
...args: Parameters<BoundFunction<AllByText<T>>>
|
|
650
|
+
): ReturnType<AllByText<T>>
|
|
651
|
+
queryByText<T extends HTMLElement = HTMLElement>(
|
|
652
|
+
...args: Parameters<BoundFunction<QueryByText<T>>>
|
|
653
|
+
): ReturnType<QueryByText<T>>
|
|
654
|
+
queryAllByText<T extends HTMLElement = HTMLElement>(
|
|
655
|
+
...args: Parameters<BoundFunction<AllByText<T>>>
|
|
656
|
+
): ReturnType<AllByText<T>>
|
|
657
|
+
findByText<T extends HTMLElement = HTMLElement>(
|
|
658
|
+
...args: Parameters<BoundFunction<FindByText<T>>>
|
|
659
|
+
): ReturnType<FindByText<T>>
|
|
660
|
+
findAllByText<T extends HTMLElement = HTMLElement>(
|
|
661
|
+
...args: Parameters<BoundFunction<FindAllByText<T>>>
|
|
662
|
+
): ReturnType<FindAllByText<T>>
|
|
663
|
+
getByAltText<T extends HTMLElement = HTMLElement>(
|
|
664
|
+
...args: Parameters<BoundFunction<GetByBoundAttribute<T>>>
|
|
665
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
666
|
+
getAllByAltText<T extends HTMLElement = HTMLElement>(
|
|
667
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
668
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
669
|
+
queryByAltText<T extends HTMLElement = HTMLElement>(
|
|
670
|
+
...args: Parameters<BoundFunction<QueryByBoundAttribute<T>>>
|
|
671
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
672
|
+
queryAllByAltText<T extends HTMLElement = HTMLElement>(
|
|
673
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
674
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
675
|
+
findByAltText<T extends HTMLElement = HTMLElement>(
|
|
676
|
+
...args: Parameters<BoundFunction<FindByBoundAttribute<T>>>
|
|
677
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
678
|
+
findAllByAltText<T extends HTMLElement = HTMLElement>(
|
|
679
|
+
...args: Parameters<BoundFunction<FindAllByBoundAttribute<T>>>
|
|
680
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
681
|
+
getByTitle<T extends HTMLElement = HTMLElement>(
|
|
682
|
+
...args: Parameters<BoundFunction<GetByBoundAttribute<T>>>
|
|
683
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
684
|
+
getAllByTitle<T extends HTMLElement = HTMLElement>(
|
|
685
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
686
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
687
|
+
queryByTitle<T extends HTMLElement = HTMLElement>(
|
|
688
|
+
...args: Parameters<BoundFunction<QueryByBoundAttribute<T>>>
|
|
689
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
690
|
+
queryAllByTitle<T extends HTMLElement = HTMLElement>(
|
|
691
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
692
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
693
|
+
findByTitle<T extends HTMLElement = HTMLElement>(
|
|
694
|
+
...args: Parameters<BoundFunction<FindByBoundAttribute<T>>>
|
|
695
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
696
|
+
findAllByTitle<T extends HTMLElement = HTMLElement>(
|
|
697
|
+
...args: Parameters<BoundFunction<FindAllByBoundAttribute<T>>>
|
|
698
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
699
|
+
getByDisplayValue<T extends HTMLElement = HTMLElement>(
|
|
700
|
+
...args: Parameters<BoundFunction<GetByBoundAttribute<T>>>
|
|
701
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
702
|
+
getAllByDisplayValue<T extends HTMLElement = HTMLElement>(
|
|
703
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
704
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
705
|
+
queryByDisplayValue<T extends HTMLElement = HTMLElement>(
|
|
706
|
+
...args: Parameters<BoundFunction<QueryByBoundAttribute<T>>>
|
|
707
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
708
|
+
queryAllByDisplayValue<T extends HTMLElement = HTMLElement>(
|
|
709
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
710
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
711
|
+
findByDisplayValue<T extends HTMLElement = HTMLElement>(
|
|
712
|
+
...args: Parameters<BoundFunction<FindByBoundAttribute<T>>>
|
|
713
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
714
|
+
findAllByDisplayValue<T extends HTMLElement = HTMLElement>(
|
|
715
|
+
...args: Parameters<BoundFunction<FindAllByBoundAttribute<T>>>
|
|
716
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
717
|
+
getByRole<T extends HTMLElement = HTMLElement>(
|
|
718
|
+
...args: Parameters<BoundFunction<GetByRole<T>>>
|
|
719
|
+
): ReturnType<GetByRole<T>>
|
|
720
|
+
getAllByRole<T extends HTMLElement = HTMLElement>(
|
|
721
|
+
...args: Parameters<BoundFunction<AllByRole<T>>>
|
|
722
|
+
): ReturnType<AllByRole<T>>
|
|
723
|
+
queryByRole<T extends HTMLElement = HTMLElement>(
|
|
724
|
+
...args: Parameters<BoundFunction<QueryByRole<T>>>
|
|
725
|
+
): ReturnType<QueryByRole<T>>
|
|
726
|
+
queryAllByRole<T extends HTMLElement = HTMLElement>(
|
|
727
|
+
...args: Parameters<BoundFunction<AllByRole<T>>>
|
|
728
|
+
): ReturnType<AllByRole<T>>
|
|
729
|
+
findByRole<T extends HTMLElement = HTMLElement>(
|
|
730
|
+
...args: Parameters<BoundFunction<FindByRole<T>>>
|
|
731
|
+
): ReturnType<FindByRole<T>>
|
|
732
|
+
findAllByRole<T extends HTMLElement = HTMLElement>(
|
|
733
|
+
...args: Parameters<BoundFunction<FindAllByRole<T>>>
|
|
734
|
+
): ReturnType<FindAllByRole<T>>
|
|
735
|
+
getByTestId<T extends HTMLElement = HTMLElement>(
|
|
736
|
+
...args: Parameters<BoundFunction<GetByBoundAttribute<T>>>
|
|
737
|
+
): ReturnType<GetByBoundAttribute<T>>
|
|
738
|
+
getAllByTestId<T extends HTMLElement = HTMLElement>(
|
|
739
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
740
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
741
|
+
queryByTestId<T extends HTMLElement = HTMLElement>(
|
|
742
|
+
...args: Parameters<BoundFunction<QueryByBoundAttribute<T>>>
|
|
743
|
+
): ReturnType<QueryByBoundAttribute<T>>
|
|
744
|
+
queryAllByTestId<T extends HTMLElement = HTMLElement>(
|
|
745
|
+
...args: Parameters<BoundFunction<AllByBoundAttribute<T>>>
|
|
746
|
+
): ReturnType<AllByBoundAttribute<T>>
|
|
747
|
+
findByTestId<T extends HTMLElement = HTMLElement>(
|
|
748
|
+
...args: Parameters<BoundFunction<FindByBoundAttribute<T>>>
|
|
749
|
+
): ReturnType<FindByBoundAttribute<T>>
|
|
750
|
+
findAllByTestId<T extends HTMLElement = HTMLElement>(
|
|
751
|
+
...args: Parameters<BoundFunction<FindAllByBoundAttribute<T>>>
|
|
752
|
+
): ReturnType<FindAllByBoundAttribute<T>>
|
|
753
|
+
} & {
|
|
754
|
+
[P in keyof Q]: BoundFunction<Q[P]>
|
|
755
|
+
}
|
|
756
|
+
: {
|
|
757
|
+
[P in keyof Q]: BoundFunction<Q[P]>
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
type Query = (
|
|
761
|
+
container: HTMLElement,
|
|
762
|
+
...args: any[]
|
|
763
|
+
) =>
|
|
764
|
+
| Error
|
|
765
|
+
| HTMLElement
|
|
766
|
+
| HTMLElement[]
|
|
767
|
+
| Promise<HTMLElement[]>
|
|
768
|
+
| Promise<HTMLElement>
|
|
769
|
+
| null
|
|
770
|
+
|
|
771
|
+
interface Queries$1 {
|
|
772
|
+
[T: string]: Query
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
declare function getQueriesForElement$1<
|
|
776
|
+
QueriesToBind extends Queries$1 = typeof queries$1,
|
|
777
|
+
// Extra type parameter required for reassignment.
|
|
778
|
+
T extends QueriesToBind = QueriesToBind,
|
|
779
|
+
>(element: HTMLElement, queriesToBind?: T): BoundFunctions<T>
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
783
|
+
*
|
|
784
|
+
* This source code is licensed under the MIT license found in the
|
|
785
|
+
* LICENSE file in the root directory of this source tree.
|
|
786
|
+
*/
|
|
787
|
+
declare type Colors = {
|
|
788
|
+
comment: {
|
|
789
|
+
close: string;
|
|
790
|
+
open: string;
|
|
791
|
+
};
|
|
792
|
+
content: {
|
|
793
|
+
close: string;
|
|
794
|
+
open: string;
|
|
795
|
+
};
|
|
796
|
+
prop: {
|
|
797
|
+
close: string;
|
|
798
|
+
open: string;
|
|
799
|
+
};
|
|
800
|
+
tag: {
|
|
801
|
+
close: string;
|
|
802
|
+
open: string;
|
|
803
|
+
};
|
|
804
|
+
value: {
|
|
805
|
+
close: string;
|
|
806
|
+
open: string;
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
declare type Indent = (arg0: string) => string;
|
|
810
|
+
declare type Refs = Array<unknown>;
|
|
811
|
+
declare type Print = (arg0: unknown) => string;
|
|
812
|
+
declare type Theme = {
|
|
813
|
+
comment: string;
|
|
814
|
+
content: string;
|
|
815
|
+
prop: string;
|
|
816
|
+
tag: string;
|
|
817
|
+
value: string;
|
|
818
|
+
};
|
|
819
|
+
declare type ThemeReceived = {
|
|
820
|
+
comment?: string;
|
|
821
|
+
content?: string;
|
|
822
|
+
prop?: string;
|
|
823
|
+
tag?: string;
|
|
824
|
+
value?: string;
|
|
825
|
+
};
|
|
826
|
+
declare type CompareKeys = ((a: string, b: string) => number) | undefined;
|
|
827
|
+
declare type Options = {
|
|
828
|
+
callToJSON: boolean;
|
|
829
|
+
compareKeys: CompareKeys;
|
|
830
|
+
escapeRegex: boolean;
|
|
831
|
+
escapeString: boolean;
|
|
832
|
+
highlight: boolean;
|
|
833
|
+
indent: number;
|
|
834
|
+
maxDepth: number;
|
|
835
|
+
min: boolean;
|
|
836
|
+
plugins: Plugins;
|
|
837
|
+
printBasicPrototype: boolean;
|
|
838
|
+
printFunctionName: boolean;
|
|
839
|
+
theme: Theme;
|
|
840
|
+
};
|
|
841
|
+
interface PrettyFormatOptions {
|
|
842
|
+
callToJSON?: boolean;
|
|
843
|
+
compareKeys?: CompareKeys;
|
|
844
|
+
escapeRegex?: boolean;
|
|
845
|
+
escapeString?: boolean;
|
|
846
|
+
highlight?: boolean;
|
|
847
|
+
indent?: number;
|
|
848
|
+
maxDepth?: number;
|
|
849
|
+
min?: boolean;
|
|
850
|
+
plugins?: Plugins;
|
|
851
|
+
printBasicPrototype?: boolean;
|
|
852
|
+
printFunctionName?: boolean;
|
|
853
|
+
theme?: ThemeReceived;
|
|
854
|
+
}
|
|
855
|
+
declare type OptionsReceived = PrettyFormatOptions;
|
|
856
|
+
declare type Config$1 = {
|
|
857
|
+
callToJSON: boolean;
|
|
858
|
+
compareKeys: CompareKeys;
|
|
859
|
+
colors: Colors;
|
|
860
|
+
escapeRegex: boolean;
|
|
861
|
+
escapeString: boolean;
|
|
862
|
+
indent: string;
|
|
863
|
+
maxDepth: number;
|
|
864
|
+
min: boolean;
|
|
865
|
+
plugins: Plugins;
|
|
866
|
+
printBasicPrototype: boolean;
|
|
867
|
+
printFunctionName: boolean;
|
|
868
|
+
spacingInner: string;
|
|
869
|
+
spacingOuter: string;
|
|
870
|
+
};
|
|
871
|
+
declare type Printer = (val: unknown, config: Config$1, indentation: string, depth: number, refs: Refs, hasCalledToJSON?: boolean) => string;
|
|
872
|
+
declare type Test = (arg0: any) => boolean;
|
|
873
|
+
declare type NewPlugin = {
|
|
874
|
+
serialize: (val: any, config: Config$1, indentation: string, depth: number, refs: Refs, printer: Printer) => string;
|
|
875
|
+
test: Test;
|
|
876
|
+
};
|
|
877
|
+
declare type PluginOptions = {
|
|
878
|
+
edgeSpacing: string;
|
|
879
|
+
min: boolean;
|
|
880
|
+
spacing: string;
|
|
881
|
+
};
|
|
882
|
+
declare type OldPlugin = {
|
|
883
|
+
print: (val: unknown, print: Print, indent: Indent, options: PluginOptions, colors: Colors) => string;
|
|
884
|
+
test: Test;
|
|
885
|
+
};
|
|
886
|
+
declare type Plugin = NewPlugin | OldPlugin;
|
|
887
|
+
declare type Plugins = Array<Plugin>;
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
891
|
+
*
|
|
892
|
+
* This source code is licensed under the MIT license found in the
|
|
893
|
+
* LICENSE file in the root directory of this source tree.
|
|
894
|
+
*/
|
|
895
|
+
|
|
896
|
+
declare const DEFAULT_OPTIONS: Options;
|
|
897
|
+
/**
|
|
898
|
+
* Returns a presentation string of your `val` object
|
|
899
|
+
* @param val any potential JavaScript object
|
|
900
|
+
* @param options Custom settings
|
|
901
|
+
*/
|
|
902
|
+
declare function format(val: unknown, options?: OptionsReceived): string;
|
|
903
|
+
declare const plugins: {
|
|
904
|
+
AsymmetricMatcher: NewPlugin;
|
|
905
|
+
ConvertAnsi: NewPlugin;
|
|
906
|
+
DOMCollection: NewPlugin;
|
|
907
|
+
DOMElement: NewPlugin;
|
|
908
|
+
Immutable: NewPlugin;
|
|
909
|
+
ReactElement: NewPlugin;
|
|
910
|
+
ReactTestComponent: NewPlugin;
|
|
911
|
+
};
|
|
912
|
+
|
|
913
|
+
type index_d_Colors = Colors;
|
|
914
|
+
type index_d_CompareKeys = CompareKeys;
|
|
915
|
+
declare const index_d_DEFAULT_OPTIONS: typeof DEFAULT_OPTIONS;
|
|
916
|
+
type index_d_NewPlugin = NewPlugin;
|
|
917
|
+
type index_d_OldPlugin = OldPlugin;
|
|
918
|
+
type index_d_Options = Options;
|
|
919
|
+
type index_d_OptionsReceived = OptionsReceived;
|
|
920
|
+
type index_d_Plugin = Plugin;
|
|
921
|
+
type index_d_Plugins = Plugins;
|
|
922
|
+
type index_d_PrettyFormatOptions = PrettyFormatOptions;
|
|
923
|
+
type index_d_Printer = Printer;
|
|
924
|
+
type index_d_Refs = Refs;
|
|
925
|
+
type index_d_Theme = Theme;
|
|
926
|
+
declare const index_d_format: typeof format;
|
|
927
|
+
declare const index_d_plugins: typeof plugins;
|
|
928
|
+
declare namespace index_d {
|
|
929
|
+
export { type index_d_Colors as Colors, type index_d_CompareKeys as CompareKeys, type Config$1 as Config, index_d_DEFAULT_OPTIONS as DEFAULT_OPTIONS, type index_d_NewPlugin as NewPlugin, type index_d_OldPlugin as OldPlugin, type index_d_Options as Options, type index_d_OptionsReceived as OptionsReceived, type index_d_Plugin as Plugin, type index_d_Plugins as Plugins, type index_d_PrettyFormatOptions as PrettyFormatOptions, type index_d_Printer as Printer, type index_d_Refs as Refs, type index_d_Theme as Theme, format as default, index_d_format as format, index_d_plugins as plugins };
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
type Screen<Q extends Queries$1 = typeof queries$1> = BoundFunctions<Q> & {
|
|
933
|
+
/**
|
|
934
|
+
* Convenience function for `pretty-dom` which also allows an array
|
|
935
|
+
* of elements
|
|
936
|
+
*/
|
|
937
|
+
debug: (
|
|
938
|
+
element?: Array<Element | HTMLDocument> | Element | HTMLDocument,
|
|
939
|
+
maxLength?: number,
|
|
940
|
+
options?: OptionsReceived,
|
|
941
|
+
) => void
|
|
942
|
+
/**
|
|
943
|
+
* Convenience function for `Testing Playground` which logs and returns the URL that
|
|
944
|
+
* can be opened in a browser
|
|
945
|
+
*/
|
|
946
|
+
logTestingPlaygroundURL: (element?: Element | HTMLDocument) => string
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
declare function waitForElementToBeRemoved$1<T>(
|
|
950
|
+
callback: T | (() => T),
|
|
951
|
+
options?: waitForOptions,
|
|
952
|
+
): Promise<void>
|
|
953
|
+
|
|
954
|
+
declare function getNodeText$1(node: HTMLElement): string
|
|
955
|
+
|
|
956
|
+
type EventType =
|
|
957
|
+
| 'copy'
|
|
958
|
+
| 'cut'
|
|
959
|
+
| 'paste'
|
|
960
|
+
| 'compositionEnd'
|
|
961
|
+
| 'compositionStart'
|
|
962
|
+
| 'compositionUpdate'
|
|
963
|
+
| 'keyDown'
|
|
964
|
+
| 'keyPress'
|
|
965
|
+
| 'keyUp'
|
|
966
|
+
| 'focus'
|
|
967
|
+
| 'blur'
|
|
968
|
+
| 'focusIn'
|
|
969
|
+
| 'focusOut'
|
|
970
|
+
| 'change'
|
|
971
|
+
| 'input'
|
|
972
|
+
| 'invalid'
|
|
973
|
+
| 'submit'
|
|
974
|
+
| 'reset'
|
|
975
|
+
| 'click'
|
|
976
|
+
| 'contextMenu'
|
|
977
|
+
| 'dblClick'
|
|
978
|
+
| 'drag'
|
|
979
|
+
| 'dragEnd'
|
|
980
|
+
| 'dragEnter'
|
|
981
|
+
| 'dragExit'
|
|
982
|
+
| 'dragLeave'
|
|
983
|
+
| 'dragOver'
|
|
984
|
+
| 'dragStart'
|
|
985
|
+
| 'drop'
|
|
986
|
+
| 'mouseDown'
|
|
987
|
+
| 'mouseEnter'
|
|
988
|
+
| 'mouseLeave'
|
|
989
|
+
| 'mouseMove'
|
|
990
|
+
| 'mouseOut'
|
|
991
|
+
| 'mouseOver'
|
|
992
|
+
| 'mouseUp'
|
|
993
|
+
| 'popState'
|
|
994
|
+
| 'select'
|
|
995
|
+
| 'touchCancel'
|
|
996
|
+
| 'touchEnd'
|
|
997
|
+
| 'touchMove'
|
|
998
|
+
| 'touchStart'
|
|
999
|
+
| 'resize'
|
|
1000
|
+
| 'scroll'
|
|
1001
|
+
| 'wheel'
|
|
1002
|
+
| 'abort'
|
|
1003
|
+
| 'canPlay'
|
|
1004
|
+
| 'canPlayThrough'
|
|
1005
|
+
| 'durationChange'
|
|
1006
|
+
| 'emptied'
|
|
1007
|
+
| 'encrypted'
|
|
1008
|
+
| 'ended'
|
|
1009
|
+
| 'loadedData'
|
|
1010
|
+
| 'loadedMetadata'
|
|
1011
|
+
| 'loadStart'
|
|
1012
|
+
| 'pause'
|
|
1013
|
+
| 'play'
|
|
1014
|
+
| 'playing'
|
|
1015
|
+
| 'progress'
|
|
1016
|
+
| 'rateChange'
|
|
1017
|
+
| 'seeked'
|
|
1018
|
+
| 'seeking'
|
|
1019
|
+
| 'stalled'
|
|
1020
|
+
| 'suspend'
|
|
1021
|
+
| 'timeUpdate'
|
|
1022
|
+
| 'volumeChange'
|
|
1023
|
+
| 'waiting'
|
|
1024
|
+
| 'load'
|
|
1025
|
+
| 'error'
|
|
1026
|
+
| 'animationStart'
|
|
1027
|
+
| 'animationEnd'
|
|
1028
|
+
| 'animationIteration'
|
|
1029
|
+
| 'transitionCancel'
|
|
1030
|
+
| 'transitionEnd'
|
|
1031
|
+
| 'transitionRun'
|
|
1032
|
+
| 'transitionStart'
|
|
1033
|
+
| 'doubleClick'
|
|
1034
|
+
| 'pointerOver'
|
|
1035
|
+
| 'pointerEnter'
|
|
1036
|
+
| 'pointerDown'
|
|
1037
|
+
| 'pointerMove'
|
|
1038
|
+
| 'pointerUp'
|
|
1039
|
+
| 'pointerCancel'
|
|
1040
|
+
| 'pointerOut'
|
|
1041
|
+
| 'pointerLeave'
|
|
1042
|
+
| 'gotPointerCapture'
|
|
1043
|
+
| 'lostPointerCapture'
|
|
1044
|
+
| 'offline'
|
|
1045
|
+
| 'online'
|
|
1046
|
+
| 'pageHide'
|
|
1047
|
+
| 'pageShow'
|
|
1048
|
+
type FireObject = {
|
|
1049
|
+
[K in EventType]: (
|
|
1050
|
+
element: Document | Element | Window | Node,
|
|
1051
|
+
options?: {},
|
|
1052
|
+
) => boolean
|
|
1053
|
+
}
|
|
1054
|
+
type CreateFunction = (
|
|
1055
|
+
eventName: string,
|
|
1056
|
+
node: Document | Element | Window | Node,
|
|
1057
|
+
init?: {},
|
|
1058
|
+
options?: {EventType?: string; defaultInit?: {}},
|
|
1059
|
+
) => Event
|
|
1060
|
+
type CreateObject = {
|
|
1061
|
+
[K in EventType]: (
|
|
1062
|
+
element: Document | Element | Window | Node,
|
|
1063
|
+
options?: {},
|
|
1064
|
+
) => Event
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
interface PrettyDOMOptions extends OptionsReceived {
|
|
1068
|
+
/**
|
|
1069
|
+
* Given a `Node` return `false` if you wish to ignore that node in the output.
|
|
1070
|
+
* By default, ignores `<style />`, `<script />` and comment nodes.
|
|
1071
|
+
*/
|
|
1072
|
+
filterNode?: (node: Node) => boolean
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
declare function prettyDOM$1(
|
|
1076
|
+
dom?: Element | HTMLDocument,
|
|
1077
|
+
maxLength?: number,
|
|
1078
|
+
options?: PrettyDOMOptions,
|
|
1079
|
+
): string | false
|
|
1080
|
+
declare function logDOM$1(
|
|
1081
|
+
dom?: Element | HTMLDocument,
|
|
1082
|
+
maxLength?: number,
|
|
1083
|
+
options?: PrettyDOMOptions,
|
|
1084
|
+
): void
|
|
1085
|
+
|
|
1086
|
+
declare function logRoles$1(
|
|
1087
|
+
container: HTMLElement,
|
|
1088
|
+
options?: LogRolesOptions,
|
|
1089
|
+
): string
|
|
1090
|
+
|
|
1091
|
+
interface LogRolesOptions {
|
|
1092
|
+
hidden?: boolean
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
declare function getRoles$1(container: HTMLElement): {
|
|
1096
|
+
[index: string]: HTMLElement[]
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* https://testing-library.com/docs/dom-testing-library/api-helpers#isinaccessible
|
|
1101
|
+
*/
|
|
1102
|
+
declare function isInaccessible$1(element: Element): boolean
|
|
1103
|
+
|
|
1104
|
+
interface Config {
|
|
1105
|
+
testIdAttribute: string
|
|
1106
|
+
/**
|
|
1107
|
+
* WARNING: `unstable` prefix means this API may change in patch and minor releases.
|
|
1108
|
+
* @param cb
|
|
1109
|
+
*/
|
|
1110
|
+
unstable_advanceTimersWrapper(cb: (...args: unknown[]) => unknown): unknown
|
|
1111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1112
|
+
asyncWrapper(cb: (...args: any[]) => any): Promise<any>
|
|
1113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1114
|
+
eventWrapper(cb: (...args: any[]) => any): void
|
|
1115
|
+
asyncUtilTimeout: number
|
|
1116
|
+
computedStyleSupportsPseudoElements: boolean
|
|
1117
|
+
defaultHidden: boolean
|
|
1118
|
+
/** default value for the `ignore` option in `ByText` queries */
|
|
1119
|
+
defaultIgnore: string
|
|
1120
|
+
showOriginalStackTrace: boolean
|
|
1121
|
+
throwSuggestions: boolean
|
|
1122
|
+
getElementError: (message: string | null, container: Element) => Error
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
interface ConfigFn {
|
|
1126
|
+
(existingConfig: Config): Partial<Config>
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
declare function configure$1(configDelta: ConfigFn | Partial<Config>): void
|
|
1130
|
+
declare function getConfig$1(): Config
|
|
1131
|
+
|
|
1132
|
+
interface QueryOptions {
|
|
1133
|
+
[key: string]: RegExp | boolean
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
type QueryArgs = [string, QueryOptions?]
|
|
1137
|
+
|
|
1138
|
+
interface Suggestion {
|
|
1139
|
+
queryName: string
|
|
1140
|
+
queryMethod: string
|
|
1141
|
+
queryArgs: QueryArgs
|
|
1142
|
+
variant: string
|
|
1143
|
+
warning?: string
|
|
1144
|
+
toString(): string
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
type Variant =
|
|
1148
|
+
| 'find'
|
|
1149
|
+
| 'findAll'
|
|
1150
|
+
| 'get'
|
|
1151
|
+
| 'getAll'
|
|
1152
|
+
| 'query'
|
|
1153
|
+
| 'queryAll'
|
|
1154
|
+
|
|
1155
|
+
type Method =
|
|
1156
|
+
| 'AltText'
|
|
1157
|
+
| 'alttext'
|
|
1158
|
+
| 'DisplayValue'
|
|
1159
|
+
| 'displayvalue'
|
|
1160
|
+
| 'LabelText'
|
|
1161
|
+
| 'labeltext'
|
|
1162
|
+
| 'PlaceholderText'
|
|
1163
|
+
| 'placeholdertext'
|
|
1164
|
+
| 'Role'
|
|
1165
|
+
| 'role'
|
|
1166
|
+
| 'TestId'
|
|
1167
|
+
| 'testid'
|
|
1168
|
+
| 'Text'
|
|
1169
|
+
| 'text'
|
|
1170
|
+
| 'Title'
|
|
1171
|
+
| 'title'
|
|
1172
|
+
|
|
1173
|
+
declare function getSuggestedQuery$1(
|
|
1174
|
+
element: HTMLElement,
|
|
1175
|
+
variant?: Variant,
|
|
1176
|
+
method?: Method,
|
|
1177
|
+
): Suggestion | undefined
|
|
1178
|
+
|
|
1179
|
+
declare const buildQueries: typeof buildQueries$1;
|
|
1180
|
+
declare const configure: typeof configure$1;
|
|
1181
|
+
declare const createEvent: CreateObject & CreateFunction;
|
|
1182
|
+
declare const fireEvent: ((element: Element | Node | Document | Window, event: Event) => Promise<false> | Promise<true>) & PromisifyObject<FireObject>;
|
|
1183
|
+
declare const findAllByAltText: typeof findAllByAltText$1;
|
|
1184
|
+
declare const findAllByDisplayValue: typeof findAllByDisplayValue$1;
|
|
1185
|
+
declare const findAllByLabelText: typeof findAllByLabelText$1;
|
|
1186
|
+
declare const findAllByPlaceholderText: typeof findAllByPlaceholderText$1;
|
|
1187
|
+
declare const findAllByRole: typeof findAllByRole$1;
|
|
1188
|
+
declare const findAllByTestId: typeof findAllByTestId$1;
|
|
1189
|
+
declare const findAllByText: typeof findAllByText$1;
|
|
1190
|
+
declare const findAllByTitle: typeof findAllByTitle$1;
|
|
1191
|
+
declare const findByAltText: typeof findByAltText$1;
|
|
1192
|
+
declare const findByDisplayValue: typeof findByDisplayValue$1;
|
|
1193
|
+
declare const findByLabelText: typeof findByLabelText$1;
|
|
1194
|
+
declare const findByPlaceholderText: typeof findByPlaceholderText$1;
|
|
1195
|
+
declare const findByRole: typeof findByRole$1;
|
|
1196
|
+
declare const findByTestId: typeof findByTestId$1;
|
|
1197
|
+
declare const findByText: typeof findByText$1;
|
|
1198
|
+
declare const findByTitle: typeof findByTitle$1;
|
|
1199
|
+
declare const getAllByAltText: typeof getAllByAltText$1;
|
|
1200
|
+
declare const getAllByDisplayValue: typeof getAllByDisplayValue$1;
|
|
1201
|
+
declare const getAllByLabelText: typeof getAllByLabelText$1;
|
|
1202
|
+
declare const getAllByPlaceholderText: typeof getAllByPlaceholderText$1;
|
|
1203
|
+
declare const getAllByRole: typeof getAllByRole$1;
|
|
1204
|
+
declare const getAllByTestId: typeof getAllByTestId$1;
|
|
1205
|
+
declare const getAllByText: typeof getAllByText$1;
|
|
1206
|
+
declare const getAllByTitle: typeof getAllByTitle$1;
|
|
1207
|
+
declare const getByAltText: typeof getByAltText$1;
|
|
1208
|
+
declare const getByDisplayValue: typeof getByDisplayValue$1;
|
|
1209
|
+
declare const getByLabelText: typeof getByLabelText$1;
|
|
1210
|
+
declare const getByPlaceholderText: typeof getByPlaceholderText$1;
|
|
1211
|
+
declare const getByRole: typeof getByRole$1;
|
|
1212
|
+
declare const getByTestId: typeof getByTestId$1;
|
|
1213
|
+
declare const getByText: typeof getByText$1;
|
|
1214
|
+
declare const getByTitle: typeof getByTitle$1;
|
|
1215
|
+
declare const getConfig: typeof getConfig$1;
|
|
1216
|
+
declare const getDefaultNormalizer: typeof getDefaultNormalizer$1;
|
|
1217
|
+
declare const getElementError: typeof getElementError$1;
|
|
1218
|
+
declare const getNodeText: typeof getNodeText$1;
|
|
1219
|
+
declare const getQueriesForElement: typeof getQueriesForElement$1;
|
|
1220
|
+
declare const getRoles: typeof getRoles$1;
|
|
1221
|
+
declare const getSuggestedQuery: typeof getSuggestedQuery$1;
|
|
1222
|
+
declare const isInaccessible: typeof isInaccessible$1;
|
|
1223
|
+
declare const logDOM: typeof logDOM$1;
|
|
1224
|
+
declare const logRoles: typeof logRoles$1;
|
|
1225
|
+
declare const prettyDOM: typeof prettyDOM$1;
|
|
1226
|
+
declare const queries: typeof queries$1;
|
|
1227
|
+
declare const queryAllByAltText: typeof queryAllByAltText$1;
|
|
1228
|
+
declare const queryAllByAttribute: AllByAttribute;
|
|
1229
|
+
declare const queryAllByDisplayValue: typeof queryAllByDisplayValue$1;
|
|
1230
|
+
declare const queryAllByLabelText: typeof queryAllByLabelText$1;
|
|
1231
|
+
declare const queryAllByPlaceholderText: typeof queryAllByPlaceholderText$1;
|
|
1232
|
+
declare const queryAllByRole: typeof queryAllByRole$1;
|
|
1233
|
+
declare const queryAllByTestId: typeof queryAllByTestId$1;
|
|
1234
|
+
declare const queryAllByText: typeof queryAllByText$1;
|
|
1235
|
+
declare const queryAllByTitle: typeof queryAllByTitle$1;
|
|
1236
|
+
declare const queryByAltText: typeof queryByAltText$1;
|
|
1237
|
+
declare const queryByAttribute: QueryByAttribute;
|
|
1238
|
+
declare const queryByDisplayValue: typeof queryByDisplayValue$1;
|
|
1239
|
+
declare const queryByLabelText: typeof queryByLabelText$1;
|
|
1240
|
+
declare const queryByPlaceholderText: typeof queryByPlaceholderText$1;
|
|
1241
|
+
declare const queryByRole: typeof queryByRole$1;
|
|
1242
|
+
declare const queryByTestId: typeof queryByTestId$1;
|
|
1243
|
+
declare const queryByText: typeof queryByText$1;
|
|
1244
|
+
declare const queryByTitle: typeof queryByTitle$1;
|
|
1245
|
+
declare const queryHelpers: typeof queryHelpers_d;
|
|
1246
|
+
declare const screen: Screen<typeof queries$1>;
|
|
1247
|
+
declare const waitFor: typeof waitFor$1;
|
|
1248
|
+
declare const waitForElementToBeRemoved: typeof waitForElementToBeRemoved$1;
|
|
1249
|
+
declare const within: typeof getQueriesForElement$1;
|
|
1250
|
+
declare const prettyFormat: typeof index_d;
|
|
109
1251
|
type _UserEvent = typeof _userEvent;
|
|
110
1252
|
interface UserEvent extends _UserEvent {
|
|
111
1253
|
}
|
|
@@ -115,11 +1257,7 @@ type Listener = (mock: MockInstance, args: unknown[]) => void;
|
|
|
115
1257
|
declare function onMockCall(callback: Listener): () => void;
|
|
116
1258
|
declare const spyOn: typeof spyOn$1;
|
|
117
1259
|
type Procedure = (...args: any[]) => any;
|
|
118
|
-
type Mock<T extends Procedure | any[] = any[], R = any> = T extends Procedure ? Mock$1<T> : T extends any[] ? Mock$1<(...args: T) => R> : never;
|
|
119
1260
|
declare function fn<T extends Procedure = Procedure>(implementation?: T): Mock<T>;
|
|
120
|
-
declare function fn<TArgs extends any[] = any, R = any>(): Mock<(...args: TArgs) => R>;
|
|
121
|
-
declare function fn<TArgs extends any[] = any[], R = any>(implementation: (...args: TArgs) => R): Mock<(...args: TArgs) => R>;
|
|
122
|
-
declare function fn<TArgs extends any[] = any[], R = any>(implementation?: (...args: TArgs) => R): Mock<(...args: TArgs) => R>;
|
|
123
1261
|
/**
|
|
124
1262
|
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will
|
|
125
1263
|
* only empty `.mock` state, it will not reset implementation.
|
|
@@ -183,4 +1321,4 @@ declare module 'storybook/internal/csf' {
|
|
|
183
1321
|
}
|
|
184
1322
|
declare const expect: Expect;
|
|
185
1323
|
|
|
186
|
-
export { type
|
|
1324
|
+
export { type UserEvent, type UserEventObject, buildQueries, clearAllMocks, configure, createEvent, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, mocked, onMockCall, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, spyOn, userEvent, waitFor, waitForElementToBeRemoved, within };
|