import { $ as GrowToSize, A as RangeMode, B as SurahInfo, C as Manzil, D as PageMeta, E as Page, F as RukuMeta, G as ThumunAlHizb, H as SurahListType, I as Surah, J as maxAyahsInSurah, K as ThumunAlHizbId, L as SurahAyah, M as RubAlHizbId, N as RubAlHizbMeta, O as QuranMeta, P as Ruku, Q as FixedArray, R as SurahAyahPos, S as JuzPart, T as NumericRange, U as SurahMeta, V as SurahJuzMeta, W as SurahName, X as numSurahs, Y as numRubsInJuz, Z as ArrayOfSameLength, _ as AyahRange, a as RiwayaData, b as JuzAndShift, c as RiwayahsWith, d as ThumunRiwayaName, et as LessThan, f as partNames, g as AyahNo, h as AyahMeta, i as PartType, j as RubAlHizb, k as RangeMeta, l as Riwayas, m as AyahId, n as MissingListsPerRiwaya, o as RiwayaFullData, p as AyahCountBetweenJuzSurah, q as ThumunAlHizbMeta, r as PartListNames, s as RiwayaName, t as AllListsNames, u as RiwayasNames, v as HizbId, w as ManzilMeta, x as JuzMeta, y as Juz, z as SurahAyahSegment } from "./types-lM7S_eMD.js"; import { C as getListNormalised, S as getList, _ as QuranRiwaya, a as string2NumberSplitterStrict, b as PartBlock, c as isValidHizb, d as isValidPage, f as isValidRubAlHizb, g as getRubAlHizb, h as isValidSurahAyah, i as string2NumberSplitter, l as isValidJuz, m as isValidSurah, n as formatSurahAyah, o as isValidAyahId, p as isValidRuku, r as ayahStringSplitter, s as isValidAyahNo, t as formatAyahId, u as isValidManzil, v as AyahStepOptions, x as generatePartBlocks, y as nextAyah } from "./formatSurahAyah-Cv9JGEG1.js"; import { n as SurahNames } from "./types-BQYy3HA6.js"; import { n as surahNamesAr, r as surahNamesEn, t as getSurahName } from "./getSurahName-BC_YuwOF.js"; import { t as getThumunAlHizb } from "./getThumunAlHizb-DCdsIxrR.js"; //#region src/customizeRiwaya.d.ts /** Lists that can be replaced with {@link customizeRiwaya} */ type RiwayaListOverrides = Partial>; /** * Checks a riwaya data object for structural problems: boundary lists that are not * ascending, do not start at ayah 1, do not end right after the last ayah, or whose * length does not match the counts in `meta`. * * Use it to check your own data before passing it to `QuranRiwaya.create` or the * functional API. * * @param data - Riwaya data to check * @returns A list of problems, empty when the data is consistent * * @example * ```ts * validateRiwayaData(HafsLists) // [] * ``` * * @category Riwaya Data */ export declare function validateRiwayaData(data: RiwayaData): string[]; /** * Creates riwaya data that reuses a built-in riwaya but replaces some of its lists, * for example a different mushaf page layout (15-line Indo-Pak, Madinah 1405, ...). * * The counts in `meta` (numPages, numJuzs, ...) are recalculated from the new lists * and the result is checked with {@link validateRiwayaData}. * * Boundary lists use the same layout as the built-in ones: * `[0, firstAyahIdOfPart1, firstAyahIdOfPart2, ..., numAyahs + 1]`. * * @param base - Built-in riwaya data to start from, e.g. `HafsLists` * @param overrides - Lists to replace * @returns New riwaya data, usable with `QuranRiwaya.create` and the functional API * @throws Error If the resulting data is inconsistent, listing every problem found * * @example * ```ts * import { QuranRiwaya, customizeRiwaya, getListsOfRiwaya } from "quran-meta" * * const indoPak = customizeRiwaya(getListsOfRiwaya("Hafs"), { PageList: myIndoPakPageList }) * const quran = QuranRiwaya.create(indoPak) * quran.meta.numPages // length of your page list * quran.findPage(2, 255) * ``` * * @category Riwaya Data */ export declare function customizeRiwaya(base: T, overrides: RiwayaListOverrides): T; //#endregion //#region src/lists/index.d.ts /** * Retrieves the lists associated with a specific Riwaya. * Uses switch statement to enable tree-shaking. * * @example * ```typescript * const hafsLists = getListsOfRiwaya('Hafs'); * ``` * * @category Riwaya Data */ export declare function getListsOfRiwaya(riwaya: R): Riwayas[R]; /** * Returns one list (e.g. `"PageList"`) of a riwaya, Hafs by default. * * @example * ```typescript * const warshPages = getListOfRiwaya("PageList", "Warsh") * ``` * * @category Riwaya Data */ export declare const getListOfRiwaya: (listName: L, riwaya?: R) => Riwayas[R][L]; //#endregion //#region src/convert/convertAyah.d.ts /** * Converts an ayah reference from one riwaya's numbering to another's. * * Riwayas follow different counting traditions (Kufi, Madani, Makki, Basri), so the same * text can be numbered differently: `الم` is ayah 2:1 in Hafs but part of 2:1 together with * Hafs 2:2 in Warsh. The result is the ayah in `to` that contains the first word of the * given ayah. Surah numbers never change between riwayas. * * The basmala of Al-Fatiha, which only some riwayas count as an ayah, maps to the first ayah. * * @param surah - Surah number * @param ayah - Ayah number in the `from` riwaya * @param from - Riwaya the reference is written in * @param to - Riwaya to convert to * @returns The `[surah, ayah]` in the `to` riwaya * @throws RangeError If the surah or ayah does not exist in the `from` riwaya * * @example * ```ts * convertAyah(2, 2, "Hafs", "Warsh") // [2, 1] * convertAyah(2, 255, "Hafs", "Warsh") // [2, 253] * convertAyah(1, 1, "Warsh", "Hafs") // [1, 2] * ``` * * @category Riwaya Conversion */ export declare function convertAyah(surah: Surah, ayah: AyahNo, from: RiwayaName, to: RiwayaName): SurahAyah; /** * Converts an ayah to all ayahs of another riwaya that share any of its text. * * Where `to` splits the ayah into several, the result is a range; where both * riwayas agree it is a single ayah, like {@link convertAyah}. * * @param surah - Surah number * @param ayah - Ayah number in the `from` riwaya * @param from - Riwaya the reference is written in * @param to - Riwaya to convert to * @returns `[surah, ayah]` or `[surah, [firstAyah, lastAyah]]` in the `to` riwaya * @throws RangeError If the surah or ayah does not exist in the `from` riwaya * * @example * ```ts * convertAyahSpan(2, 1, "Warsh", "Hafs") // [2, [1, 2]] * convertAyahSpan(1, 7, "Hafs", "Warsh") // [1, [6, 7]] * convertAyahSpan(2, 3, "Hafs", "Warsh") // [2, 2] * ``` * * @category Riwaya Conversion */ export declare function convertAyahSpan(surah: Surah, ayah: AyahNo, from: RiwayaName, to: RiwayaName): SurahAyahSegment; //#endregion //#region src/ayahsInPart.d.ts /** * Returns the first and last ayah id of a part of the Quran (surah, juz, page, manzil, ruku, * rub' al-hizb or thumun al-hizb). * * @param type - The kind of part * @param num - The part number, starting at 1 * @param data - The Lists object for the riwaya * @returns `[firstAyahId, lastAyahId]` * @throws RangeError If `num` is outside the parts of that kind * @throws Error If the riwaya has no data for that kind of part (e.g. thumun al-hizb in Hafs) * * @example * ```ts * getPartRange("juz", 30, HafsLists) // [5673, 6236] * getPartRange("surah", 1, HafsLists) // [1, 7] * ``` * * @category Ranges & Iteration */ export declare function getPartRange(type: PartType, num: number, data: RiwayaData): AyahRange; /** * Iterates over every ayah in a part of the Quran, in order. * * @param type - The kind of part * @param num - The part number, starting at 1 * @param data - The Lists object for the riwaya * @yields `[surah, ayah]` for every ayah of the part * @throws RangeError If `num` is outside the parts of that kind * * @example * ```ts * for (const [surah, ayah] of ayahsInPart("page", 604, HafsLists)) { * console.log(`${surah}:${ayah}`) // 112:1 ... 114:6 * } * const ayahs = [...ayahsInPart("ruku", 1, HafsLists)] * ``` * * @category Ranges & Iteration */ export declare function ayahsInPart(type: PartType, num: number, data: RiwayaData): Generator; /** * Iterates over every ayah on a mushaf page. * * @param page - Page number * @param data - The Lists object for the riwaya * @returns A generator of `[surah, ayah]` pairs * * @example * ```ts * [...ayahsInPage(1, HafsLists)] // [[1, 1], [1, 2], ..., [1, 7]] * ``` * * @category Ranges & Iteration */ export declare function ayahsInPage(page: Page, data: RiwayaData): Generator; /** * Iterates over every ayah in a juz. * * @param juz - Juz number * @param data - The Lists object for the riwaya * @returns A generator of `[surah, ayah]` pairs * * @example * ```ts * const count = [...ayahsInJuz(30, HafsLists)].length // 564 * ``` * * @category Ranges & Iteration */ export declare function ayahsInJuz(juz: Juz, data: RiwayaData): Generator; //#endregion //#region src/surahStringParser.d.ts /** * Parses a string representation of a Surah number and converts it to a valid Surah type * @param str - The string containing the Surah number to parse * @returns The parsed Surah number as a Surah type * @throws Error If the string cannot be parsed as a number or if the number is not a valid Surah number * * @category Parsing & Formatting */ export declare function surahStringParser(str: string, isStrict: boolean | undefined, meta: QuranMeta): Surah; //#endregion //#region src/findAyahIdBySurah.d.ts /** * Get the ayah ID for the given surah and ayah number. * @param surah - The surah number. * @param ayah - The ayah number within the surah. * @param data - The Lists object containing SurahList. * @returns The ayah ID for the given surah and ayah number. * * @category Surah & Ayah */ export declare function findAyahIdBySurah(surah: Surah, ayah: AyahNo, data: RiwayaData): AyahId; //#endregion //#region src/findJuz.d.ts /** * Finds the Juz (part) of the Quran that the given Ayah (verse) belongs to. * * @param surah - The Surah (chapter) number. * @param ayah - The Ayah (verse) number. * @param lists - The Lists object containing JuzList and SurahList. * @returns The Juz (part) number that the given Ayah belongs to. * * @category Juz */ export declare function findJuz(surah: Surah, ayah: AyahNo, lists: RiwayaData): Juz; //#endregion //#region src/findJuzAndShift.d.ts /** * Finds the juz (section) that contains the specified ayah (verse) and calculates the number of ayahs between the start of the juz and the start of the surah (chapter) that contains the ayah. * * @param surah - The surah (chapter) that contains the ayah. * @param ayah - The ayah (verse) number. * @param lists - The Lists object for the riwaya. * @returns An object containing the following properties: * - `juz`: The juz (section) that contains the ayah. * - `leftAyahId`: The ayah ID of the first ayah in the juz. * - `ayahsBetweenJuzSurah`: The number of ayahs between the start of the juz and the start of the surah (positive if the surah starts is in the juz, negative if the surah starts before the juz). * * @category Juz */ export declare function findJuzAndShift(surah: Surah, ayah: AyahNo, lists: RiwayaData): JuzAndShift; /** * Finds the Juz number and calculates the shift between Juz start and Surah start for a given Ayah ID * * @param ayahId - The unique identifier of an Ayah (verse) in the Quran * @param data - The Lists object for the riwaya. * @returns An object containing: * - juz: The Juz number where the Ayah is located * - leftAyahId: The starting Ayah ID of the Juz * - ayahsBetweenJuzSurah: The number of Ayahs between the Juz start and the Surah start * * @throws Error If the provided Ayah ID is invalid * * @category Juz */ export declare function findJuzAndShiftByAyahId(ayahId: AyahId, data: RiwayaData): JuzAndShift; //#endregion //#region src/findJuzByAyahId.d.ts /** * Finds the Juz (part) of the Quran that contains the given Ayah (verse) ID. * * @param ayahId - The ID of the Ayah (verse) to find the Juz for. * @param data - The Lists object containing JuzList. * @returns The Juz (part) of the Quran that contains the given Ayah ID. * * @category Juz */ export declare function findJuzByAyahId(ayahId: AyahId, data: RiwayaData): Juz; //#endregion //#region src/findJuzMetaBySurah.d.ts /** * Finds the SurahJuzMeta for a given Surah and Ayah. * * @param surah - The Surah (chapter) number. * @param ayah - The Ayah (verse) number. * @param data - The Lists object for the riwaya. * @returns The juz containing the ayah (`leftJuz`) and its first ayah id, the juz the surah ends in * (`rightJuz`) and the first ayah id after it, and the ayahs between the juz start and the surah start. * * @category Juz */ export declare function findJuzMetaBySurah(surah: Surah, ayah: AyahNo, data: RiwayaData): SurahJuzMeta; //#endregion //#region src/findManzil.d.ts /** * Finds the Manzil number for a given Surah and Ayah * @param surah - The Surah number or object * @param ayah - Optional Ayah number (defaults to 1) * @param data - The Lists object for the riwaya. * @returns The Manzil number (1-7) containing the specified Ayah * * @category Manzil & Ruku */ export declare function findManzil(surah: Surah, ayah: AyahNo, data: RiwayaData): Manzil; //#endregion //#region src/findManzilByAyahId.d.ts /** * Finds the Manzil number for a given Ayah ID using binary search. * A Manzil is one of seven approximately equal divisions of the Quran. * * @param ayahId - The ID of the Ayah to find the Manzil for * @param data - The Lists object for the riwaya. * @returns The Manzil number (1-7) containing the specified Ayah * @throws Error If the provided Ayah ID is invalid * * @example * ```typescript * const manzil = findManzilByAyahId(2345, HafsLists); // Returns the Manzil containing Ayah 2345 * ``` * * @category Manzil & Ruku */ export declare function findManzilByAyahId(ayahId: AyahId, data: RiwayaData): Manzil; //#endregion //#region src/findPage.d.ts /** * Finds the page number for the given Surah and Ayah number. * * @param surah - The Surah to find the page for. * @param ayah - The Ayah number to find the page for. * @param data - The Lists object for the riwaya. * @returns The page number for the given Surah and Ayah. * * @category Page */ export declare function findPage(surah: Surah, ayah: AyahNo, data: RiwayaData): Page; //#endregion //#region src/findPagebyAyahId.d.ts /** * Returns the page number for a given ayah ID in the Quran. * * @param ayahId - A numeric identifier representing a verse (ayah) in the Quran * @param data - The Lists object for the riwaya. * @returns The page number where the specified ayah can be found * @throws Will throw an error if the ayahId is invalid * * @example * ```ts * const page = findPageByAyahId(142, HafsLists); // Returns the page number containing ayah 142 * ``` * * @category Page */ export declare function findPageByAyahId(ayahId: AyahId, data: RiwayaData): Page; /** * Old spelling of {@link findPageByAyahId}. * * @deprecated Use {@link findPageByAyahId}, which matches `findJuzByAyahId` and the other `By` functions. * * @category Page */ export declare const findPagebyAyahId: typeof findPageByAyahId; //#endregion //#region src/findRangeAroundAyah.d.ts /** * Finds the range of ayahs surrounding a given ayah based on specified mode * @param ayahId - The unique identifier of the ayah * @param mode - The scope for finding the range: * - "juz": Returns range of ayahs in the same juz * - "surah": Returns range of ayahs in the same surah * - "ayah": Returns the single ayah as both start and end of range * - "page": Returns range of ayahs on the same page * - "ruku": Returns range of ayahs on the same ruku * - "all": Returns range covering all ayahs (1 to total number of ayahs) * @param data - The Lists object for the riwaya. * @returns An array of two numbers representing the start and end ayah IDs of the range [startAyahId, endAyahId] * * @category Ranges & Iteration */ export declare function findRangeAroundAyah(ayahId: AyahId, mode: RangeMode, data: RiwayaData): AyahRange; //#endregion //#region src/findRangeAroundSurahAyah.d.ts /** * Finds a range of ayahs around a given ayah based on the specified mode. * * @param surah - The surah number (1-114) * @param ayah - The ayah number within the surah * @param mode - The range mode: "juz", "surah", "ayah", "page", "ruku" or "all" * @param data - The data for the riwaya. * @returns A tuple containing the start and end ayah IDs of the range * * @category Ranges & Iteration */ export declare function findRangeAroundSurahAyah(surah: Surah, ayah: AyahNo, mode: RangeMode, data: RiwayaData): AyahRange; //#endregion //#region src/findRubAlHizb.d.ts /** * Finds the Juz (part) and Rub-ul-Hizb/Maqra (quarter section) of the Quran that the given Ayah (verse) belongs to. * * @param surah - The Surah (chapter) number. * @param ayah - The Ayah (verse) number. * @param data - The Lists object containing SurahList and HizbQuarterList. * @returns An object containing the Juz (part) number, Hizb (section) number, and the index of the Hizb that the given Ayah belongs to. * * @category Hizb */ export declare function findRubAlHizb(surah: Surah, ayah: AyahNo, data: RiwayaData): RubAlHizbId; //#endregion //#region src/findRubAlHizbByAyahId.d.ts /** * Finds the Maqra/Rub-al-Hizb of the Quran that contains the given Ayah (verse) ID. * * @param ayahId - The ID of the Ayah (verse) to find the Juz for. * @param data - The data for the riwaya. * @returns The Maqra of the Quran that contains the given Ayah ID. * * @category Hizb */ export declare function findRubAlHizbByAyahId(ayahId: AyahId, data: RiwayaData): RubAlHizbId; //#endregion //#region src/findRukuByAyahId.d.ts /** * Finds the Ruku number for a given Ayah ID using binary search. * * @param ayahId - The unique identifier of an Ayah in format: surah:ayah (e.g., "2:255") * @param data - The Lists object for the riwaya. * @returns The Ruku number corresponding to the given Ayah ID * @throws Error If the provided Ayah ID is invalid * * @example * ```ts * const ruku = findRukuByAyahId("2:255", HafsLists); * // Returns the Ruku number containing Ayah 255 of Surah 2 * ``` * * @category Manzil & Ruku */ export declare function findRukuByAyahId(ayahId: AyahId, data: RiwayaData): Ruku; //#endregion //#region src/findSurahAyahByAyahId.d.ts /** * Finds the Surah (chapter) and Ayah (verse) numbers that the given Ayah ID belongs to. * * @param ayahId - The Ayah ID to find the Surah and Ayah numbers for. * @param data - The data for the riwaya. * @returns An array containing the Surah number and the Ayah number within that Surah. * * @category Surah & Ayah */ export declare function findSurahAyahByAyahId(ayahId: AyahId, data: RiwayaData): SurahAyah; //#endregion //#region src/findSurahByAyahId.d.ts /** * Finds a Surah based on the provided Ayah ID. * * @param ayaId - The unique identifier of the Ayah * @param data - The Lists object containing SurahList. * @returns The Surah that contains the specified Ayah * * @example * const surah = findSurahByAyahId(1234, data); * * @category Surah & Ayah */ export declare function findSurahByAyahId(ayaId: AyahId, data: RiwayaData): Surah; //#endregion //#region src/getAyahCountInSurah.d.ts /** * Get the number of ayahs (verses) in the specified surah. * @param surah - The surah number. * @param data - The Lists object containing SurahList. * @returns The number of ayahs in the specified surah. * * @category Surah & Ayah */ export declare function getAyahCountInSurah(surah: Surah, data: RiwayaData): AyahNo; //#endregion //#region src/getSurahInfo.d.ts /** * Gets the metadata for the specified Surah. * * @param surah - The Surah to get the metadata for. * @param data - The Lists object containing SurahList. * @returns The metadata for the specified Surah. * * @category Surah & Ayah */ export declare function getSurahInfo(surah: Surah, data: RiwayaData): SurahInfo; //#endregion //#region src/getAyahMeta.d.ts /** * Retrieves metadata for a specific ayah of the Quran. * * @param ayahId - The ayahId number to retrieve metadata for (1-6236) * @param data - The Lists object for the riwaya. * @returns An object containing the ayah related meta, including information about the surah, juz, and quarter the ayah is in. * @throws RangeError If the ayahId number is not between 1 and 6236 * * @category Surah & Ayah */ export declare function getAyahMeta(ayahId: AyahId, data: RiwayaData): AyahMeta; //#endregion //#region src/getAyahMetasForSurah.d.ts /** * Retrieves metadata for all ayahs in a specific surah. * * @param surahNumber - The surah number (1-114) * @param data - The Lists object for the riwaya. * @returns Array of AyahMeta objects for each ayah in the surah * @throws RangeError If the surah number is not between 1 and 114 * * @category Surah & Ayah */ export declare function getAyahMetasForSurah(surahNumber: Surah, data: RiwayaData): AyahMeta[]; //#endregion //#region src/getJuzMeta.d.ts /** * Retrieves metadata for a specific Juz of the Quran. * * @param juzNum - The Juz number to retrieve metadata for (1-30) * @param data - The Lists object for the riwaya. * @returns An object containing the Juz number, first ayah, and last ayah in the Juz * @throws RangeError If the Juz number is not between 1 and 30 * * @category Juz */ export declare function getJuzMeta(juzNum: Juz, data: RiwayaData): JuzMeta; //#endregion //#region src/getManzilMeta.d.ts /** * Retrieves metadata for a specific Manzil (section) of the Quran * * @param manzilNum - The number of the Manzil (1-7) * @param data - The Lists object for the riwaya. * @returns The metadata for the specified Manzil containing: * - manzilNum: The Manzil number * - firstAyahId: ID of the first ayah in the Manzil * - lastAyahId: ID of the last ayah in the Manzil * - first: Surah and ayah details of the first ayah * - last: Surah and ayah details of the last ayah * @throws Will throw an error if manzilNum is invalid * * @category Manzil & Ruku */ export declare function getManzilMeta(manzilNum: number, data: RiwayaData): ManzilMeta; //#endregion //#region src/getPageMeta.d.ts /** * Retrieves metadata for a specific page of the Quran. * * @param pageNum - The page number to retrieve metadata for (1-604) * @param data - The Lists object for the riwaya. * @returns {@link PageMeta} An object containing the page number, first ayah, and last ayah on the page * @throws RangeError If the page number is not between 1 and 604 * * @category Page */ export declare function getPageMeta(pageNum: Page, data: RiwayaData): PageMeta; //#endregion //#region src/getRukuMeta.d.ts /** * Retrieves metadata for a specific Ruku (section) of the Quran. * @param rukuNum - The number of the Ruku to retrieve metadata for * @param data - The Lists object for the riwaya. * @returns {@link RukuMeta} An object containing metadata about the Ruku including: * - rukuNum: The Ruku number * - firstAyahId: The global Ayah ID of the first verse in this Ruku * - lastAyahId: The global Ayah ID of the last verse in this Ruku * - first: The Surah and Ayah numbers for the first verse * - last: The Surah and Ayah numbers for the last verse * @throws Will throw an error if the provided Ruku number is invalid * * @category Manzil & Ruku */ export declare function getRukuMeta(rukuNum: number, data: RiwayaData): RukuMeta; //#endregion //#region src/getRubAlHizbMeta.d.ts /** * Retrieves the metadata for a specific quarter (rub' al-hizb) of the Quran. * * @param quarterIndex - The index of the quarter (rub' al-hizb) to retrieve metadata for, where 1 is the first quarter. * @param data - The Lists object for the riwaya. * @returns An object containing the metadata for the specified quarter, including the juz' (part), hizb (section), and the quarter (rub' al-hizb) index. * * @category Hizb */ export declare function getRubAlHizbMeta(quarterIndex: RubAlHizbId, data: RiwayaData): RubAlHizbMeta; //#endregion //#region src/getRubAlHizbMetaByAyahId.d.ts /** * Finds the Juz, Hizb, and Rub-el-Hizb id for the given Ayah ID. * * @param ayahId - The Ayah ID to find the Juz, Hizb, and Hizb ID for. * @param data - The Lists object containing HizbQuarterList. * @returns An object containing the Juz, Hizb, and Hizb ID for the given Ayah ID. * * @category Hizb */ export declare function getRubAlHizbMetaByAyahId(ayahId: AyahId, data: RiwayaData): RubAlHizbMeta; //#endregion //#region src/getRubAlHizbByAyahId.d.ts /** * Finds the Juz, Hizb, and Rub-el-Hizb id for the given Ayah ID. * * @param ayahId - The Ayah ID to find the Juz, Hizb, and Hizb ID for. * @param data - The Lists object for the riwaya. * @returns An object containing the Juz, Hizb, and Hizb ID for the given Ayah ID. * * @category Hizb */ export declare function getRubAlHizbByAyahId(ayahId: AyahId, data: RiwayaData): RubAlHizb; //#endregion //#region src/findThumunAlHizb.d.ts /** * Finds the thumun al-hizb (eighth of a hizb) that the given ayah belongs to. * * @param surah - The Surah (chapter) number. * @param ayah - The Ayah (verse) number. * @param data - The Lists object of a riwaya that has thumun al-hizb data (Qalun). * @returns The thumun al-hizb number, 1 to 480. * * @category Hizb */ export declare function findThumunAlHizb(surah: Surah, ayah: AyahNo, data: RiwayahsWith<"HizbEighthList">): ThumunAlHizbId; //#endregion //#region src/findThumunAlHizbByAyahId.d.ts /** * Finds the Maqra/Rub-al-Hizb of the Quran that contains the given Ayah (verse) ID. * * @param ayahId - The ID of the Ayah (verse) to find the Juz for. * @param data - The Lists object for the riwaya. * @returns The thumun of the Quran that contains the given Ayah ID. * * @category Hizb */ export declare function findThumunAlHizbByAyahId(ayahId: AyahId, data: RiwayahsWith<"HizbEighthList">): ThumunAlHizbId; //#endregion //#region src/getThumunAlHizbByAyahId.d.ts /** * Finds the Juz, Hizb, Rub-el-Hizb id and thuumun-el-Hizb id for the given Ayah ID. * * @param ayahId - The Ayah ID to find the Juz, Hizb, and Hizb ID for. * @param data - The riwaya. Defaults to "Qalun" if not provided. * @returns An object containing the Juz, Hizb, Hizb ID and thuumun-el-Hizb id for the given Ayah ID. * * @category Hizb */ export declare function getThumunAlHizbByAyahId(ayahId: AyahId, data: RiwayahsWith<"HizbEighthList">): ThumunAlHizb; //#endregion //#region src/getThumunAlHizbMeta.d.ts /** * Retrieves the metadata for a specific quarter (rub' al-hizb) of the Quran. * * @param eighthIndex - The index of the Eighth (thumun' al-hizb) to retrieve metadata for, where 1 is the first quarter. * @param data - The Lists object for the riwaya. * @returns An object containing the metadata for the specified quarter, including the juz' (part), hizb (section), and the quarter (rub' al-hizb) index. * * @category Hizb */ export declare function getThumunAlHizbMeta(eighthIndex: ThumunAlHizbId, data: RiwayahsWith<"HizbEighthList">): ThumunAlHizbMeta; //#endregion //#region src/getThumunAlHizbMetaByAyahId.d.ts /** * Returns the thumun al-hizb containing the given ayah id, with its first and last ayah. * * @param ayahId - The ayah id. * @param data - The Lists object of a riwaya that has thumun al-hizb data (Qalun). * @returns Juz, hizb, rub' al-hizb and thumun al-hizb numbers plus the range of the thumun. * * @category Hizb */ export declare function getThumunAlHizbMetaByAyahId(ayahId: AyahId, data: RiwayahsWith<"HizbEighthList">): ThumunAlHizbMeta; //#endregion //#region src/getSurahMeta.d.ts /** * Gets the metadata for the specified Surah. * * @param surahNum - The Surah to get the metadata for. * @param data - The Lists object containing SurahList. * @returns The metadata for the specified Surah. * * @category Surah & Ayah */ export declare function getSurahMeta(surahNum: Surah, data: RiwayaData): SurahMeta; //#endregion //#region src/isAyahJuzFirst.d.ts /** * Returns the Juz (part) number that the given Ayah (verse) belongs to. * * * @param ayahId - The Ayah Id (verse) number. * @param data - The Lists object for the riwaya. * @returns The Juz (part) number that the given Ayah belongs to. Returns Positive number if ayah is first ayah of juz, number is juz number * * @category Juz */ export declare function isAyahJuzFirst(ayahId: AyahId, data: RiwayaData): number; //#endregion //#region src/isAyahPageFirst.d.ts /** * Determines if the given ayah is the first ayah of a juz. * * @param ayahId - The ayah id . * @param data - The Lists object for the riwaya. * @returns The page number if the ayah is the first ayah of the page, otherwise -1. * * @category Page */ export declare function isAyahPageFirst(ayahId: AyahId, data: RiwayaData): number; //#endregion //#region src/isSurahAyahJuzFirst.d.ts /** * Determines if a given Surah and Ayah combination marks the beginning of a Juz. * * @param surah - The Surah number to check * @param ayah - The Ayah number within the Surah to check * @param data - The Lists object for the riwaya. * @returns The Juz number if the combination marks the start of a Juz, -1 otherwise * @throws Error When the provided Surah number is invalid * * @example * ```typescript * isSurahAyahJuzFirst(2, 142, HafsLists) // Returns 2 * isSurahAyahJuzFirst(2, 143, HafsLists) // Returns -1 * ``` * * @category Juz */ export declare function isSurahAyahJuzFirst(surah: Surah, ayah: AyahNo, data: RiwayaData): number; //#endregion //#region src/isSurahAyahPageFirst.d.ts /** * Determines if an ayah is the first ayah on its page in the Quran * @param surah - The surah number (1-114) * @param ayah - The ayah number within the surah * @param data - The data for the riwaya. * @returns The page number if the ayah is first on its page, -1 otherwise * @throws Error If surah number is invalid * * @category Page */ export declare function isSurahAyahPageFirst(surah: Surah, ayah: AyahNo, data: RiwayaData): number; //#endregion //#region src/prevAyah.d.ts /** * Get the previous ayah for the given surah and ayah number. * * @param surah - The surah number. * @param ayah - The ayah number within the surah. * @param data - The Lists object containing SurahList. * @param options - Behaviour at the start of the Quran, see {@link AyahStepOptions}. * @returns The surah and ayah number of the previous ayah, or `undefined` when `wrap` is `false` and there is no previous ayah. * * @example * ```ts * prevAyah(2, 1, HafsLists) // [1, 7] * prevAyah(1, 1, HafsLists) // [114, 6] * prevAyah(1, 1, HafsLists, { wrap: false }) // undefined * ``` * * @category Navigation */ export declare function prevAyah(surah: Surah, ayah: AyahNo, data: RiwayaData, options?: { wrap?: true; }): SurahAyah; export declare function prevAyah(surah: Surah, ayah: AyahNo, data: RiwayaData, options: AyahStepOptions): SurahAyah | undefined; //#endregion //#region src/validation.d.ts /** * Validates if the provided value is a valid Surah number. * * @param surah - The value to validate, can be a Surah object, number, or unknown type * @throws TypeError When the provided value is not an integer * @throws RangeError When the provided surah number is outside the valid range (1 to total number of surahs) * @remarks This is a type assertion function that ensures the input is a valid Surah * * @category Validation */ export declare function checkValidSurah(surah: unknown, meta: QuranMeta): asserts surah is Surah; /** * Validates if the given surah and ayah numbers form a valid combination. * @param surah - The surah number or Surah object to validate * @param ayah - The ayah number or AyahNo object to validate * @throws Error If the surah-ayah combination is invalid * * @category Validation */ export declare function checkValidSurahAyah(surah: unknown, ayah: unknown, data: RiwayaData): asserts ayah is AyahNo; /** * Validates that a surah-ayah pair contains valid values * @param surahAyah - A tuple containing surah number/object and ayah number * @throws RangeError If ayah number is not between 1 and the maximum ayah count for the given surah * @throws If surah is invalid (from checkValidSurah) * @example * ```ts * checkValidSurahAyahPair([1, 7]) // Valid * checkValidSurahAyahPair([1, 8]) // Throws RangeError * ``` * * @category Validation */ export declare function checkValidSurahAyahPair(surahAyah: [unknown, unknown], data: RiwayaData): asserts surahAyah is SurahAyah; /** * Validates and asserts that the given value is a valid Ayah ID. * An Ayah ID must be an integer between 1 and the total number of Ayahs. * * @param ayahId - The value to check as an Ayah ID * @throws TypeError If the value is not an integer * @throws RangeError If the value is not within valid Ayah ID range * * @category Validation */ export declare function checkValidAyahId(ayahId: unknown, meta: QuranMeta): asserts ayahId is AyahId; /** * Checks if a value is a valid Page number. * @param x - The value to check * @throws TypeError When the value is not an integer * @throws RangeError When the value is not within valid page range (1 to numPages) * @remarks This is a type assertion function that ensures a value is a valid Page number * * @category Validation */ export declare function checkValidPage(x: unknown, meta: QuranMeta): asserts x is Page; /** * Type guard that checks if a value is a valid Juz number. * Throws TypeError if value is not an integer. * Throws RangeError if value is outside valid Juz range. * * @param x - Value to check * @throws TypeError If value is not an integer * @throws RangeError If value is not between 1 and the total number of Juz * * @category Validation */ export declare function checkValidJuz(x: unknown, meta: QuranMeta): asserts x is Juz; /** * Type guard that checks if a value is a valid Ruku number. * @param x - The value to check * @throws TypeError If the value is not an integer number * @throws RangeError If the number is not within valid Ruku range * @example * ```ts * checkValidRuku(5); // OK * checkValidRuku("5"); // Throws TypeError * checkValidRuku(999); // Throws RangeError * ``` * * @category Validation */ export declare function checkValidRuku(x: unknown, meta: QuranMeta): asserts x is Ruku; /** * Type guard that checks if a value is a valid Manzil number. * @param x - The value to check * @throws TypeError If the value is not an integer * @throws RangeError If the value is not within valid Manzil range (1 to max manzils) * @remarks This is an assertion function that ensures the input is a valid Manzil type * * @category Validation */ export declare function checkValidManzil(x: unknown, meta: QuranMeta): asserts x is Manzil; //#endregion //#region src/index.d.ts /** * Create a QuranRiwaya instance with Hafs riwaya (default) * * @category Class API */ export declare const createHafs: () => QuranRiwaya<"Hafs">; /** * Create a QuranRiwaya instance with Qalun riwaya * * @category Class API */ export declare const createQalun: () => QuranRiwaya<"Qalun">; /** * Create a QuranRiwaya instance with Warsh riwaya * * @category Class API */ export declare const createWarsh: () => QuranRiwaya<"Warsh">; /** * Create a QuranRiwaya instance with Bazzi riwaya * * @category Class API */ export declare const createBazzi: () => QuranRiwaya<"Bazzi">; /** * Create a QuranRiwaya instance with Douri riwaya * * @category Class API */ export declare const createDouri: () => QuranRiwaya<"Douri">; /** * Create a QuranRiwaya instance with Qunbul riwaya * * @category Class API */ export declare const createQunbul: () => QuranRiwaya<"Qunbul">; /** * Create a QuranRiwaya instance with Shuba riwaya * * @category Class API */ export declare const createShuba: () => QuranRiwaya<"Shuba">; /** * Create a QuranRiwaya instance with Sousi riwaya * * @category Class API */ export declare const createSousi: () => QuranRiwaya<"Sousi">; /** * Pre-initialized QuranRiwaya instance for Hafs (for convenience) * * @category Class API */ export declare const quran: QuranRiwaya<"Hafs">; /** * Default Quran metadata (Hafs riwaya). * For other riwayas, use `quran-meta/qalun`, `quran-meta/warsh`, etc. * * @category Riwaya Data */ export declare const meta: QuranMeta; //#endregion export { type AllListsNames, type ArrayOfSameLength, type AyahCountBetweenJuzSurah, type AyahId, type AyahMeta, type AyahNo, type AyahRange, type AyahStepOptions, type FixedArray, type GrowToSize, type HizbId, type Juz, type JuzAndShift, type JuzMeta, type JuzPart, type LessThan, type Manzil, type ManzilMeta, type MissingListsPerRiwaya, type NumericRange, type Page, type PageMeta, type PartBlock, type PartListNames, type PartType, type QuranMeta, QuranRiwaya, type RangeMeta, type RangeMode, type RiwayaData, type RiwayaFullData, type RiwayaListOverrides, type RiwayaName, type Riwayas, type RiwayasNames, type RubAlHizb, type RubAlHizbId, type RubAlHizbMeta, type Ruku, type RukuMeta, type Surah, type SurahAyah, type SurahAyahPos, type SurahAyahSegment, type SurahInfo, type SurahJuzMeta, type SurahListType, type SurahMeta, type SurahName, type SurahNames, type ThumunAlHizb, type ThumunAlHizbId, type ThumunAlHizbMeta, type ThumunRiwayaName, ayahStringSplitter, formatAyahId, formatSurahAyah, generatePartBlocks, getList, getListNormalised, getRubAlHizb, getSurahName, getThumunAlHizb, isValidAyahId, isValidAyahNo, isValidHizb, isValidJuz, isValidManzil, isValidPage, isValidRubAlHizb, isValidRuku, isValidSurah, isValidSurahAyah, maxAyahsInSurah, nextAyah, numRubsInJuz, numSurahs, partNames, string2NumberSplitter, string2NumberSplitterStrict, surahNamesAr, surahNamesEn };