-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from batoulapps/refactor
Refactor
- Loading branch information
Showing
36 changed files
with
12,801 additions
and
2,741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules/ | ||
node_modules/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
|
Oops, something went wrong.