diff --git a/index.d.ts b/index.d.ts index 733b3c4..8fc30e7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -105,25 +105,25 @@ declare class Nedb> extends EventEmitter { projection?: any ): Nedb.Cursor; - update( + update( query: any, updateQuery: any, - options?: Nedb.UpdateOptions, + options?: O, callback?: ( err: Error | null, numberOfUpdated: number, - affectedDocuments: Document | Document[] | null, + affectedDocuments: O['returnUpdatedDocs'] extends true ? O['multi'] extends true ? Document[] | null : Document | null : null, upsert: boolean | null ) => void ): void; - updateAsync( + updateAsync( query: any, updateQuery: any, - options?: Nedb.UpdateOptions + options?: O ): Promise<{ numAffected: number; - affectedDocuments: Document | Document[] | null; + affectedDocuments: O['returnUpdatedDocs'] extends true ? O['multi'] extends true ? Document[] | null : Document | null : null; upsert: boolean; }>;