I’m using mongoose-delete and its types package @types/mongoose-delete. There is a problem with one of their interface declarations, so I’ve tried to augment it like so…
// mongoose-soft-delete.d.ts
import mongoose from 'mongoose';
import 'mongoose-delete';
declare module 'mongoose-delete' {
interface SoftDeleteModel<
T,
//.. the rest of the owl
>
}
It’s only half working in that – now I have two definitions for SoftDeleteModel. How do I get it to replace the other instead? The original declaration is like
import mongoose = require("mongoose");
declare namespace MongooseDelete {
interface SoftDeleteModel<
T extends Omit<mongoose.Document, "delete">,
// ...
}
}
When I try to include the namespace value, it does not work at all.
New contributor
1