import { k as ApiParams, a1 as QuranFetchClient, B as BaseApiParams, j as VerseRecitationField, m as SearchParams, P as PaginationParams, W as WordField, T as TranslationField, V as VerseField } from './app-state-state-DN5xrHqP.js'; /** * Maps chapter number to verse count */ declare const versesMapping: { readonly 1: 7; readonly 2: 286; readonly 3: 200; readonly 4: 176; readonly 5: 120; readonly 6: 165; readonly 7: 206; readonly 8: 75; readonly 9: 129; readonly 10: 109; readonly 11: 123; readonly 12: 111; readonly 13: 43; readonly 14: 52; readonly 15: 99; readonly 16: 128; readonly 17: 111; readonly 18: 110; readonly 19: 98; readonly 20: 135; readonly 21: 112; readonly 22: 78; readonly 23: 118; readonly 24: 64; readonly 25: 77; readonly 26: 227; readonly 27: 93; readonly 28: 88; readonly 29: 69; readonly 30: 60; readonly 31: 34; readonly 32: 30; readonly 33: 73; readonly 34: 54; readonly 35: 45; readonly 36: 83; readonly 37: 182; readonly 38: 88; readonly 39: 75; readonly 40: 85; readonly 41: 54; readonly 42: 53; readonly 43: 89; readonly 44: 59; readonly 45: 37; readonly 46: 35; readonly 47: 38; readonly 48: 29; readonly 49: 18; readonly 50: 45; readonly 51: 60; readonly 52: 49; readonly 53: 62; readonly 54: 55; readonly 55: 78; readonly 56: 96; readonly 57: 29; readonly 58: 22; readonly 59: 24; readonly 60: 13; readonly 61: 14; readonly 62: 11; readonly 63: 11; readonly 64: 18; readonly 65: 12; readonly 66: 12; readonly 67: 30; readonly 68: 52; readonly 69: 52; readonly 70: 44; readonly 71: 28; readonly 72: 28; readonly 73: 20; readonly 74: 56; readonly 75: 40; readonly 76: 31; readonly 77: 50; readonly 78: 40; readonly 79: 46; readonly 80: 42; readonly 81: 29; readonly 82: 19; readonly 83: 36; readonly 84: 25; readonly 85: 22; readonly 86: 17; readonly 87: 19; readonly 88: 26; readonly 89: 30; readonly 90: 20; readonly 91: 15; readonly 92: 21; readonly 93: 11; readonly 94: 8; readonly 95: 8; readonly 96: 19; readonly 97: 5; readonly 98: 8; readonly 99: 8; readonly 100: 11; readonly 101: 11; readonly 102: 8; readonly 103: 3; readonly 104: 9; readonly 105: 5; readonly 106: 4; readonly 107: 7; readonly 108: 3; readonly 109: 6; readonly 110: 3; readonly 111: 5; readonly 112: 4; readonly 113: 5; readonly 114: 6; }; type _NumbersFrom0ToN = Nr extends Nr ? number extends Nr ? number : Nr extends 0 ? never : _NumbersFrom0ToNRec : never; type _NumbersFrom0ToNRec = Counter["length"] extends Nr ? Accumulator : _NumbersFrom0ToNRec; type NumberRange = Exclude<_NumbersFrom0ToN, _NumbersFrom0ToN>; type NumberUnionToString = TType extends number ? `${TType}` : TType; /** * Builds a tuple with a length equal to the provided number literal. * Used for type-level arithmetic. */ type BuildTuple = TAccumulator["length"] extends TLength ? TAccumulator : BuildTuple; /** * Increments a numeric literal type by 1. */ type Increment = [ ...BuildTuple, unknown ]["length"]; /** * A `VerseKey` is a string literal in the form `${chapter}:${verse}` where: * - `chapter` is a valid chapter id from `versesMapping` * - `verse` is within the range 1..(verseCount for that chapter) */ type VerseKey = { [TChapter in keyof typeof versesMapping]: `${TChapter}:${NumberRange<1, Increment<(typeof versesMapping)[TChapter]>>}`; }[keyof typeof versesMapping]; type ChapterId = keyof typeof versesMapping | NumberUnionToString; type _HizbNumber = NumberRange<1, 61>; type HizbNumber = _HizbNumber | NumberUnionToString<_HizbNumber>; type _JuzNumber = NumberRange<1, 31>; type JuzNumber = _JuzNumber | NumberUnionToString<_JuzNumber>; type _PageNumber = NumberRange<1, 605>; type PageNumber = _PageNumber | NumberUnionToString<_PageNumber>; type _RubNumber = NumberRange<1, 241>; type RubNumber = _RubNumber | NumberUnionToString<_RubNumber>; declare enum SearchNavigationType { SURAH = "surah", JUZ = "juz", HIZB = "hizb", AYAH = "ayah", RUB_EL_HIZB = "rub_el_hizb", SEARCH_PAGE = "search_page", PAGE = "page", RANGE = "range", QURAN_RANGE = "quran_range" } interface SearchResult { resultType: SearchNavigationType; key: number | string; name: string; arabic?: string; isArabic?: boolean; isTransliteration?: boolean; } interface SearchResponse { pagination: { currentPage: number; nextPage: number | null; perPage: number; totalPages: number; totalRecords: number; }; result?: { navigation: SearchResult[]; verses: SearchResult[]; }; } interface Answer { id: string | number; body: string; answeredBy?: string; status: string; language?: string; } interface AnswerQuestion { id: string | number; body: string; type: string; ranges: VerseKey[]; surah: number; theme?: string[]; summary?: string; references?: string[]; language?: string; status: string; answers: Answer[]; } interface AnswersByAyahResponse { questions: AnswerQuestion[]; totalCount?: number; } interface AnswerCount { types?: Record; total: number; } type AnswerCountWithinRangeResponse = Record; /** * Segment structure is [wordFrom, wordTo, timeFrom, timeTo] time is in ms */ type Segment = [number, number, number, number]; interface ChapterRecitation { id: number; chapterId: number; fileSize: number; format: string; audioUrl: string; } interface VerseRecitation { verseKey: VerseKey; /** Relative URL path (e.g., "AbdulBaset/Murattal/mp3/002255.mp3") */ url: string; /** Absolute URL when returned by SDK helpers (e.g., "https://verses.quran.com/AbdulBaset/Murattal/mp3/002255.mp3") */ audioUrl?: string; id?: number; chapterId?: number; segments?: Segment[]; format?: string; } type NormalizedVerseRecitation = VerseRecitation & { audioUrl: string; }; interface AudioResponse { url?: string; duration?: number; format?: string; verseKey: string; segments?: Segment[]; } interface TranslatedName { name: string; languageName: string; } interface Chapter { id: number; versesCount: number; bismillahPre: boolean; revelationOrder: number; revelationPlace: string; pages: Array; nameComplex: string; nameSimple: string; transliteratedName: string; nameArabic: string; translatedName: TranslatedName; } interface RecitationResource { id?: number; reciterName?: string; style?: string; translatedName?: TranslatedName; } interface RecitationInfoResource { id?: number; info?: string; } interface TranslationResource { id?: number; name?: string; authorName?: string; slug?: string; languageName?: string; translatedName?: TranslatedName; } interface TranslationInfoResource { id?: number; info?: string; } interface TafsirResource { id?: number; name?: string; authorName?: string; slug?: string; languageName?: string; translatedName?: TranslatedName; } interface TafsirInfoResource { id?: number; info?: string; } interface RecitationStylesResource { mujawwad: string; murattal: string; muallim: string; } interface LanguageResource { id?: number; name?: string; nativeName?: string; isoCode?: string; direction?: string; translatedNames?: TranslatedName[]; } interface ChapterInfoResource { id?: number; name?: string; authorName?: string; slug?: string; languageName?: string; translatedName?: TranslatedName; } interface VerseMediaResource { id?: number; name?: string; authorName?: string; languageName?: string; } interface ChapterReciterResource { id: number; name: string; arabicName?: string; relativePath?: string; format?: string; filesSize?: number; } type ContentSyncResourceGroup = "articles" | "chapter_recitations" | "mushafs" | "quran_core" | "recitations" | "tafsirs" | "translations" | "word_by_word_transliterations" | "word_by_word_translations"; interface ChapterAudioFileSnapshotRecord extends Record { recordType: "chapter_audio_file"; id: number; audioRecitationId: number; chapterId: number; audioUrl: string | null; duration: number | null; durationMs: number | null; fileName: string | null; fileSize: number | null; format: string | null; mimeType: string | null; metadata: Record | null; updatedAt: string; } interface AudioSegmentSnapshotRecord extends Record { recordType: "audio_segment"; id: number; audioFileId: number; audioRecitationId: number; chapterId: number; verseId: number; verseKey: string; verseNumber: number; timestampFrom: number | null; timestampTo: number | null; timestampMedian: number | null; duration: number | null; durationMs: number | null; segments: [number, number, number][]; updatedAt: string; } type ChapterRecitationSnapshotRecord = ChapterAudioFileSnapshotRecord | AudioSegmentSnapshotRecord; interface MushafMetadataSnapshotRecord extends Record { recordType: "mushaf"; id: number; resourceContentId: number; name: string; description: string | null; pagesCount: number; linesPerPage: number; defaultFontName: string; mappingMode: string; qirat: { id: number; name: string; } | null; } interface MushafPageSnapshotRecord extends Record { recordType: "mushaf_page"; id: number; mushafId: number; pageNumber: number; firstVerseId: number | null; lastVerseId: number | null; firstWordId: number | null; lastWordId: number | null; versesCount: number | null; verseMapping: Record | null; updatedAt: string; } interface MushafFontAssetSnapshotRecord extends Record { recordType: "font_asset"; id: number; assetKey: string; mushafId: number; pageNumber: number | null; fontFamily: string; format: string; mimeType: string; url: string; sha256: string; byteSize: number; version: string; provider: string; licenseName: string; licenseUrl: string | null; attribution: string | null; updatedAt: string; } interface MushafWordSnapshotRecord extends Record { recordType: "mushaf_word"; id: number; mushafId: number; wordId: number; verseId: number; sourceVerseId: number | null; text: string | null; charTypeId: number | null; charTypeName: string | null; pageNumber: number | null; lineNumber: number | null; positionInVerse: number | null; positionInLine: number | null; positionInPage: number | null; cssClass: string | null; cssStyle: string | null; } type MushafSnapshotRecord = MushafMetadataSnapshotRecord | MushafPageSnapshotRecord | MushafFontAssetSnapshotRecord | MushafWordSnapshotRecord; interface QuranCoreChapterSnapshotRecord extends Record { recordType: "chapter"; id: number; chapterNumber: number; revelationPlace: string | null; revelationOrder: number | null; bismillahPre: boolean | null; nameSimple: string | null; nameComplex: string | null; nameArabic: string | null; versesCount: number | null; rukusCount: number | null; hizbsCount: number | null; rubElHizbsCount: number | null; updatedAt: string; } interface QuranCoreVerseSnapshotRecord extends Record { recordType: "verse"; id: number; chapterId: number; verseNumber: number; verseIndex: number; verseKey: string; textUthmani: string; juzNumber: number | null; hizbNumber: number | null; rubElHizbNumber: number | null; rukuNumber: number | null; surahRukuNumber: number | null; manzilNumber: number | null; sajdahType: string | null; sajdahNumber: number | null; wordsCount: number | null; updatedAt: string; } interface QuranCoreWordSnapshotRecord extends Record { recordType: "word"; id: number; verseId: number; chapterId: number; position: number; verseKey: string; location: string; charTypeId: number | null; charTypeName: string | null; /** @deprecated Use `textIndopakNastaleeq`. Retained for backwards compatibility. */ textIndopak: string | null; /** * IndoPak Nastaleeq word text, as used by Quran.com. Optional because * snapshots generated before the server-side backfill do not include it. */ textIndopakNastaleeq?: string | null; textUthmaniTajweed: string | null; updatedAt: string; } interface QuranCoreBoundaryFields extends Record { id: number; verseMapping: Record | null; firstVerseId: number | null; lastVerseId: number | null; versesCount: number | null; updatedAt: string; } interface QuranCoreJuzSnapshotRecord extends QuranCoreBoundaryFields { recordType: "juz"; juzNumber: number; } interface QuranCoreHizbSnapshotRecord extends QuranCoreBoundaryFields { recordType: "hizb"; hizbNumber: number; } interface QuranCoreRubElHizbSnapshotRecord extends QuranCoreBoundaryFields { recordType: "rub_el_hizb"; rubElHizbNumber: number; } type QuranCoreSnapshotRecord = QuranCoreChapterSnapshotRecord | QuranCoreVerseSnapshotRecord | QuranCoreWordSnapshotRecord | QuranCoreJuzSnapshotRecord | QuranCoreHizbSnapshotRecord | QuranCoreRubElHizbSnapshotRecord; interface WordByWordTranslationSnapshotRecord extends Record { id: number; resourceContentId: number; resourceId: number; wordId: number; languageId: number; languageName: string | null; text: string | null; priority: number | null; updatedAt: string; } interface WordByWordTransliterationSnapshotRecord extends Record { id: number; resourceContentId: number; resourceId: number; wordId: number; languageId: number; languageName: string | null; text: string | null; updatedAt: string; } type ContentSyncMutationType = "RESOURCE_CREATE" | "RESOURCE_UPDATE" | "RESOURCE_DELETE" | "ROW_CREATE" | "ROW_UPDATE" | "ROW_DELETE" | "RESOURCE_INVALIDATE"; interface ContentSyncOptions extends ApiParams { /** Resource filter, e.g. `mushafs:1;quran_core:1;translations:1,6`. */ resources?: string; /** Set to true for the initial sync. */ bootstrap?: boolean; /** Token returned by the final bootstrap or incremental page. */ syncToken?: string; /** Pagination cursor from `nextPageUrl`. */ cursor?: string; /** Page size, up to the API maximum. */ perPage?: number; } type ContentResourceSnapshotOptions = ApiParams; interface ContentSyncMutation = Record> { sequence: number; type: ContentSyncMutationType; resourceGroup: ContentSyncResourceGroup; resourceId: number; resourceContentId: number | null; recordType: string | null; recordKey: string | null; sourceRecordId: number | null; changedAt: string; data: TData | null; snapshotUrl: string | null; unavailableReason: string | null; } interface ContentSyncResponse = Record> { sync: { syncUntilSequence: number; hasMore: boolean; nextPageUrl: string | null; nextSyncToken: string | null; mutations: ContentSyncMutation[]; }; } interface ContentResourceSnapshot = Record> { resourceGroup: ContentSyncResourceGroup; resourceId: number; resourceContentId: number | null; schemaVersion: number; syncSequence: number; records: TRecord[]; } interface ChapterInfo { id: number; chapterId: number; text: string; shortText: string; source: string; languageName?: string; resourceId?: number; } interface ChapterInfoResponse { chapterInfo: ChapterInfo | null; resources?: ChapterInfoResource[]; } interface HadithReference { id: number; collection: string; hadithNumber: string; ourHadithNumber: number; arabicUrn: number; englishUrn: number; surahNumber: number; ayahStartNumber: number; ayahEndNumber: number; } interface HadithReferencesByAyahResponse { verseKey: VerseKey; verseNumber: number; chapterNumber: number; language: string; direction: string; hadithReferences: HadithReference[]; } interface HadithGrade { gradedBy?: string; grade?: string; } interface HadithContent { lang: string; chapterNumber: string; chapterTitle: string; body: string; urn: number; grades: HadithGrade[]; } interface Hadith { urn: number; collection: string; bookNumber: string; chapterId: string; hadithNumber: string; name: string; hadith: HadithContent[]; } interface HadithsByAyahResponse { hadiths: Hadith[]; page: number; limit: number; hasMore: boolean; language: string; direction: string; } type HadithCountWithinRangeResponse = Record; interface Tafsir { id?: number; resourceId?: number; text?: string; resourceName?: string; languageName?: string; slug?: string; languageId?: number; groupVerseKeyFrom?: string; groupVerseKeyTo?: string; groupTafsirId?: number; startVerseId?: number; endVerseId?: number; } interface Translation { id?: number; text: string; resourceId: number; resourceName?: string; verseId?: number; languageId?: number; languageName?: string; verseKey?: VerseKey; chapterId?: number; verseNumber?: number; juzNumber?: number; hizbNumber?: number; rubNumber?: number; pageNumber?: number; } interface Transliteration { languageName?: string; text?: string; } declare enum CharType { Word = "word", End = "end", Pause = "pause", Sajdah = "sajdah", RubElHizb = "rub-el-hizb" } interface Word { id?: number; position: number; audioUrl: string; charTypeName: CharType; codeV1?: string; codeV2?: string; pageNumber?: number; lineNumber?: number; text?: string; textUthmani?: string; textIndopak?: string; textImlaei?: string; translation: Translation; transliteration: Transliteration; location?: string; verseKey?: VerseKey; } interface Verse { id: number; verseNumber: number; verseKey: VerseKey; chapterId?: number | string; pageNumber: number; juzNumber: number; hizbNumber: number; rubElHizbNumber: number; words?: Word[]; textUthmani?: string; textUthmaniSimple?: string; textUthmaniTajweed?: string; textImlaei?: string; textImlaeiSimple?: string; textIndopak?: string; textIndopakNastaleeq?: string; sajdahNumber: null; imageUrl?: string; imageWidth?: number; v1Page?: number; v2Page?: number; codeV1?: string; codeV2?: string; translations?: Translation[]; tafsirs?: Tafsir[]; audio?: AudioResponse; } interface Juz { id: number; juzNumber: number; verseMapping: Record; firstVerseId: number; lastVerseId: number; versesCount: number; } interface Pagination { perPage: number; currentPage: number; nextPage: number; totalPages: number; totalRecords: number; } interface QiraatTranslatedName { name: string; languageName: string; } interface QiraatReaderSummary { id: number; name: string; abbreviation: string; } interface QiraatBio { text: string; /** Only returned by the single reader endpoint. */ shortText?: string; } interface QiraatTransmitterSummary { id: number; name: string; abbreviation: string; isPrimary: boolean; } interface QiraatReader { id: number; name: string; abbreviation: string; deathYearHijri?: number | null; deathYearGregorian?: number | null; position: number; translatedName?: QiraatTranslatedName | string | null; /** Returned when the reader's transmitters are loaded (single reader, or `include=transmitters`). */ transmitters?: QiraatTransmitterSummary[]; bio?: QiraatBio; } interface QiraatTransmitter { id: number; name: string; abbreviation: string; isPrimary: boolean; deathYearHijri?: number | null; deathYearGregorian?: number | null; position: number; translatedName?: QiraatTranslatedName | string | null; reader?: QiraatReaderSummary; /** Only returned by the single transmitter endpoint. */ bio?: QiraatBio; } type QiraatReaderInclude = "transmitters" | "bio"; type QiraatJunctureInclude = "readings"; interface QiraatReadersResponse { readers: QiraatReader[]; meta: { total: number; }; } interface QiraatReaderResponse { reader: QiraatReader; } interface QiraatTransmittersResponse { transmitters: QiraatTransmitter[]; meta: { total: number; }; } interface QiraatTransmitterResponse { transmitter: QiraatTransmitter; } interface QiraatPagination { currentPage: number; totalPages: number; totalCount: number; perPage: number; } interface QiraatChapterSummary { id: number; chapterNumber: number; nameSimple: string; } interface QiraatVerseSummary { verseKey: VerseKey; verseNumber: number; chapterNumber: number; textUthmani: string; } interface QiraatJuncturePreviewReading { id: number; position: number; textUthmani: string; translation?: string; } interface QiraatJuncture { id: number; verseKey: string; position: number; wordId?: number | null; wordPosition?: number | null; startWordPosition?: number | null; endWordPosition?: number | null; textUthmani?: string | null; textImlaei?: string | null; category?: string | null; flags?: unknown; explanation?: string; /** Only returned when requested with `include=readings`. */ readings?: QiraatJuncturePreviewReading[]; readingsCount: number; } interface QiraatJuncturesByVerseResponse { verse: QiraatVerseSummary; junctures: QiraatJuncture[]; meta: { totalJunctures: number; }; } interface QiraatJuncturesByChapterResponse { chapter: QiraatChapterSummary; junctures: QiraatJuncture[]; pagination: QiraatPagination; } interface QiraatReadingExplanation { text: string; source?: string | null; } interface QiraatJunctureReading { id: number; textUthmani?: string | null; textImlaei?: string | null; grammaticalForm?: string | null; rootLetters?: string | null; color?: string | null; translation?: string; transliteration?: string; explanations?: QiraatReadingExplanation[]; } interface QiraatJunctureDetail { id: number; verseKey: string; position: number; wordId?: number | null; wordPosition?: number | null; startWordPosition?: number | null; endWordPosition?: number | null; textUthmani?: string | null; textImlaei?: string | null; flags?: unknown; explanation?: string; readings: QiraatJunctureReading[]; readingsCount: number; } interface QiraatJunctureResponse { juncture: QiraatJunctureDetail; } interface QiraatReadingAttributedReader { id: number; name?: string | null; abbreviation?: string | null; scope: string; } interface QiraatReadingAttributedTransmitter { id: number; name?: string | null; abbreviation?: string | null; readerId: number; readerName?: string | null; } interface QiraatReading { id: number; junctureId: number; verseKey: string; textUthmani?: string | null; textImlaei?: string | null; position: number; color?: string | null; translation?: string | null; transliteration?: string | null; explanation?: string | QiraatReadingExplanation | null; explanations?: QiraatReadingExplanation[]; attributedTo: { readers: QiraatReadingAttributedReader[]; transmitters: QiraatReadingAttributedTransmitter[]; }; } interface QiraatReadingResponse { reading: QiraatReading; } type QiraatMatrixTextField = "text_uthmani" | "text_imlaei" | "text_qpc_hafs"; interface QiraatMatrixCell { readerId: number; transmitterId: number | null; type: "reader" | "transmitter"; } interface QiraatMatrixAttribution { readers: number[]; transmitters: number[]; cells: QiraatMatrixCell[]; } interface QiraatMatrixReader { id: number; name: string; abbreviation: string; position: number; translatedName?: QiraatTranslatedName | string | null; city?: string | null; bio?: string | null; } interface QiraatMatrixTransmitter { id: number; name: string; abbreviation: string; readerId: number; position: number; isPrimary: boolean; translatedName?: QiraatTranslatedName | string | null; } interface QiraatMatrixExplanation { id?: number; text: string; source?: string | null; } interface QiraatMatrixReading { id: number; position?: number; text: string | null; textUthmani?: string | null; textImlaei?: string | null; grammaticalForm?: string | null; rootLetters?: string | null; color?: string | null; translation?: string; translations?: Array<{ id: number; text: string; source?: string | null; }>; transliteration?: string; explanation?: QiraatMatrixExplanation; explanations?: QiraatMatrixExplanation[]; matrix: QiraatMatrixAttribution; } interface QiraatMatrixSegment { id: number; verseKey: string; verseId: number; text: string | null; position: number; } interface QiraatMatrixJuncture { id: number; position: number; verseKey: string | null; verseRange?: string | null; crossVerse?: boolean; text: string | null; textSimple?: string | null; category?: string | null; wordId?: number | null; wordPosition?: number | null; startWordPosition?: number | null; endWordPosition?: number | null; segments?: QiraatMatrixSegment[]; readings: QiraatMatrixReading[]; commentary?: string; combinedTranslation?: string; } interface QiraatMatrixAdjacentVerse { verseKey: string; chapterId: number; verseId: number; } interface QiraatMatrixByVerseResponse { verse: { verseKey: string; chapterNumber: number; verseNumber: number; text: string | null; textField: QiraatMatrixTextField; }; navigation: { previousVerse: QiraatMatrixAdjacentVerse | null; nextVerse: QiraatMatrixAdjacentVerse | null; }; readers: QiraatMatrixReader[]; transmitters: QiraatMatrixTransmitter[]; junctures: QiraatMatrixJuncture[]; meta: { language: string; direction: string; textField: QiraatMatrixTextField; totalJunctures: number; totalReadings: number; generatedAt: string; }; } interface QiraatMatrixByChapterResponse { chapter: QiraatChapterSummary; readers: Array>; transmitters: QiraatMatrixTransmitter[]; junctures: QiraatMatrixJuncture[]; pagination: QiraatPagination; meta: { language: string; direction: string; textField: QiraatMatrixTextField; generatedAt: string; }; } /** Map of verse key to the number of approved junctures in that verse. */ type QiraatMatrixCountWithinRangeResponse = Record; /** A JSON value accepted in an analytics event's properties object. */ type AnalyticsJsonValue = boolean | null | number | string | AnalyticsJsonValue[] | { [key: string]: AnalyticsJsonValue; }; interface AnalyticsEvent { /** Stable caller-generated ID. Reuse it when retrying this event. */ eventId: string; /** Namespaced event name, for example `quran.reader.verse_viewed`. */ name: string; /** When the event happened. Date values are serialized as RFC 3339. */ occurredAt: Date | string; /** Version of this event's property structure, starting at 1. */ version: number; /** Optional ID linking the event to a specific action. */ actionId?: null | string; /** Application-generated ID for a person who is not signed in. */ anonymousId?: null | string; /** Event-specific JSON. Caller-defined property names are preserved. */ properties?: { [key: string]: AnalyticsJsonValue; }; /** Application-generated ID grouping events from one usage session. */ sessionId?: null | string; /** Quran Foundation OAuth user ID. Do not send an application-local ID. */ userId?: null | string; } interface AnalyticsBatchRequest { /** The API accepts between 1 and 100 events as one all-or-nothing batch. */ events: AnalyticsEvent[]; } interface AnalyticsBatchAccepted { /** Number of accepted events; this equals the submitted count on HTTP 202. */ accepted: number; /** Server-generated identifier shared by all events in this batch. */ batchId: string; } type GetAnswersByAyahOptions = BaseApiParams & { page?: number; pageSize?: number; }; type CountAnswersWithinRangeOptions = BaseApiParams; /** * Quran answers API methods. */ declare class QuranAnswers { private fetcher; constructor(fetcher: QuranFetchClient); /** * Get published answer questions linked to a specific ayah. * @param {VerseKey} key verse key in format "chapter:verse" (e.g., "2:255") * @param {GetAnswersByAyahOptions} options * @example * client.answers.findByAyah("2:255", { page: 1, pageSize: 2 }) */ findByAyah(key: VerseKey, options?: GetAnswersByAyahOptions): Promise; /** * Get a published answer question by id. * @param {string | number} questionId question id * @example * client.answers.findByQuestionId("988") */ findByQuestionId(questionId: string | number): Promise; /** * Get a verse-key to answer-count map within an inclusive ayah range. * @param {VerseKey} from start verse key in format "chapter:verse" * @param {VerseKey} to end verse key in format "chapter:verse" * @param {CountAnswersWithinRangeOptions} options * @example * client.answers.countWithinRange("2:255", "2:256") */ countWithinRange(from: VerseKey, to: VerseKey, options?: CountAnswersWithinRangeOptions): Promise; } type GetChapterRecitationOptions = BaseApiParams; type GetVerseRecitationOptions = BaseApiParams & { fields?: Partial>; }; /** * Audio API methods */ declare class QuranAudio { private fetcher; constructor(fetcher: QuranFetchClient); /** * Get all chapter recitations for specific reciter * @param {string} reciterId * @param {GetChapterRecitationOptions} options * @example * client.audio.findAllChapterRecitations('2') */ findAllChapterRecitations(reciterId: string, options?: GetChapterRecitationOptions): Promise; /** * Get a specific chapter recitation by reciter and chapter * @param {string} reciterId * @param {ChapterId} chapterId * @param {GetChapterRecitationOptions} options * @example * client.audio.findChapterRecitationById('2', '1') */ findChapterRecitationById(reciterId: string, chapterId: ChapterId, options?: GetChapterRecitationOptions): Promise; /** * Get verse recitations by chapter * @param {ChapterId} chapterId * @param {string} recitationId * @param {GetVerseRecitationOptions} options * @example * client.audio.findVerseRecitationsByChapter('1', '2') */ findVerseRecitationsByChapter(chapterId: ChapterId, recitationId: string, options?: GetVerseRecitationOptions): Promise<{ audioFiles: NormalizedVerseRecitation[]; pagination: Pagination; }>; /** * Get verse recitations by verse key * @param {VerseKey} key * @param {string} recitationId * @param {GetVerseRecitationOptions} options * @example * client.audio.findVerseRecitationsByKey('1:1', '2') */ findVerseRecitationsByKey(key: VerseKey, recitationId: string, options?: GetVerseRecitationOptions): Promise<{ audioFiles: NormalizedVerseRecitation[]; pagination: Pagination; }>; } type GetChapterOptions = BaseApiParams; type GetChapterInfoOptions = BaseApiParams & { resourceId?: string | number; includeResources?: boolean; }; /** * Chapters API methods */ declare class QuranChapters { private fetcher; constructor(fetcher: QuranFetchClient); /** * Get all chapters. * @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/list-chapters * @param {GetChapterOptions} options * @example * client.chapters.findAll() */ findAll(options?: GetChapterOptions): Promise; /** * Get chapter by id. * @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter * @param {ChapterId} id chapter id, minimum 1, maximum 114 * @param {GetChapterOptions} options * @example * client.chapters.findById('1') * client.chapters.findById('114') */ findById(id: ChapterId, options?: GetChapterOptions): Promise; /** * Get chapter info by id. * @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter-info * @param {ChapterId} id chapter id, minimum 1, maximum 114 * @param {GetChapterInfoOptions} options * @example * client.chapters.findInfoById('1') * client.chapters.findInfoById('114') */ findInfoById(id: ChapterId, options?: GetChapterInfoOptions): Promise; /** * Get the full chapter info response, including available resources when requested. * @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/get-chapter-info * @param {ChapterId} id chapter id, minimum 1, maximum 114 * @param {GetChapterInfoOptions} options * @example * client.chapters.findInfoResponseById('1', { includeResources: true }) * client.chapters.findInfoResponseById('1', { resourceId: 'en-tafsir-ibn-ashur' }) */ findInfoResponseById(id: ChapterId, options?: GetChapterInfoOptions): Promise; } type GetHadithReferenceOptions = BaseApiParams; type GetHadithsByAyahOptions = BaseApiParams & { page?: number; limit?: number; }; type CountHadithsWithinRangeOptions = BaseApiParams; /** * Hadith reference API methods. */ declare class QuranHadithReferences { private fetcher; constructor(fetcher: QuranFetchClient); /** * Get ordered hadith reference records linked to a specific ayah. * @param {VerseKey} key verse key in format "chapter:verse" (e.g., "12:12") * @param {GetHadithReferenceOptions} options * @example * client.hadithReferences.findByAyah("12:12") */ findByAyah(key: VerseKey, options?: GetHadithReferenceOptions): Promise; /** * Get paginated hadith payloads linked to a specific ayah. * @param {VerseKey} key verse key in format "chapter:verse" (e.g., "12:12") * @param {GetHadithsByAyahOptions} options * @example * client.hadithReferences.findHadithsByAyah("12:12", { limit: 4 }) */ findHadithsByAyah(key: VerseKey, options?: GetHadithsByAyahOptions): Promise; /** * Get a verse-key to hadith-count map within an inclusive ayah range. * @param {VerseKey} from start verse key in format "chapter:verse" * @param {VerseKey} to end verse key in format "chapter:verse" * @param {CountHadithsWithinRangeOptions} options * @example * client.hadithReferences.countWithinRange("12:12", "12:13") */ countWithinRange(from: VerseKey, to: VerseKey, options?: CountHadithsWithinRangeOptions): Promise; } /** * Juzs API methods */ declare class QuranJuzs { private fetcher; constructor(fetcher: QuranFetchClient); /** * Get All Juzs * @description https://api-docs.quran.com/docs/quran.com_versioned/4.0.0/juzs * @example * client.juzs.findAll() */ findAll(): Promise; } type GetResourceOptions = BaseApiParams; /** * Resources API methods */ declare class QuranResources { private fetcher; constructor(fetcher: QuranFetchClient); /** * Get all recitations. * @param {GetResourceOptions} options * @example * client.resources.findAllRecitations() */ findAllRecitations(options?: GetResourceOptions): Promise; /** * Get all translations. * @param {GetResourceOptions} options * @example * client.resources.findAllTranslations() */ findAllTranslations(options?: GetResourceOptions): Promise; /** * Get all tafsirs. * @param {GetResourceOptions} options * @example * client.resources.findAllTafsirs() */ findAllTafsirs(options?: GetResourceOptions): Promise; /** * Get all languages. * @param {GetResourceOptions} options * @example * client.resources.findAllLanguages() */ findAllLanguages(options?: GetResourceOptions): Promise; /** * Get recitation info by id. * @param {string} id recitation id * @param {GetResourceOptions} options * @example * client.resources.findRecitationInfo('1') */ findRecitationInfo(id: string, options?: GetResourceOptions): Promise; /** * Get translation info by id. * @param {string} id translation id * @param {GetResourceOptions} options * @example * client.resources.findTranslationInfo('131') */ findTranslationInfo(id: string, options?: GetResourceOptions): Promise; /** * Get tafsir info by id. * @param {string} id tafsir id * @param {GetResourceOptions} options * @example * client.resources.findTafsirInfo('171') */ findTafsirInfo(id: string, options?: GetResourceOptions): Promise; /** * Get all chapter infos. * @param {GetResourceOptions} options * @example * client.resources.findAllChapterInfos() */ findAllChapterInfos(options?: GetResourceOptions): Promise; /** * Get all chapter reciters. * @param {GetResourceOptions} options * @example * client.resources.findAllChapterReciters() */ findAllChapterReciters(options?: GetResourceOptions): Promise; /** * Get all recitation styles. * @param {GetResourceOptions} options * @example * client.resources.findAllRecitationStyles() */ findAllRecitationStyles(options?: GetResourceOptions): Promise; /** * Get verse media. * @param {GetResourceOptions} options * @example * client.resources.findVerseMedia() */ findVerseMedia(options?: GetResourceOptions): Promise; /** * Bootstrap or incrementally sync public content resources. * @param {ContentSyncOptions} options * @example * client.resources.sync({ * bootstrap: true, * resources: "mushafs:1;translations:19;word_by_word_transliterations:60" * }) */ sync = Record>(options?: ContentSyncOptions): Promise>; /** * Fetch the current full snapshot for a syncable public content resource. * @param {ContentSyncResourceGroup} resourceGroup * @param {string | number} id * @param {ContentResourceSnapshotOptions} options * @example * client.resources.findSnapshot("word_by_word_transliterations", 60) */ findSnapshot = Record>(resourceGroup: ContentSyncResourceGroup, id: string | number, options?: ContentResourceSnapshotOptions): Promise>; } type SearchOptions = Omit; /** * Search API methods */ declare class QuranSearch { private fetcher; constructor(fetcher: QuranFetchClient); /** * Search * @description /v1/search * @param {string} query search query * @param {SearchOptions} options * @example * client.search.search('نور', { mode: SearchMode.Quick }) * client.search.search('نور', { mode: SearchMode.Advanced, exactMatchesOnly: '1' }) * client.search.search('نور', { mode: SearchMode.Quick, size: 10 }) * client.search.search('نور', { mode: SearchMode.Quick, page: 2 }) */ search(query: string, options: SearchOptions): Promise; } type GetVerseOptions = BaseApiParams & PaginationParams & { reciter?: string | number; words?: boolean; translations?: string[] | number[]; tafsirs?: string[] | number[]; wordFields?: Partial>; translationFields?: Partial>; fields?: Partial>; }; /** * Verses API methods */ declare class QuranVerses { private fetcher; constructor(fetcher: QuranFetchClient); /** * Get a specific verse by its key. * @param {VerseKey} key verse key in format "chapter:verse" (e.g., "1:1") * @param {GetVerseOptions} options * @example * client.verses.findByKey('1:1') * client.verses.findByKey('2:255') */ findByKey(key: VerseKey, options?: GetVerseOptions): Promise; /** * Get verses by range. * @param {VerseKey} from start verse key (e.g., "1:1") * @param {VerseKey} to end verse key (e.g., "1:7") * @param {GetVerseOptions} options * @example * client.verses.findByRange('1:1', '1:7') */ findByRange(from: VerseKey, to: VerseKey, options?: GetVerseOptions): Promise; /** * Get verses by chapter. * @param {ChapterId} id chapter id, minimum 1, maximum 114 * @param {GetVerseOptions} options * @example * client.verses.findByChapter('1') */ findByChapter(id: ChapterId, options?: GetVerseOptions): Promise; /** * Get verses by page number. * @param {PageNumber} page page number * @param {GetVerseOptions} options * @example * client.verses.findByPage('1') */ findByPage(page: PageNumber, options?: GetVerseOptions): Promise; /** * Get verses by juz number. * @param {JuzNumber} juz juz number * @param {GetVerseOptions} options * @example * client.verses.findByJuz('1') */ findByJuz(juz: JuzNumber, options?: GetVerseOptions): Promise; /** * Get verses by hizb number. * @param {HizbNumber} hizb hizb number * @param {GetVerseOptions} options * @example * client.verses.findByHizb('1') */ findByHizb(hizb: HizbNumber, options?: GetVerseOptions): Promise; /** * Get verses by rub number. * @param {RubNumber} rub rub number * @param {GetVerseOptions} options * @example * client.verses.findByRub('1') */ findByRub(rub: RubNumber, options?: GetVerseOptions): Promise; /** * Get a random verse. * @param {GetVerseOptions} options * @example * client.verses.findRandom() */ findRandom(options?: GetVerseOptions): Promise; } export { type QiraatReaderResponse as $, type Answer as A, type Translation as B, type ChapterId as C, type Transliteration as D, type Verse as E, CharType as F, type Juz as G, type HizbNumber as H, type Pagination as I, type JuzNumber as J, type QiraatTranslatedName as K, type QiraatReaderSummary as L, type QiraatBio as M, type NormalizedVerseRecitation as N, type QiraatTransmitterSummary as O, type PageNumber as P, QuranChapters as Q, type RubNumber as R, type SearchResponse as S, type TranslatedName as T, type QiraatReader as U, type VerseKey as V, type Word as W, type QiraatTransmitter as X, type QiraatReaderInclude as Y, type QiraatJunctureInclude as Z, type QiraatReadersResponse as _, QuranAnswers as a, type ContentSyncResponse as a$, type QiraatTransmittersResponse as a0, type QiraatTransmitterResponse as a1, type QiraatPagination as a2, type QiraatChapterSummary as a3, type QiraatVerseSummary as a4, type QiraatJuncturePreviewReading as a5, type QiraatJuncture as a6, type QiraatJuncturesByVerseResponse as a7, type QiraatJuncturesByChapterResponse as a8, type QiraatReadingExplanation as a9, type RecitationStylesResource as aA, type LanguageResource as aB, type ChapterInfoResource as aC, type VerseMediaResource as aD, type ChapterReciterResource as aE, type ContentSyncResourceGroup as aF, type ChapterAudioFileSnapshotRecord as aG, type AudioSegmentSnapshotRecord as aH, type ChapterRecitationSnapshotRecord as aI, type MushafMetadataSnapshotRecord as aJ, type MushafPageSnapshotRecord as aK, type MushafFontAssetSnapshotRecord as aL, type MushafWordSnapshotRecord as aM, type MushafSnapshotRecord as aN, type QuranCoreChapterSnapshotRecord as aO, type QuranCoreVerseSnapshotRecord as aP, type QuranCoreWordSnapshotRecord as aQ, type QuranCoreJuzSnapshotRecord as aR, type QuranCoreHizbSnapshotRecord as aS, type QuranCoreRubElHizbSnapshotRecord as aT, type QuranCoreSnapshotRecord as aU, type WordByWordTranslationSnapshotRecord as aV, type WordByWordTransliterationSnapshotRecord as aW, type ContentSyncMutationType as aX, type ContentSyncOptions as aY, type ContentResourceSnapshotOptions as aZ, type ContentSyncMutation as a_, type QiraatJunctureReading as aa, type QiraatJunctureDetail as ab, type QiraatJunctureResponse as ac, type QiraatReadingAttributedReader as ad, type QiraatReadingAttributedTransmitter as ae, type QiraatReading as af, type QiraatReadingResponse as ag, type QiraatMatrixTextField as ah, type QiraatMatrixCell as ai, type QiraatMatrixAttribution as aj, type QiraatMatrixReader as ak, type QiraatMatrixTransmitter as al, type QiraatMatrixExplanation as am, type QiraatMatrixReading as an, type QiraatMatrixSegment as ao, type QiraatMatrixJuncture as ap, type QiraatMatrixAdjacentVerse as aq, type QiraatMatrixByVerseResponse as ar, type QiraatMatrixByChapterResponse as as, type QiraatMatrixCountWithinRangeResponse as at, type RecitationResource as au, type RecitationInfoResource as av, type TranslationResource as aw, type TranslationInfoResource as ax, type TafsirResource as ay, type TafsirInfoResource as az, QuranVerses as b, type ContentResourceSnapshot as b0, SearchNavigationType as b1, type SearchResult as b2, type AnalyticsJsonValue as b3, type AnalyticsEvent as b4, type AnalyticsBatchRequest as b5, type AnalyticsBatchAccepted as b6, QuranJuzs as c, QuranAudio as d, QuranHadithReferences as e, QuranResources as f, QuranSearch as g, type AnswerQuestion as h, type AnswersByAyahResponse as i, type AnswerCount as j, type AnswerCountWithinRangeResponse as k, type ChapterRecitation as l, type VerseRecitation as m, type AudioResponse as n, type Chapter as o, type ChapterInfo as p, type ChapterInfoResponse as q, type HadithReference as r, type HadithReferencesByAyahResponse as s, type HadithGrade as t, type HadithContent as u, type Hadith as v, type HadithsByAyahResponse as w, type HadithCountWithinRangeResponse as x, type Segment as y, type Tafsir as z };