salat-first
Version:
Islamic prayer times calculation with special support for Moroccan methods and Maliki madhab
45 lines (44 loc) • 1.46 kB
TypeScript
import { Coordinates } from "../core/coordinates";
/**
* Common locations with their coordinates
*/
export declare const COMMON_LOCATIONS: {
MAKKAH: Coordinates;
MADINAH: Coordinates;
CASABLANCA: Coordinates;
RABAT: Coordinates;
FEZ: Coordinates;
MARRAKECH: Coordinates;
RIYADH: Coordinates;
ISTANBUL: Coordinates;
CAIRO: Coordinates;
DUBAI: Coordinates;
LONDON: Coordinates;
NEW_YORK: Coordinates;
PARIS: Coordinates;
TOKYO: Coordinates;
SYDNEY: Coordinates;
};
/**
* Creates a new coordinates object with validation
* @param latitude The latitude in decimal degrees
* @param longitude The longitude in decimal degrees
* @returns The validated coordinates
*/
export declare function createCoordinates(latitude: number, longitude: number): Coordinates;
/**
* Finds the nearest common location to given coordinates
* @param coordinates The coordinates to find the nearest location for
* @returns The name of the nearest common location and the distance in kilometers
*/
export declare function findNearestLocation(coordinates: Coordinates): {
name: string;
distance: number;
};
/**
* Calculates the distance between two coordinates using the Haversine formula
* @param coords1 The first coordinates
* @param coords2 The second coordinates
* @returns The distance in kilometers
*/
export declare function calculateDistance(coords1: Coordinates, coords2: Coordinates): number;