UNPKG

hellenic-holidays

Version:

A modern TypeScript package for Greek holidays and Orthodox celebrations

43 lines (42 loc) 1.36 kB
import { Holiday, HolidayResponse, HolidayType } from "../types"; export declare class HolidayService { /** * Get all holidays for a specific year * @param year The year to get holidays for * @returns Array of holidays */ getHolidays(year: number): Holiday[]; /** * Check if a given date is a holiday * @param date The date to check * @returns HolidayResponse object */ isHoliday(date: Date): HolidayResponse; /** * Get holidays between two dates * @param startDate Start date * @param endDate End date * @returns Array of holidays */ getHolidaysBetweenDates(startDate: Date, endDate: Date): Holiday[]; /** * Get holidays by type * @param year The year to get holidays for * @param type The type of holidays to get * @returns Array of holidays of the specified type */ getHolidaysByType(year: number, type: HolidayType): Holiday[]; /** * Get the next holiday from a given date * @param date The reference date * @returns The next holiday or undefined if none found */ getNextHoliday(date: Date): Holiday | undefined; /** * Helper function to check if two dates are the same day * @param date1 First date * @param date2 Second date * @returns boolean */ private isSameDay; }