bookshelf:: count return type fix and bump knex version (#37608)

* Update index.d.ts

See https://github.com/bookshelf/bookshelf/issues/1275

* Bump knex dependency version to correspond to new bookshelf version
This commit is contained in:
David Furlong 2019-08-21 10:24:46 -05:00 committed by Sheetal Nandi
parent 4b966494ee
commit d1d0effcf9
2 changed files with 4 additions and 4 deletions

View File

@ -90,7 +90,7 @@ declare namespace Bookshelf {
class Model<T extends Model<any>> extends ModelBase<T> {
static collection<T extends Model<any>>(models?: T[], options?: CollectionOptions<T>): Collection<T>;
static count(column?: string, options?: SyncOptions): BlueBird<number>;
static count(column?: string, options?: SyncOptions): BlueBird<number | string>;
/** @deprecated use Typescript classes */
static extend<T extends Model<any>>(prototypeProperties?: any, classProperties?: any): Function; // should return a type
static fetchAll<T extends Model<any>>(): BlueBird<Collection<T>>;
@ -101,7 +101,7 @@ declare namespace Bookshelf {
belongsTo<R extends Model<any>>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): R;
belongsToMany<R extends Model<any>>(target: { new (...args: any[]): R }, table?: string, foreignKey?: string, otherKey?: string, foreignKeyTarget?: string, otherKeyTarget?: string): Collection<R>;
count(column?: string, options?: SyncOptions): BlueBird<number>;
count(column?: string, options?: SyncOptions): BlueBird<number | string>;
destroy(options?: DestroyOptions): BlueBird<T>;
fetch(options?: FetchOptions): BlueBird<T>;
fetchAll(options?: FetchAllOptions): BlueBird<Collection<T>>;
@ -244,7 +244,7 @@ declare namespace Bookshelf {
static forge<T>(attributes?: any, options?: ModelOptions): T;
attach(ids: any | any[], options?: SyncOptions): BlueBird<Collection<T>>;
count(column?: string, options?: SyncOptions): BlueBird<number>;
count(column?: string, options?: SyncOptions): BlueBird<number | string>;
create(model: { [key: string]: any }, options?: CollectionCreateOptions): BlueBird<T>;
detach(ids: any[], options?: SyncOptions): BlueBird<any>;
detach(options?: SyncOptions): BlueBird<any>;

View File

@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
"knex": "^0.16.1"
"knex": "^0.17.0"
}
}