diff --git a/types/knex/index.d.ts b/types/knex/index.d.ts index 3a76221bd4..2fc1aa31d1 100644 --- a/types/knex/index.d.ts +++ b/types/knex/index.d.ts @@ -7,6 +7,7 @@ /// 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 { 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; + stream(options?: { [key: string]: any }): stream.PassThrough; + stream(options: { [key: string]: any }, callback: (readable: stream.PassThrough) => any): Promise; + pipe(writable: any): stream.PassThrough; exec(callback: Function): QueryBuilder; }