From 9b48a0bcc03f51e7d9e36e1c87c911bb38d290bb Mon Sep 17 00:00:00 2001 From: Lukas Steuer <13337295+xxxLukskyxxx@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:54:03 +0100 Subject: [PATCH] Added callback typings for the insertOne method Adding the missing callback typings for the insertOne method in mongo-legacy.d.ts --- mongodb-legacy.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mongodb-legacy.d.ts b/mongodb-legacy.d.ts index b04fb12..32817c7 100644 --- a/mongodb-legacy.d.ts +++ b/mongodb-legacy.d.ts @@ -263,7 +263,10 @@ declare class LegacyCollection extends Coll * @param options - Optional settings for the command * @param callback - An optional callback, a Promise will be returned if none is provided */ - insertOne(doc: OptionalUnlessRequiredId, options?: InsertOneOptions): Promise>; + insertOne(doc: OptionalUnlessRequiredId): Promise>; + insertOne(doc: OptionalUnlessRequiredId, callback: Callback>): void; + insertOne(doc: OptionalUnlessRequiredId, options: InsertOneOptions): Promise>; + insertOne(doc: OptionalUnlessRequiredId, options: InsertOneOptions, callback: Callback>): void; /** * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, * one will be added to each of the documents missing it by the driver, mutating the document. This behavior