@hebcal/core 5.4.1 → 5.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/candles.d.ts CHANGED
@@ -3,18 +3,19 @@ import { CalOptions } from './CalOptions';
3
3
  import { Location } from './location';
4
4
  import { Event } from './event';
5
5
  import { HolidayEvent } from './HolidayEvent';
6
+ import { TimedEvent } from './TimedEvent';
6
7
  /**
7
8
  * @private
8
9
  */
9
- export declare function makeCandleEvent(ev: Event | undefined, hd: HDate, options: CalOptions, isFriday: boolean, isSaturday: boolean): Event | null;
10
+ export declare function makeCandleEvent(ev: Event | undefined, hd: HDate, options: CalOptions, isFriday: boolean, isSaturday: boolean): TimedEvent | undefined;
10
11
  /**
11
12
  * Makes a pair of events representing fast start and end times
12
13
  * @private
13
14
  */
14
15
  export declare function makeFastStartEnd(ev: HolidayEvent, options: CalOptions): HolidayEvent;
15
- export declare class ChanukahEvent extends HolidayEvent {
16
- readonly eventTime: Date;
17
- readonly eventTimeStr: string;
16
+ export declare class TimedChanukahEvent extends HolidayEvent {
17
+ eventTime: Date;
18
+ eventTimeStr: string;
18
19
  readonly location: Location;
19
20
  constructor(date: HDate, desc: string, mask: number, eventTime: Date, location: Location);
20
21
  }
@@ -24,4 +25,4 @@ export declare class ChanukahEvent extends HolidayEvent {
24
25
  * Another source suggests 4.6667 degrees below horizon.
25
26
  * @private
26
27
  */
27
- export declare function makeWeekdayChanukahCandleLighting(ev: Event, hd: HDate, options: CalOptions): ChanukahEvent | null;
28
+ export declare function makeWeekdayChanukahCandleLighting(ev: HolidayEvent, hd: HDate, options: CalOptions): TimedChanukahEvent | null;
package/dist/event.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
+ import './locale';
2
3
  /**
3
4
  * Holiday flags for Event
4
5
  * @readonly
@@ -0,0 +1,292 @@
1
+ declare const _default: {
2
+ headers: {
3
+ "plural-forms": string;
4
+ };
5
+ contexts: {
6
+ "": {
7
+ Shabbat: string[];
8
+ "Daf Yomi": string[];
9
+ Parashat: string[];
10
+ "Achrei Mot": string[];
11
+ Balak: string[];
12
+ Bamidbar: string[];
13
+ Bechukotai: string[];
14
+ "Beha'alotcha": string[];
15
+ Behar: string[];
16
+ Bereshit: string[];
17
+ Beshalach: string[];
18
+ Bo: string[];
19
+ "Chayei Sara": string[];
20
+ Chukat: string[];
21
+ Devarim: string[];
22
+ Eikev: string[];
23
+ Emor: string[];
24
+ "Ha'azinu": string[];
25
+ Kedoshim: string[];
26
+ "Ki Tavo": string[];
27
+ "Ki Teitzei": string[];
28
+ "Ki Tisa": string[];
29
+ Korach: string[];
30
+ "Lech-Lecha": string[];
31
+ Masei: string[];
32
+ Matot: string[];
33
+ Metzora: string[];
34
+ Miketz: string[];
35
+ Mishpatim: string[];
36
+ Nasso: string[];
37
+ Nitzavim: string[];
38
+ Noach: string[];
39
+ Pekudei: string[];
40
+ Pinchas: string[];
41
+ "Re'eh": string[];
42
+ "Sh'lach": string[];
43
+ Shemot: string[];
44
+ Shmini: string[];
45
+ Shoftim: string[];
46
+ Tazria: string[];
47
+ Terumah: string[];
48
+ Tetzaveh: string[];
49
+ Toldot: string[];
50
+ Tzav: string[];
51
+ Vaera: string[];
52
+ Vaetchanan: string[];
53
+ Vayakhel: string[];
54
+ Vayechi: string[];
55
+ Vayeilech: string[];
56
+ Vayera: string[];
57
+ Vayeshev: string[];
58
+ Vayetzei: string[];
59
+ Vayigash: string[];
60
+ Vayikra: string[];
61
+ Vayishlach: string[];
62
+ "Vezot Haberakhah": string[];
63
+ Yitro: string[];
64
+ "Asara B'Tevet": string[];
65
+ "Candle lighting": string[];
66
+ Chanukah: string[];
67
+ "Chanukah: 1 Candle": string[];
68
+ "Chanukah: 2 Candles": string[];
69
+ "Chanukah: 3 Candles": string[];
70
+ "Chanukah: 4 Candles": string[];
71
+ "Chanukah: 5 Candles": string[];
72
+ "Chanukah: 6 Candles": string[];
73
+ "Chanukah: 7 Candles": string[];
74
+ "Chanukah: 8 Candles": string[];
75
+ "Chanukah: 8th Day": string[];
76
+ "Days of the Omer": string[];
77
+ Omer: string[];
78
+ "day of the Omer": string[];
79
+ "Erev Pesach": string[];
80
+ "Erev Purim": string[];
81
+ "Erev Rosh Hashana": string[];
82
+ "Erev Shavuot": string[];
83
+ "Erev Simchat Torah": string[];
84
+ "Erev Sukkot": string[];
85
+ "Erev Tish'a B'Av": string[];
86
+ "Erev Yom Kippur": string[];
87
+ Havdalah: string[];
88
+ "Lag BaOmer": string[];
89
+ "Leil Selichot": string[];
90
+ Pesach: string[];
91
+ "Pesach I": string[];
92
+ "Pesach II": string[];
93
+ "Pesach II (CH''M)": string[];
94
+ "Pesach III (CH''M)": string[];
95
+ "Pesach IV (CH''M)": string[];
96
+ "Pesach Sheni": string[];
97
+ "Pesach V (CH''M)": string[];
98
+ "Pesach VI (CH''M)": string[];
99
+ "Pesach VII": string[];
100
+ "Pesach VIII": string[];
101
+ Purim: string[];
102
+ "Purim Katan": string[];
103
+ "Rosh Chodesh %s": string[];
104
+ "Rosh Chodesh": string[];
105
+ "Rosh Hashana": string[];
106
+ "Rosh Hashana I": string[];
107
+ "Rosh Hashana II": string[];
108
+ "Shabbat Chazon": string[];
109
+ "Shabbat HaChodesh": string[];
110
+ "Shabbat HaGadol": string[];
111
+ "Shabbat Machar Chodesh": string[];
112
+ "Shabbat Nachamu": string[];
113
+ "Shabbat Parah": string[];
114
+ "Shabbat Rosh Chodesh": string[];
115
+ "Shabbat Shekalim": string[];
116
+ "Shabbat Shuva": string[];
117
+ "Shabbat Zachor": string[];
118
+ Shavuot: string[];
119
+ "Shavuot I": string[];
120
+ "Shavuot II": string[];
121
+ "Shmini Atzeret": string[];
122
+ "Shushan Purim": string[];
123
+ Sigd: string[];
124
+ "Simchat Torah": string[];
125
+ Sukkot: string[];
126
+ "Sukkot I": string[];
127
+ "Sukkot II": string[];
128
+ "Sukkot II (CH''M)": string[];
129
+ "Sukkot III (CH''M)": string[];
130
+ "Sukkot IV (CH''M)": string[];
131
+ "Sukkot V (CH''M)": string[];
132
+ "Sukkot VI (CH''M)": string[];
133
+ "Sukkot VII (Hoshana Raba)": string[];
134
+ "Ta'anit Bechorot": string[];
135
+ "Ta'anit Esther": string[];
136
+ "Tish'a B'Av": string[];
137
+ "Tu B'Av": string[];
138
+ "Tu BiShvat": string[];
139
+ "Tu B'Shvat": string[];
140
+ "Tzom Gedaliah": string[];
141
+ "Tzom Tammuz": string[];
142
+ "Yom HaAtzma'ut": string[];
143
+ "Yom HaShoah": string[];
144
+ "Yom HaZikaron": string[];
145
+ "Yom Kippur": string[];
146
+ "Yom Yerushalayim": string[];
147
+ "Yom HaAliyah": string[];
148
+ "Yom HaAliyah School Observance": string[];
149
+ "Pesach I (on Shabbat)": string[];
150
+ "Pesach Chol ha-Moed Day 1": string[];
151
+ "Pesach Chol ha-Moed Day 2": string[];
152
+ "Pesach Chol ha-Moed Day 3": string[];
153
+ "Pesach Chol ha-Moed Day 4": string[];
154
+ "Pesach Chol ha-Moed Day 5": string[];
155
+ "Pesach Shabbat Chol ha-Moed": string[];
156
+ "Shavuot II (on Shabbat)": string[];
157
+ "Rosh Hashana I (on Shabbat)": string[];
158
+ "Yom Kippur (on Shabbat)": string[];
159
+ "Yom Kippur (Mincha, Traditional)": string[];
160
+ "Yom Kippur (Mincha, Alternate)": string[];
161
+ "Sukkot I (on Shabbat)": string[];
162
+ "Sukkot Chol ha-Moed Day 1": string[];
163
+ "Sukkot Chol ha-Moed Day 2": string[];
164
+ "Sukkot Chol ha-Moed Day 3": string[];
165
+ "Sukkot Chol ha-Moed Day 4": string[];
166
+ "Sukkot Chol ha-Moed Day 5": string[];
167
+ "Sukkot Shabbat Chol ha-Moed": string[];
168
+ "Sukkot Final Day (Hoshana Raba)": string[];
169
+ "Rosh Chodesh Adar": string[];
170
+ "Rosh Chodesh Adar I": string[];
171
+ "Rosh Chodesh Adar II": string[];
172
+ "Rosh Chodesh Av": string[];
173
+ "Rosh Chodesh Cheshvan": string[];
174
+ "Rosh Chodesh Elul": string[];
175
+ "Rosh Chodesh Iyyar": string[];
176
+ "Rosh Chodesh Kislev": string[];
177
+ "Rosh Chodesh Nisan": string[];
178
+ "Rosh Chodesh Sh'vat": string[];
179
+ "Rosh Chodesh Sivan": string[];
180
+ "Rosh Chodesh Tamuz": string[];
181
+ "Rosh Chodesh Tevet": string[];
182
+ min: string[];
183
+ "Fast begins": string[];
184
+ "Fast ends": string[];
185
+ "Rosh Hashana LaBehemot": string[];
186
+ "Tish'a B'Av (observed)": string[];
187
+ "Shabbat Mevarchim Chodesh": string[];
188
+ "Shabbat Shirah": string[];
189
+ "Chatzot HaLailah": string[];
190
+ "Alot haShachar": string[];
191
+ Misheyakir: string[];
192
+ "Misheyakir Machmir": string[];
193
+ Dawn: string[];
194
+ Sunrise: string[];
195
+ "Kriat Shema, sof zeman": string[];
196
+ "Tefilah, sof zeman": string[];
197
+ "Kriat Shema, sof zeman (MGA)": string[];
198
+ "Tefilah, sof zeman (MGA)": string[];
199
+ "Chatzot hayom": string[];
200
+ "Mincha Gedolah": string[];
201
+ "Mincha Ketanah": string[];
202
+ "Plag HaMincha": string[];
203
+ Dusk: string[];
204
+ Sunset: string[];
205
+ "Nightfall - End of ordained fasts": string[];
206
+ "Tzeit HaKochavim": string[];
207
+ Lovingkindness: string[];
208
+ Might: string[];
209
+ Beauty: string[];
210
+ Eternity: string[];
211
+ Splendor: string[];
212
+ Foundation: string[];
213
+ Majesty: string[];
214
+ day: string[];
215
+ "Chanukah Day 1": string[];
216
+ "Chanukah Day 2": string[];
217
+ "Chanukah Day 3": string[];
218
+ "Chanukah Day 4": string[];
219
+ "Chanukah Day 5": string[];
220
+ "Chanukah Day 6": string[];
221
+ "Chanukah Day 7": string[];
222
+ "Chanukah Day 7 (on Rosh Chodesh)": string[];
223
+ "Chanukah Day 8": string[];
224
+ "Chanukah Day 1 (on Shabbat)": string[];
225
+ "Chanukah Day 2 (on Shabbat)": string[];
226
+ "Chanukah Day 3 (on Shabbat)": string[];
227
+ "Chanukah Day 4 (on Shabbat)": string[];
228
+ "Chanukah Day 5 (on Shabbat)": string[];
229
+ "Chanukah Day 7 (on Shabbat)": string[];
230
+ "Chanukah Day 8 (on Shabbat)": string[];
231
+ "Shabbat Rosh Chodesh Chanukah": string[];
232
+ "Yom Kippur Katan": string[];
233
+ "Family Day": string[];
234
+ "Yitzhak Rabin Memorial Day": string[];
235
+ "Jabotinsky Day": string[];
236
+ "Herzl Day": string[];
237
+ "Ben-Gurion Day": string[];
238
+ "Hebrew Language Day": string[];
239
+ "Birkat Hachamah": string[];
240
+ "Shushan Purim Katan": string[];
241
+ "Purim Meshulash": string[];
242
+ "after sunset": string[];
243
+ Yerushalmi: string[];
244
+ "Chag HaBanot": string[];
245
+ Joshua: string[];
246
+ Judges: string[];
247
+ "I Samuel": string[];
248
+ "II Samuel": string[];
249
+ "I Kings": string[];
250
+ "II Kings": string[];
251
+ Isaiah: string[];
252
+ Jeremiah: string[];
253
+ Ezekiel: string[];
254
+ Hosea: string[];
255
+ Joel: string[];
256
+ Amos: string[];
257
+ Obadiah: string[];
258
+ Jonah: string[];
259
+ Micah: string[];
260
+ Nachum: string[];
261
+ Habakkuk: string[];
262
+ Zephaniah: string[];
263
+ Haggai: string[];
264
+ Zechariah: string[];
265
+ Malachi: string[];
266
+ Psalms: string[];
267
+ Proverbs: string[];
268
+ Job: string[];
269
+ "Song of Songs": string[];
270
+ Ruth: string[];
271
+ Lamentations: string[];
272
+ Ecclesiastes: string[];
273
+ Esther: string[];
274
+ Daniel: string[];
275
+ Ezra: string[];
276
+ Nehemiah: string[];
277
+ "I Chronicles": string[];
278
+ "II Chronicles": string[];
279
+ "Yom Kippur (Mincha)": string[];
280
+ "Tish'a B'Av (Mincha)": string[];
281
+ "Asara B'Tevet (Mincha)": string[];
282
+ "Ta'anit Bechorot (Mincha)": string[];
283
+ "Ta'anit Esther (Mincha)": string[];
284
+ "Tzom Gedaliah (Mincha)": string[];
285
+ "Tzom Tammuz (Mincha)": string[];
286
+ Molad: string[];
287
+ chalakim: string[];
288
+ "Pirkei Avot": string[];
289
+ };
290
+ };
291
+ };
292
+ export default _default;
package/dist/hebcal.d.ts CHANGED
@@ -1,10 +1,18 @@
1
+ import { HDate } from '@hebcal/hdate';
2
+ import './locale';
3
+ import { CalOptions } from './CalOptions';
4
+ import { Event } from './event';
5
+ import { Sedra } from './sedra';
6
+ import { HolidayYearMap } from './holidays';
7
+ import { HolidayEvent } from './HolidayEvent';
8
+ import { TachanunResult } from './tachanun';
1
9
  /**
2
10
  * HebrewCalendar is the main interface to the `@hebcal/core` library.
3
11
  * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,
4
12
  * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.
5
13
  * Event names can be rendered in several languges using the `locale` option.
6
14
  */
7
- export class HebrewCalendar {
15
+ export declare class HebrewCalendar {
8
16
  /**
9
17
  * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.
10
18
  *
@@ -114,7 +122,7 @@ export class HebrewCalendar {
114
122
  * @param {CalOptions} [options={}]
115
123
  * @return {Event[]}
116
124
  */
117
- static calendar(options?: import("./CalOptions").CalOptions | undefined): Event[];
125
+ static calendar(options?: CalOptions): Event[];
118
126
  /**
119
127
  * Calculates a birthday or anniversary (non-yahrzeit).
120
128
  * `hyear` must be after original `gdate` of anniversary.
@@ -139,9 +147,9 @@ export class HebrewCalendar {
139
147
  * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'
140
148
  * @param {number} hyear Hebrew year
141
149
  * @param {Date|HDate} gdate Gregorian or Hebrew date of event
142
- * @return {HDate} anniversary occurring in `hyear`
150
+ * @return {HDate | undefined} anniversary occurring in `hyear`
143
151
  */
144
- static getBirthdayOrAnniversary(hyear: number, gdate: Date | HDate): HDate;
152
+ static getBirthdayOrAnniversary(hyear: number, gdate: Date | HDate): HDate | undefined;
145
153
  /**
146
154
  * Calculates yahrzeit.
147
155
  * `hyear` must be after original `gdate` of death.
@@ -174,32 +182,32 @@ export class HebrewCalendar {
174
182
  * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'
175
183
  * @param {number} hyear Hebrew year
176
184
  * @param {Date|HDate} gdate Gregorian or Hebrew date of death
177
- * @return {HDate} anniversary occurring in hyear
185
+ * @return {HDate | undefined} anniversary occurring in hyear
178
186
  */
179
- static getYahrzeit(hyear: number, gdate: Date | HDate): HDate;
187
+ static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined;
180
188
  /**
181
189
  * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
182
190
  * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
183
191
  * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
184
192
  * @function
185
193
  * @param {number} year Hebrew year
186
- * @return {Map<string,Event[]>}
194
+ * @return {HolidayYearMap}
187
195
  */
188
- static getHolidaysForYear(year: number): Map<string, Event[]>;
196
+ static getHolidaysForYear(year: number): HolidayYearMap;
189
197
  /**
190
198
  * Returns an array of holidays for the year
191
199
  * @param {number} year Hebrew year
192
200
  * @param {boolean} il use the Israeli schedule for holidays
193
- * @return {Event[]}
201
+ * @return {HolidayEvent[]}
194
202
  */
195
- static getHolidaysForYearArray(year: number, il: boolean): Event[];
203
+ static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[];
196
204
  /**
197
205
  * Returns an array of Events on this date (or `undefined` if no events)
198
206
  * @param {HDate|Date|number} date Hebrew Date, Gregorian date, or absolute R.D. day number
199
207
  * @param {boolean} [il] use the Israeli schedule for holidays
200
- * @return {Event[]}
208
+ * @return {HolidayEvent[] | undefined}
201
209
  */
202
- static getHolidaysOnDate(date: HDate | Date | number, il?: boolean | undefined): Event[];
210
+ static getHolidaysOnDate(date: HDate | Date | number, il?: boolean): HolidayEvent[] | undefined;
203
211
  /**
204
212
  * Eruv Tavshilin
205
213
  * @param {Date | HDate} date
@@ -270,20 +278,3 @@ export class HebrewCalendar {
270
278
  */
271
279
  static tachanun(hdate: HDate, il: boolean): TachanunResult;
272
280
  }
273
- export type CalOptions = import('./CalOptions').CalOptions;
274
- export type TachanunResult = {
275
- /**
276
- * Tachanun is said at Shacharit
277
- */
278
- shacharit: boolean;
279
- /**
280
- * Tachanun is said at Mincha
281
- */
282
- mincha: boolean;
283
- /**
284
- * All congregations say Tachanun on the day
285
- */
286
- allCongs: boolean;
287
- };
288
- export type Event = import('./event').Event;
289
- import { HDate } from '@hebcal/hdate';
@@ -1,32 +1,9 @@
1
+ import { HolidayEvent } from './HolidayEvent';
2
+ export type HolidayYearMap = Map<string, HolidayEvent[]>;
1
3
  /**
2
4
  * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
3
5
  * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`
4
6
  * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.
5
7
  * @private
6
- * @param {number} year Hebrew year
7
- * @return {Map<string,Event[]>}
8
8
  */
9
- export function getHolidaysForYear_(year: number): Map<string, Event[]>;
10
- /** Represents Rosh Chodesh, the beginning of a new month */
11
- export class RoshChodeshEvent extends HolidayEvent {
12
- /**
13
- * Constructs Rosh Chodesh event
14
- * @param {HDate} date Hebrew date event occurs
15
- * @param {string} monthName Hebrew month name (not translated)
16
- */
17
- constructor(date: HDate, monthName: string);
18
- }
19
- /** Represents Rosh Hashana, the Jewish New Year */
20
- export class RoshHashanaEvent extends HolidayEvent {
21
- /**
22
- * @private
23
- * @param {HDate} date Hebrew date event occurs
24
- * @param {number} hyear Hebrew year
25
- * @param {number} mask optional holiday flags
26
- */
27
- private constructor();
28
- hyear: number;
29
- }
30
- export const NISAN: number;
31
- import { HolidayEvent } from './HolidayEvent';
32
- import { HDate } from '@hebcal/hdate';
9
+ export declare function getHolidaysForYear_(year: number): HolidayYearMap;