@@ -12,36 +12,36 @@ export declare class NativeEvent {
12
12
export declare function getEventHandlerName ( key : string ) : string
13
13
14
14
export interface FireEventFn {
15
- ( element : FiberRoot , event : NativeEvent ) : any
16
- focus ( element : FiberRoot , init ?: any ) : any
17
- blur ( element : FiberRoot , init ?: any ) : any
18
- change ( element : FiberRoot , init ?: any ) : any
19
- changeText ( element : FiberRoot , value : string ) : any
20
- contentSizeChange ( element : FiberRoot , init ?: any ) : any
21
- endEditing ( element : FiberRoot , init ?: any ) : any
22
- keyPress ( element : FiberRoot , init ?: any ) : any
23
- submitEditing ( element : FiberRoot , init ?: any ) : any
24
- layout ( element : FiberRoot , init ?: any ) : any
25
- selectionChange ( element : FiberRoot , init ?: any ) : any
26
- longPress ( element : FiberRoot , init ?: any ) : any
27
- press ( element : FiberRoot , init ?: any ) : any
28
- pressIn ( element : FiberRoot , init ?: any ) : any
29
- pressOut ( element : FiberRoot , init ?: any ) : any
30
- momentumScrollBegin ( element : FiberRoot , init ?: any ) : any
31
- momentumScrollEnd ( element : FiberRoot , init ?: any ) : any
32
- scroll ( element : FiberRoot , init ?: any ) : any
33
- scrollBeginDrag ( element : FiberRoot , init ?: any ) : any
34
- scrollEndDrag ( element : FiberRoot , init ?: any ) : any
35
- load ( element : FiberRoot , init ?: any ) : any
36
- error ( element : FiberRoot , init ?: any ) : any
37
- progress ( element : FiberRoot , init ?: any ) : any
15
+ ( element : NativeTestInstance , event : NativeEvent ) : any
16
+ focus ( element : NativeTestInstance , init ?: any ) : any
17
+ blur ( element : NativeTestInstance , init ?: any ) : any
18
+ change ( element : NativeTestInstance , init ?: any ) : any
19
+ changeText ( element : NativeTestInstance , value : string ) : any
20
+ contentSizeChange ( element : NativeTestInstance , init ?: any ) : any
21
+ endEditing ( element : NativeTestInstance , init ?: any ) : any
22
+ keyPress ( element : NativeTestInstance , init ?: any ) : any
23
+ submitEditing ( element : NativeTestInstance , init ?: any ) : any
24
+ layout ( element : NativeTestInstance , init ?: any ) : any
25
+ selectionChange ( element : NativeTestInstance , init ?: any ) : any
26
+ longPress ( element : NativeTestInstance , init ?: any ) : any
27
+ press ( element : NativeTestInstance , init ?: any ) : any
28
+ pressIn ( element : NativeTestInstance , init ?: any ) : any
29
+ pressOut ( element : NativeTestInstance , init ?: any ) : any
30
+ momentumScrollBegin ( element : NativeTestInstance , init ?: any ) : any
31
+ momentumScrollEnd ( element : NativeTestInstance , init ?: any ) : any
32
+ scroll ( element : NativeTestInstance , init ?: any ) : any
33
+ scrollBeginDrag ( element : NativeTestInstance , init ?: any ) : any
34
+ scrollEndDrag ( element : NativeTestInstance , init ?: any ) : any
35
+ load ( element : NativeTestInstance , init ?: any ) : any
36
+ error ( element : NativeTestInstance , init ?: any ) : any
37
+ progress ( element : NativeTestInstance , init ?: any ) : any
38
38
}
39
39
export declare const fireEvent : FireEventFn
40
40
41
41
// GET NODE TEXT
42
42
// -------------
43
43
44
- export declare function getNodeText ( node : FiberRoot ) : string
44
+ export declare function getNodeText ( node : NativeTestInstance ) : string
45
45
46
46
// GET QUERIES FOR ELEMENT
47
47
// -----------------------
@@ -53,7 +53,7 @@ export declare function within<T = Queries>(element: ReactElement, queries?: T):
53
53
// ------------
54
54
55
55
// TODO: options are pretty-format options
56
- export declare function prettyPrint ( element : ReactTestRenderer | FiberRoot , maxLength ?: number , options ?: any ) : string
56
+ export declare function prettyPrint ( element : ReactTestRenderer | NativeTestInstance , maxLength ?: number , options ?: any ) : string
57
57
58
58
// QUERIES
59
59
// -------
@@ -62,7 +62,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
62
62
type Bound < T > = T extends ( arg : any , ...rest : infer U ) => infer V ? ( ...args : U ) => V : never
63
63
type BoundQueries < T > = { [ P in keyof T ] : Bound < T [ P ] > }
64
64
65
- export type FiberRoot = Omit < ReactTestInstance , 'find' | 'findAllByProps' | 'findAllByType' | 'findByProps' | 'findByType' | 'instance' >
65
+ export type NativeTestInstance = Omit < ReactTestInstance , 'find' | 'findAllByProps' | 'findAllByType' | 'findByProps' | 'findByType' | 'instance' >
66
66
67
67
export type TextMatch = string | RegExp | ( ( value : string ) => boolean )
68
68
export type FilterFn = ( value : string , index : number ) => boolean
@@ -80,55 +80,55 @@ export interface TextNormalizerOptions extends NormalizerOptions {
80
80
types ?: string [ ]
81
81
}
82
82
83
- export declare function getByA11yHint ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot
84
- export declare function getByA11yLabel ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot
85
- export declare function getByA11yRole ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot
86
- export declare function getByA11yStates ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : FiberRoot
87
- export declare function getByA11yTraits ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : FiberRoot
88
- export declare function getByPlaceholder ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot
89
- export declare function getByText ( container : FiberRoot , match : TextMatch , options ?: TextNormalizerOptions ) : FiberRoot
90
- export declare function getByValue ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot
91
- export declare function getByTestId ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot
92
-
93
- export declare function getAllByA11yHint ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot [ ]
94
- export declare function getAllByA11yLabel ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot [ ]
95
- export declare function getAllByA11yRole ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot [ ]
96
- export declare function getAllByA11yStates ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : FiberRoot [ ]
97
- export declare function getAllByA11yTraits ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : FiberRoot [ ]
98
- export declare function getAllByPlaceholder ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot [ ]
99
- export declare function getAllByText ( container : FiberRoot , match : TextMatch , options ?: TextNormalizerOptions ) : FiberRoot [ ]
100
- export declare function getAllByValue ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot [ ]
101
- export declare function getAllByTestId ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot [ ]
102
-
103
- export declare function queryByA11yHint ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot | null
104
- export declare function queryByA11yLabel ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot | null
105
- export declare function queryByA11yRole ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot | null
106
- export declare function queryByA11yStates ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : FiberRoot | null
107
- export declare function queryByA11yTraits ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : FiberRoot | null
108
- export declare function queryByPlaceholder ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot | null
109
- export declare function queryByText ( container : FiberRoot , match : TextMatch , options ?: TextNormalizerOptions ) : FiberRoot | null
110
- export declare function queryByValue ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot | null
111
- export declare function queryByTestId ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : FiberRoot | null
112
-
113
- export declare function findByA11yHint ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot >
114
- export declare function findByA11yLabel ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot >
115
- export declare function findByA11yRole ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot >
116
- export declare function findByA11yStates ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : Promise < FiberRoot >
117
- export declare function findByA11yTraits ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : Promise < FiberRoot >
118
- export declare function findByPlaceholder ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot >
119
- export declare function findByText ( container : FiberRoot , match : TextMatch , options ?: TextNormalizerOptions ) : Promise < FiberRoot >
120
- export declare function findByValue ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot >
121
- export declare function findByTestId ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot >
122
-
123
- export declare function findAllByA11yHint ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
124
- export declare function findAllByA11yLabel ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
125
- export declare function findAllByA11yRole ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
126
- export declare function findAllByA11yStates ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
127
- export declare function findAllByA11yTraits ( container : FiberRoot , match : string [ ] , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
128
- export declare function findAllByPlaceholder ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
129
- export declare function findAllByText ( container : FiberRoot , match : TextMatch , options ?: TextNormalizerOptions ) : Promise < FiberRoot [ ] >
130
- export declare function findAllByValue ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
131
- export declare function findAllByTestId ( container : FiberRoot , match : TextMatch , options ?: NormalizerOptions ) : Promise < FiberRoot [ ] >
83
+ export declare function getByA11yHint ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance
84
+ export declare function getByA11yLabel ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance
85
+ export declare function getByA11yRole ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance
86
+ export declare function getByA11yStates ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : NativeTestInstance
87
+ export declare function getByA11yTraits ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : NativeTestInstance
88
+ export declare function getByPlaceholder ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance
89
+ export declare function getByText ( container : NativeTestInstance , match : TextMatch , options ?: TextNormalizerOptions ) : NativeTestInstance
90
+ export declare function getByValue ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance
91
+ export declare function getByTestId ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance
92
+
93
+ export declare function getAllByA11yHint ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance [ ]
94
+ export declare function getAllByA11yLabel ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance [ ]
95
+ export declare function getAllByA11yRole ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance [ ]
96
+ export declare function getAllByA11yStates ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : NativeTestInstance [ ]
97
+ export declare function getAllByA11yTraits ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : NativeTestInstance [ ]
98
+ export declare function getAllByPlaceholder ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance [ ]
99
+ export declare function getAllByText ( container : NativeTestInstance , match : TextMatch , options ?: TextNormalizerOptions ) : NativeTestInstance [ ]
100
+ export declare function getAllByValue ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance [ ]
101
+ export declare function getAllByTestId ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance [ ]
102
+
103
+ export declare function queryByA11yHint ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance | null
104
+ export declare function queryByA11yLabel ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance | null
105
+ export declare function queryByA11yRole ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance | null
106
+ export declare function queryByA11yStates ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : NativeTestInstance | null
107
+ export declare function queryByA11yTraits ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : NativeTestInstance | null
108
+ export declare function queryByPlaceholder ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance | null
109
+ export declare function queryByText ( container : NativeTestInstance , match : TextMatch , options ?: TextNormalizerOptions ) : NativeTestInstance | null
110
+ export declare function queryByValue ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance | null
111
+ export declare function queryByTestId ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : NativeTestInstance | null
112
+
113
+ export declare function findByA11yHint ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
114
+ export declare function findByA11yLabel ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
115
+ export declare function findByA11yRole ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
116
+ export declare function findByA11yStates ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
117
+ export declare function findByA11yTraits ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
118
+ export declare function findByPlaceholder ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
119
+ export declare function findByText ( container : NativeTestInstance , match : TextMatch , options ?: TextNormalizerOptions ) : Promise < NativeTestInstance >
120
+ export declare function findByValue ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
121
+ export declare function findByTestId ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance >
122
+
123
+ export declare function findAllByA11yHint ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
124
+ export declare function findAllByA11yLabel ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
125
+ export declare function findAllByA11yRole ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
126
+ export declare function findAllByA11yStates ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
127
+ export declare function findAllByA11yTraits ( container : NativeTestInstance , match : string [ ] , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
128
+ export declare function findAllByPlaceholder ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
129
+ export declare function findAllByText ( container : NativeTestInstance , match : TextMatch , options ?: TextNormalizerOptions ) : Promise < NativeTestInstance [ ] >
130
+ export declare function findAllByValue ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
131
+ export declare function findAllByTestId ( container : NativeTestInstance , match : TextMatch , options ?: NormalizerOptions ) : Promise < NativeTestInstance [ ] >
132
132
133
133
export interface Queries {
134
134
getByA11yHint : typeof getByA11yHint
@@ -185,24 +185,24 @@ export interface Queries {
185
185
// QUERY HELPERS
186
186
// -------------
187
187
188
- export declare function defaultFilter ( node : FiberRoot ) : boolean
188
+ export declare function defaultFilter ( node : NativeTestInstance ) : boolean
189
189
export declare function getBaseElement ( container : ReactTestRenderer | ReactTestInstance ) : ReactTestInstance
190
190
export declare function getElementError ( message : string , container : ReactTestRenderer ) : Error
191
191
export declare function firstResultOrNull < T extends any [ ] , U > ( query : ( ...args : T ) => U [ ] , ...args : T ) : U | null
192
- export declare function filterNodeByType ( node : FiberRoot , type : string ) : boolean
192
+ export declare function filterNodeByType ( node : NativeTestInstance , type : string ) : boolean
193
193
export declare function queryAllByProp (
194
194
attribute : string ,
195
195
container : ReactTestRenderer ,
196
196
match : TextMatch ,
197
197
options ?: NormalizerOptions ,
198
- ) : FiberRoot [ ]
198
+ ) : NativeTestInstance [ ]
199
199
export declare function queryByProp (
200
200
attribute : string ,
201
201
container : ReactTestRenderer ,
202
202
match : TextMatch ,
203
203
options ?: NormalizerOptions ,
204
- ) : FiberRoot | null
205
- export function removeBadProperties ( node : ReactTestInstance ) : FiberRoot
204
+ ) : NativeTestInstance | null
205
+ export function removeBadProperties ( node : ReactTestInstance ) : NativeTestInstance
206
206
207
207
// WAIT
208
208
// ----
@@ -255,7 +255,7 @@ export declare function render<T>(ui: ReactElement, options: RenderOptionsWithQu
255
255
256
256
export interface RenderResult {
257
257
container : ReactTestRenderer
258
- baseElement : FiberRoot
258
+ baseElement : NativeTestInstance
259
259
debug : ( ) => void
260
260
rerender : ( ui : ReactElement ) => void
261
261
unmount : ( ) => void
0 commit comments