Skip to content

Commit 05094ba

Browse files
committed
Include Daf Weekly in types and exports
1 parent 714143e commit 05094ba

File tree

4 files changed

+57
-10
lines changed

4 files changed

+57
-10
lines changed

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@rollup/plugin-json": "^6.0.0",
5252
"@rollup/plugin-terser": "^0.4.3",
5353
"ava": "^5.3.1",
54-
"core-js": "^3.32.0",
54+
"core-js": "^3.32.1",
5555
"eslint": "^8.47.0",
5656
"eslint-config-google": "^0.14.0",
5757
"jsdoc": "^4.0.2",

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import './register';
2-
export {DafYomi, DafYomiEvent} from './dafyomi';
2+
export {DafPage, DafPageEvent, DafYomi, DafYomiEvent} from './dafyomi';
33
export {MishnaYomiEvent} from './MishnaYomiEvent';
44
export {MishnaYomiIndex, mishnaYomiStart} from './mishnaYomi';
55
export {NachYomiEvent} from './NachYomiEvent';
@@ -9,3 +9,4 @@ export {chofetzChaim, ChofetzChaimEvent} from './chofetzChaim';
99
export {dailyRambam1, DailyRambamEvent} from './rambam';
1010
export {shemiratHaLashon, ShemiratHaLashonEvent} from './shemiratHaLashon';
1111
export {dailyPsalms, PsalmsEvent} from './psalms';
12+
export {dafWeekly, DafWeeklyEvent, dafWeeklyStart} from './dafWeekly';

types.d.ts

+48-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,42 @@
33
import {HDate, Event} from '@hebcal/core';
44

55
declare module '@hebcal/learning' {
6+
export class DafPage {
7+
constructor(name: string, blatt: number);
8+
getBlatt(): number;
9+
getName(): string;
10+
/**
11+
* Formats (with translation) the dafyomi result as a string like "Pesachim 34"
12+
* @param [locale] - Optional locale name (defaults to active locale).
13+
*/
14+
render(locale?: string): string;
15+
}
16+
17+
/**
18+
* Event wrapper around a DafPage instance
19+
*/
20+
export class DafPageEvent extends Event {
21+
constructor(date: HDate, daf: DafPage);
22+
/**
23+
* Returns Daf Yomi name including the 'Daf Yomi: ' prefix (e.g. "Daf Yomi: Pesachim 107").
24+
* @param [locale] - Optional locale name (defaults to active locale).
25+
*/
26+
render(locale?: string): string;
27+
/**
28+
* Returns Daf Yomi name without the 'Daf Yomi: ' prefix (e.g. "Pesachim 107").
29+
* @param [locale] - Optional locale name (defaults to active locale).
30+
*/
31+
renderBrief(locale?: string): string;
32+
/**
33+
* Returns a link to sefaria.org or dafyomi.org
34+
*/
35+
url(): string;
36+
}
37+
638
/**
739
* Returns the Daf Yomi for given date
840
*/
9-
export class DafYomi {
41+
export class DafYomi extends DafPage {
1042
/**
1143
* Initializes a daf yomi instance
1244
* @param date Gregorian or Hebrew date
@@ -21,7 +53,7 @@ declare module '@hebcal/learning' {
2153
render(locale?: string): string;
2254
}
2355

24-
export class DafYomiEvent extends Event {
56+
export class DafYomiEvent extends DafPageEvent {
2557
constructor(date: HDate);
2658
render(locale?: string): string;
2759
renderBrief(locale?: string): string;
@@ -182,4 +214,18 @@ declare module '@hebcal/learning' {
182214
url(): string;
183215
getCategories(): string[];
184216
}
217+
218+
/**
219+
* Daf-a-Week
220+
* @param date - Hebrew or Gregorian date
221+
*/
222+
export function dafWeekly(date: HDate | Date | number): DafPage;
223+
224+
/**
225+
* Event wrapper around a daily weekly
226+
*/
227+
export class DafWeeklyEvent extends DafPageEvent {
228+
constructor(date: HDate, daf: DafPage);
229+
getCategories(): string[];
230+
}
185231
}

0 commit comments

Comments
 (0)