@hebcal/core 5.3.13 → 5.4.1

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.
Files changed (43) hide show
  1. package/README.md +253 -175
  2. package/dist/CalOptions.d.ts +157 -0
  3. package/dist/DailyLearning.d.ts +2 -1
  4. package/dist/HebrewDateEvent.d.ts +27 -2
  5. package/dist/HolidayEvent.d.ts +45 -0
  6. package/dist/MevarchimChodeshEvent.d.ts +27 -0
  7. package/dist/ParshaEvent.d.ts +18 -8
  8. package/dist/TimedEvent.d.ts +53 -0
  9. package/dist/YomKippurKatanEvent.d.ts +27 -0
  10. package/dist/bundle.js +11183 -11935
  11. package/dist/bundle.min.js +2 -2
  12. package/dist/candles.d.ts +14 -61
  13. package/dist/event.d.ts +73 -42
  14. package/dist/getStartAndEnd.d.ts +6 -0
  15. package/dist/hallel.d.ts +3 -1
  16. package/dist/hebcal.d.ts +11 -166
  17. package/dist/holidays.d.ts +3 -36
  18. package/dist/index.cjs +3522 -4561
  19. package/dist/index.d.ts +15 -15
  20. package/dist/index.mjs +3525 -4564
  21. package/dist/location.d.ts +4 -4
  22. package/dist/modern.d.ts +3 -3
  23. package/dist/molad.d.ts +14 -13
  24. package/dist/omer.d.ts +23 -5
  25. package/dist/pkgVersion.d.ts +1 -1
  26. package/dist/reformatTimeStr.d.ts +2 -1
  27. package/dist/sedra.d.ts +2 -105
  28. package/dist/staticHolidays.d.ts +165 -201
  29. package/dist/tachanun.d.ts +10 -8
  30. package/dist/zmanim.d.ts +40 -39
  31. package/package.json +12 -22
  32. package/dist/ashkenazi.po.d.ts +0 -68
  33. package/dist/dateFormat.d.ts +0 -33
  34. package/dist/hdate.d.ts +0 -395
  35. package/dist/he.po.d.ts +0 -306
  36. package/dist/locale-ashkenazi.d.ts +0 -1
  37. package/dist/locale-he.d.ts +0 -1
  38. package/dist/locale.d.ts +0 -80
  39. package/dist/staticHols.d.ts +0 -175
  40. package/dist/throwTypeError.d.ts +0 -5
  41. package/po/ashkenazi.po +0 -195
  42. package/po/he.min.po +0 -50
  43. package/po/he.po +0 -931
package/dist/zmanim.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import 'temporal-polyfill/global';
2
+ import { GeoLocation } from '@hebcal/noaa';
3
+ import { HDate } from '@hebcal/hdate';
1
4
  /**
2
5
  * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
3
6
  * Calculations are available for tzeit / tzais (nightfall),
@@ -24,34 +27,11 @@
24
27
  * const candleLighting = zmanim.sunsetOffset(-18, true);
25
28
  * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
26
29
  */
