quran-meta
Version:
Library with meta data and functionality related to Holy Quran
26 lines (24 loc) • 917 B
text/typescript
import { AyahId, AyahNo } from "./types.cjs";
//#region src/getList.d.ts
declare const partNames: readonly ["surah", "juz", "page", "manzil", "rubAlHizb", "ruku"];
type PartType = (typeof partNames)[number];
/**
* An object that maps part types to their corresponding data lists.
*/
/**
* Represents a block or section of the Quran with its starting ayah and length
* startAyahId - The identifier of the first ayah in the block
* ayahCount - The number of ayahs contained in this block
*/
type PartBlock = {
startAyahId: AyahId;
ayahCount: AyahId | AyahNo;
};
/**
* Retrieves a formatted list of Quran parts based on the specified type.
* @param type - The type of parts to retrieve (e.g., juz, hizb, rub)
* @returns An array of formatted part blocks, excluding the first and last elements
*/
declare function getList(type: PartType): PartBlock[];
//#endregion
export { PartType, getList, partNames };