3
3
import { HDate , Event } from '@hebcal/core' ;
4
4
5
5
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
+
6
38
/**
7
39
* Returns the Daf Yomi for given date
8
40
*/
9
- export class DafYomi {
41
+ export class DafYomi extends DafPage {
10
42
/**
11
43
* Initializes a daf yomi instance
12
44
* @param date Gregorian or Hebrew date
@@ -21,7 +53,7 @@ declare module '@hebcal/learning' {
21
53
render ( locale ?: string ) : string ;
22
54
}
23
55
24
- export class DafYomiEvent extends Event {
56
+ export class DafYomiEvent extends DafPageEvent {
25
57
constructor ( date : HDate ) ;
26
58
render ( locale ?: string ) : string ;
27
59
renderBrief ( locale ?: string ) : string ;
@@ -182,4 +214,18 @@ declare module '@hebcal/learning' {
182
214
url ( ) : string ;
183
215
getCategories ( ) : string [ ] ;
184
216
}
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
+ }
185
231
}
0 commit comments