UNPKG

colombian-holidays

Version:
63 lines (57 loc) 1.92 kB
interface BasicHoliday { name: { en: string; es: string; }; nextMonday: boolean; } interface ColombianHoliday extends BasicHoliday { date: string; celebrationDate: string; } interface ColombianHolidayWithNativeDate extends BasicHoliday { date: Date; celebrationDate: Date; } declare function getHolidaysForYear(year: number, options?: { valueAsDate: false | undefined; }): ColombianHoliday[]; declare function getHolidaysForYear(year: number, options?: { valueAsDate: true; }): ColombianHolidayWithNativeDate[]; declare function holidaysWithinInterval(options: { start: Date; end: Date; valueAsDate: false | undefined; }): ColombianHoliday[]; declare function holidaysWithinInterval(options: { start: Date; end: Date; valueAsDate: true; }): ColombianHolidayWithNativeDate[]; declare function holidaysWithinInterval(options: { start: Date; end: Date; valueAsDate?: boolean; }): ColombianHoliday[] | ColombianHolidayWithNativeDate[]; declare function isHoliday(date: Date): boolean; declare const FIRST_HOLIDAY_YEAR = 1583; declare const LAST_HOLIDAY_YEAR = 4099; type MonthNumbers = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; type Month = MonthNumbers | Omit<number, MonthNumbers>; declare function colombianHolidays(options?: undefined | { year?: number; month?: Month; valueAsDate: false | undefined; }): ColombianHoliday[]; declare function colombianHolidays(options?: { year?: number; month?: Month; valueAsDate: true; }): ColombianHolidayWithNativeDate[]; declare function colombianHolidays(options?: { year?: number; month?: Month; valueAsDate?: boolean; }): ColombianHoliday[] | ColombianHolidayWithNativeDate[]; export { FIRST_HOLIDAY_YEAR, LAST_HOLIDAY_YEAR, type Month, colombianHolidays, colombianHolidays as default, getHolidaysForYear, holidaysWithinInterval, isHoliday };