Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit d7d3c38

Browse files
committed
Rename FiberRoot to NativeTestInstance
1 parent 420e3f6 commit d7d3c38

File tree

1 file changed

+81
-81
lines changed

1 file changed

+81
-81
lines changed

src/index.d.ts

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@ export declare class NativeEvent {
1212
export declare function getEventHandlerName(key: string): string
1313

1414
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
3838
}
3939
export declare const fireEvent: FireEventFn
4040

4141
// GET NODE TEXT
4242
// -------------
4343

44-
export declare function getNodeText(node: FiberRoot): string
44+
export declare function getNodeText(node: NativeTestInstance): string
4545

4646
// GET QUERIES FOR ELEMENT
4747
// -----------------------
@@ -53,7 +53,7 @@ export declare function within<T = Queries>(element: ReactElement, queries?: T):
5353
// ------------
5454

5555
// 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
5757

5858
// QUERIES
5959
// -------
@@ -62,7 +62,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
6262
type Bound<T> = T extends (arg: any, ...rest: infer U) => infer V ? (...args: U) => V : never
6363
type BoundQueries<T> = { [P in keyof T]: Bound<T[P]> }
6464

65-
export type FiberRoot = Omit<ReactTestInstance, 'find' | 'findAllByProps' | 'findAllByType' | 'findByProps' | 'findByType' | 'instance'>
65+
export type NativeTestInstance = Omit<ReactTestInstance, 'find' | 'findAllByProps' | 'findAllByType' | 'findByProps' | 'findByType' | 'instance'>
6666

6767
export type TextMatch = string | RegExp | ((value: string) => boolean)
6868
export type FilterFn = (value: string, index: number) => boolean
@@ -80,55 +80,55 @@ export interface TextNormalizerOptions extends NormalizerOptions {
8080
types?: string[]
8181
}
8282

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[]>
132132

133133
export interface Queries {
134134
getByA11yHint: typeof getByA11yHint
@@ -185,24 +185,24 @@ export interface Queries {
185185
// QUERY HELPERS
186186
// -------------
187187

188-
export declare function defaultFilter(node: FiberRoot): boolean
188+
export declare function defaultFilter(node: NativeTestInstance): boolean
189189
export declare function getBaseElement(container: ReactTestRenderer | ReactTestInstance): ReactTestInstance
190190
export declare function getElementError(message: string, container: ReactTestRenderer): Error
191191
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
193193
export declare function queryAllByProp(
194194
attribute: string,
195195
container: ReactTestRenderer,
196196
match: TextMatch,
197197
options?: NormalizerOptions,
198-
): FiberRoot[]
198+
): NativeTestInstance[]
199199
export declare function queryByProp(
200200
attribute: string,
201201
container: ReactTestRenderer,
202202
match: TextMatch,
203203
options?: NormalizerOptions,
204-
): FiberRoot | null
205-
export function removeBadProperties(node: ReactTestInstance): FiberRoot
204+
): NativeTestInstance | null
205+
export function removeBadProperties(node: ReactTestInstance): NativeTestInstance
206206

207207
// WAIT
208208
// ----
@@ -255,7 +255,7 @@ export declare function render<T>(ui: ReactElement, options: RenderOptionsWithQu
255255

256256
export interface RenderResult {
257257
container: ReactTestRenderer
258-
baseElement: FiberRoot
258+
baseElement: NativeTestInstance
259259
debug: () => void
260260
rerender: (ui: ReactElement) => void
261261
unmount: () => void

0 commit comments

Comments
 (0)