quran-meta
Version:
Library with meta data and functionality related to Holy Quran
25 lines (23 loc) • 1.13 kB
text/typescript
import { PartType, RiwayaData, Riwayas } from "./types.mjs";
import { AyahId, AyahNo } from "../types.mjs";
//#region src/lists/getList.d.ts
/**
* 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 name - The type of parts to retrieve (e.g., juz, hizb, rub)
* @param data - The Lists object for the riwaya.
* @returns An array of formatted part blocks, excluding the first and last elements
*/
declare function generatePartBlocks<P extends PartType>(name: P, data: RiwayaData): PartBlock[] | null;
declare const getList: <P extends PartType, M extends Riwayas, R extends keyof M, L extends keyof Omit<M[R], "meta">>(name: P, lists: RiwayaData) => M[R][L];
declare function getListNormalised(name: PartType, lists: RiwayaData): PartBlock[];
//#endregion
export { generatePartBlocks, getList, getListNormalised };