diff --git a/.wiki/API-Reference.md b/.github/wiki/API-Reference.md similarity index 100% rename from .wiki/API-Reference.md rename to .github/wiki/API-Reference.md diff --git a/.wiki/Architecture.md b/.github/wiki/Architecture.md similarity index 100% rename from .wiki/Architecture.md rename to .github/wiki/Architecture.md diff --git a/.wiki/Home.md b/.github/wiki/Home.md similarity index 100% rename from .wiki/Home.md rename to .github/wiki/Home.md diff --git a/.github/workflows/wiki-sync.yml b/.github/workflows/wiki-sync.yml index 974c6c6..69b3350 100644 --- a/.github/workflows/wiki-sync.yml +++ b/.github/workflows/wiki-sync.yml @@ -3,7 +3,7 @@ name: Sync Wiki on: push: branches: [main] - paths: [".wiki/**"] + paths: [".github/wiki/**"] workflow_dispatch: permissions: @@ -29,7 +29,7 @@ jobs: - name: Sync wiki pages if: steps.clone_wiki.outputs.wiki_exists == 'true' run: | - cp .wiki/*.md .wiki-remote/ + cp .github/wiki/*.md .wiki-remote/ cd .wiki-remote git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" diff --git a/src/index.ts b/src/index.ts index 8b0779d..43da950 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,14 +10,17 @@ * @module */ -/** Latitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees north). */ -export const KAABA_LAT = 21.422511; +export * from "./types.js"; -/** Longitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees east). */ -export const KAABA_LNG = 39.82615; - -/** Mean radius of the Earth in kilometers (WGS-84 volumetric mean). */ -export const EARTH_RADIUS_KM = 6371; +import { + KAABA_LAT, + KAABA_LNG, + EARTH_RADIUS_KM, + COMPASS_ABBR, + COMPASS_NAMES, + type CompassAbbr, + type CompassName, +} from "./types.js"; const DEG = Math.PI / 180; @@ -50,26 +53,7 @@ export function qiblaAngle(lat: number, lng: number): number { return (Math.atan2(y, x) / DEG + 360) % 360; } -/** Eight-point compass abbreviations. */ -const COMPASS_ABBR = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] as const; -/** Eight-point compass full names. */ -const COMPASS_NAMES = [ - "North", - "Northeast", - "East", - "Southeast", - "South", - "Southwest", - "West", - "Northwest", -] as const; - -/** Compass abbreviation type. */ -export type CompassAbbr = (typeof COMPASS_ABBR)[number]; - -/** Compass full name type. */ -export type CompassName = (typeof COMPASS_NAMES)[number]; /** * Eight-point compass abbreviation for a bearing. diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..a2b59e4 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,30 @@ +/** Latitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees north). */ +export const KAABA_LAT = 21.422511; + +/** Longitude of the Ka'bah center, Masjid al-Haram, Mecca (degrees east). */ +export const KAABA_LNG = 39.82615; + +/** Mean radius of the Earth in kilometers (WGS-84 volumetric mean). */ +export const EARTH_RADIUS_KM = 6371; + +/** Eight-point compass abbreviations. */ +export const COMPASS_ABBR = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"] as const; + +/** Eight-point compass full names. */ +export const COMPASS_NAMES = [ + "North", + "Northeast", + "East", + "Southeast", + "South", + "Southwest", + "West", + "Northwest", +] as const; + +/** Compass abbreviation type. */ +export type CompassAbbr = (typeof COMPASS_ABBR)[number]; + +/** Compass full name type. */ +export type CompassName = (typeof COMPASS_NAMES)[number]; +