UNPKG

@sahabaplus/mushaf-engine

Version:

TypeScript implementation of a Quran Mushaf navigation engine

54 lines (53 loc) 1.63 kB
/** * Information about a single verse (ayah) in the Quran * * This class contains metadata about a verse, including its sura and number, * its position on the page, and how many lines it spans. */ export declare class Verse { /** * Number of the Sura (1-114) containing this verse */ sura: number; /** * Number of the verse within its sura */ number: number; /** * Position on the page as [x position 0.0-1.0, line number 1-15] */ position: [number, number]; /** * Number of lines this verse spans (can be fractional) */ lines: number; /** * Create a new Verse with the specified parameters * * @param sura - Sura number (1-114) * @param number - Verse number within the sura * @param position - Position on the page as [relative position 0.0-1.0, line number] * @param lines - Number of lines this verse spans (can be fractional) */ constructor(sura?: number, number?: number, position?: [number, number], lines?: number); /** * Check if the verse is the last of the page * * @returns true if the verse is the last of the page, false otherwise */ isLastOfPage(): boolean; /** * Create a string representation of the verse */ toString(): string; /** * Check if this verse equals another verse */ equals(other: Verse): boolean; /** * Compare this verse to another verse * Returns -1 if this verse comes before the other verse, * 0 if they are equal, and 1 if this verse comes after */ compareTo(other: Verse): number; }