@hebcal/core
Version:
A perpetual Jewish Calendar API
84 lines (83 loc) • 2.92 kB
TypeScript
import { HDate } from '@hebcal/hdate';
import { Event } from './event';
import './locale';
/** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */
export declare class HolidayEvent extends Event {
/** During Sukkot or Pesach */
cholHaMoedDay?: number;
/**
* `true` if the fast day was postponed a day to avoid Shabbat.
* - Tish'a B'Av postponed from the 9th to the 10th
* - Tzom Tammuz postponed from the 17th to the 18th
*/
observed?: boolean;
basename(): string;
url(): string | undefined;
urlDateSuffix(): string;
getEmoji(): string;
getCategories(): string[];
/**
* Returns (translated) description of this event
* @param [locale] Optional locale name (defaults to empty locale)
*/
render(locale?: string): string;
/**
* Returns a brief (translated) description of this event.
* For most events, this is the same as render(). For some events, it procudes
* a shorter text (e.g. without a time or added description).
* @param [locale] Optional locale name (defaults to empty locale)
*/
renderBrief(locale?: string): string;
}
/**
* Because Asara B'Tevet often occurs twice in the same Gregorian year,
* we subclass HolidayEvent to generate the correct URL.
*/
export declare class AsaraBTevetEvent extends HolidayEvent {
urlDateSuffix(): string;
}
/**
* Because Chanukah sometimes starts in December and ends in January,
* we subclass HolidayEvent to generate the correct URL.
*/
export declare class ChanukahEvent extends HolidayEvent {
readonly chanukahDay?: number;
/**
* @param chanukahDay should be undefined for 1st night of Chanukah
*/
constructor(date: HDate, desc: string, mask: number, chanukahDay?: number);
urlDateSuffix(): string;
}
/** Represents Rosh Hashana, the Jewish New Year */
export declare class RoshHashanaEvent extends HolidayEvent {
private readonly hyear;
/**
* @private
* @param date Hebrew date event occurs
* @param hyear Hebrew year
* @param mask optional holiday flags
*/
constructor(date: HDate, hyear: number, mask: number);
/**
* Returns (translated) description of this event
* @param [locale] Optional locale name (defaults to empty locale)
*/
render(locale?: string): string;
getEmoji(): string;
}
/** Represents Rosh Chodesh, the beginning of a new month */
export declare class RoshChodeshEvent extends HolidayEvent {
/**
* Constructs Rosh Chodesh event
* @param date Hebrew date event occurs
* @param monthName Hebrew month name (not translated)
*/
constructor(date: HDate, monthName: string);
/**
* Returns (translated) description of this event
* @param [locale] Optional locale name (defaults to empty locale)
*/
render(locale?: string): string;
basename(): string;
getEmoji(): string;
}