27
- export class Zmanim {
28
- /**
29
- * Uses timeFormat to return a date like '20:34'
30
- * @param {Date} dt
31
- * @param {Intl.DateTimeFormat} timeFormat
32
- * @return {string}
33
- */
34
- static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string;
35
- /**
36
- * Discards seconds, rounding to nearest minute.
37
- * @param {Date} dt
38
- * @return {Date}
39
- */
40
- static roundTime(dt: Date): Date;
41
- /**
42
- * Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
43
- * @param {string} tzid
44
- * @param {Date} date
45
- * @return {string}
46
- */
47
- static timeZoneOffset(tzid: string, date: Date): string;
48
- /**
49
- * Returns a string like "2022-04-01T13:06:00-11:00"
50
- * @param {string} tzid
51
- * @param {Date} date
52
- * @return {string}
53
- */
54
- static formatISOWithTimeZone(tzid: string, date: Date): string;
30
+ export declare class Zmanim {
31
+ private readonly date;
32
+ private readonly gloc;
33
+ private readonly noaa;
34
+ private useElevation;
55
35
  /**
56
36
  * Initialize a Zmanim instance.
57
37
  * @param {GeoLocation} gloc GeoLocation including latitude, longitude, and timezone
@@ -64,10 +44,6 @@ export class Zmanim {
64
44
  * These zmanim intentionally do not support elevation adjustment.
65
45
  */
66
46
  constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean);
67
- date: any;
68
- gloc: GeoLocation;
69
- noaa: NOAACalculator;
70
- useElevation: boolean;
71
47
  /**
72
48
  * Returns `true` if elevation adjustment is enabled
73
49
  * for zmanim support elevation adjustment
@@ -136,7 +112,7 @@ export class Zmanim {
136
112
  * @private
137
113
  * @return {number}
138
114
  */
139
- private nightHour;
115
+ nightHour(): number;
140
116
  /**
141
117
  * Midday – Chatzot; Sunrise plus 6 halachic hours
142
118
  * @return {Date}
@@ -175,7 +151,7 @@ export class Zmanim {
175
151
  * @param {number} hours
176
152
  * @return {Date}
177
153
  */
178
- private getShaahZmanisBasedZman;
154
+ getShaahZmanisBasedZman(hours: number): Date;
179
155
  /**
180
156
  * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.
181
157
  * If elevation is enabled, this function will include elevation in the calculation.
@@ -193,14 +169,14 @@ export class Zmanim {
193
169
  * @private
194
170
  * @return {any[]}
195
171
  */
196
- private getTemporalHour72;
172
+ getTemporalHour72(): any[];
197
173
  /**
198
174
  * Returns an array with alot (Date) and ms in hour (number)
199
175
  * @private
200
176
  * @param {number} angle
201
177
  * @return {any[]}
202
178
  */
203
- private getTemporalHourByDeg;
179
+ getTemporalHourByDeg(angle: number): any[];
204
180
  /**
205
181
  * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
206
182
  * Based on the opinion of the MGA that the day is calculated from
@@ -275,7 +251,7 @@ export class Zmanim {
275
251
  * the result is not impacted by elevation.
276
252
  * @return {Date}
277
253
  */
278
- tzeit(angle?: number | undefined): Date;
254
+ tzeit(angle?: number): Date;
279
255
  /**
280
256
  * Alias for sunrise
281
257
  * @return {Date}
@@ -296,6 +272,33 @@ export class Zmanim {
296
272
  * @return {Date}
297
273
  */
298
274
  beinHaShmashos(): Date;
275
+ /**
276
+ * Uses timeFormat to return a date like '20:34'
277
+ * @param {Date} dt
278
+ * @param {Intl.DateTimeFormat} timeFormat
279
+ * @return {string}
280
+ */
281
+ static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string;
282
+ /**
283
+ * Discards seconds, rounding to nearest minute.
284
+ * @param {Date} dt
285
+ * @return {Date}
286
+ */
287
+ static roundTime(dt: Date): Date;
288
+ /**
289
+ * Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
290
+ * @param {string} tzid
291
+ * @param {Date} date
292
+ * @return {string}
293
+ */
294
+ static timeZoneOffset(tzid: string, date: Date): string;
295
+ /**
296
+ * Returns a string like "2022-04-01T13:06:00-11:00"
297
+ * @param {string} tzid
298
+ * @param {Date} date
299
+ * @return {string}
300
+ */
301
+ static formatISOWithTimeZone(tzid: string, date: Date): string;
299
302
  /**
300
303
  * Returns sunrise + `offset` minutes (either positive or negative).
301
304
  * If elevation is enabled, this function will include elevation in the calculation
@@ -317,5 +320,3 @@ export class Zmanim {
317
320
  */
318
321
  sunsetOffset(offset: number, roundMinute?: boolean, forceSeaLevel?: boolean): Date;
319
322
  }
320
- import { NOAACalculator } from '@hebcal/noaa';
321
- import { HDate } from './hdate.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "5.3.13",
3
+ "version": "5.4.1",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",
@@ -46,54 +46,44 @@
46
46
  ],
47
47
  "scripts": {
48
48
  "build:rollup": "rollup -c",
49
- "build": "npm run po2json && npm run version && npm run build:rollup --production",
49
+ "build": "npm run version && npm run build:rollup --production",
50
50
  "prepublish": "npm run build",
51
- "po2json": "node ./po2json.cjs po/*.po",
52
51
  "version": "node ./version.cjs package.json src/pkgVersion.js",
53
52
  "readme": "cp dist/index.mjs tmp.js && npx -p jsdoc-to-markdown jsdoc2md tmp.js && rm -f tmp.js",
54
53
  "pretest": "npm run build",
55
54
  "lint": "eslint src",
56
- "coverage": "nyc --concurrency 2 ava",
57
- "test": "ava --concurrency 4"
55
+ "coverage": "jest --coverage",
56
+ "test": "jest"
58
57
  },
59
58
  "license": "GPL-2.0",
60
- "ava": {
61
- "files": [
62
- "src/**/*.spec.js"
63
- ],
64
- "require": [
65
- "@babel/register"
66
- ],
67
- "verbose": true
68
- },
69
59
  "peerDependencies": {
70
60
  "temporal-polyfill": "^0.2.4"
71
61
  },
