-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
In order to handle Dates where we don't care about the time, we have a custom schema type of DateOnly that is effectively a wrapper around Date with some validators attached to make sure the time is set to midnight UTC via a plugin.
We use a types.d.ts file to make Typescript aware of this additional type which so far has worked. Now, when using mongoose-tsgen, we get an error parser: Unknown type detected for field for any fields using this new custom type.
The type looks like the following:
declare module "mongoose" {
namespace Schema {
namespace Types {
class DateOnly extends Schema.Types.Date {}
}
}
}
So quite similar to how you are already augmenting for populate. Any ideas on how to effectively do this so types generate correctly for the schemas that use this custom type? Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels