I am using mongo@4.2.1. In this package the openUploadStreamWithId in the GridFSBucket is defined as ObjectId.
mongodb.d.ts
export declare class GridFSBucket extends TypedEventEmitter<GridFSBucketEvents> {
...
openUploadStreamWithId(id: ObjectId, filename: string, options?: GridFSBucketWriteStreamOptions): GridFSBucketWriteStream;
...
}
But it should be type GridFSBucketWriteStreamId = string | number | Object | ObjectID; stackexchange mongodb driver
I'm using a string as id, instead of an ObjectId, therefore I have to fix the definition.
How can I extend the openUploadStreamWithId typescript?