Skip to content

Commit

Permalink
Merge pull request #8 from batoulapps/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
z3bi authored Apr 17, 2020
2 parents 72ef780 + ea59e00 commit a7d7e0c
Show file tree
Hide file tree
Showing 36 changed files with 12,801 additions and 2,741 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
coverage/
6 changes: 5 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
test/
example.html
Shared/
coverage/
example.html
.travis.yml
jest.config.js
babel.config.js
webpack.config.js
86 changes: 86 additions & 0 deletions Adhan.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
export as namespace adhan;

export class PrayerTimes {
constructor(coordinates: Coordinates, date: Date, params: CalculationParameters);

fajr: Date;
sunrise: Date;
dhuhr: Date;
asr: Date;
maghrib: Date;
isha: Date;

timeForPrayer(prayer: Prayer): Date;
currentPrayer(date?: Date): Prayer;
nextPrayer(date?: Date): Prayer;
}

export class CalculationParameters {
constructor(fajrAngle: number, ishaAngle: number, ishaInterval: number, methodName?: string)

readonly method: string;
fajrAngle: number;
ishaAngle: number;
ishaInterval: number;
madhab: Madhab;
highLatitudeRule: HighLatitudeRule;
adjustments: PrayerAdjustments;
}

export interface PrayerAdjustments {
fajr: number;
sunrise: number;
dhuhr: number;
asr: number;
maghrib: number;
isha: number;
}

export namespace CalculationMethod {
export function MuslimWorldLeague(): CalculationParameters;
export function Egyptian(): CalculationParameters;
export function Karachi(): CalculationParameters;
export function UmmAlQura(): CalculationParameters;
export function Dubai(): CalculationParameters;
export function MoonsightingCommittee(): CalculationParameters;
export function NorthAmerica(): CalculationParameters;
export function Kuwait(): CalculationParameters;
export function Qatar(): CalculationParameters;
export function Singapore(): CalculationParameters;
export function Other(): CalculationParameters;
}

export class Coordinates {
constructor(longitude: number, latitude: number);
longitude: number;
latitude: number;
}

export class SunnahTimes {
constructor(prayerTimes: PrayerTimes);

middleOfTheNight: Date;
lastThirdOfTheNight: Date;
}

export enum Madhab {
Shafi,
Hanafi
}

export enum Prayer {
Fajr,
Sunrise,
Dhuhr,
Asr,
Maghrib,
Isha,
None
}

export enum HighLatitudeRule {
MiddleOfTheNight,
SeventhOfTheNight,
TwilightAngle
}

Loading

0 comments on commit a7d7e0c

Please sign in to comment.