Skip to content

Commit

Permalink
correct return TS type for update() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
joewestcott committed Apr 5, 2021
1 parent 027ab43 commit eb5f8c0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,36 +336,36 @@ declare module "monk" {
query: FilterQuery<T>,
update: UpdateQuery<T> | Partial<T>,
options?: UpdateOneOptions & { single?: true, multi?: false, replace?: false}
): Promise<UpdateWriteOpResult>;
): Promise<UpdateResult>;
update(
query: FilterQuery<T>,
update: UpdateQuery<T> | Partial<T>,
options: UpdateOneOptions & { single?: true, multi?: false, replace?: false},
callback: Callback<UpdateWriteOpResult>
callback: Callback<UpdateResult>
): void;
// multi
update(
query: FilterQuery<T>,
update: UpdateQuery<T> | Partial<T>,
options?: UpdateManyOptions & ({ single?: false, multi: true, replace?: false} | { single: false, multi?: true, replace?: false})
): Promise<UpdateWriteOpResult>;
): Promise<UpdateResult>;
update(
query: FilterQuery<T>,
update: UpdateQuery<T> | Partial<T>,
options: UpdateOneOptions & ({ single?: false, multi: true, replace?: false} | { single: false, multi?: true, replace?: false}),
callback: Callback<UpdateWriteOpResult>
callback: Callback<UpdateResult>
): void;
// replace
update(
query: FilterQuery<T>,
update: UpdateQuery<T> | Partial<T>,
options?: ReplaceOneOptions & { single?: true, multi?: false, replace: true}
): Promise<UpdateWriteOpResult>;
): Promise<UpdateResult>;
update(
query: FilterQuery<T>,
update: UpdateQuery<T> | Partial<T>,
options: ReplaceOneOptions & { single?: true, multi?: false, replace: true},
callback: Callback<UpdateWriteOpResult>
callback: Callback<UpdateResult>
): void;
}

Expand Down

0 comments on commit eb5f8c0

Please sign in to comment.