UNPKG

salat-first

Version:

Islamic prayer times calculation with special support for Moroccan methods and Maliki madhab

82 lines (81 loc) 3.11 kB
import { Madhab } from "../madhab"; import { CalculationMethod } from "../methods"; import { PrayerTimes } from "./times"; import { Rounding } from "../utils/formatting"; /** * Calculation parameters for prayer times */ export declare class CalculationParameters { method: CalculationMethod; fajrAngle: number; ishaAngle: number; ishaInterval: number; maghribAngle: number; /** * Madhab for Asr calculation */ madhab: Madhab; /** * Manual adjustments (in minutes) to be added to each prayer time */ adjustments: { [key: string]: number; }; /** * Adjustments set by a calculation method (in minutes) */ methodAdjustments: { [key: string]: number; }; /** * How seconds are rounded when calculating prayer times */ rounding: Rounding; /** * Creates a new calculation parameters object * @param method The calculation method * @param fajrAngle Angle of the sun below the horizon for Fajr * @param ishaAngle Angle of the sun below the horizon for Isha * @param ishaInterval Minutes after Maghrib for Isha (if > 0, ishaAngle is not used) * @param maghribAngle Angle of the sun below the horizon for Maghrib */ constructor(method: CalculationMethod, fajrAngle?: number, ishaAngle?: number, ishaInterval?: number, maghribAngle?: number); /** * Gets the shadow length multiplier for the current madhab * @returns The shadow length multiplier */ getShadowLength(): number; } /** * Main calculator for prayer times */ export declare class PrayerCalculator { /** * Calculates prayer times for a specific location and date * @param latitude Latitude of the location * @param longitude Longitude of the location * @param date Date for prayer calculation (defaults to today) * @param method Calculation method (defaults to MoroccanHabous) * @param madhab Madhab for Asr calculation (defaults to method's default) * @returns Prayer times object */ static getPrayerTimes(latitude: number, longitude: number, date?: Date, method?: CalculationMethod, madhab?: Madhab): PrayerTimes; /** * Gets the current prayer for a specific location and time * @param latitude Latitude of the location * @param longitude Longitude of the location * @param date Date and time to check (defaults to now) * @param method Calculation method (defaults to MoroccanHabous) * @returns The current prayer name */ static getCurrentPrayer(latitude: number, longitude: number, date?: Date, method?: CalculationMethod): string; /** * Gets the next prayer for a specific location and time * @param latitude Latitude of the location * @param longitude Longitude of the location * @param date Date and time to check (defaults to now) * @param method Calculation method (defaults to MoroccanHabous) * @returns The next prayer name */ static getNextPrayer(latitude: number, longitude: number, date?: Date, method?: CalculationMethod): string; }