/** * Yes, wrapping dayjs is a bit annoying and might seem overly paranoid. However, I feel strongly * about not letting Dayjs instances leak into the rest of the codebase. Having Dayjs objects * floating around the application leads to inconsistent timezone handling, makes testing more * difficult, and creates subtle bugs that are hard to track down. * * By wrapping dayjs completely and only exposing plain JavaScript Date objects, we get several * key benefits: * 1. Consistent timezone handling through a single configuration point * 2. Simpler testing since we only need to mock this one library * 3. Type safety - the rest of the codebase only deals with standard Date objects * 4. No risk of dayjs method chains creating unexpected timezone shifts * * The Library interface gives us full control over all date operations while keeping the messy * details of timezone manipulation contained in one place. Yes it's more code, but the peace of * mind is worth it. */ export interface Utility { now: () => Date; today: () => string; date: (date: string | number | Date | null | undefined) => Date; parse: (date: string | number | Date | null | undefined, format: string) => Date; isValidDate: (date: string, format: string) => boolean; addDays: (date: Date, days: number) => Date; addMonths: (date: Date, months: number) => Date; addYears: (date: Date, years: number) => Date; format: (date: Date, format: string) => string; subDays: (date: Date, days: number) => Date; subMonths: (date: Date, months: number) => Date; subYears: (date: Date, years: number) => Date; startOfMonth: (date: Date) => Date; endOfMonth: (date: Date) => Date; startOfYear: (date: Date) => Date; endOfYear: (date: Date) => Date; isBefore: (date: Date, other: Date) => boolean; isAfter: (date: Date, other: Date) => boolean; } export declare const create: (parameters: { timezone: string; }) => { now: () => Date; today: () => string; date: (date: string | number | Date | null | undefined) => Date; parse: (date: string | number | Date | null | undefined, format: string) => Date; isValidDate: (date: string, format: string) => boolean; addDays: (date: Date, days: number) => Date; addMonths: (date: Date, months: number) => Date; addYears: (date: Date, years: number) => Date; format: (date: Date, format: string) => string; subDays: (date: Date, days: number) => Date; subMonths: (date: Date, months: number) => Date; subYears: (date: Date, years: number) => Date; startOfMonth: (date: Date) => Date; endOfMonth: (date: Date) => Date; startOfYear: (date: Date) => Date; endOfYear: (date: Date) => Date; isBefore: (date: Date, other: Date) => boolean; isAfter: (date: Date, other: Date) => boolean; }; export declare const validTimezones: () => string[];