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
This commit is contained in:
Lorefnon 2019-10-29 13:19:15 +05:30 committed by Igor Savin
parent 0560959fa4
commit 6f5a13d3ab

2
types/index.d.ts vendored
View File

@ -1401,7 +1401,7 @@ declare namespace Knex {
// Chainable interface
//
interface ChainableInterface<T = any> extends Promise<T> {
interface ChainableInterface<T = any> extends Pick<Promise<T>, "then" | "catch" | "finally"> {
toQuery(): string;
options(options: { [key: string]: any }): this;
connection(connection: any): this;