diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 00915d3473..a2aabc0128 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -40,6 +40,7 @@ declare module "mongoose" { mquery: any; version: string; connection: Connection; + Promise: any; } export interface Connection extends NodeJS.EventEmitter { @@ -307,8 +308,8 @@ declare module "mongoose" { circle(area: Object): Query; circle(path: string, area: Object): Query; comment(val: any): Query; - count(callback?: (err: any, count: number) => void): Query; - count(criteria: Object, callback?: (err: any, count: number) => void): Query; + count(callback?: (err: any, count: number) => void): Query; + count(criteria: Object, callback?: (err: any, count: number) => void): Query; distinct(callback?: (err: any, res: T) => void): Query; distinct(field: string, callback?: (err: any, res: T) => void): Query; distinct(criteria: Object, field: string, callback?: (err: any, res: T) => void): Query; @@ -481,7 +482,7 @@ declare module "mongoose" { export class Promise { constructor(fn?: (err: any, result: T) => void); - then(onFulFill: (result: T) => void, onReject?: (err: any) => void): Promise; + then(onFulFill: (result: T) => void | U | Promise, onReject?: (err: any) => void | U | Promise): Promise; end(): void; fulfill(result: T): Promise;