Knex: Fix the typings for the streaming methods

This commit is contained in:
Aditya
2017-08-15 13:34:23 +02:00
parent d4f42ab007
commit 83f35b36e9

View File

@@ -7,6 +7,7 @@
/// <reference types="node" />
import events = require("events");
import stream = require ("stream");
import Promise = require("bluebird");
type Callback = Function;
@@ -350,9 +351,10 @@ declare namespace Knex {
interface ChainableInterface extends Promise<any> {
toQuery(): string;
options(options: any): QueryBuilder;
stream(options?: any, callback?: (builder: QueryBuilder) => any): QueryBuilder;
stream(callback?: (builder: QueryBuilder) => any): QueryBuilder;
pipe(writable: any): QueryBuilder;
stream(callback: (readable: stream.PassThrough) => any): Promise<any>;
stream(options?: { [key: string]: any }): stream.PassThrough;
stream(options: { [key: string]: any }, callback: (readable: stream.PassThrough) => any): Promise<any>;
pipe(writable: any): stream.PassThrough;
exec(callback: Function): QueryBuilder;
}