-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b76a9d4
commit 0f6c90c
Showing
4 changed files
with
125 additions
and
5 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
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,3 +1,115 @@ | ||
# API Reference | ||
|
||
WIP | ||
## Table of Contents | ||
|
||
- [StaticCalculator](#StaticCalculator) | ||
- [Constructor](#StaticCalculator-Constructor) | ||
- [Methods](#StaticCalculator-Methods) | ||
- [ReactiveCalculator](#ReactiveCalculator) | ||
- [Constructor](#ReactiveCalculator-Constructor) | ||
- [Methods](#ReactiveCalculator-Methods) | ||
- [Helper Functions](#Helper-Functions) | ||
- [calculateQibla](#calculateQibla) | ||
- [Types](#Types) | ||
- [CoordinatesObject](#CoordinatesObject) | ||
- [TimeObject](#TimeObject) | ||
|
||
--- | ||
|
||
## StaticCalculator | ||
|
||
### Constructor | ||
|
||
#### `new StaticCalculator(config: CalculationsConfig)` | ||
|
||
Initializes a new `StaticCalculator` instance. | ||
|
||
**Parameters:** | ||
|
||
- `config`: [CalculationsConfig](#CalculationsConfig) | ||
|
||
**Example:** | ||
|
||
```ts | ||
const calculator = new StaticCalculator({ | ||
/* config options */ | ||
}) | ||
``` | ||
|
||
### Methods | ||
|
||
#### `getQiblaDirection(coordinates?: CoordinatesObject): number` | ||
|
||
Calculates the Qibla direction. | ||
|
||
**Parameters:** | ||
|
||
- `coordinates`: Optional. [CoordinatesObject](#CoordinatesObject) | ||
|
||
**Example:** | ||
|
||
```ts | ||
const direction = calculator.getQiblaDirection() | ||
``` | ||
|
||
--- | ||
|
||
## ReactiveCalculator | ||
|
||
### Constructor | ||
|
||
#### `new ReactiveCalculator(config: CalculationsConfig)` | ||
|
||
Initializes a new `ReactiveCalculator` instance. | ||
|
||
### Methods | ||
|
||
#### `cleanup(): void` | ||
|
||
Cleans up all subscriptions. | ||
|
||
**Example:** | ||
|
||
```ts | ||
reactiveCalculator.cleanup() | ||
``` | ||
|
||
--- | ||
|
||
## Helper Functions | ||
|
||
### calculateQibla | ||
|
||
#### `calculateQibla(coordinates: CoordinatesObject): number` | ||
|
||
Calculates the Qibla direction based on the given coordinates. | ||
|
||
**Example:** | ||
|
||
```ts | ||
const direction = calculateQibla({ latitude: 40.7128, longitude: -74.006 }) | ||
``` | ||
|
||
--- | ||
|
||
## Types | ||
|
||
### CoordinatesObject | ||
|
||
```ts | ||
{ | ||
latitude: number | ||
longitude: number | ||
} | ||
``` | ||
|
||
### TimeObject | ||
|
||
```ts | ||
{ | ||
name: string | ||
time: Date | ||
} | ||
``` | ||
|
||
--- |
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,7 +1,13 @@ | ||
# Testing | ||
|
||
::: tip | ||
This is a work in progress. If you have any questions or suggestions, please [open an issue]() or [start a discussion](). | ||
::: warning Work in progress | ||
We're currently evaluating the inclusion of testing utilities. While they may not be available in version 1, we're considering adding them in future releases. Your input is valuable to us. Feel free to open an [issue]() for questions or suggestions. | ||
::: | ||
|
||
Testing reactive code can be tricky. That's why `prayer-call` provides some helpers that allows you to test your reactive code in a synchronous manner. | ||
|
||
<!-- | ||
Testing your code | ||
how to use timers to go to the past or the future | ||
how to use marble tests to test the expected outputs | ||
--> |
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,5 +1,7 @@ | ||
- Offer open source tools to make comparing and making methods easier. | ||
- Offer open source tools to make comparing and building calculation methods easier. | ||
- Re-write the library from scratch making it reactive from the ground up (using vue 3 reactive core api) | ||
- improve the docs to have examples imported from actual ts files <!-- https://vitepress.dev/guide/markdown#import-code-snippets --> | ||
- translated the docs to Arabic | ||
- Add altitude to the calculation formula | ||
- Support `Temporal` instead of `Date` | ||
- Offer testing utilities for reactive code |