Skip to content

Commit

Permalink
added proper overload for findoneandupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
chill-cod3r committed Dec 28, 2018
1 parent cbcefe4 commit 6c8caab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ declare module 'monk' {
monkInstance,
}: { collection: ICollection; monkInstance: IMonkManager }
) => (
next: (args: Object, method: string) => Promise<any>
) => (args: Object, method: string) => Promise<any>
next: (args: Object, method: string) => Promise<any>
) => (args: Object, method: string) => Promise<any>

type TQuery = string | Object
type TFields = string | Array<string>
Expand Down Expand Up @@ -86,6 +86,12 @@ declare module 'monk' {
update: Object,
options?: Object
): Promise<U | undefined>
findOneAndUpdate<U = T>(
query: TQuery,
update: Object,
options?: Object,
callback?: (err: Error, data: U) => void
): void;
geoHaystackSearch<U = T>(
x: number,
y: number,
Expand Down Expand Up @@ -154,7 +160,7 @@ declare module 'monk' {
export function id(): IObjectID // returns new generated ObjectId
export function cast(obj?: Object | Array<any> | any): any

export default function(
export default function (
database: string | Array<string>,
options?: {
collectionOptions?: Object
Expand Down

0 comments on commit 6c8caab

Please sign in to comment.