import { ObjectId } from 'bson'; import { OmitUnion } from 'k8w-extend-native'; type InsertOneResult = any; type OptionalId = any; type Document = any; declare module 'mongodb' { export interface Collection { insertOne(doc: OptionalUnlessRequiredId_1): Promise>; } export type OptionalUnlessRequiredId_1 = TSchema extends { _id: ObjectId; } ? (OmitUnion & { _id?: ObjectId }) : TSchema extends { _id: any; } ? TSchema : OptionalId; }