I am writing an Interface for a record I want to use in TypeScript. I want to store a date there as an ISOString. However an ISOString is more specific than a regular String. I was hoping to reflect that in my records interface.
So far I haven't been able to figure out how. Is there a default type I can use for this in TypeScript? I was thinking maybe it is possible to use a RegExp instead ( I found no examples using a RegExp as type, so I'm not sure that's even possible ) ?
export default interface Invoice {
readonly id: number;
date: string; // ???? should be an ISOString
payment_term: number;
client_id: number;
}
PS: Using the Date type is not a solution for me. I want to define an ISOString in my record, not a Date object.