export interface Date { /** * Give a more precise return type to the method `toISOString()`: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString */ toISOString(): TDateISO; } export type TYear = `${number}${number}${number}${number}`; export type TMonth = `${number}${number}`; export type TDay = `${number}${number}`; export type THours = `${number}${number}`; export type TMinutes = `${number}${number}`; export type TSeconds = `${number}${number}`; export type TMilliseconds = `${number}${number}${number}`; /** * Represent a string like `2021-01-08` */ export type TDateISODate = `${TYear}-${TMonth}-${TDay}`; /** * Represent a string like `14:42:34.678` */ export type TDateISOTime = `${THours}:${TMinutes}:${TSeconds}.${TMilliseconds}`; /** * Represent a string like `2021-01-08T14:42:34.678Z` (format: ISO 8601). */ export type TDateISO = `${TDateISODate}T${TDateISOTime}Z`;