From 43d6285831049d1e4e9c3a9865d364a2e0c74c1c Mon Sep 17 00:00:00 2001 From: Rob Mayer <5171361+RobMayer@users.noreply.github.com> Date: Fri, 7 Jul 2023 09:30:46 -0400 Subject: [PATCH] added explicit types to update query --- index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index 9c43a04..297c7b7 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; }>;