72
62
  "devDependencies": {
73
- "@babel/core": "^7.24.5",
74
- "@babel/preset-env": "^7.24.5",
75
- "@babel/register": "^7.23.7",
76
- "@hebcal/hdate": "^0.9.6",
77
- "@hebcal/noaa": "^0.8.14",
63
+ "@babel/core": "^7.24.6",
64
+ "@babel/preset-env": "^7.24.6",
65
+ "@babel/preset-typescript": "^7.24.6",
66
+ "@babel/register": "^7.24.6",
78
67
  "@rollup/plugin-babel": "^6.0.4",
79
68
  "@rollup/plugin-commonjs": "^25.0.8",
80
69
  "@rollup/plugin-json": "^6.1.0",
81
70
  "@rollup/plugin-node-resolve": "^15.2.3",
82
71
  "@rollup/plugin-terser": "^0.4.4",
83
72
  "@rollup/plugin-typescript": "^11.1.6",
84
- "ava": "^6.1.3",
73
+ "@types/jest": "^29.5.12",
85
74
  "core-js": "^3.37.1",
86
75
  "eslint": "^8.57.0",
87
76
  "eslint-config-google": "^0.14.0",
77
+ "jest": "^29.7.0",
88
78
  "jsdoc": "^4.0.3",
89
79
  "jsdoc-to-markdown": "^8.0.1",
90
- "nyc": "^15.1.0",
91
80
  "quick-lru": "^7.0.0",
92
81
  "rollup": "^4.18.0",
93
- "ttag-cli": "^1.10.12",
94
82
  "typescript": "^5.4.5"
95
83
  },
96
84
  "dependencies": {
85
+ "@hebcal/hdate": "^0.9.13",
86
+ "@hebcal/noaa": "^0.8.14",
97
87
  "tslib": "^2.6.2"
98
88
  }
99
89
  }
@@ -1,68 +0,0 @@
1
- declare namespace _default {
2
- let headers: {
3
- "plural-forms": string;
4
- };
5
- let contexts: {
6
- "": {
7
- Shabbat: string[];
8
- "Achrei Mot": string[];
9
- Bechukotai: string[];
10
- "Beha'alotcha": string[];
11
- Bereshit: string[];
12
- Chukat: string[];
13
- "Erev Shavuot": string[];
14
- "Erev Sukkot": string[];
15
- "Ki Tavo": string[];
16
- "Ki Teitzei": string[];
17
- "Ki Tisa": string[];
18
- Matot: string[];
19
- "Purim Katan": string[];
20
- "Shabbat Chazon": string[];
21
- "Shabbat HaChodesh": string[];
22
- "Shabbat HaGadol": string[];
23
- "Shabbat Nachamu": string[];
24
- "Shabbat Parah": string[];
25
- "Shabbat Shekalim": string[];
26
- "Shabbat Shuva": string[];
27
- "Shabbat Zachor": string[];
28
- Shavuot: string[];
29
- "Shavuot I": string[];
30
- "Shavuot II": string[];
31
- Shemot: string[];
32
- "Shmini Atzeret": string[];
33
- "Simchat Torah": string[];
34
- Sukkot: string[];
35
- "Sukkot I": string[];
36
- "Sukkot II": string[];
37
- "Sukkot II (CH''M)": string[];
38
- "Sukkot III (CH''M)": string[];
39
- "Sukkot IV (CH''M)": string[];
40
- "Sukkot V (CH''M)": string[];
41
- "Sukkot VI (CH''M)": string[];
42
- "Sukkot VII (Hoshana Raba)": string[];
43
- "Ta'anit Bechorot": string[];
44
- "Ta'anit Esther": string[];
45
- Toldot: string[];
46
- Vaetchanan: string[];
47
- Yitro: string[];
48
- "Vezot Haberakhah": string[];
49
- Parashat: string[];
50
- "Leil Selichot": string[];
51
- "Shabbat Mevarchim Chodesh": string[];
52
- "Shabbat Shirah": string[];
53
- Tevet: string[];
54
- "Asara B'Tevet": string[];
55
- "Alot HaShachar": string[];
56
- "Kriat Shema, sof zeman": string[];
57
- "Tefilah, sof zeman": string[];
58
- "Kriat Shema, sof zeman (MGA)": string[];
59
- "Tefilah, sof zeman (MGA)": string[];
60
- "Chatzot HaLailah": string[];
61
- "Chatzot hayom": string[];
62
- "Tzeit HaKochavim": string[];
63
- "Birkat Hachamah": string[];
64
- "Shushan Purim Katan": string[];
65
- };
66
- };
67
- }
68
- export default _default;
@@ -1,33 +0,0 @@
1
- /**
2
- * @private
3
- * @param {string} tzid
4
- * @param {Date} date
5
- * @return {string}
6
- */
7
- export function getPseudoISO(tzid: string, date: Date): string;
8
- /**
9
- * @private
10
- * @param {string} tzid
11
- * @param {Date} date
12
- * @return {number}
13
- */
14
- export function getTimezoneOffset(tzid: string, date: Date): number;
15
- /**
16
- * @private
17
- * @param {number} number
18
- * @return {string}
19
- */
20
- export function pad4(number: number): string;
21
- /**
22
- * @private
23
- * @param {number} number
24
- * @return {string}
25
- */
26
- export function pad2(number: number): string;
27
- /**
28
- * Returns YYYY-MM-DD in the local timezone
29
- * @private
30
- * @param {Date} dt
31
- * @return {string}
32
- */
33
- export function isoDateString(dt: Date): string;