From c19a4db060761cd4b61fb227a43b6e31b0c2d828 Mon Sep 17 00:00:00 2001 From: Miroslav Simulcik Date: Wed, 17 Apr 2019 16:37:53 +0200 Subject: [PATCH] Make type parameter more specific --- typings/get-queries-for-element.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/typings/get-queries-for-element.d.ts b/typings/get-queries-for-element.d.ts index 3b173a59..253d6ec4 100644 --- a/typings/get-queries-for-element.d.ts +++ b/typings/get-queries-for-element.d.ts @@ -13,7 +13,21 @@ export type BoundFunction = T extends ( : never export type BoundFunctions = {[P in keyof T]: BoundFunction} -export function getQueriesForElement( +interface Query extends Function { + (container: HTMLElement, ...args: any[]): + | Error + | Promise + | Promise + | HTMLElement[] + | HTMLElement + | null +} + +interface Queries { + [T: string]: Query +} + +export function getQueriesForElement( element: HTMLElement, queriesToBind?: T, ): BoundFunctions