@zodiacs/engine 0.1.1-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +502 -0
- package/LICENSE +21 -0
- package/LICENSING.md +99 -0
- package/NOTICE +58 -0
- package/README.md +785 -0
- package/dist/chunk-4OSOCZY2.js +340 -0
- package/dist/chunk-AECKV73C.js +231 -0
- package/dist/chunk-CPALRSPC.js +35 -0
- package/dist/chunk-GFT24GFR.js +25 -0
- package/dist/chunk-NAJ735VN.js +219 -0
- package/dist/chunk-ONBZ4HK7.js +285 -0
- package/dist/chunk-PFGUCNOK.js +87 -0
- package/dist/chunk-RETEVD4F.js +681 -0
- package/dist/crossings.d.ts +91 -0
- package/dist/crossings.js +8 -0
- package/dist/deltat.d.ts +73 -0
- package/dist/deltat.js +12 -0
- package/dist/geo.d.ts +58 -0
- package/dist/geo.js +312 -0
- package/dist/index.d.ts +478 -0
- package/dist/index.js +682 -0
- package/dist/internal-math-BE2hcSHd.d.ts +271 -0
- package/dist/internal-math.d.ts +3 -0
- package/dist/internal-math.js +76 -0
- package/dist/internal.d.ts +9 -0
- package/dist/internal.js +16 -0
- package/dist/receipt.d.ts +224 -0
- package/dist/receipt.js +824 -0
- package/dist/types-CeafogFp.d.ts +197 -0
- package/package.json +94 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { DeltaT } from './deltat.js';
|
|
2
|
+
|
|
3
|
+
/** Public, serializable vocabulary shared by the chart APIs. */
|
|
4
|
+
|
|
5
|
+
type DateInput = Date | string | number;
|
|
6
|
+
type ZodiacSign = "aries" | "taurus" | "gemini" | "cancer" | "leo" | "virgo" | "libra" | "scorpio" | "sagittarius" | "capricorn" | "aquarius" | "pisces";
|
|
7
|
+
type Element = "fire" | "earth" | "air" | "water";
|
|
8
|
+
type Modality = "cardinal" | "fixed" | "mutable";
|
|
9
|
+
type Polarity = "day" | "night";
|
|
10
|
+
type HouseNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
11
|
+
interface SignDefinition {
|
|
12
|
+
slug: ZodiacSign;
|
|
13
|
+
name: string;
|
|
14
|
+
element: Element;
|
|
15
|
+
modality: Modality;
|
|
16
|
+
polarity: Polarity;
|
|
17
|
+
naturalHouse: HouseNumber;
|
|
18
|
+
}
|
|
19
|
+
type BodyName = "Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | "North Node" | "South Node";
|
|
20
|
+
type HouseSystem = "whole" | "placidus" | "porphyry" | "equal" | "equal-mc" | "vehlow" | "koch" | "regiomontanus" | "campanus" | "topocentric" | "alcabitius" | "morinus" | "meridian";
|
|
21
|
+
type ChartFlag = "dst-gap" | "dst-fold" | "lmt" | "no-time" | "polar-fallback" | "outside-reference-span";
|
|
22
|
+
/**
|
|
23
|
+
* A resolved birth instant. Use `resolveBirth` from `@zodiacs/engine/geo`
|
|
24
|
+
* when starting from a local wall time and IANA timezone.
|
|
25
|
+
*/
|
|
26
|
+
interface BirthInput {
|
|
27
|
+
utc: DateInput;
|
|
28
|
+
latitude?: number;
|
|
29
|
+
longitude?: number;
|
|
30
|
+
houseSystem?: HouseSystem;
|
|
31
|
+
/** False means `utc` is a caller-supplied reference instant and suppresses angles/houses.
|
|
32
|
+
* It does not establish a UTC-noon or local-noon convention by itself. */
|
|
33
|
+
timeKnown?: boolean;
|
|
34
|
+
/** Up to 64 known flags. Duplicate claims normalize to one value. Time flags
|
|
35
|
+
* are caller assertions; no-time/polar-fallback echoes must match calculation.
|
|
36
|
+
* natalChart returns canonical semantic flags, not the raw submitted array. */
|
|
37
|
+
flags?: readonly ChartFlag[];
|
|
38
|
+
/**
|
|
39
|
+
* Fix ΔT (TT − UT1) at this many seconds instead of the engine's model. The
|
|
40
|
+
* chart then reports `deltaT.model` "pinned". Finite, at most 1e10 in size.
|
|
41
|
+
*/
|
|
42
|
+
deltaT?: number;
|
|
43
|
+
}
|
|
44
|
+
interface ChartInput {
|
|
45
|
+
utc: Date;
|
|
46
|
+
/** A caller's fixed ΔT in seconds; the engine's model when absent. */
|
|
47
|
+
deltaT?: number;
|
|
48
|
+
latitude?: number;
|
|
49
|
+
longitude?: number;
|
|
50
|
+
houseSystem: HouseSystem;
|
|
51
|
+
timeKnown: boolean;
|
|
52
|
+
flags?: readonly ChartFlag[];
|
|
53
|
+
}
|
|
54
|
+
interface BodyPosition {
|
|
55
|
+
body: BodyName;
|
|
56
|
+
/** Tropical ecliptic longitude of date, degrees in [0, 360). */
|
|
57
|
+
lon: number;
|
|
58
|
+
/** Ecliptic latitude, degrees (zero for the Moon nodes). */
|
|
59
|
+
lat: number;
|
|
60
|
+
/**
|
|
61
|
+
* Longitude speed in degrees/day, the derivative of `lon` over plus/minus
|
|
62
|
+
* 0.001 day (the nodes: plus/minus 0.25 day); negative means retrograde.
|
|
63
|
+
*/
|
|
64
|
+
speed: number;
|
|
65
|
+
retrograde: boolean;
|
|
66
|
+
sign: ZodiacSign;
|
|
67
|
+
/** Longitude inside `sign`, degrees in [0, 30). */
|
|
68
|
+
degree: number;
|
|
69
|
+
}
|
|
70
|
+
/** A chart point that is not a body; see `chartPoints`. */
|
|
71
|
+
type PointName = "Mean Node" | "Mean South Node" | "Black Moon Lilith" | "Vertex" | "East Point" | "Lot of Fortune" | "Lot of Spirit" | "Lot of Eros" | "Lot of Necessity" | "Lot of Courage" | "Lot of Victory" | "Lot of Nemesis";
|
|
72
|
+
/** Day when the Sun is above the horizon, night when it is below. */
|
|
73
|
+
type Sect = "day" | "night";
|
|
74
|
+
interface PointPosition {
|
|
75
|
+
point: PointName;
|
|
76
|
+
/** Tropical longitude of date, degrees in [0, 360). */
|
|
77
|
+
lon: number;
|
|
78
|
+
/** Ecliptic latitude, degrees; zero except for Black Moon Lilith. */
|
|
79
|
+
lat: number;
|
|
80
|
+
/**
|
|
81
|
+
* Longitude speed in degrees/day, the derivative of `lon` over plus/minus
|
|
82
|
+
* 0.001 day, for the mean node and Black Moon Lilith; null for the points the
|
|
83
|
+
* chart's angles fix.
|
|
84
|
+
*/
|
|
85
|
+
speed: number | null;
|
|
86
|
+
sign: ZodiacSign;
|
|
87
|
+
/** Longitude inside `sign`, degrees in [0, 30). */
|
|
88
|
+
degree: number;
|
|
89
|
+
}
|
|
90
|
+
interface ChartPoints {
|
|
91
|
+
/** The chart's sect; null when it has no angles. */
|
|
92
|
+
sect: Sect | null;
|
|
93
|
+
/**
|
|
94
|
+
* The mean node and its opposite point and Black Moon Lilith always; the
|
|
95
|
+
* Vertex, the East Point and the seven lots only when the chart has angles.
|
|
96
|
+
*/
|
|
97
|
+
points: PointPosition[];
|
|
98
|
+
}
|
|
99
|
+
interface Angles {
|
|
100
|
+
asc: number;
|
|
101
|
+
mc: number;
|
|
102
|
+
dsc: number;
|
|
103
|
+
ic: number;
|
|
104
|
+
}
|
|
105
|
+
interface Houses {
|
|
106
|
+
system: HouseSystem;
|
|
107
|
+
/** Cusp longitudes; array index zero is the first house. */
|
|
108
|
+
cusps: number[];
|
|
109
|
+
}
|
|
110
|
+
type AspectType = "conjunction" | "sextile" | "square" | "trine" | "opposition";
|
|
111
|
+
interface Aspect {
|
|
112
|
+
a: BodyName;
|
|
113
|
+
b: BodyName;
|
|
114
|
+
type: AspectType;
|
|
115
|
+
/** Deviation from exact, in degrees. */
|
|
116
|
+
orb: number;
|
|
117
|
+
/**
|
|
118
|
+
* True only when the orb is strictly decreasing at the chart instant, judged
|
|
119
|
+
* from the two longitude speeds. False when separating, when exact, and when
|
|
120
|
+
* the relative speed is below STATIONARY_RELATIVE_SPEED; aspectMotion tells
|
|
121
|
+
* the last case apart.
|
|
122
|
+
*/
|
|
123
|
+
applying: boolean;
|
|
124
|
+
}
|
|
125
|
+
interface Chart {
|
|
126
|
+
input: ChartInput;
|
|
127
|
+
bodies: BodyPosition[];
|
|
128
|
+
/** Present only when a time and coordinates are available. */
|
|
129
|
+
angles: Angles | null;
|
|
130
|
+
houses: Houses | null;
|
|
131
|
+
aspects: Aspect[];
|
|
132
|
+
flags: ChartFlag[];
|
|
133
|
+
/** The ΔT (TT − UT1) the chart was computed with, its band and its source. */
|
|
134
|
+
deltaT: DeltaT;
|
|
135
|
+
engineVersion: string;
|
|
136
|
+
}
|
|
137
|
+
interface MinimalBody {
|
|
138
|
+
body: string;
|
|
139
|
+
lon: number;
|
|
140
|
+
}
|
|
141
|
+
interface InterAspect {
|
|
142
|
+
/** Body in the first chart (or the moving body for `transits`). */
|
|
143
|
+
a: string;
|
|
144
|
+
aLon: number;
|
|
145
|
+
/** Body in the second chart (or the natal body for `transits`). */
|
|
146
|
+
b: string;
|
|
147
|
+
bLon: number;
|
|
148
|
+
type: AspectType;
|
|
149
|
+
orb: number;
|
|
150
|
+
}
|
|
151
|
+
interface PairSummary {
|
|
152
|
+
aspects: InterAspect[];
|
|
153
|
+
top: InterAspect[];
|
|
154
|
+
counts: Record<AspectType, number>;
|
|
155
|
+
easeful: number;
|
|
156
|
+
charged: number;
|
|
157
|
+
elements: {
|
|
158
|
+
a: Record<Element, number>;
|
|
159
|
+
b: Record<Element, number>;
|
|
160
|
+
};
|
|
161
|
+
modalities: {
|
|
162
|
+
a: Record<Modality, number>;
|
|
163
|
+
b: Record<Modality, number>;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
interface SynastryResult extends PairSummary {
|
|
167
|
+
a: Chart;
|
|
168
|
+
b: Chart;
|
|
169
|
+
}
|
|
170
|
+
interface TransitResult {
|
|
171
|
+
natal: Chart;
|
|
172
|
+
at: Date;
|
|
173
|
+
positions: BodyPosition[];
|
|
174
|
+
/** Moving-body-to-natal-body aspects, sorted by orb. */
|
|
175
|
+
aspects: InterAspect[];
|
|
176
|
+
}
|
|
177
|
+
type MoonPhaseName = "New Moon" | "Waxing Crescent" | "First Quarter" | "Waxing Gibbous" | "Full Moon" | "Waning Gibbous" | "Last Quarter" | "Waning Crescent";
|
|
178
|
+
interface MoonPhase {
|
|
179
|
+
at: Date;
|
|
180
|
+
/** Elongation Moon minus Sun: 0 = new, 180 = full. */
|
|
181
|
+
angle: number;
|
|
182
|
+
/** Illuminated fraction in [0, 1]. */
|
|
183
|
+
illumination: number;
|
|
184
|
+
name: MoonPhaseName;
|
|
185
|
+
waxing: boolean;
|
|
186
|
+
}
|
|
187
|
+
declare const ENGINE_VERSION = "0.1.1-rc.14";
|
|
188
|
+
/**
|
|
189
|
+
* The ephemeris underneath every position. The dependency is pinned to this
|
|
190
|
+
* exact version, so receipts can name it without asking the caller.
|
|
191
|
+
*/
|
|
192
|
+
declare const EPHEMERIS: Readonly<{
|
|
193
|
+
readonly name: "astronomy-engine";
|
|
194
|
+
readonly version: "2.1.19";
|
|
195
|
+
}>;
|
|
196
|
+
|
|
197
|
+
export { type Angles as A, type BodyName as B, type ChartInput as C, type DateInput as D, type Element as E, type HouseSystem as H, type InterAspect as I, type MoonPhase as M, type PairSummary as P, type SynastryResult as S, type TransitResult as T, type ZodiacSign as Z, type BodyPosition as a, type Chart as b, type ChartFlag as c, type BirthInput as d, type ChartPoints as e, type Sect as f, type MinimalBody as g, type Modality as h, type Aspect as i, type AspectType as j, ENGINE_VERSION as k, EPHEMERIS as l, type HouseNumber as m, type Houses as n, type MoonPhaseName as o, type PointName as p, type PointPosition as q, type Polarity as r, type SignDefinition as s };
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zodiacs/engine",
|
|
3
|
+
"version": "0.1.1-rc.14",
|
|
4
|
+
"description": "Browser-first tropical astrology calculations used by Zodiacs.org.",
|
|
5
|
+
"license": "MIT AND CC-BY-4.0",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"astrology",
|
|
8
|
+
"ephemeris",
|
|
9
|
+
"natal-chart",
|
|
10
|
+
"synastry",
|
|
11
|
+
"transits",
|
|
12
|
+
"typescript",
|
|
13
|
+
"zodiac"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/zodiacs-org/engine#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/zodiacs-org/engine/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/zodiacs-org/engine.git"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./crossings": {
|
|
33
|
+
"types": "./dist/crossings.d.ts",
|
|
34
|
+
"import": "./dist/crossings.js"
|
|
35
|
+
},
|
|
36
|
+
"./deltat": {
|
|
37
|
+
"types": "./dist/deltat.d.ts",
|
|
38
|
+
"import": "./dist/deltat.js"
|
|
39
|
+
},
|
|
40
|
+
"./geo": {
|
|
41
|
+
"types": "./dist/geo.d.ts",
|
|
42
|
+
"import": "./dist/geo.js"
|
|
43
|
+
},
|
|
44
|
+
"./internal": {
|
|
45
|
+
"types": "./dist/internal.d.ts",
|
|
46
|
+
"import": "./dist/internal.js"
|
|
47
|
+
},
|
|
48
|
+
"./internal/math": {
|
|
49
|
+
"types": "./dist/internal-math.d.ts",
|
|
50
|
+
"import": "./dist/internal-math.js"
|
|
51
|
+
},
|
|
52
|
+
"./receipt": {
|
|
53
|
+
"types": "./dist/receipt.d.ts",
|
|
54
|
+
"import": "./dist/receipt.js"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"dist/*.d.ts",
|
|
59
|
+
"dist/*.js",
|
|
60
|
+
"README.md",
|
|
61
|
+
"CHANGELOG.md",
|
|
62
|
+
"LICENSE",
|
|
63
|
+
"LICENSING.md",
|
|
64
|
+
"NOTICE"
|
|
65
|
+
],
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": "^20.19.0 || >=22.7.0"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"build": "tsup src/index.ts src/crossings.ts src/deltat.ts src/geo.ts src/receipt.ts src/internal.ts src/internal-math.ts --format esm --dts --clean --splitting --tsconfig tsconfig.build.json",
|
|
74
|
+
"docs": "typedoc --options typedoc.json",
|
|
75
|
+
"exports:smoke": "node scripts/module-resolution-smoke.mjs",
|
|
76
|
+
"consumer:smoke": "node scripts/verify-packed-consumer.mjs",
|
|
77
|
+
"package:contents": "node scripts/verify-package-contents.mjs",
|
|
78
|
+
"archive:binding": "node scripts/verify-archive-binding.mjs",
|
|
79
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
80
|
+
"prepack": "npm run build",
|
|
81
|
+
"test": "vitest run",
|
|
82
|
+
"typecheck": "tsc -p tsconfig.typecheck.json --pretty false"
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"astronomy-engine": "2.1.19"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"@types/node": "^22.19.19",
|
|
89
|
+
"tsup": "^8.5.1",
|
|
90
|
+
"typedoc": "^0.28.20",
|
|
91
|
+
"typescript": "^5.9.3",
|
|
92
|
+
"vitest": "^2.1.9"
|
|
93
|
+
}
|
|
94
|
+
}
|