@hebcal/core 3.50.3 → 4.0.0

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/hebcal.d.ts CHANGED
@@ -29,6 +29,7 @@ declare module '@hebcal/core' {
29
29
  observedInDiaspora(): boolean;
30
30
  observedIn(il: boolean): boolean;
31
31
  clone(): Event;
32
+ getCategories(): string[];
32
33
  readonly date: Date;
33
34
  readonly desc: string;
34
35
  readonly mask: number;
@@ -130,7 +131,7 @@ declare module '@hebcal/core' {
130
131
  /**
131
132
  * Renders this Hebrew date in Hebrew gematriya, regardless of locale.
132
133
  */
133
- renderGematriya(): string;
134
+ renderGematriya(suppressNikud?: boolean): string;
134
135
 
135
136
  before(day: number): HDate;
136
137
  onOrBefore(day: number): HDate;
@@ -522,6 +523,10 @@ declare module '@hebcal/core' {
522
523
  dd: number;
523
524
  };
524
525
 
526
+ export interface DailyLearningOptions {
527
+ [key: string]: any;
528
+ }
529
+
525
530
  /**
526
531
  * Options to configure which events are returned
527
532
  */
@@ -573,16 +578,6 @@ declare module '@hebcal/core' {
573
578
  noSpecialShabbat?: boolean;
574
579
  /** suppress regular holidays */
575
580
  noHolidays?: boolean;
576
- /** Babylonian Talmud Daf Yomi */
577
- dafyomi?: boolean;
578
- /** Jerusalem Talmud (Yerushalmi) Yomi */
579
- yerushalmi?: boolean;
580
- /** Use 1 for Vilna, 2 for Schottenstein */
581
- yerushalmiEdition?: number;
582
- /** include Mishna Yomi */
583
- mishnaYomi?: boolean;
584
- /** include Nach Yomi */
585
- nachYomi?: boolean;
586
581
  /** include Days of the Omer */
587
582
  omer?: boolean;
588
583
  /** include event announcing the molad */
@@ -617,6 +612,12 @@ declare module '@hebcal/core' {
617
612
  * Possible values are `true` and `false`; the default is locale dependent.
618
613
  */
619
614
  hour12?: boolean;
615
+ /**
616
+ * map of options to enable daily study calendars such as `dafYomi`, `mishnaYomi`,
617
+ * `nachYomi`, etc. with value `true`.
618
+ * For `yerushalmi` the value should be a `number` for edition (`1` for Vilna, `2` for Schottenstein).
619
+ */
620
+ dailyLearning?: DailyLearningOptions;
620
621
  };
621
622
 
622
623
  export type TachanunResult = {
@@ -802,24 +803,6 @@ declare module '@hebcal/core' {
802
803
  getChalakim(): number;
803
804
  }
804
805
 
805
- /**
806
- * Returns the Daf Yomi for given date
807
- */
808
- export class DafYomi {
809
- /**
810
- * Initializes a daf yomi instance
811
- * @param gregdate Gregorian date
812
- */
813
- constructor(gregdate: Date);
814
- getBlatt(): number;
815
- getName(): string;
816
- /**
817
- * Formats (with translation) the dafyomi result as a string like "Pesachim 34"
818
- * @param [locale] Optional locale name (defaults to active locale).
819
- */
820
- render(locale?: string): string;
821
- }
822
-
823
806
  /**
824
807
  * Gregorian date helper functions.
825
808
  */
@@ -1008,13 +991,6 @@ declare module '@hebcal/core' {
1008
991
  constructor(date: HDate, mask: number, eventTime: Date, location: Location, linkedEvent?: Event);
1009
992
  getEmoji(): string;
1010
993
  }
1011
- export class DafYomiEvent extends Event {
1012
- constructor(date: HDate);
1013
- render(locale?: string): string;
1014
- renderBrief(locale?: string): string;
1015
- url(): string;
1016
- readonly daf: DafYomi;
1017
- }
1018
994
  export class HavdalahEvent extends TimedEvent {
1019
995
  constructor(date: HDate, mask: number, eventTime: Date, location: Location, havdalahMins?: number, linkedEvent?: Event);
1020
996
  render(locale?: string): string;
@@ -1106,77 +1082,16 @@ declare module '@hebcal/core' {
1106
1082
  export function gematriya(number: number): string;
1107
1083
 
1108
1084
  /**
1109
- * Describes a mishna to be read
1110
- * @property k - tractate name in Sephardic transliteration (e.g. "Berakhot", "Moed Katan")
1111
- * @property v - verse (e.g. "2:1")
1085
+ * Daf Yomi, Mishna Yomi, Nach Yomi, etc.
1112
1086
  */
1113
- export type MishnaYomi = {
1114
- k: string;
1115
- v: string;
1116
- };
1117
- /**
1118
- * Initializes a Mishna Yomi instance
1119
- */
1120
- export class MishnaYomiIndex {
1087
+ export class DailyLearning {
1121
1088
  /**
1122
- * Looks up a Mishna Yomi
1123
- * @param date - Gregorian date
1089
+ * Register a new learning calendar.
1124
1090
  */
1125
- lookup(date: Date | HDate | number): MishnaYomi[];
1126
- }
1127
- /**
1128
- * Event wrapper around a Mishna Yomi instance
1129
- */
1130
- export class MishnaYomiEvent {
1131
- constructor(date: HDate, mishnaYomi: MishnaYomi[]);
1091
+ static addCalendar(name: string, calendar: Function): void;
1132
1092
  /**
1133
- * Returns Mishna Yomi name (e.g. "Bava Metzia 10:5-6" or "Berakhot 9:5-Peah 1:1").
1134
- * @param [locale] - Optional locale name (defaults to active locale).
1093
+ * Returns an event from daily calendar for a given date
1135
1094
  */
1136
- render(locale?: string): string;
1137
- /**
1138
- * Returns a link to sefaria.org
1139
- */
1140
- url(): string;
1141
- readonly mishnaYomi: MishnaYomi[];
1142
- }
1143
-
1144
- /**
1145
- * Using the Vilna edition, the Yerushalmi Daf Yomi program takes
1146
- * ~4.25 years or 51 months.
1147
- * Unlike the Daf Yomi Bavli cycle, this Yerushalmi cycle skips both
1148
- * Yom Kippur and Tisha B'Av (returning `null`).
1149
- * The page numbers are according to the Vilna
1150
- * Edition which is used since 1900.
1151
- *
1152
- * The Schottenstein edition uses different page numbers and takes
1153
- * ~6 years to complete.
1154
- *
1155
- * Throws an exception if the date is before Daf Yomi Yerushalmi
1156
- * cycle began (2 February 1980 for Vilna,
1157
- * 14 November 2022 for Schottenstein).
1158
- *
1159
- * @param date - Hebrew or Gregorian date
1160
- * @param config - either vilna or schottenstein
1161
- */
1162
- export function yerushalmiYomi(date: Date | HDate | number, config: any): any;
1163
- /** Yerushalmi Yomi configuration for Vilna Edition */
1164
- export const vilna: any;
1165
- /** Yerushalmi Yomi configuration for Schottenstein Edition */
1166
- export const schottenstein: any;
1167
-
1168
- /**
1169
- * Event wrapper around a Yerushalmi Yomi result
1170
- */
1171
- export class YerushalmiYomiEvent {
1172
- constructor(date: HDate, daf: any);
1173
- /**
1174
- * Returns name of tractate and page (e.g. "Yerushalmi Beitzah 21").
1175
- * @param [locale] - Optional locale name (defaults to active locale).
1176
- */
1177
- render(locale?: string): string;
1178
- renderBrief(locale?: string): string;
1179
- url(): string;
1180
- readonly daf: any;
1095
+ static lookup(name: string, hd: HDate): Event;
1181
1096
  }
1182
1097
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "3.50.3",
3
+ "version": "4.0.0",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",
@@ -67,24 +67,24 @@
67
67
  "verbose": true
68
68
  },
69
69
  "devDependencies": {
70
- "@babel/core": "^7.20.12",
71
- "@babel/preset-env": "^7.20.2",
72
- "@babel/register": "^7.18.9",
70
+ "@babel/core": "^7.21.4",
71
+ "@babel/preset-env": "^7.21.4",
72
+ "@babel/register": "^7.21.0",
73
73
  "@hebcal/solar-calc": "^1.1.2",
74
74
  "@rollup/plugin-babel": "^6.0.3",
75
- "@rollup/plugin-commonjs": "^24.0.0",
75
+ "@rollup/plugin-commonjs": "^24.1.0",
76
76
  "@rollup/plugin-json": "^6.0.0",
77
- "@rollup/plugin-node-resolve": "^15.0.1",
78
- "@rollup/plugin-terser": "^0.3.0",
79
- "ava": "^5.1.1",
77
+ "@rollup/plugin-node-resolve": "^15.0.2",
78
+ "@rollup/plugin-terser": "^0.4.1",
79
+ "ava": "^5.2.0",
80
80
  "codecov": "^3.8.3",
81
- "core-js": "^3.27.2",
82
- "eslint": "^8.32.0",
81
+ "core-js": "^3.30.1",
82
+ "eslint": "^8.39.0",
83
83
  "eslint-config-google": "^0.14.0",
84
- "jsdoc": "^4.0.0",
84
+ "jsdoc": "^4.0.2",
85
85
  "jsdoc-to-markdown": "^8.0.0",
86
86
  "nyc": "^15.1.0",
87
- "rollup": "^3.10.0",
87
+ "rollup": "^3.21.0",
88
88
  "ttag-cli": "^1.10.5"
89
89
  }
90
90
  }