From b19e221088fb6f54273791751e0e71de04dceaa1 Mon Sep 17 00:00:00 2001 From: Hendrik Mittrop Date: Tue, 6 Aug 2019 16:10:18 +0200 Subject: [PATCH] fix: explicitly mention `Matcher` type Type inference was not working properly in some cases. Since all queries have the `Matcher` type for the text property the types can be explicit here. --- typings/get-queries-for-element.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/typings/get-queries-for-element.d.ts b/typings/get-queries-for-element.d.ts index 253d6ec4..6fe076f6 100644 --- a/typings/get-queries-for-element.d.ts +++ b/typings/get-queries-for-element.d.ts @@ -4,12 +4,12 @@ import * as queries from './queries' export type BoundFunction = T extends ( attribute: string, element: HTMLElement, - text: infer P, + text: Matcher, options: infer Q, ) => infer R - ? (text: P, options?: Q) => R - : T extends (a1: any, text: infer P, options: infer Q) => infer R - ? (text: P, options?: Q) => R + ? (text: Matcher, options?: Q) => R + : T extends (a1: any, text: Matcher, options: infer Q) => infer R + ? (text: Matcher, options?: Q) => R : never export type BoundFunctions = {[P in keyof T]: BoundFunction}