@quranjs/api 3.0.0 → 3.2.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/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +2 -2
- package/dist/index.min.mjs.map +1 -1
- package/dist/public.d.mts +5 -2
- package/dist/public.d.ts +5 -2
- package/dist/public.min.js +1 -1
- package/dist/public.min.js.map +1 -1
- package/dist/public.min.mjs +1 -1
- package/dist/public.min.mjs.map +1 -1
- package/dist/server.d.mts +18 -5
- package/dist/server.d.ts +18 -5
- package/dist/server.min.js +2 -2
- package/dist/server.min.js.map +1 -1
- package/dist/server.min.mjs +2 -2
- package/dist/server.min.mjs.map +1 -1
- package/dist/{verses-DnPcyHIi.d.ts → verses-B5K9Egsa.d.ts} +181 -73
- package/dist/{verses-qzAdux2V.d.mts → verses-CFFeqPDX.d.mts} +181 -73
- package/package.json +3 -3
|
@@ -251,6 +251,76 @@ interface Chapter {
|
|
|
251
251
|
translatedName: TranslatedName;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
interface RecitationResource {
|
|
255
|
+
id?: number;
|
|
256
|
+
reciterName?: string;
|
|
257
|
+
style?: string;
|
|
258
|
+
translatedName?: TranslatedName;
|
|
259
|
+
}
|
|
260
|
+
interface RecitationInfoResource {
|
|
261
|
+
id?: number;
|
|
262
|
+
info?: string;
|
|
263
|
+
}
|
|
264
|
+
interface TranslationResource {
|
|
265
|
+
id?: number;
|
|
266
|
+
name?: string;
|
|
267
|
+
authorName?: string;
|
|
268
|
+
slug?: string;
|
|
269
|
+
languageName?: string;
|
|
270
|
+
translatedName?: TranslatedName;
|
|
271
|
+
}
|
|
272
|
+
interface TranslationInfoResource {
|
|
273
|
+
id?: number;
|
|
274
|
+
info?: string;
|
|
275
|
+
}
|
|
276
|
+
interface TafsirResource {
|
|
277
|
+
id?: number;
|
|
278
|
+
name?: string;
|
|
279
|
+
authorName?: string;
|
|
280
|
+
slug?: string;
|
|
281
|
+
languageName?: string;
|
|
282
|
+
translatedName?: TranslatedName;
|
|
283
|
+
}
|
|
284
|
+
interface TafsirInfoResource {
|
|
285
|
+
id?: number;
|
|
286
|
+
info?: string;
|
|
287
|
+
}
|
|
288
|
+
interface RecitationStylesResource {
|
|
289
|
+
mujawwad: string;
|
|
290
|
+
murattal: string;
|
|
291
|
+
muallim: string;
|
|
292
|
+
}
|
|
293
|
+
interface LanguageResource {
|
|
294
|
+
id?: number;
|
|
295
|
+
name?: string;
|
|
296
|
+
nativeName?: string;
|
|
297
|
+
isoCode?: string;
|
|
298
|
+
direction?: string;
|
|
299
|
+
translatedNames?: TranslatedName[];
|
|
300
|
+
}
|
|
301
|
+
interface ChapterInfoResource {
|
|
302
|
+
id?: number;
|
|
303
|
+
name?: string;
|
|
304
|
+
authorName?: string;
|
|
305
|
+
slug?: string;
|
|
306
|
+
languageName?: string;
|
|
307
|
+
translatedName?: TranslatedName;
|
|
308
|
+
}
|
|
309
|
+
interface VerseMediaResource {
|
|
310
|
+
id?: number;
|
|
311
|
+
name?: string;
|
|
312
|
+
authorName?: string;
|
|
313
|
+
languageName?: string;
|
|
314
|
+
}
|
|
315
|
+
interface ChapterReciterResource {
|
|
316
|
+
id: number;
|
|
317
|
+
name: string;
|
|
318
|
+
arabicName?: string;
|
|
319
|
+
relativePath?: string;
|
|
320
|
+
format?: string;
|
|
321
|
+
filesSize?: number;
|
|
322
|
+
}
|
|
323
|
+
|
|
254
324
|
interface ChapterInfo {
|
|
255
325
|
id: number;
|
|
256
326
|
chapterId: number;
|
|
@@ -258,8 +328,63 @@ interface ChapterInfo {
|
|
|
258
328
|
shortText: string;
|
|
259
329
|
source: string;
|
|
260
330
|
languageName?: string;
|
|
331
|
+
resourceId?: number;
|
|
332
|
+
}
|
|
333
|
+
interface ChapterInfoResponse {
|
|
334
|
+
chapterInfo: ChapterInfo | null;
|
|
335
|
+
resources?: ChapterInfoResource[];
|
|
261
336
|
}
|
|
262
337
|
|
|
338
|
+
interface HadithReference {
|
|
339
|
+
id: number;
|
|
340
|
+
collection: string;
|
|
341
|
+
hadithNumber: string;
|
|
342
|
+
ourHadithNumber: number;
|
|
343
|
+
arabicUrn: number;
|
|
344
|
+
englishUrn: number;
|
|
345
|
+
surahNumber: number;
|
|
346
|
+
ayahStartNumber: number;
|
|
347
|
+
ayahEndNumber: number;
|
|
348
|
+
}
|
|
349
|
+
interface HadithReferencesByAyahResponse {
|
|
350
|
+
verseKey: VerseKey;
|
|
351
|
+
verseNumber: number;
|
|
352
|
+
chapterNumber: number;
|
|
353
|
+
language: string;
|
|
354
|
+
direction: string;
|
|
355
|
+
hadithReferences: HadithReference[];
|
|
356
|
+
}
|
|
357
|
+
interface HadithGrade {
|
|
358
|
+
gradedBy?: string;
|
|
359
|
+
grade?: string;
|
|
360
|
+
}
|
|
361
|
+
interface HadithContent {
|
|
362
|
+
lang: string;
|
|
363
|
+
chapterNumber: string;
|
|
364
|
+
chapterTitle: string;
|
|
365
|
+
body: string;
|
|
366
|
+
urn: number;
|
|
367
|
+
grades: HadithGrade[];
|
|
368
|
+
}
|
|
369
|
+
interface Hadith {
|
|
370
|
+
urn: number;
|
|
371
|
+
collection: string;
|
|
372
|
+
bookNumber: string;
|
|
373
|
+
chapterId: string;
|
|
374
|
+
hadithNumber: string;
|
|
375
|
+
name: string;
|
|
376
|
+
hadith: HadithContent[];
|
|
377
|
+
}
|
|
378
|
+
interface HadithsByAyahResponse {
|
|
379
|
+
hadiths: Hadith[];
|
|
380
|
+
page: number;
|
|
381
|
+
limit: number;
|
|
382
|
+
hasMore: boolean;
|
|
383
|
+
language: string;
|
|
384
|
+
direction: string;
|
|
385
|
+
}
|
|
386
|
+
type HadithCountWithinRangeResponse = Record<string, number>;
|
|
387
|
+
|
|
263
388
|
interface Tafsir {
|
|
264
389
|
id?: number;
|
|
265
390
|
resourceId?: number;
|
|
@@ -369,76 +494,6 @@ interface Pagination {
|
|
|
369
494
|
totalRecords: number;
|
|
370
495
|
}
|
|
371
496
|
|
|
372
|
-
interface RecitationResource {
|
|
373
|
-
id?: number;
|
|
374
|
-
reciterName?: string;
|
|
375
|
-
style?: string;
|
|
376
|
-
translatedName?: TranslatedName;
|
|
377
|
-
}
|
|
378
|
-
interface RecitationInfoResource {
|
|
379
|
-
id?: number;
|
|
380
|
-
info?: string;
|
|
381
|
-
}
|
|
382
|
-
interface TranslationResource {
|
|
383
|
-
id?: number;
|
|
384
|
-
name?: string;
|
|
385
|
-
authorName?: string;
|
|
386
|
-
slug?: string;
|
|
387
|
-
languageName?: string;
|
|
388
|
-
translatedName?: TranslatedName;
|
|
389
|
-
}
|
|
390
|
-
interface TranslationInfoResource {
|
|
391
|
-
id?: number;
|
|
392
|
-
info?: string;
|
|
393
|
-
}
|
|
394
|
-
interface TafsirResource {
|
|
395
|
-
id?: number;
|
|
396
|
-
name?: string;
|
|
397
|
-
authorName?: string;
|
|
398
|
-
slug?: string;
|
|
399
|
-
languageName?: string;
|
|
400
|
-
translatedName?: TranslatedName;
|
|
401
|
-
}
|
|
402
|
-
interface TafsirInfoResource {
|
|
403
|
-
id?: number;
|
|
404
|
-
info?: string;
|
|
405
|
-
}
|
|
406
|
-
interface RecitationStylesResource {
|
|
407
|
-
mujawwad: string;
|
|
408
|
-
murattal: string;
|
|
409
|
-
muallim: string;
|
|
410
|
-
}
|
|
411
|
-
interface LanguageResource {
|
|
412
|
-
id?: number;
|
|
413
|
-
name?: string;
|
|
414
|
-
nativeName?: string;
|
|
415
|
-
isoCode?: string;
|
|
416
|
-
direction?: string;
|
|
417
|
-
translatedNames?: TranslatedName[];
|
|
418
|
-
}
|
|
419
|
-
interface ChapterInfoResource {
|
|
420
|
-
id?: number;
|
|
421
|
-
name?: string;
|
|
422
|
-
authorName?: string;
|
|
423
|
-
slug?: string;
|
|
424
|
-
languageName?: string;
|
|
425
|
-
translatedName?: TranslatedName;
|
|
426
|
-
}
|
|
427
|
-
interface VerseMediaResource {
|
|
428
|
-
id?: number;
|
|
429
|
-
name?: string;
|
|
430
|
-
authorName?: string;
|
|
431
|
-
languageName?: string;
|
|
432
|
-
}
|
|
433
|
-
interface ChapterReciterResource {
|
|
434
|
-
id: number;
|
|
435
|
-
name: string;
|
|
436
|
-
arabicName?: string;
|
|
437
|
-
relativePath?: string;
|
|
438
|
-
format?: string;
|
|
439
|
-
filesSize?: number;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
497
|
type GetChapterRecitationOptions = BaseApiParams;
|
|
443
498
|
type GetVerseRecitationOptions = BaseApiParams & {
|
|
444
499
|
fields?: Partial<Record<VerseRecitationField, boolean>>;
|
|
@@ -493,6 +548,10 @@ declare class QuranAudio {
|
|
|
493
548
|
}
|
|
494
549
|
|
|
495
550
|
type GetChapterOptions = BaseApiParams;
|
|
551
|
+
type GetChapterInfoOptions = BaseApiParams & {
|
|
552
|
+
resourceId?: string | number;
|
|
553
|
+
includeResources?: boolean;
|
|
554
|
+
};
|
|
496
555
|
/**
|
|
497
556
|
* Chapters API methods
|
|
498
557
|
*/
|
|
@@ -521,12 +580,61 @@ declare class QuranChapters {
|
|
|
521
580
|
* Get chapter info by id.
|
|
522
581
|
* @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter-info
|
|
523
582
|
* @param {ChapterId} id chapter id, minimum 1, maximum 114
|
|
524
|
-
* @param {
|
|
583
|
+
* @param {GetChapterInfoOptions} options
|
|
525
584
|
* @example
|
|
526
585
|
* client.chapters.findInfoById('1')
|
|
527
586
|
* client.chapters.findInfoById('114')
|
|
528
587
|
*/
|
|
529
|
-
findInfoById(id: ChapterId, options?:
|
|
588
|
+
findInfoById(id: ChapterId, options?: GetChapterInfoOptions): Promise<ChapterInfo | null>;
|
|
589
|
+
/**
|
|
590
|
+
* Get the full chapter info response, including available resources when requested.
|
|
591
|
+
* @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter-info
|
|
592
|
+
* @param {ChapterId} id chapter id, minimum 1, maximum 114
|
|
593
|
+
* @param {GetChapterInfoOptions} options
|
|
594
|
+
* @example
|
|
595
|
+
* client.chapters.findInfoResponseById('1', { includeResources: true })
|
|
596
|
+
* client.chapters.findInfoResponseById('1', { resourceId: 'en-tafsir-ibn-ashur' })
|
|
597
|
+
*/
|
|
598
|
+
findInfoResponseById(id: ChapterId, options?: GetChapterInfoOptions): Promise<ChapterInfoResponse>;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
type GetHadithReferenceOptions = BaseApiParams;
|
|
602
|
+
type GetHadithsByAyahOptions = BaseApiParams & {
|
|
603
|
+
page?: number;
|
|
604
|
+
limit?: number;
|
|
605
|
+
};
|
|
606
|
+
type CountHadithsWithinRangeOptions = BaseApiParams;
|
|
607
|
+
/**
|
|
608
|
+
* Hadith reference API methods.
|
|
609
|
+
*/
|
|
610
|
+
declare class QuranHadithReferences {
|
|
611
|
+
private fetcher;
|
|
612
|
+
constructor(fetcher: QuranFetchClient);
|
|
613
|
+
/**
|
|
614
|
+
* Get ordered hadith reference records linked to a specific ayah.
|
|
615
|
+
* @param {VerseKey} key verse key in format "chapter:verse" (e.g., "12:12")
|
|
616
|
+
* @param {GetHadithReferenceOptions} options
|
|
617
|
+
* @example
|
|
618
|
+
* client.hadithReferences.findByAyah("12:12")
|
|
619
|
+
*/
|
|
620
|
+
findByAyah(key: VerseKey, options?: GetHadithReferenceOptions): Promise<HadithReferencesByAyahResponse>;
|
|
621
|
+
/**
|
|
622
|
+
* Get paginated hadith payloads linked to a specific ayah.
|
|
623
|
+
* @param {VerseKey} key verse key in format "chapter:verse" (e.g., "12:12")
|
|
624
|
+
* @param {GetHadithsByAyahOptions} options
|
|
625
|
+
* @example
|
|
626
|
+
* client.hadithReferences.findHadithsByAyah("12:12", { limit: 4 })
|
|
627
|
+
*/
|
|
628
|
+
findHadithsByAyah(key: VerseKey, options?: GetHadithsByAyahOptions): Promise<HadithsByAyahResponse>;
|
|
629
|
+
/**
|
|
630
|
+
* Get a verse-key to hadith-count map within an inclusive ayah range.
|
|
631
|
+
* @param {VerseKey} from start verse key in format "chapter:verse"
|
|
632
|
+
* @param {VerseKey} to end verse key in format "chapter:verse"
|
|
633
|
+
* @param {CountHadithsWithinRangeOptions} options
|
|
634
|
+
* @example
|
|
635
|
+
* client.hadithReferences.countWithinRange("12:12", "12:13")
|
|
636
|
+
*/
|
|
637
|
+
countWithinRange(from: VerseKey, to: VerseKey, options?: CountHadithsWithinRangeOptions): Promise<HadithCountWithinRangeResponse>;
|
|
530
638
|
}
|
|
531
639
|
|
|
532
640
|
/**
|
|
@@ -736,4 +844,4 @@ declare class QuranVerses {
|
|
|
736
844
|
findRandom(options?: GetVerseOptions): Promise<Verse>;
|
|
737
845
|
}
|
|
738
846
|
|
|
739
|
-
export { type AudioResponse as A, type
|
|
847
|
+
export { type AudioResponse as A, type RecitationResource as B, type ChapterId as C, type RecitationInfoResource as D, type TranslationResource as E, type TranslationInfoResource as F, type TafsirResource as G, type HizbNumber as H, type TafsirInfoResource as I, type JuzNumber as J, type RecitationStylesResource as K, type LanguageResource as L, type ChapterInfoResource as M, type NormalizedVerseRecitation as N, type VerseMediaResource as O, type PageNumber as P, QuranChapters as Q, type RubNumber as R, type SearchResponse as S, type TranslatedName as T, type ChapterReciterResource as U, type VerseKey as V, type Word as W, SearchNavigationType as X, type SearchResult as Y, QuranVerses as a, QuranJuzs as b, QuranAudio as c, QuranHadithReferences as d, QuranResources as e, QuranSearch as f, type ChapterRecitation as g, type VerseRecitation as h, type Chapter as i, type ChapterInfo as j, type ChapterInfoResponse as k, type HadithReference as l, type HadithReferencesByAyahResponse as m, type HadithGrade as n, type HadithContent as o, type Hadith as p, type HadithsByAyahResponse as q, type HadithCountWithinRangeResponse as r, type Segment as s, type Tafsir as t, type Translation as u, type Transliteration as v, type Verse as w, CharType as x, type Juz as y, type Pagination as z };
|
|
@@ -251,6 +251,76 @@ interface Chapter {
|
|
|
251
251
|
translatedName: TranslatedName;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
interface RecitationResource {
|
|
255
|
+
id?: number;
|
|
256
|
+
reciterName?: string;
|
|
257
|
+
style?: string;
|
|
258
|
+
translatedName?: TranslatedName;
|
|
259
|
+
}
|
|
260
|
+
interface RecitationInfoResource {
|
|
261
|
+
id?: number;
|
|
262
|
+
info?: string;
|
|
263
|
+
}
|
|
264
|
+
interface TranslationResource {
|
|
265
|
+
id?: number;
|
|
266
|
+
name?: string;
|
|
267
|
+
authorName?: string;
|
|
268
|
+
slug?: string;
|
|
269
|
+
languageName?: string;
|
|
270
|
+
translatedName?: TranslatedName;
|
|
271
|
+
}
|
|
272
|
+
interface TranslationInfoResource {
|
|
273
|
+
id?: number;
|
|
274
|
+
info?: string;
|
|
275
|
+
}
|
|
276
|
+
interface TafsirResource {
|
|
277
|
+
id?: number;
|
|
278
|
+
name?: string;
|
|
279
|
+
authorName?: string;
|
|
280
|
+
slug?: string;
|
|
281
|
+
languageName?: string;
|
|
282
|
+
translatedName?: TranslatedName;
|
|
283
|
+
}
|
|
284
|
+
interface TafsirInfoResource {
|
|
285
|
+
id?: number;
|
|
286
|
+
info?: string;
|
|
287
|
+
}
|
|
288
|
+
interface RecitationStylesResource {
|
|
289
|
+
mujawwad: string;
|
|
290
|
+
murattal: string;
|
|
291
|
+
muallim: string;
|
|
292
|
+
}
|
|
293
|
+
interface LanguageResource {
|
|
294
|
+
id?: number;
|
|
295
|
+
name?: string;
|
|
296
|
+
nativeName?: string;
|
|
297
|
+
isoCode?: string;
|
|
298
|
+
direction?: string;
|
|
299
|
+
translatedNames?: TranslatedName[];
|
|
300
|
+
}
|
|
301
|
+
interface ChapterInfoResource {
|
|
302
|
+
id?: number;
|
|
303
|
+
name?: string;
|
|
304
|
+
authorName?: string;
|
|
305
|
+
slug?: string;
|
|
306
|
+
languageName?: string;
|
|
307
|
+
translatedName?: TranslatedName;
|
|
308
|
+
}
|
|
309
|
+
interface VerseMediaResource {
|
|
310
|
+
id?: number;
|
|
311
|
+
name?: string;
|
|
312
|
+
authorName?: string;
|
|
313
|
+
languageName?: string;
|
|
314
|
+
}
|
|
315
|
+
interface ChapterReciterResource {
|
|
316
|
+
id: number;
|
|
317
|
+
name: string;
|
|
318
|
+
arabicName?: string;
|
|
319
|
+
relativePath?: string;
|
|
320
|
+
format?: string;
|
|
321
|
+
filesSize?: number;
|
|
322
|
+
}
|
|
323
|
+
|
|
254
324
|
interface ChapterInfo {
|
|
255
325
|
id: number;
|
|
256
326
|
chapterId: number;
|
|
@@ -258,8 +328,63 @@ interface ChapterInfo {
|
|
|
258
328
|
shortText: string;
|
|
259
329
|
source: string;
|
|
260
330
|
languageName?: string;
|
|
331
|
+
resourceId?: number;
|
|
332
|
+
}
|
|
333
|
+
interface ChapterInfoResponse {
|
|
334
|
+
chapterInfo: ChapterInfo | null;
|
|
335
|
+
resources?: ChapterInfoResource[];
|
|
261
336
|
}
|
|
262
337
|
|
|
338
|
+
interface HadithReference {
|
|
339
|
+
id: number;
|
|
340
|
+
collection: string;
|
|
341
|
+
hadithNumber: string;
|
|
342
|
+
ourHadithNumber: number;
|
|
343
|
+
arabicUrn: number;
|
|
344
|
+
englishUrn: number;
|
|
345
|
+
surahNumber: number;
|
|
346
|
+
ayahStartNumber: number;
|
|
347
|
+
ayahEndNumber: number;
|
|
348
|
+
}
|
|
349
|
+
interface HadithReferencesByAyahResponse {
|
|
350
|
+
verseKey: VerseKey;
|
|
351
|
+
verseNumber: number;
|
|
352
|
+
chapterNumber: number;
|
|
353
|
+
language: string;
|
|
354
|
+
direction: string;
|
|
355
|
+
hadithReferences: HadithReference[];
|
|
356
|
+
}
|
|
357
|
+
interface HadithGrade {
|
|
358
|
+
gradedBy?: string;
|
|
359
|
+
grade?: string;
|
|
360
|
+
}
|
|
361
|
+
interface HadithContent {
|
|
362
|
+
lang: string;
|
|
363
|
+
chapterNumber: string;
|
|
364
|
+
chapterTitle: string;
|
|
365
|
+
body: string;
|
|
366
|
+
urn: number;
|
|
367
|
+
grades: HadithGrade[];
|
|
368
|
+
}
|
|
369
|
+
interface Hadith {
|
|
370
|
+
urn: number;
|
|
371
|
+
collection: string;
|
|
372
|
+
bookNumber: string;
|
|
373
|
+
chapterId: string;
|
|
374
|
+
hadithNumber: string;
|
|
375
|
+
name: string;
|
|
376
|
+
hadith: HadithContent[];
|
|
377
|
+
}
|
|
378
|
+
interface HadithsByAyahResponse {
|
|
379
|
+
hadiths: Hadith[];
|
|
380
|
+
page: number;
|
|
381
|
+
limit: number;
|
|
382
|
+
hasMore: boolean;
|
|
383
|
+
language: string;
|
|
384
|
+
direction: string;
|
|
385
|
+
}
|
|
386
|
+
type HadithCountWithinRangeResponse = Record<string, number>;
|
|
387
|
+
|
|
263
388
|
interface Tafsir {
|
|
264
389
|
id?: number;
|
|
265
390
|
resourceId?: number;
|
|
@@ -369,76 +494,6 @@ interface Pagination {
|
|
|
369
494
|
totalRecords: number;
|
|
370
495
|
}
|
|
371
496
|
|
|
372
|
-
interface RecitationResource {
|
|
373
|
-
id?: number;
|
|
374
|
-
reciterName?: string;
|
|
375
|
-
style?: string;
|
|
376
|
-
translatedName?: TranslatedName;
|
|
377
|
-
}
|
|
378
|
-
interface RecitationInfoResource {
|
|
379
|
-
id?: number;
|
|
380
|
-
info?: string;
|
|
381
|
-
}
|
|
382
|
-
interface TranslationResource {
|
|
383
|
-
id?: number;
|
|
384
|
-
name?: string;
|
|
385
|
-
authorName?: string;
|
|
386
|
-
slug?: string;
|
|
387
|
-
languageName?: string;
|
|
388
|
-
translatedName?: TranslatedName;
|
|
389
|
-
}
|
|
390
|
-
interface TranslationInfoResource {
|
|
391
|
-
id?: number;
|
|
392
|
-
info?: string;
|
|
393
|
-
}
|
|
394
|
-
interface TafsirResource {
|
|
395
|
-
id?: number;
|
|
396
|
-
name?: string;
|
|
397
|
-
authorName?: string;
|
|
398
|
-
slug?: string;
|
|
399
|
-
languageName?: string;
|
|
400
|
-
translatedName?: TranslatedName;
|
|
401
|
-
}
|
|
402
|
-
interface TafsirInfoResource {
|
|
403
|
-
id?: number;
|
|
404
|
-
info?: string;
|
|
405
|
-
}
|
|
406
|
-
interface RecitationStylesResource {
|
|
407
|
-
mujawwad: string;
|
|
408
|
-
murattal: string;
|
|
409
|
-
muallim: string;
|
|
410
|
-
}
|
|
411
|
-
interface LanguageResource {
|
|
412
|
-
id?: number;
|
|
413
|
-
name?: string;
|
|
414
|
-
nativeName?: string;
|
|
415
|
-
isoCode?: string;
|
|
416
|
-
direction?: string;
|
|
417
|
-
translatedNames?: TranslatedName[];
|
|
418
|
-
}
|
|
419
|
-
interface ChapterInfoResource {
|
|
420
|
-
id?: number;
|
|
421
|
-
name?: string;
|
|
422
|
-
authorName?: string;
|
|
423
|
-
slug?: string;
|
|
424
|
-
languageName?: string;
|
|
425
|
-
translatedName?: TranslatedName;
|
|
426
|
-
}
|
|
427
|
-
interface VerseMediaResource {
|
|
428
|
-
id?: number;
|
|
429
|
-
name?: string;
|
|
430
|
-
authorName?: string;
|
|
431
|
-
languageName?: string;
|
|
432
|
-
}
|
|
433
|
-
interface ChapterReciterResource {
|
|
434
|
-
id: number;
|
|
435
|
-
name: string;
|
|
436
|
-
arabicName?: string;
|
|
437
|
-
relativePath?: string;
|
|
438
|
-
format?: string;
|
|
439
|
-
filesSize?: number;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
497
|
type GetChapterRecitationOptions = BaseApiParams;
|
|
443
498
|
type GetVerseRecitationOptions = BaseApiParams & {
|
|
444
499
|
fields?: Partial<Record<VerseRecitationField, boolean>>;
|
|
@@ -493,6 +548,10 @@ declare class QuranAudio {
|
|
|
493
548
|
}
|
|
494
549
|
|
|
495
550
|
type GetChapterOptions = BaseApiParams;
|
|
551
|
+
type GetChapterInfoOptions = BaseApiParams & {
|
|
552
|
+
resourceId?: string | number;
|
|
553
|
+
includeResources?: boolean;
|
|
554
|
+
};
|
|
496
555
|
/**
|
|
497
556
|
* Chapters API methods
|
|
498
557
|
*/
|
|
@@ -521,12 +580,61 @@ declare class QuranChapters {
|
|
|
521
580
|
* Get chapter info by id.
|
|
522
581
|
* @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter-info
|
|
523
582
|
* @param {ChapterId} id chapter id, minimum 1, maximum 114
|
|
524
|
-
* @param {
|
|
583
|
+
* @param {GetChapterInfoOptions} options
|
|
525
584
|
* @example
|
|
526
585
|
* client.chapters.findInfoById('1')
|
|
527
586
|
* client.chapters.findInfoById('114')
|
|
528
587
|
*/
|
|
529
|
-
findInfoById(id: ChapterId, options?:
|
|
588
|
+
findInfoById(id: ChapterId, options?: GetChapterInfoOptions): Promise<ChapterInfo | null>;
|
|
589
|
+
/**
|
|
590
|
+
* Get the full chapter info response, including available resources when requested.
|
|
591
|
+
* @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter-info
|
|
592
|
+
* @param {ChapterId} id chapter id, minimum 1, maximum 114
|
|
593
|
+
* @param {GetChapterInfoOptions} options
|
|
594
|
+
* @example
|
|
595
|
+
* client.chapters.findInfoResponseById('1', { includeResources: true })
|
|
596
|
+
* client.chapters.findInfoResponseById('1', { resourceId: 'en-tafsir-ibn-ashur' })
|
|
597
|
+
*/
|
|
598
|
+
findInfoResponseById(id: ChapterId, options?: GetChapterInfoOptions): Promise<ChapterInfoResponse>;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
type GetHadithReferenceOptions = BaseApiParams;
|
|
602
|
+
type GetHadithsByAyahOptions = BaseApiParams & {
|
|
603
|
+
page?: number;
|
|
604
|
+
limit?: number;
|
|
605
|
+
};
|
|
606
|
+
type CountHadithsWithinRangeOptions = BaseApiParams;
|
|
607
|
+
/**
|
|
608
|
+
* Hadith reference API methods.
|
|
609
|
+
*/
|
|
610
|
+
declare class QuranHadithReferences {
|
|
611
|
+
private fetcher;
|
|
612
|
+
constructor(fetcher: QuranFetchClient);
|
|
613
|
+
/**
|
|
614
|
+
* Get ordered hadith reference records linked to a specific ayah.
|
|
615
|
+
* @param {VerseKey} key verse key in format "chapter:verse" (e.g., "12:12")
|
|
616
|
+
* @param {GetHadithReferenceOptions} options
|
|
617
|
+
* @example
|
|
618
|
+
* client.hadithReferences.findByAyah("12:12")
|
|
619
|
+
*/
|
|
620
|
+
findByAyah(key: VerseKey, options?: GetHadithReferenceOptions): Promise<HadithReferencesByAyahResponse>;
|
|
621
|
+
/**
|
|
622
|
+
* Get paginated hadith payloads linked to a specific ayah.
|
|
623
|
+
* @param {VerseKey} key verse key in format "chapter:verse" (e.g., "12:12")
|
|
624
|
+
* @param {GetHadithsByAyahOptions} options
|
|
625
|
+
* @example
|
|
626
|
+
* client.hadithReferences.findHadithsByAyah("12:12", { limit: 4 })
|
|
627
|
+
*/
|
|
628
|
+
findHadithsByAyah(key: VerseKey, options?: GetHadithsByAyahOptions): Promise<HadithsByAyahResponse>;
|
|
629
|
+
/**
|
|
630
|
+
* Get a verse-key to hadith-count map within an inclusive ayah range.
|
|
631
|
+
* @param {VerseKey} from start verse key in format "chapter:verse"
|
|
632
|
+
* @param {VerseKey} to end verse key in format "chapter:verse"
|
|
633
|
+
* @param {CountHadithsWithinRangeOptions} options
|
|
634
|
+
* @example
|
|
635
|
+
* client.hadithReferences.countWithinRange("12:12", "12:13")
|
|
636
|
+
*/
|
|
637
|
+
countWithinRange(from: VerseKey, to: VerseKey, options?: CountHadithsWithinRangeOptions): Promise<HadithCountWithinRangeResponse>;
|
|
530
638
|
}
|
|
531
639
|
|
|
532
640
|
/**
|
|
@@ -736,4 +844,4 @@ declare class QuranVerses {
|
|
|
736
844
|
findRandom(options?: GetVerseOptions): Promise<Verse>;
|
|
737
845
|
}
|
|
738
846
|
|
|
739
|
-
export { type AudioResponse as A, type
|
|
847
|
+
export { type AudioResponse as A, type RecitationResource as B, type ChapterId as C, type RecitationInfoResource as D, type TranslationResource as E, type TranslationInfoResource as F, type TafsirResource as G, type HizbNumber as H, type TafsirInfoResource as I, type JuzNumber as J, type RecitationStylesResource as K, type LanguageResource as L, type ChapterInfoResource as M, type NormalizedVerseRecitation as N, type VerseMediaResource as O, type PageNumber as P, QuranChapters as Q, type RubNumber as R, type SearchResponse as S, type TranslatedName as T, type ChapterReciterResource as U, type VerseKey as V, type Word as W, SearchNavigationType as X, type SearchResult as Y, QuranVerses as a, QuranJuzs as b, QuranAudio as c, QuranHadithReferences as d, QuranResources as e, QuranSearch as f, type ChapterRecitation as g, type VerseRecitation as h, type Chapter as i, type ChapterInfo as j, type ChapterInfoResponse as k, type HadithReference as l, type HadithReferencesByAyahResponse as m, type HadithGrade as n, type HadithContent as o, type Hadith as p, type HadithsByAyahResponse as q, type HadithCountWithinRangeResponse as r, type Segment as s, type Tafsir as t, type Translation as u, type Transliteration as v, type Verse as w, CharType as x, type Juz as y, type Pagination as z };
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"version": "3.
|
|
14
|
+
"version": "3.2.0",
|
|
15
15
|
"main": "dist/index.min.js",
|
|
16
16
|
"module": "dist/index.min.mjs",
|
|
17
17
|
"types": "dist/index.d.ts",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"tsup": "^8.5.0",
|
|
58
58
|
"typescript": "^5.9.2",
|
|
59
59
|
"vitest": "^3.2.4",
|
|
60
|
+
"@quranjs/eslint-config": "0.3.0",
|
|
60
61
|
"@quranjs/prettier-config": "0.1.0",
|
|
61
|
-
"@quranjs/tsconfig": "0.1.0"
|
|
62
|
-
"@quranjs/eslint-config": "0.3.0"
|
|
62
|
+
"@quranjs/tsconfig": "0.1.0"
|
|
63
63
|
},
|
|
64
64
|
"prettier": "@quranjs/prettier-config",
|
|
65
65
|
"size-limit": [
|