Skip to content

Commit a1de1f6

Browse files
committed
fix(typings): handle double-bound functions
fixes testing-library#135
1 parent b7baf11 commit a1de1f6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

typings/get-queries-for-element.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import {Matcher} from './matches'
22
import * as queries from './queries'
33

44
export type BoundFunction<T> = T extends (
5-
a1: any,
5+
attribute: string,
6+
element: HTMLElement,
67
text: infer P,
78
options: infer Q,
89
) => infer R
910
? (text: P, options?: Q) => R
10-
: never
11+
: T extends (a1: any, text: infer P, options: infer Q) => infer R
12+
? (text: P, options?: Q) => R
13+
: never
1114
export type BoundFunctions<T> = {[P in keyof T]: BoundFunction<T[P]>}
1215

1316
export function getQueriesForElement(

0 commit comments

Comments
 (0)