export interface TimeUnit { singular: string plural: string } export type TranslationValue = string | TimeUnit export interface LanguageTranslations { [key: string]: TranslationValue } export type AvailableTimeLanguages = 'en' | 'es' | 'fr' | 'he' export type DayFormatTypes = 'DD' | 'DDD' | 'DDDD' export type MonthFormatTypes = 'MM' | 'MMM' | 'MMMM' export type YearFormatTypes = 'YY' | 'YYYY' export type HourFormatTypes = 'HH' export type MinuteFormatTypes = 'mm' export type SecondFormatTypes = 'ss' export type MillisecondFormatTypes = 'sss' export type AmPmFormatTypes = 'AmPm' export type DateFormatSeparatorTypes = '/' | '-' | ' ' | ':' | '.' // Common predefined formats instead of template literals export type CommonDateFormats = | `${DayFormatTypes}${DateFormatSeparatorTypes}${MonthFormatTypes}${DateFormatSeparatorTypes}${YearFormatTypes}` | `${MonthFormatTypes}${DateFormatSeparatorTypes}${YearFormatTypes}` | 'DD.MM.YY' | 'DD.MM.YYYY' | 'DD/MM/YY' | 'DD/MM/YYYY' // European style | 'MM.DD.YY' | 'MM.DD.YYYY' | 'MM/DD/YY' | 'MM/DD/YYYY' // US style | 'YYYY-MM-DD' | 'YY-MM-DD' // ISO style | 'DD MMM YYYY' | 'DD MMMM YYYY' // Long format | 'DDD, DD MMM' | 'DDDD, DD MMMM' // Day-focused format | 'MMM DD' | 'MMMM DD' // Month-day format export type CommonTimeFormats = | 'HH:mm' | 'HH:mm:ss' | 'HH:mm:ss:sss' // 24-hour format | 'HH:mm AmPm' // 12-hour format // Combined date and time formats export type CommonDateTimeFormats = | `${CommonDateFormats} ${CommonTimeFormats}` | `${CommonTimeFormats}, ${CommonDateFormats}` | 'YYYY-MM-DD HH:MM' // Explicit ISO-style datetime format // Named formats export type NamedFormats = | 'ISO' | 'ISO8601' | 'UTC' | 'RFC2822' | 'RFC3339' | 'UNIX' | 'TIMESTAMP' // Final accepted format type with string fallback for custom formats export type DateTimeAcceptedFormats = | CommonDateFormats | CommonTimeFormats | CommonDateTimeFormats // ^^ Union types for common formats | DayFormatTypes | MonthFormatTypes | YearFormatTypes | HourFormatTypes | MinuteFormatTypes | SecondFormatTypes | MillisecondFormatTypes // ^^ Union types for individual date parts | NamedFormats // ^^ Named format shortcuts // ! | string // ! no string fallback so that autocomplete works (developers should / can always cast to DateTimeAcceptedFormats)