/** * Copyright (C) Paul Sarando * Distributed under the Eclipse Public License (http://www.eclipse.org/legal/epl-v10.html). */ import { Calendar, CalendarDate } from "./Utils"; import { GondorLeapYearRuleEnum } from "./GondorReckoning"; declare enum ShireRegionEnum { TOLKIEN = "tolkien", SHIRE = "shire", BREE = "bree" } /** * @property emoji - An icon representing this weekday. * @property tolkien - The Gregorian substitution Tolkien used for this weekday name. * @property shire - The Shire name for this weekday. * @property bree - The Bree name for this weekday. * @property description */ interface ShireWeekday { emoji: string; tolkien: string; shire: string; bree: string; description: string; } /** * Weekday names and descriptions * @constant */ declare const ShireWeekdays: ShireWeekday[]; /** * @property emoji - An icon representing this month. * @property tolkien - The Gregorian substitution Tolkien used for this month name. * @property shire - The Shire name for this month. * @property bree - The Bree name for this month. * @property description * @property className - UI-hint for styling this month. */ interface ShireMonth { emoji: string; tolkien: string; shire: string; bree: string; description: string; className: string; } /** * Month names and descriptions. * @constant */ declare const ShireMonths: ShireMonth[]; /** * @default new Date(0, 11, 21, 0,0,0) * * The Gregorian Date corresponding to the first Shire New Year Date. * The default year is 0 in order to keep Shire leap-years in sync with Gregorian leap-years. */ type FirstShireNewYearDate = Date; /** * @param {Date} today * @param {FirstShireNewYearDate} [startDate] * @param {GondorLeapYearRuleEnum} [rules=GondorLeapYearRuleEnum.GREGORIAN] * * @return {Date} The Gregorian Date corresponding to the Shire New Year Date * for the year of the given `today`. */ declare const getShireNewYearDate: (today: Date, startDate: FirstShireNewYearDate, rules?: GondorLeapYearRuleEnum) => Date; /** * The Shire or Bree name of a holiday. */ type ShireHolidayRegionNames = Record; /** * @property month - The month index of {@link ShireMonths}. * @property weekDay - The weekday index of {@link ShireWeekdays}. * @property region - The regional name variation. */ interface ShireDate extends CalendarDate { region?: ShireHolidayRegionNames; className?: string; } /** * @property year - The current Shire year. * @property dates - The dates of this Shire calendar year. * @property todayShire - The current Shire date corresponding to the given [today]{@link ShireCalendarYear#today}. */ interface ShireCalendarYear extends Calendar { dates: ShireDate[]; todayShire: ShireDate; } /** * Generates a calendar year for the given Date `today`, according to the given `startDate`. * * @param {Date} today * @param {FirstShireNewYearDate} [startDate] * @param {GondorLeapYearRuleEnum} [rules=GondorLeapYearRuleEnum.GREGORIAN] * * @return {ShireCalendarYear} The calendar year for the given `today`. */ declare const makeShireCalendarDates: (today: Date, startDate?: FirstShireNewYearDate, rules?: GondorLeapYearRuleEnum) => ShireCalendarYear; declare const REGION_NAMES_TOLKIEN: ShireRegionEnum, REGION_NAMES_SHIRE: ShireRegionEnum, REGION_NAMES_BREE: ShireRegionEnum; export { ShireCalendarYear, ShireDate, ShireWeekday, ShireWeekdays, ShireMonths, ShireRegionEnum, REGION_NAMES_TOLKIEN, REGION_NAMES_SHIRE, REGION_NAMES_BREE, getShireNewYearDate, makeShireCalendarDates, };