import './temporal-shim'; import { Event } from './event'; import { CalOptions } from './CalOptions'; import { HDate } from '@hebcal/hdate'; import './locale'; /** * Represents a *molad* — the calculated moment when the new moon is "born" * for a given Hebrew month. * * The molad is announced in synagogue on Shabbat Mevarchim (the Shabbat * before Rosh Chodesh) and is the anchor point for Kiddush Levana zmanim. * Calculations use the traditional chalakim arithmetic * (1 hour = 1080 chalakim) anchored to *Molad Tohu BaHaRaD*. * * @example * import {Molad, months} from '@hebcal/core'; * const m = new Molad(5784, months.NISAN); * console.log(m.getMonthName()); // 'Nisan' * console.log(m.getHour(), m.getMinutes(), m.getChalakim()); // e.g. 1 31 12 * console.log(m.render('en')); // 'Molad Nisan: Mon, 1:31am and 12 chalakim' */ export declare class Molad { private readonly m; private readonly year; private readonly month; private instant?; /** * Calculates the molad for a given Hebrew year and month. * @param year Hebrew year * @param month 1=NISAN, 7=TISHREI (uses Nisan-based numbering) */ constructor(year: number, month: number); /** * The exact Hebrew date of the molad, which often falls on the * 28th or 30th of the preceeding month, occasionally on the first of the * month, and in extremely rare circumstances the 27th of the month. * - Molad Shevat 5541 occured on 27 Tevet / 1781-01-24T19:57:20.170Z * - Molad Shevat 5788 will occur on 27 Tevet / 2028-01-26T19:07:03.504Z * - Molad Nissan 5866 will occur on 27 Adar II / 2106-04-03T21:08:46.837Z */ getMoladDate(): HDate; /** * The year of the molad (as constructed) */ getYear(): number; /** * The month (1=NISSAN, 7=TISHREI) as constructed */ getMonth(): number; /** * Returns a transliterated string name of the molad's Hebrew month, * for example 'Elul' or 'Cheshvan'. */ getMonthName(): string; /** * @returns Day of Week (0=Sunday, 6=Saturday) */ getDow(): number; /** * @returns hour of day (0-23) */ getHour(): number; /** * @returns minutes past hour (0-59) */ getMinutes(): number; /** * @returns parts of a minute (0-17) */ getChalakim(): number; /** * Returns the molad in Standard Time in Yerushalayim as a `Temporal.ZonedDateTime`. * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude * of 35.2354° is 5.2354° away from the %15 timezone longitude) to get to standard time. This method * intentionally uses standard time and not daylight savings time. * * The returned value is cached after the first call. * @example * import {Molad, months} from '@hebcal/core'; * const m = new Molad(5784, months.NISAN); * const zdt = m.getInstant(); * console.log(zdt.toString()); // e.g. '2024-04-08T17:21:13.333+00:00[UTC]' * @return the `Temporal.ZonedDateTime` representing the moment of the molad */ getInstant(): Temporal.ZonedDateTime; /** * Returns the earliest time of _Kiddush Levana_ calculated as 3 days after the molad. This method returns the time * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider * displaying the next _tzais_ if the zman is between _alos_ and _tzais_. * * @return the Temporal.ZonedDateTime representing the moment 3 days after the molad. */ getTchilasZmanKidushLevana3Days(): Temporal.ZonedDateTime; /** * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the Mechaber. See the Bach's opinion on this time. This method returns the time * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider * displaying the next _tzais_ if the zman is between _alos_ and _tzais_. * * @return the Temporal.ZonedDateTime representing the moment 7 days after the molad. */ getTchilasZmanKidushLevana7Days(): Temporal.ZonedDateTime; /** * Returns the latest time of Kiddush Levana according to the Maharil's opinion that it is calculated as * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider * displaying _alos_ before this time if the zman is between _alos_ and _tzais_. * * @return the Temporal.ZonedDateTime representing the moment halfway between molad and molad. */ getSofZmanKidushLevanaBetweenMoldos(): Temporal.ZonedDateTime; /** * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the * Rema who brings down the opinion of the Maharil's of calculating * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} is of the opinion that Mechaber * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid * Heber's very detailed writeup in Siman Daled (chapter 4) of Shaarei Zmanim. This method returns the time even if it is during * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_ * before this time if the zman is between _alos_ and _tzais_. * * @return the Temporal.ZonedDateTime representing the moment 15 days after the molad. */ getSofZmanKidushLevana15Days(): Temporal.ZonedDateTime; /** * Returns a human-readable, localized string announcing the molad — * suitable for use on Shabbat Mevarchim. The format includes the Hebrew * month name, day of week, hour : minute, and chalakim if non-zero. * * Time format honors `options.hour12` and `options.location` (12-hour vs. * 24-hour); see {@link HebrewCalendar.reformatTimeStr}. * @example * import {Molad, months} from '@hebcal/core'; * const m = new Molad(5784, months.NISAN); * m.render('en', {hour12: true}); * // => 'Molad Nisan: Mon, 7:21pm and 6 chalakim' * m.render('he'); * // => 'מוֹלָד נִיסָן יִהְיֶה בַּיּוֹם שֵׁנִי בשָׁבוּעַ, …' * @param [locale] Optional locale name (defaults to empty locale) * @param options used for time formatting (12-hour vs 24-hour) */ render(locale?: string, options?: CalOptions): string; } /** Represents a Molad announcement on Shabbat Mevarchim */ export declare class MoladEvent extends Event { readonly molad: Molad; private readonly options; /** * @param date Hebrew date event occurs * @param hyear molad year * @param hmonth molad month * @param options */ constructor(date: HDate, hyear: number, hmonth: number, options: CalOptions); /** * @param [locale] Optional locale name (defaults to empty locale) */ render(locale?: string): string; }