/** * Copyright (C) Paul Sarando * Distributed under the Eclipse Public License (http://www.eclipse.org/legal/epl-v10.html). */ import { ElvishHolidays } from "./RivendellReckoning"; import { Calendar, CalendarDate } from "./Utils"; declare enum GondorReckoningEnum { KINGS = "kings", STEWARDS = "stewards", NEW = "new" } declare enum GondorLeapYearRuleEnum { TRADITIONAL = "traditional", GREGORIAN = "reformed" } /** * @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. * @property description */ interface GondorWeekday { emoji: string; english: string; quenya: string; sindarin: string; description: string; } /** * Weekday names and descriptions * @constant */ declare const GondorWeekdays: GondorWeekday[]; /** * @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 GondorMonth { emoji: string; english: string; quenya: string; sindarin: string; description: string; className: string; } /** * Month names and descriptions. * @constant */ declare const GondorMonths: GondorMonth[]; /** * Gondor Holiday names and descriptions. * @constant */ declare const GondorHolidays: ElvishHolidays; /** * @default new Date(0, 11, 21, 0,0,0) * * The Gregorian Date corresponding to the first NĂºmenor New Year Date. * The default year is 0 in order to keep Gondor leap-years in sync with Gregorian leap-years. */ type FirstNumenorNewYearDate = Date; /** * @param {number} gondorYear * @return {boolean} True if the given `gondorYear` is a millennial year that requires an additional leap-day adjustment. */ declare const isMillennialLeapYear: (gondorYear: number) => boolean; /** * @param {number} gondorYear * @param {GondorLeapYearRuleEnum} [rules=GondorLeapYearRuleEnum.GREGORIAN] * * @return {boolean} True if the given `gondorYear` is a leap-year (standard or millennial). */ declare const isGondorLeapYear: (gondorYear: number, rules?: GondorLeapYearRuleEnum) => boolean; /** * @param {Date} today * @param {FirstNumenorNewYearDate} [startDate] * @param {GondorLeapYearRuleEnum} [rules=GondorLeapYearRuleEnum.GREGORIAN] * * @return {Date} The Gregorian Date corresponding to the Gondor New Year Date * for the year of the given `today`. */ declare const getGondorNewYearDate: (today: Date, startDate: FirstNumenorNewYearDate, rules?: GondorLeapYearRuleEnum) => Date; /** * @param {Date} today * @param {FirstNumenorNewYearDate} [startDate] * @param {GondorLeapYearRuleEnum} [rules=GondorLeapYearRuleEnum.GREGORIAN] * * @return {Date} The Gregorian Date corresponding to the Gondor New Year Date * in the New Reckoning calendar for the year of the given `today`. */ declare const getNewReckoningNewYearDate: (today: Date, startDate: FirstNumenorNewYearDate, rules: GondorLeapYearRuleEnum) => Date; /** * @param {GondorReckoningEnum} fromReckoning * @param {GondorReckoningEnum} toReckoning * @param {number} monthIndex The current {@link GondorMonths} index for the given `fromReckoning`. * * @return {number} The index to use with {@link GondorMonths} for the given `toReckoning` * that most closely matches the given `monthIndex`. */ declare const convertGondorianMonthIndex: (fromReckoning: GondorReckoningEnum, toReckoning: GondorReckoningEnum, monthIndex: number) => number; /** * @param {number} weekday - The current Gregorian weekday index (Sunday = 0). * @return {number} The Gondorian weekday index, for use with {@link GondorWeekdays}, * that is the cultural equivalent for the given Gregorian weekday index. */ declare const convertGregorianToGondorianWeekday: (weekday: number) => number; /** * @property day - The number of the day of the month, if this date is not intercalary; otherwise, the name of the intercalary date. * @property month - The month index of {@link GondorMonths}. * @property weekDay - The weekday index of {@link GondorWeekdays}. * @property gregorian - The corresponding Gregorian date. */ interface GondorDate extends CalendarDate { className?: string; } /** * @property year - The current Gondor year. * @property dates - The dates of this Gondor calendar year. * @property todayGondor - The current Gondor date corresponding to the given {@link GondorCalendarYear.today}. */ interface GondorCalendarYear extends Calendar { dates: GondorDate[]; todayGondor: GondorDate; } /** * Generates a calendar year for the given Date `today`, * according to the given `startDate` and `reckoning` rules. * * @param {Date} today * @param {FirstNumenorNewYearDate} [startDate] * @param {GondorReckoningEnum} [reckoning=GondorReckoningEnum.STEWARDS] * @param {GondorLeapYearRuleEnum} [rules=GondorLeapYearRuleEnum.GREGORIAN] * * @return {GondorCalendarYear} The calendar year for the given `today`. */ declare const makeGondorCalendarDates: (today: Date, startDate?: FirstNumenorNewYearDate, reckoning?: GondorReckoningEnum, rules?: GondorLeapYearRuleEnum) => GondorCalendarYear; declare const RECKONING_KINGS: GondorReckoningEnum, RECKONING_STEWARDS: GondorReckoningEnum, RECKONING_NEW: GondorReckoningEnum; declare const RECKONING_RULES_TRADITIONAL: GondorLeapYearRuleEnum, RECKONING_RULES_GREGORIAN: GondorLeapYearRuleEnum; export { RECKONING_KINGS, RECKONING_STEWARDS, RECKONING_NEW, RECKONING_RULES_TRADITIONAL, RECKONING_RULES_GREGORIAN, GondorCalendarYear, GondorDate, GondorReckoningEnum, GondorLeapYearRuleEnum, GondorWeekdays, GondorMonths, GondorHolidays, getGondorNewYearDate, getNewReckoningNewYearDate, isGondorLeapYear, isMillennialLeapYear, convertGondorianMonthIndex, convertGregorianToGondorianWeekday, makeGondorCalendarDates, };