/** * Copyright (C) Paul Sarando * Distributed under the Eclipse Public License (http://www.eclipse.org/legal/epl-v10.html). */ import { Calendar, CalendarDate } from "./Utils"; declare enum RivendellRulesEnum { TRADITIONAL = "traditional", REFORMED = "reformed" } declare const TRADITIONAL_RULES: RivendellRulesEnum, REFORMED_RULES: RivendellRulesEnum; /** * @property emoji - An icon representing this weekday. * @property english - The English translation of this weekday name. * @property quenya - The Quenya name for this weekday. * @property sindarin - The Sindarin name for this weekday. */ interface RivendellWeekday { emoji: string; english: string; quenya: string; sindarin: string; description: string; } /** * Weekday names and descriptions * @constant */ declare const RivendellWeekdays: RivendellWeekday[]; /** * @property emoji - An icon representing this month. * @property english - The English translation of this month name. * @property quenya - The Quenya name for this month. * @property sindarin - The Sindarin name for this month. * @property description * @property className - UI-hint for styling this month. */ interface RivendellMonth { emoji: string; english: string; quenya: string; sindarin: string; description: string; className: string; } /** * Month names and descriptions. * @constant */ declare const RivendellMonths: RivendellMonth[]; /** * @property english - The English translation of this holiday name. * @property quenya - The Quenya name for this holiday. * @property sindarin - The Sindarin name for this holiday. * @property description */ interface ElvishHoliday { english: string; quenya: string; sindarin: string; description: string; } type ElvishHolidays = Record; /** * Elvish Holiday names and descriptions. * @constant */ declare const CommonElvishHolidays: ElvishHolidays; /** * Rivendell Holiday names and descriptions. * @constant */ declare const RivendellHolidays: ElvishHolidays; /** * @param {number} year - The Rivendell year to check. * @return {boolean} True if the given `year` is a Rivendell leap-year. */ declare const isRivendellLeapYear: (year: number) => boolean; /** * @default new Date(1, 2, 22, 0,0,0) * * The Gregorian Date corresponding to the first Rivendell New Year Date. * The default year is 1 in order to keep Rivendell leap-years in sync with Gregorian leap-years. */ type FirstRivendellNewYearDate = Date; /** * @param {Date} today * @param {FirstRivendellNewYearDate} [startDate] * @param {RivendellRulesEnum} [calendarRules=TRADITIONAL_RULES] * * @return {Date} The Gregorian Date corresponding to the Rivendell New Year's Day for the year of the given `today`. */ declare const getRivendellNewYearDate: (today: Date, startDate: FirstRivendellNewYearDate, calendarRules?: RivendellRulesEnum) => Date; /** * @property month - The month index of {@link RivendellMonths}. * @property weekDay - The weekday index of {@link RivendellWeekdays}. */ interface RivendellDate extends CalendarDate { className?: string; } /** * @property year - The current Rivendell year. * @property dates - The dates of this Rivendell calendar year. * @property todayRivendell - The current Rivendell date corresponding to the given * [today]{@link RivendellCalendarYear.today}. */ interface RivendellCalendarYear extends Calendar { dates: RivendellDate[]; todayRivendell: RivendellDate; } /** * Generates a calendar year for the given Date `today`, * according to the given `startDate` and `calendarRules`. * * @param {Date} today * @param {FirstRivendellNewYearDate} [startDate] * @param {RivendellRulesEnum} [calendarRules=TRADITIONAL_RULES] * * @return {RivendellCalendarYear} The calendar year for the given `today`. */ declare const makeRivendellCalendarDates: (today: Date, startDate?: FirstRivendellNewYearDate, calendarRules?: RivendellRulesEnum) => RivendellCalendarYear; export { TRADITIONAL_RULES, REFORMED_RULES, RivendellRulesEnum, ElvishHolidays, RivendellCalendarYear, RivendellDate, RivendellWeekdays, RivendellMonths, RivendellHolidays, CommonElvishHolidays, isRivendellLeapYear, getRivendellNewYearDate, makeRivendellCalendarDates, };