diff --git a/index.d.ts b/index.d.ts index f03696c2..ac44b0fe 100644 --- a/index.d.ts +++ b/index.d.ts @@ -42,7 +42,7 @@ declare module "monk" { }; type DropIndexInput = CreateIndexInput & string[]; type DropIndexOptions = CommonOptions & { maxTimeMS?: number }; - type FindOptions = FindOneOptions & { rawCursor?: boolean }; + type FindOptions = FindOneOptions & { rawCursor?: boolean }; type RemoveOptions = CommonOptions & SingleMulti; type StatsOptions = { scale: number; session?: ClientSession }; @@ -196,38 +196,41 @@ declare module "monk" { // Raw find( query: FilterQuery, - options?: FindOptions & { rawCursor: true } + options?: FindOptions & { rawCursor: true } ): Promise>; find( query: FilterQuery, - options: FindOneOptions & { rawCursor: true }, + options: FindOneOptions & { rawCursor: true }, callback: Callback> ): void; // Normal - find(query?: FilterQuery, options?: FindOptions): Promise>; + find( + query?: FilterQuery, + options?: FindOptions + ): Promise>; find( query: FilterQuery, - options: FindOneOptions, + options: FindOneOptions, callback: Callback> ): void; findOne( query?: FilterQuery, - options?: FindOneOptions + options?: FindOneOptions ): Promise>; findOne( query: FilterQuery, - options: FindOneOptions, + options: FindOneOptions, callback: Callback> ): void; findOneAndDelete( query: FilterQuery, - options?: FindOneAndDeleteOption + options?: FindOneAndDeleteOption ): Promise>; findOneAndDelete( query: FilterQuery, - options: FindOneAndDeleteOption, + options: FindOneAndDeleteOption, callback: Callback> ): void; @@ -235,24 +238,24 @@ declare module "monk" { findOneAndUpdate( query: FilterQuery, update: UpdateQuery | Partial, - options?: FindOneAndUpdateOption & { replaceOne?: false } + options?: FindOneAndUpdateOption & { replaceOne?: false } ): Promise>; findOneAndUpdate( query: FilterQuery, update: UpdateQuery | Partial, - options?: FindOneAndUpdateOption & { replaceOne?: false }, + options?: FindOneAndUpdateOption & { replaceOne?: false }, callback?: Callback> ): void; // Replace findOneAndUpdate( query: FilterQuery, update: T, - options?: FindOneAndReplaceOption & { replaceOne: true } + options?: FindOneAndReplaceOption & { replaceOne: true } ): Promise>; findOneAndUpdate( query: FilterQuery, update: T, - options: FindOneAndReplaceOption & { replaceOne: true }, + options: FindOneAndReplaceOption & { replaceOne: true }, callback: Callback> ): void;