mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
fixing a Promise bug in type definition (#9334)
* fixing a Promise bug in type definition * add Promise to Mongoose object
This commit is contained in:
committed by
Horiuchi_H
parent
398bd74211
commit
5e1ca2b9ef
7
mongoose/mongoose.d.ts
vendored
7
mongoose/mongoose.d.ts
vendored
@@ -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<T>;
|
||||
circle(path: string, area: Object): Query<T>;
|
||||
comment(val: any): Query<T>;
|
||||
count(callback?: (err: any, count: number) => void): Query<T>;
|
||||
count(criteria: Object, callback?: (err: any, count: number) => void): Query<T>;
|
||||
count(callback?: (err: any, count: number) => void): Query<number>;
|
||||
count(criteria: Object, callback?: (err: any, count: number) => void): Query<number>;
|
||||
distinct(callback?: (err: any, res: T) => void): Query<T>;
|
||||
distinct(field: string, callback?: (err: any, res: T) => void): Query<T>;
|
||||
distinct(criteria: Object, field: string, callback?: (err: any, res: T) => void): Query<T>;
|
||||
@@ -481,7 +482,7 @@ declare module "mongoose" {
|
||||
export class Promise<T> {
|
||||
constructor(fn?: (err: any, result: T) => void);
|
||||
|
||||
then<U>(onFulFill: (result: T) => void, onReject?: (err: any) => void): Promise<U>;
|
||||
then<U>(onFulFill: (result: T) => void | U | Promise<U>, onReject?: (err: any) => void | U | Promise<U>): Promise<U>;
|
||||
end(): void;
|
||||
|
||||
fulfill(result: T): Promise<T>;
|
||||
|
||||
Reference in New Issue
Block a user