salat-first
Version:
Islamic prayer times calculation with special support for Moroccan methods and Maliki madhab
92 lines (91 loc) • 2.5 kB
TypeScript
import { Coordinates } from "../core/coordinates";
import { CalculationParameters } from "./calculator";
/**
* Class representing prayer times for a specific date and location
*/
export declare class PrayerTimes {
coordinates: Coordinates;
date: Date;
calculationParameters: CalculationParameters;
/**
* Fajr prayer time
*/
fajr: Date;
/**
* Sunrise time
*/
sunrise: Date;
/**
* Dhuhr prayer time
*/
dhuhr: Date;
/**
* Asr prayer time
*/
asr: Date;
/**
* Sunset time
*/
sunset: Date;
/**
* Maghrib prayer time
*/
maghrib: Date;
/**
* Isha prayer time
*/
isha: Date;
/**
* Creates a new prayer times object
* @param coordinates The coordinates
* @param date The date
* @param calculationParameters The calculation parameters
*/
constructor(coordinates: Coordinates, date: Date, calculationParameters: CalculationParameters);
/**
* Calculates the hour angle for a given angle, declination and latitude
* @param angle The angle in degrees
* @param declination The solar declination in degrees
* @param latitude The latitude in degrees
* @param afterTransit Whether the hour angle is after transit (true) or before (false)
* @returns The hour angle in degrees
*/
private calculateHourAngle;
/**
* Converts an hour angle to a time
* @param hourAngle The hour angle in degrees
* @param date The base date
* @returns The time
*/
private timeFromHourAngle;
/**
* Gets the time for a specific prayer
* @param prayer The prayer name
* @returns The prayer time or null if invalid
*/
getTimeForPrayer(prayer: string): Date | null;
/**
* Gets the current prayer at a specific time
* @param time The time to check (defaults to now)
* @returns The current prayer name
*/
getCurrentPrayer(time?: Date): string;
/**
* Gets the next prayer at a specific time
* @param time The time to check (defaults to now)
* @returns The next prayer name
*/
getNextPrayer(time?: Date): string;
/**
* Gets all prayer times as an object
* @returns Object with all prayer times
*/
getAllTimes(): {
[key: string]: Date;
};
/**
* Returns a string representation of all prayer times
* @returns String with all prayer times
*/
toString(): string;
}