import { HDate } from '@hebcal/hdate'; import './locale'; /** * Holiday flags for Event. These flags are typically * combined using bitwise arithmetic to form a mask. * @readonly * @enum {number} */ export declare const flags: { /** Chag, yontiff, yom tov */ readonly CHAG: 1; /** Light candles 18 minutes before sundown */ readonly LIGHT_CANDLES: 2; /** End of holiday (end of Yom Tov) */ readonly YOM_TOV_ENDS: 4; /** Observed only in the Diaspora (chutz l'aretz) */ readonly CHUL_ONLY: 8; /** Observed only in Israel */ readonly IL_ONLY: 16; /** Light candles in the evening at Tzeit time (3 small stars) */ readonly LIGHT_CANDLES_TZEIS: 32; /** Candle-lighting for Chanukah */ readonly CHANUKAH_CANDLES: 64; /** Rosh Chodesh, beginning of a new Hebrew month */ readonly ROSH_CHODESH: 128; /** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */ readonly MINOR_FAST: 256; /** Shabbat Shekalim, Zachor, ... */ readonly SPECIAL_SHABBAT: 512; /** Weekly sedrot on Saturdays */ readonly PARSHA_HASHAVUA: 1024; /** Daily page of Talmud (Bavli) */ readonly DAF_YOMI: 2048; /** Days of the Omer */ readonly OMER_COUNT: 4096; /** Yom HaShoah, Yom HaAtzma'ut, ... */ readonly MODERN_HOLIDAY: 8192; /** Yom Kippur and Tish'a B'Av */ readonly MAJOR_FAST: 16384; /** On the Saturday before Rosh Chodesh */ readonly SHABBAT_MEVARCHIM: 32768; /** Molad */ readonly MOLAD: 65536; /** Yahrzeit or Hebrew Anniversary */ readonly USER_EVENT: 131072; /** Daily Hebrew date ("11th of Sivan, 5780") */ readonly HEBREW_DATE: 262144; /** A holiday that's not major, modern, rosh chodesh, or a fast day */ readonly MINOR_HOLIDAY: 524288; /** Evening before a major or minor holiday */ readonly EREV: 1048576; /** Chol haMoed, intermediate days of Pesach or Sukkot */ readonly CHOL_HAMOED: 2097152; /** Mishna Yomi */ readonly MISHNA_YOMI: 4194304; /** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */ readonly YOM_KIPPUR_KATAN: 8388608; /** Daily page of Jerusalem Talmud (Yerushalmi) */ readonly YERUSHALMI_YOMI: 16777216; /** Nach Yomi */ readonly NACH_YOMI: 33554432; /** Daily Learning */ readonly DAILY_LEARNING: 67108864; /** Yizkor */ readonly YIZKOR: 134217728; /** BeHaB fast days on Monday, Thursday and Monday after Pesach and Sukkot */ readonly BEHAB: 268435456; }; /** * Represents an Event with a title, date, and flags. * * Events are used to represent holidays, candle-lighting times, * Torah readings, Omer days, Hebrew dates, and more. Most concrete event * types are subclasses (e.g. {@link HolidayEvent}, {@link TimedEvent}, * {@link ParshaEvent}, {@link OmerEvent}) and are produced by * {@link HebrewCalendar.calendar}. * * To get the title of the event in a language other than English with * Sephardic transliterations, use the {@link Event.render} method. * * @example * import {Event, HDate, flags} from '@hebcal/core'; * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG); * ev.getDate().toString(); // '6 Sivan 5749' * ev.getDesc(); // 'Shavuot' * ev.render('he'); // 'שָׁבוּעוֹת' */ export declare class Event { /** Hebrew date of this event */ readonly date: HDate; /** * Untranslated title of this event. Note that these description * strings are always in English and will remain stable across releases. * To get the title of the event in another language, use the * `render()` method. */ readonly desc: string; /** Bitmask of optional event flags. See {@link flags} */ readonly mask: number; /** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */ emoji?: string; /** Optional longer description or memo text */ memo?: string; /** Alarms are used by iCalendar feeds */ alarm?: Date | string | boolean; /** * Constructs Event * @param date Hebrew date event occurs * @param desc Description (not translated) * @param [mask=0] optional bitmask of holiday flags (see {@link flags}) * @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`) */ constructor(date: HDate, desc: string, mask?: number, attrs?: object); /** * Hebrew date of this event */ getDate(): HDate; /** * Gregorian date of this event */ greg(): Date; /** * Untranslated title of this event. Note that these description * strings are always in English and will remain stable across releases. * To get the title of the event in another language, use the * `render()` method. */ getDesc(): string; /** * Bitmask of optional event flags. See {@link flags} */ getFlags(): number; /** * Returns (translated) description of this event * @example * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG); * ev.render('en'); // 'Shavuot' * ev.render('he'); // 'שָׁבוּעוֹת' * ev.render('ashkenazi'); // 'Shavuos' * @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 {@link render}. Some subclasses * (e.g. {@link CandleLightingEvent}, {@link HavdalahEvent}, * {@link OmerEvent}) produce shorter text without an attached time or * extra qualifier — useful for compact UI display. * @example * import {CandleLightingEvent} from '@hebcal/core'; * // For a regular Event, renderBrief() == render(): * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG); * ev.renderBrief('en'); // 'Shavuot' * @param [locale] Optional locale name (defaults to empty locale) */ renderBrief(locale?: string): string; /** * Returns the event's emoji character (e.g. `🕯️`, `🕎`, `🇮🇱`, `🍏🍯`), * or `null` if no emoji is associated with this event. * Subclasses override this to provide holiday-specific emoji. */ getEmoji(): string | null; /** * Returns a simplified (untranslated) description for this event, suitable * for grouping related events under a single name. * * For example, {@link HolidayEvent} strips qualifiers so that * `"Erev Pesach"` → `"Pesach"` and `"Sukkot III (CH''M)"` → `"Sukkot"`. * For many events the basename and the event description are identical. * @example * import {HolidayEvent, HDate, months, flags} from '@hebcal/core'; * const ev = new HolidayEvent( * new HDate(14, months.NISAN, 5784), 'Erev Pesach', flags.EREV); * ev.getDesc(); // 'Erev Pesach' * ev.basename(); // 'Pesach' */ basename(): string; /** * Returns a URL to hebcal.com or sefaria.org for more detail on the event, * or `undefined` for events with no detail page. * * Subclasses such as {@link HolidayEvent}, {@link ChanukahEvent}, * {@link AsaraBTevetEvent}, {@link ParshaEvent}, and {@link OmerEvent} * override this with their own URL patterns. */ url(): string | undefined; /** * Is this event observed in Israel? * @example * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); * ev1.observedInIsrael(); // false * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); * ev2.observedInIsrael(); // true */ observedInIsrael(): boolean; /** * Is this event observed in the Diaspora? * @example * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); * ev1.observedInDiaspora(); // true * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); * ev2.observedInDiaspora(); // true */ observedInDiaspora(): boolean; /** * Is this event observed in Israel/Diaspora? * @example * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY); * ev1.observedIn(false); // true * ev1.observedIn(true); // false * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0); * ev2.observedIn(false); // true * ev2.observedIn(true); // true * @param il */ observedIn(il: boolean): boolean; /** * Returns an array of category strings classifying this event, derived * from its {@link flags} bitmask. The first element is the broad category * (e.g. `'holiday'`, `'roshchodesh'`, `'parashat'`, `'omer'`), followed * by zero or more refinements (e.g. `'major'`, `'minor'`, `'fast'`). * * Returns `['unknown']` if no flag maps to a known category. * @example * import {Event, HDate, flags} from '@hebcal/core'; * new Event(new HDate(10, 'Tishrei', 5784), 'Yom Kippur', flags.MAJOR_FAST) * .getCategories(); // ['holiday', 'major', 'fast'] * new Event(new HDate(1, 'Shvat', 5784), 'Rosh Chodesh Sh\'vat', flags.ROSH_CHODESH) * .getCategories(); // ['roshchodesh'] */ getCategories(): string[]; }