I'm a fan of Open Source and have a growing interest in serverless and edge computing. I'm not a big fan of spiders, but they're doing good work eating bugs. I also stream on Twitch.
interfaceBaseEntity{id:string;createdAt:Date;}typeEntity<T>=T&BaseEntity;interfaceVehicle{model:string;year?:string;seatsCount?:number;}// Enforce having the bare minimum entity propertiestypeMongooseDocument<TextendsBaseEntity>=T&mongoose.Document;constdbDocument:MongooseDocument<Entity<Vehicle>>={SomeMongooseDocProperty:"yolo",createdAt:newDate(),id:"5FCA1C32-1D92-47CA-A885-A5A747E6E4FB",model:"Mini",seatsCount:4,year:"1999"};
You can even go a bit further.
See the updated playground example