[add] first

This commit is contained in:
2022-04-29 15:25:10 +08:00
commit da8024fc30
87 changed files with 16892 additions and 0 deletions

17
res/mongodb-polyfill.d.ts vendored Normal file
View File

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