From 6f5a13d3ab155332553e22b8323fb5e5f4f4d7d8 Mon Sep 17 00:00:00 2001 From: Lorefnon Date: Tue, 29 Oct 2019 13:19:15 +0530 Subject: [PATCH] Gracefully handle global promise pollution (#3502) Update QueryInterface to proxy to only standard promise methods Update QueryInterface type to be explicit about the methods being proxied This primarily handles pollution of global Promise (either the type or the global object at runtime) by other libraries. Fixes: #3422 --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index e667b5dd3c..d956298ba5 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1401,7 +1401,7 @@ declare namespace Knex { // Chainable interface // - interface ChainableInterface extends Promise { + interface ChainableInterface extends Pick, "then" | "catch" | "finally"> { toQuery(): string; options(options: { [key: string]: any }): this; connection(connection: any): this;