@hebcal/leyning 4.20.0 → 5.1.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/leyning.d.ts CHANGED
@@ -28,8 +28,11 @@ declare module '@hebcal/leyning' {
28
28
  * Leyning for a parsha hashavua or holiday
29
29
  */
30
30
  export type Leyning = {
31
+ /** Name of the parsha hashavua or holiday */
31
32
  name: {
33
+ /** English */
32
34
  en: string;
35
+ /** Hebrew (with nikud) */
33
36
  he: string;
34
37
  };
35
38
  /** An array of either 1 (regular) or 2 (doubled parsha). `undefined` for holiday readings */
@@ -78,24 +81,6 @@ declare module '@hebcal/leyning' {
78
81
  */
79
82
  export function getLeyningOnDate(hdate: HDate, il: boolean): Leyning;
80
83
 
81
- /**
82
- * Represents triennial aliyot for a given date
83
- */
84
- export type TriennialAliyot = {
85
- /** Map of aliyot `1` through `7` plus `M` for maftir */
86
- aliyot: AliyotMap;
87
- /** year number, 0-2 */
88
- yearNum: number;
89
- /** Shabbat date for when this parsha is read in this 3-year cycle */
90
- date: Date;
91
- /** true if a double parsha is read separately in year `yearNum` */
92
- readSeparately?: boolean;
93
- /** Shabbat date of the first part of a read-separately aliyah pair */
94
- date1?: Date;
95
- /** Shabbat date of the second part of a read-separately aliyah pair */
96
- date2?: Date;
97
- };
98
-
99
84
  /**
100
85
  * Makes a summary of the leyning, like "Genesis 6:9-11:32"
101
86
  */
@@ -153,6 +138,24 @@ declare module '@hebcal/leyning' {
153
138
  */
154
139
  export function formatAliyahShort(aliyah: Aliyah, showBook: boolean): string;
155
140
 
141
+ /**
142
+ * Represents triennial aliyot for a given date
143
+ */
144
+ export type TriennialAliyot = {
145
+ /** Map of aliyot `1` through `7` plus `M` for maftir */
146
+ aliyot: AliyotMap;
147
+ /** year number, 0-2 */
148
+ yearNum: number;
149
+ /** Shabbat date for when this parsha is read in this 3-year cycle */
150
+ date: Date;
151
+ /** true if a double parsha is read separately in year `yearNum` */
152
+ readSeparately?: boolean;
153
+ /** Shabbat date of the first part of a read-separately aliyah pair */
154
+ date1?: Date;
155
+ /** Shabbat date of the second part of a read-separately aliyah pair */
156
+ date2?: Date;
157
+ };
158
+
156
159
  /**
157
160
  * Triennial Torah readings
158
161
  */
@@ -182,26 +185,56 @@ declare module '@hebcal/leyning' {
182
185
  /**
183
186
  * Looks up triennial leyning for a regular Shabbat parsha.
184
187
  * @param ev - the Hebcal event associated with this parsha
185
- * @param [context] returns a reading wrapper object which includes `date`, `yearNum` and `aliyot`
186
188
  * @returns a map of aliyot 1-7 plus "M"
187
189
  */
188
- export function getTriennialForParshaHaShavua(ev: Event, context?: boolean): AliyotMap|TriennialAliyot;
190
+ export function getTriennialForParshaHaShavua(ev: Event): TriennialAliyot;
189
191
 
190
192
  export function getTriennialHaftaraForHoliday(holiday: string, yearNum: number): any;
191
193
 
192
- export const parshiyot: any;
193
- export const holidayReadings: any;
194
+ /**
195
+ * Names of the books of the Torah. BOOK[1] === 'Genesis'
196
+ */
194
197
  export const BOOK: string[];
195
198
 
196
199
  export function writeTriennialCsv(stream: WriteStream, hyear: number): void;
197
200
  export function writeFullKriyahCsv(stream: WriteStream, hyear: number, il: boolean): void;
198
201
 
199
202
  /**
200
- * Makes Sefaria links by adding `href`, `verses` and `num` attributes to each aliyah.
201
- * CAUTION: Modifies the `aliyot` parameter instead of making a copy.
202
- * @deprecated
203
- * @param aliyot - aliyah map to decorate
204
- * @param showBook - display the book name in the `verses` field (e.g. for special Maftir)
203
+ * Parsha metadata (underlying JSON object)
204
+ */
205
+ export type ParshaMeta = {
206
+ /** 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings */
207
+ num: number;
208
+ /** parsha name in Hebrew with niqud */
209
+ hebrew: string;
210
+ /** 1 for Genesis, 2 for Exodus, 5 for Deuteronomy */
211
+ book: number;
212
+ /** Haftarah object(s) */
213
+ haft: Aliyah | Aliyah[];
214
+ /** Haftarah object(s) for Sephardim */
215
+ seph?: Aliyah | Aliyah[];
216
+ /** Raw map of Shabbat aliyot `1` through `7` plus `M` for maftir */
217
+ fullkriyah: {
218
+ [key: string]: string[];
219
+ };
220
+ /** weekday - raw map of weekday Torah Readings aliyot `1` through `3` for Mon & Thu */
221
+ weekday: {
222
+ [key: string]: string[];
223
+ };
224
+ };
225
+
226
+ /**
227
+ * Returns raw parsha metadata
228
+ */
229
+ export function lookupParsha(parsha: string | string[]): ParshaMeta;
230
+
231
+ /**
232
+ * Is there a special festival Torah Reading for `holiday`?
233
+ */
234
+ export function hasFestival(holiday: string): boolean;
235
+
236
+ /**
237
+ * Returns the raw metadata for festival reading for `holiday`
205
238
  */
206
- export function addSefariaLinksToLeyning(aliyot: AliyotMap, showBook: boolean): void;
239
+ export function lookupFestival(holiday: string): any;
207
240
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/leyning",
3
- "version": "4.20.0",
3
+ "version": "5.1.0",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "hebcal",
@@ -52,7 +52,7 @@
52
52
  "verbose": true
53
53
  },
54
54
  "devDependencies": {
55
- "@babel/core": "^7.18.10",
55
+ "@babel/core": "^7.18.13",
56
56
  "@babel/preset-env": "^7.18.10",
57
57
  "@babel/register": "^7.18.9",
58
58
  "@rollup/plugin-babel": "^5.3.1",