Merge pull request #21186 from SteveXian/enable-es6-promises-in-bookshelf-transaction

Bookshelf transaction incompatible with async/await due to forced Bluebird return type.
This commit is contained in:
Daniel Rosenwasser
2017-11-06 10:35:20 -08:00
committed by GitHub

View File

@@ -1,4 +1,4 @@
// Type definitions for bookshelfjs v0.9.3
// Type definitions for bookshelfjs v0.9.4
// Project: http://bookshelfjs.org/
// Definitions by: Andrew Schurman <https://github.com/arcticwaters>, Vesa Poikajärvi <https://github.com/vesse>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -17,7 +17,7 @@ interface Bookshelf extends Bookshelf.Events<any> {
Collection: typeof Bookshelf.Collection;
plugin(name: string | string[] | Function, options?: any): Bookshelf;
transaction<T>(callback: (transaction: knex.Transaction) => BlueBird<T>): BlueBird<T>;
transaction<T>(callback: (transaction: knex.Transaction) => PromiseLike<T>): BlueBird<T>;
}
declare function Bookshelf(knex: knex): Bookshelf;