Is it possible to define an interface which has some information on the format of a string? Take the following example:
interface timeMarkers{
markerTime: string[]
};
an example would be:
{
markerTime: ["0:00","1:30", "1:48"]
}
My question: Is there a way to define the type for markerTime
such that that the string value must always match this regex, instead of declaring it as simply string[]
and going from there?
var reg = /[0-9]?[0-9]:[0-9][0-9]/;