@zodiacs/engine 0.1.1-rc.15 → 1.0.0

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +891 -0
  2. package/LICENSING.md +192 -12
  3. package/NOTICE +96 -2
  4. package/README.md +296 -66
  5. package/dist/{api-CoB_kqE3.d.ts → api-WbxJ4Wj-.d.ts} +15 -10
  6. package/dist/ayanamsa--YQ46fET.d.ts +134 -0
  7. package/dist/calc.d.ts +390 -0
  8. package/dist/calc.js +1039 -0
  9. package/dist/chunk-47ERTK5X.js +27 -0
  10. package/dist/chunk-7TRLIFFI.js +56 -0
  11. package/dist/chunk-A3U2ZS2W.js +29 -0
  12. package/dist/{chunk-KHBLFXFG.js → chunk-B5LKF437.js} +29 -28
  13. package/dist/{chunk-ONBZ4HK7.js → chunk-BHJXUY67.js} +4 -2
  14. package/dist/{chunk-OYGRVGXD.js → chunk-CHSYDKBL.js} +3 -3
  15. package/dist/{chunk-ZHVI3KWJ.js → chunk-DMGHYCDI.js} +4 -4
  16. package/dist/{chunk-CWI4YUDL.js → chunk-FTX3JDJA.js} +21 -18
  17. package/dist/{chunk-MFF3VKO3.js → chunk-OG4OYTJJ.js} +47 -42
  18. package/dist/{chunk-ZZPITHQS.js → chunk-SRXBTP5H.js} +199 -65
  19. package/dist/{chunk-AECKV73C.js → chunk-TSS2SZWQ.js} +8 -2
  20. package/dist/chunk-WS3TDSP3.js +474 -0
  21. package/dist/chunk-YIITY7Q7.js +483 -0
  22. package/dist/crossings.d.ts +8 -7
  23. package/dist/crossings.js +1 -1
  24. package/dist/deltat.d.ts +28 -3
  25. package/dist/deltat.js +1 -1
  26. package/dist/geo.d.ts +33 -12
  27. package/dist/geo.js +17 -458
  28. package/dist/{internal-math-BbktkHCc.d.ts → houses-CFERsAlK.d.ts} +14 -160
  29. package/dist/houses-extra.d.ts +95 -0
  30. package/dist/houses-extra.js +339 -0
  31. package/dist/index.d.ts +34 -48
  32. package/dist/index.js +31 -23
  33. package/dist/internal-math-DJJ8BYex.d.ts +174 -0
  34. package/dist/internal-math.d.ts +3 -2
  35. package/dist/internal-math.js +2 -2
  36. package/dist/internal.d.ts +1 -1
  37. package/dist/internal.js +5 -5
  38. package/dist/receipt.d.ts +2 -243
  39. package/dist/receipt.js +78 -37
  40. package/dist/reference-span-CILpclrz.d.ts +40 -0
  41. package/dist/rulers-Dla6h_Sm.d.ts +15 -0
  42. package/dist/sky.d.ts +173 -0
  43. package/dist/sky.js +379 -0
  44. package/dist/techniques.d.ts +453 -0
  45. package/dist/techniques.js +823 -0
  46. package/dist/timing.d.ts +113 -17
  47. package/dist/timing.js +98 -64
  48. package/dist/{types-BsWaqwU_.d.ts → types-B-yb_tGL.d.ts} +23 -11
  49. package/dist/vedic.d.ts +42 -124
  50. package/dist/vedic.js +44 -458
  51. package/dist/window.d.ts +180 -0
  52. package/dist/window.js +960 -0
  53. package/dist/zone-history-ghdyO0Sc.d.ts +268 -0
  54. package/package.json +25 -3
@@ -0,0 +1,134 @@
1
+ import { DeltaT } from './deltat.js';
2
+ import { T as TimeScaleName, e as TimeScale, D as DateInput } from './types-B-yb_tGL.js';
3
+
4
+ /** The precession model of an epoch value: the engine's IAU 2006, Newcomb's (Kinoshita 1975) or IAU 1976. */
5
+ type AyanamsaPrecessionModel = "engine" | "newcomb" | "iau1976";
6
+ /** The built-in ayanamsas: the keys of AYANAMSAS. */
7
+ type AyanamsaName = "lahiri" | "fagan-bradley" | "krishnamurti" | "raman" | "yukteswar" | "true-chitra" | "true-revati" | "true-pushya" | "galactic-center";
8
+ interface Definition {
9
+ readonly name: string;
10
+ readonly label: string;
11
+ /** Short citation; docs/vedic.md has the full one. */
12
+ readonly source: string;
13
+ }
14
+ /**
15
+ * A mean `value` (degrees) at TT Julian date `epochTT`, computed with
16
+ * `model`'s precession. The engine holds the zodiac where that model puts it
17
+ * at J2000.0 and carries it with its own; with an older model its value at
18
+ * the epoch differs from `value`.
19
+ */
20
+ interface EpochAyanamsa extends Definition {
21
+ readonly kind: "epoch";
22
+ readonly epochTT: number;
23
+ readonly value: number;
24
+ readonly model: AyanamsaPrecessionModel;
25
+ }
26
+ /** `value` degrees at `epochTT` plus `rate` arcseconds per Julian year (365.25 days of TT). */
27
+ interface LinearAyanamsa extends Definition {
28
+ readonly kind: "linear";
29
+ readonly epochTT: number;
30
+ readonly value: number;
31
+ readonly rate: number;
32
+ }
33
+ /** A catalogue star, ICRS, with its space motion. */
34
+ interface CatalogueStar {
35
+ readonly name: string;
36
+ /** Right ascension and declination at `epochTT`, degrees. */
37
+ readonly ra: number;
38
+ readonly dec: number;
39
+ readonly epochTT: number;
40
+ /** Proper motion, mas/yr; `pmRa` is μα·cos δ. */
41
+ readonly pmRa: number;
42
+ readonly pmDec: number;
43
+ /** Parallax, mas (0: at infinity). */
44
+ readonly parallax: number;
45
+ /** Radial velocity, km/s. */
46
+ readonly radialVelocity: number;
47
+ }
48
+ /** The star's apparent geocentric place sits at sidereal `longitude` degrees at every instant. */
49
+ interface StarAyanamsa extends Definition {
50
+ readonly kind: "star";
51
+ readonly star: CatalogueStar;
52
+ readonly longitude: number;
53
+ }
54
+ /** A definition; functions accept only AYANAMSAS entries and userAyanamsa results. */
55
+ type AyanamsaDefinition = EpochAyanamsa | LinearAyanamsa | StarAyanamsa;
56
+ /** The built-in definitions. docs/vedic.md cites each in full. */
57
+ declare const AYANAMSAS: Readonly<Record<AyanamsaName, AyanamsaDefinition>>;
58
+ /** Input to userAyanamsa. */
59
+ interface UserAyanamsaInput {
60
+ /** Lowercase identifier, at most 64 characters, not a built-in name; default "user". */
61
+ readonly name?: string | undefined;
62
+ /**
63
+ * When `value` holds: `{ julianDateTT }`, a TT Julian date within the Date
64
+ * range, or a UTC instant as a Date or an ISO 8601 string, read on the
65
+ * engine's time basis. A bare number is refused: it could be a Julian date
66
+ * or epoch milliseconds.
67
+ */
68
+ readonly epoch: Date | string | {
69
+ readonly julianDateTT: number;
70
+ };
71
+ /** The mean ayanamsa at `epoch` as `model` computes it, degrees, in [−360, 360]. */
72
+ readonly value: number;
73
+ /** Arcseconds per Julian year, in [−3600, 3600]: a linear ayanamsa. */
74
+ readonly rate?: number | undefined;
75
+ /**
76
+ * Without `rate`: the model `value` was computed with, default "engine"
77
+ * (`value` then holds at `epoch`); an older model's zodiac is held at
78
+ * J2000.0, as for the built-ins.
79
+ */
80
+ readonly model?: AyanamsaPrecessionModel | undefined;
81
+ }
82
+ /**
83
+ * A caller's ayanamsa, frozen. Refuses a key not named in UserAyanamsaInput, a
84
+ * built-in name, a bare-number epoch, both `rate` and `model`, and
85
+ * out-of-range values.
86
+ */
87
+ declare function userAyanamsa(input: UserAyanamsaInput): AyanamsaDefinition;
88
+ /** An ayanamsa at an instant; made only by `ayanamsa`. Degrees throughout. */
89
+ interface AyanamsaValue {
90
+ /** The definition's name. */
91
+ readonly ayanamsa: string;
92
+ /**
93
+ * The instant as given, ISO 8601, on the scale `timeScale.input` names (UTC
94
+ * unless the options say otherwise), named as ChartInput.utc is: on UT1 or
95
+ * TT input it is that reading, with a Z. A SiderealLongitude made from this
96
+ * value has the UTC instant of the time basis in its own `utc`.
97
+ */
98
+ readonly utc: string;
99
+ /** How the instant became UT1 and TT, as a chart's `timeScale` (docs/time.md). */
100
+ readonly timeScale: TimeScale;
101
+ readonly julianDateTT: number;
102
+ /** The ΔT (TT − UT1) the instant was read with: its time basis's, or the pin. */
103
+ readonly deltaT: DeltaT;
104
+ /** Referred to the mean equinox and ecliptic of date, in (−180, 180]. */
105
+ readonly mean: number;
106
+ /** The engine's nutation in longitude Δψ. */
107
+ readonly nutation: number;
108
+ /** mean + nutation: subtract it from the engine's tropical longitudes. */
109
+ readonly true: number;
110
+ /** "outside-reference-span" when the instant, or an epoch definition's epoch, is outside REFERENCE_SPAN. */
111
+ readonly flags: readonly AyanamsaFlag[];
112
+ }
113
+ /**
114
+ * A flag on an ayanamsa's value. A minor release may add one, as for a
115
+ * chart's flags, so code that switches on a flag should handle one it does
116
+ * not know.
117
+ */
118
+ type AyanamsaFlag = "outside-reference-span";
119
+ /** Options for ayanamsa. A key not named here is refused with a RangeError. */
120
+ interface AyanamsaOptions {
121
+ /** A fixed ΔT (TT − UT1) in seconds, as BirthInput.deltaT; the engine's time basis when absent. */
122
+ readonly deltaT?: number | undefined;
123
+ /** The scale the instant is on, as BirthInput.timeScale: "utc" (default), "ut1" or "tt". */
124
+ readonly timeScale?: TimeScaleName | undefined;
125
+ }
126
+ /**
127
+ * The mean and true ayanamsa of a definition at an instant, read as a chart
128
+ * reads its own: on the engine's time basis, or a pinned ΔT, and refused
129
+ * outside EPHEMERIS_SPAN. `true` adds the engine's nutation in longitude (IAU
130
+ * 2000B, all 77 terms), which cancels from sidereal longitudes.
131
+ */
132
+ declare function ayanamsa(definition: AyanamsaName | AyanamsaDefinition, at: DateInput, options?: AyanamsaOptions): AyanamsaValue;
133
+
134
+ export { type AyanamsaName as A, type CatalogueStar as C, type EpochAyanamsa as E, type LinearAyanamsa as L, type StarAyanamsa as S, type UserAyanamsaInput as U, type AyanamsaPrecessionModel as a, type AyanamsaValue as b, type AyanamsaDefinition as c, AYANAMSAS as d, type AyanamsaFlag as e, type AyanamsaOptions as f, ayanamsa as g, userAyanamsa as u };
package/dist/calc.d.ts ADDED
@@ -0,0 +1,390 @@
1
+ import { DeltaT } from './deltat.js';
2
+ import { E as EPHEMERIS_SPAN } from './reference-span-CILpclrz.js';
3
+ import { e as TimeScale, T as TimeScaleName, B as BodyName, H as HouseSystem, g as ChartFlag, d as Chart, A as Angles } from './types-B-yb_tGL.js';
4
+ import { A as AyanamsaName, a as AyanamsaPrecessionModel } from './ayanamsa--YQ46fET.js';
5
+
6
+ /**
7
+ * The frames of the calc entry point. A position is first found as a vector on
8
+ * astronomy-engine's EQJ axes, the mean equator and equinox of J2000.0 that its
9
+ * precession starts from, and is then turned into one of eight frames. The
10
+ * precession (IAU 2006, astronomy-engine's own, reproduced in src/frame.ts) and
11
+ * the nutation (IAU 2000B, src/nutation.ts) are the engine's, as positions()
12
+ * and natalChart() use them (src/equator.ts); the J2000.0-ecliptic and ICRS
13
+ * frames are built here.
14
+ */
15
+
16
+ /**
17
+ * A reference plane (the ecliptic or the equator) and the equinox its
18
+ * longitudes count from: the true or the mean equinox of date, the mean
19
+ * equinox of J2000.0, or the ICRS axes.
20
+ */
21
+ type CalcFrame = "ecliptic-true-of-date" | "ecliptic-mean-of-date" | "ecliptic-j2000" | "ecliptic-icrs" | "equatorial-true-of-date" | "equatorial-mean-of-date" | "equatorial-j2000" | "equatorial-icrs";
22
+ /**
23
+ * "apparent": light time and aberration (annual, and diurnal for a topocentric
24
+ * observer), without gravitational deflection. "astrometric": light time only.
25
+ * "geometric": where the body is at the instant.
26
+ */
27
+ type CalcCorrection = "apparent" | "astrometric" | "geometric";
28
+
29
+ /** The Sun, Moon, Earth and planets, the true and mean lunar nodes, and Black Moon Lilith (the mean apogee). */
30
+ type CalcBody = "Sun" | "Moon" | "Mercury" | "Venus" | "Earth" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | "North Node" | "South Node" | "Mean Node" | "Mean South Node" | "Black Moon Lilith";
31
+ declare const CALC_BODIES: readonly CalcBody[];
32
+ /** The time scale of a Julian date: "utc", "ut1" or "tt", the root entry's TimeScaleName. */
33
+ type CalcScale = TimeScaleName;
34
+ /** The frames calc() gives a position in. */
35
+ declare const CALC_FRAMES: readonly CalcFrame[];
36
+ /**
37
+ * An instant: an ISO 8601 string or a Date, read as UTC on the engine's time
38
+ * basis, as positions() and natalChart() read one; or a Julian date on a
39
+ * named time scale. `deltaT` fixes ΔT = TT − UT1, seconds, in place of the
40
+ * time basis's: UT1 still comes from the instant (UTC plus IERS UT1 − UTC
41
+ * from 1972), and TT = UT1 + ΔT.
42
+ */
43
+ type CalcTime = string | Date | {
44
+ readonly iso: string;
45
+ readonly deltaT?: number;
46
+ } | {
47
+ readonly jd: number;
48
+ readonly scale: CalcScale;
49
+ readonly deltaT?: number;
50
+ };
51
+ /**
52
+ * Geodetic latitude and east longitude, degrees: the place `houses()` and
53
+ * `chart()` take, which has no height.
54
+ */
55
+ interface CalcLocation {
56
+ readonly latitude: number;
57
+ readonly longitude: number;
58
+ }
59
+ /**
60
+ * Geodetic latitude and east longitude, degrees; `height` in metres above the
61
+ * IERS 2003 ellipsoid, from −12,000 to 100,000, 0 by default: a topocentric
62
+ * center. `@zodiacs/engine/sky`'s Observer has the same fields on WGS84, with
63
+ * heights from −10,000 m.
64
+ */
65
+ interface CalcPlace extends CalcLocation {
66
+ readonly height?: number;
67
+ }
68
+ type CalcCenter = "geocentric" | "heliocentric" | "barycentric" | {
69
+ readonly topocentric: CalcPlace;
70
+ };
71
+ /** The built-in ayanamsas, by name: `@zodiacs/engine/vedic`'s AyanamsaName, whose guide (docs/vedic.md) defines each. */
72
+ type CalcAyanamsa = AyanamsaName;
73
+ /** The built-in ayanamsas' names, in the order of `@zodiacs/engine/vedic`'s AYANAMSAS, from which they are taken. */
74
+ declare const CALC_AYANAMSAS: readonly CalcAyanamsa[];
75
+ /** The precession model a caller's ayanamsa was computed with: the engine's IAU 2006, Newcomb's (Kinoshita 1975) or IAU 1976; `@zodiacs/engine/vedic`'s AyanamsaPrecessionModel. */
76
+ type CalcAyanamsaModel = AyanamsaPrecessionModel;
77
+ /**
78
+ * A caller's ayanamsa, the counterpart of Swiss Ephemeris's SE_SIDM_USER: the
79
+ * mean ayanamsa `value` at `epoch`, carried from there by precession in
80
+ * `model`, or by a fixed `rate`. It defines what `@zodiacs/engine/vedic`'s
81
+ * userAyanamsa defines, with its epoch given as any instant in a request is.
82
+ */
83
+ interface CalcUserAyanamsa {
84
+ /** A lowercase identifier of at most 64 characters that is not a built-in name; default "user". */
85
+ readonly name?: string;
86
+ /**
87
+ * When `value` holds, read as `time` is: `{ jd, scale: "tt" }` is
88
+ * SE_SIDM_USER's TT epoch, and `{ jd, scale: "ut1" }` its UT epoch
89
+ * (SE_SIDBIT_USER_UT), whose TT comes from the time basis.
90
+ */
91
+ readonly epoch: CalcTime;
92
+ /** The mean ayanamsa at `epoch`, degrees, from −360 to 360. */
93
+ readonly value: number;
94
+ /** Arcseconds per Julian year, from −3600 to 3600: an ayanamsa that grows by this rate, with no precession model. */
95
+ readonly rate?: number;
96
+ /** Without `rate`: the model `value` was computed with, default "engine". An older model's zodiac is held where that model puts it at J2000.0. */
97
+ readonly model?: CalcAyanamsaModel;
98
+ }
99
+ /**
100
+ * "tropical" (default), or `{ sidereal }` with a built-in ayanamsa's name or a
101
+ * caller's ayanamsa. A sidereal longitude is the longitude in the ecliptic of
102
+ * date less the ayanamsa: the true ayanamsa (the mean plus the nutation in
103
+ * longitude) in the true ecliptic of date, the mean ayanamsa in the mean one.
104
+ */
105
+ type CalcZodiac = "tropical" | {
106
+ readonly sidereal: CalcAyanamsa | CalcUserAyanamsa;
107
+ };
108
+ /**
109
+ * The ayanamsa of a sidereal result, at its instant and on its clock, in the
110
+ * result's angular unit; calc(), houses() and chart() give the same shape.
111
+ */
112
+ interface CalcAyanamsaValue {
113
+ /** The definition's name. */
114
+ readonly name: string;
115
+ /** The mean ayanamsa, counted along the mean ecliptic of date. */
116
+ readonly mean: number;
117
+ /** The engine's nutation in longitude (IAU 2000B). */
118
+ readonly nutation: number;
119
+ /** The mean ayanamsa plus the nutation in longitude, counted along the true ecliptic of date, in (−180°, 180°]. */
120
+ readonly true: number;
121
+ /** The one subtracted: "true" in the true ecliptic of date, "mean" in the mean ecliptic of date. */
122
+ readonly subtracted: "true" | "mean";
123
+ /**
124
+ * The mean ayanamsa's difference from ERFA's construction of the same
125
+ * definition, the bound a sidereal result's own bounds add. The nutation
126
+ * cancels from a sidereal longitude; `true`, read on its own, also differs
127
+ * from IAU 2000A's by the nutation model's difference (docs/calc.md).
128
+ */
129
+ readonly bound: CalcBound;
130
+ }
131
+ interface CalcFlags {
132
+ /** Default "apparent". */
133
+ readonly correction?: CalcCorrection;
134
+ /** Rates of every coordinate, per day. Default true. */
135
+ readonly speeds?: boolean;
136
+ /** Also x, y, z (au) and their rates. Default false. */
137
+ readonly cartesian?: boolean;
138
+ /** Default "degrees". */
139
+ readonly units?: "degrees" | "radians";
140
+ /** Gravitational light deflection; true is refused in this version. */
141
+ readonly deflection?: boolean;
142
+ }
143
+ interface CalcRequest {
144
+ readonly body: CalcBody;
145
+ readonly time: CalcTime;
146
+ /** Default "ecliptic-true-of-date". */
147
+ readonly frame?: CalcFrame;
148
+ /** Default "geocentric". */
149
+ readonly center?: CalcCenter;
150
+ /** Default "tropical". */
151
+ readonly zodiac?: CalcZodiac;
152
+ readonly flags?: CalcFlags;
153
+ }
154
+ /** An instant as the engine used it: its UTC, UT1 and TT, and how the time basis gave them. */
155
+ interface CalcInstant {
156
+ /** UTC, ISO 8601, to the millisecond; before 1972 and after the IERS table, the civil time read as UT1. */
157
+ readonly utc: string;
158
+ readonly jdUt1: number;
159
+ readonly jdTt: number;
160
+ readonly deltaT: DeltaT;
161
+ /** The scale the instant was given on and the basis that gave UT1 and TT, as a chart records it. */
162
+ readonly timeScale: TimeScale;
163
+ }
164
+ /**
165
+ * The schema id of a calc receipt. Candidates before 1.0.0 wrote
166
+ * "zodiacs.calc-receipt.draft-v1", whose requests name a Julian date's scale
167
+ * in capitals and houses()'s house system as `system`; from 1.0.0 the id is
168
+ * this one, and its requests are 1.0's.
169
+ */
170
+ declare const CALC_RECEIPT_SCHEMA = "zodiacs.calc-receipt.v1";
171
+ interface CalcReceipt<Request> {
172
+ readonly schema: typeof CALC_RECEIPT_SCHEMA;
173
+ /** The request as read, every default filled in, as JSON; passing it back repeats the calculation. */
174
+ readonly request: Request;
175
+ readonly instants: readonly CalcInstant[];
176
+ /** Convention ids, such as "frame:ecliptic-j2000"; docs/calc.md defines each. */
177
+ readonly conventions: readonly string[];
178
+ readonly engine: {
179
+ readonly name: "@zodiacs/engine";
180
+ readonly version: string;
181
+ readonly ephemeris: {
182
+ readonly name: "astronomy-engine";
183
+ readonly version: string;
184
+ };
185
+ };
186
+ }
187
+ /** A bound on a result, labelled by how it was found; none is proven. */
188
+ interface CalcBound {
189
+ /** null where nothing has been measured. */
190
+ readonly value: number | null;
191
+ readonly unit: "arcsec" | "arcsec/day" | "relative" | "s";
192
+ readonly label: "measured" | "estimated";
193
+ readonly basis: string;
194
+ }
195
+ interface CalcBounds {
196
+ /** Angle between the reported and the arbiter's direction. */
197
+ readonly position: CalcBound;
198
+ /** Relative distance difference; null for the nodes and Lilith. */
199
+ readonly distance: CalcBound | null;
200
+ /** Angular-rate difference, and how rates were found; null without speeds. */
201
+ readonly speed: (CalcBound & {
202
+ readonly method: "analytic" | "central-difference";
203
+ readonly stepDays: number | null;
204
+ }) | null;
205
+ }
206
+ interface CalcPosition {
207
+ readonly status: "ok";
208
+ readonly body: CalcBody;
209
+ readonly frame: CalcFrame;
210
+ /** Ecliptic longitude, or right ascension in an equatorial frame, in [0, 360) degrees (or radians). */
211
+ readonly lon: number;
212
+ /** Ecliptic latitude, or declination. */
213
+ readonly lat: number;
214
+ /** au: the light path for apparent and astrometric positions (the geocentric apparent Moon, its series, is geometric); null for the nodes and Lilith. */
215
+ readonly dist: number | null;
216
+ /** Per day, in the units of lon and lat, and au. */
217
+ readonly speeds: {
218
+ readonly lon: number;
219
+ readonly lat: number;
220
+ readonly dist: number | null;
221
+ } | null;
222
+ /** au and au per day, when `flags.cartesian`. */
223
+ readonly cartesian: {
224
+ readonly x: number;
225
+ readonly y: number;
226
+ readonly z: number;
227
+ readonly vx: number | null;
228
+ readonly vy: number | null;
229
+ readonly vz: number | null;
230
+ } | null;
231
+ /** In the sidereal zodiac, the ayanamsa and which value of it `lon` has subtracted; null in the tropical zodiac. */
232
+ readonly ayanamsa: CalcAyanamsaValue | null;
233
+ /** In the sidereal zodiac, each includes the ayanamsa's own bound. */
234
+ readonly bounds: CalcBounds;
235
+ readonly receipt: CalcReceipt<CalcRequest>;
236
+ }
237
+ /**
238
+ * Why a request was not computed. A refused search in `@zodiacs/engine/crossings`
239
+ * and `@zodiacs/engine/sky` carries the same `status: "refused"`, and for a
240
+ * spent budget the same `reason: "sample-budget"`.
241
+ */
242
+ type CalcRefusal = {
243
+ readonly status: "refused";
244
+ readonly detail: string;
245
+ } & ({
246
+ readonly reason: "unsupported-combination" | "not-in-this-version";
247
+ } | {
248
+ readonly reason: "out-of-range";
249
+ readonly span: CalcSpan;
250
+ } | {
251
+ readonly reason: "epoch-out-of-range";
252
+ readonly epochSpan: typeof EPHEMERIS_SPAN;
253
+ } | {
254
+ readonly reason: "sample-budget";
255
+ readonly samples: number;
256
+ readonly maxSamples: number;
257
+ });
258
+ /** From an instant up to, not including, another: ISO 8601 UTC to the millisecond, as Date.prototype.toISOString gives them. */
259
+ interface CalcSpan {
260
+ readonly from: string;
261
+ readonly to: string;
262
+ }
263
+ /** calc() and the other functions compute an instant only if its UT1 and its TT are in this span; positions() and natalChart() compute outside it, with a flag. */
264
+ declare const CALC_SPAN: CalcSpan;
265
+ /**
266
+ * The position of `body` at `time` in `frame` from `center`, with the
267
+ * correction and outputs `flags` asks for, or a typed refusal. With every
268
+ * default it is the position positions() and natalChart() give, to the bit
269
+ * after the same earlier calls (docs/calc.md).
270
+ */
271
+ declare function calc(request: CalcRequest): CalcPosition | CalcRefusal;
272
+ interface HousesRequest {
273
+ readonly time: CalcTime;
274
+ readonly place: CalcLocation;
275
+ /** Default "whole", as in natalChart() and chart(). */
276
+ readonly houseSystem?: HouseSystem;
277
+ readonly zodiac?: CalcZodiac;
278
+ }
279
+ interface HousesResult {
280
+ readonly status: "ok";
281
+ readonly requested: HouseSystem;
282
+ /** The requested system, or whole sign where Placidus or Koch is undefined (flag "polar-fallback"). */
283
+ readonly system: HouseSystem;
284
+ /**
285
+ * Twelve cusps from the first house, degrees in the true ecliptic of date,
286
+ * in the zodiac asked for; in the sidereal zodiac, whole-sign cusps start at
287
+ * the sidereal ascendant's sign.
288
+ */
289
+ readonly cusps: readonly number[];
290
+ /** In the zodiac asked for, as the Vertex and the East Point are. */
291
+ readonly angles: Angles;
292
+ readonly vertex: number;
293
+ readonly eastPoint: number;
294
+ /** Right ascension of the midheaven, degrees. */
295
+ readonly armc: number;
296
+ /** The true obliquity used, degrees. */
297
+ readonly obliquity: number;
298
+ readonly flags: readonly ChartFlag[];
299
+ /** In the sidereal zodiac, the ayanamsa, degrees, whose true value is subtracted; null in the tropical zodiac. */
300
+ readonly ayanamsa: CalcAyanamsaValue | null;
301
+ /** In the sidereal zodiac, each includes the ayanamsa's own bound. */
302
+ readonly bounds: {
303
+ readonly angles: CalcBound;
304
+ readonly cusps: CalcBound;
305
+ };
306
+ readonly receipt: CalcReceipt<HousesRequest>;
307
+ }
308
+ /** The angles, the Vertex, the East Point and the cusps for an instant and a place, as natalChart() computes them. */
309
+ declare function houses(request: HousesRequest): HousesResult | CalcRefusal;
310
+ interface EventsRequest {
311
+ /** The one kind in this version: the instants a body sits on a longitude. */
312
+ readonly kind: "longitude-crossing";
313
+ readonly body: CalcBody;
314
+ /** Apparent geocentric ecliptic longitude of date, degrees, in the zodiac asked for. */
315
+ readonly longitude: number;
316
+ /** The search covers (from, to]. */
317
+ readonly from: CalcTime;
318
+ readonly to: CalcTime;
319
+ readonly zodiac?: CalcZodiac;
320
+ /** Days between coarse samples, default 5. */
321
+ readonly stepDays?: number;
322
+ /** Most longitude evaluations allowed, refusing beyond; no limit by default. */
323
+ readonly maxSamples?: number;
324
+ }
325
+ interface CalcEvent {
326
+ /** UTC, ISO 8601, to the millisecond, as the crossing search gives it. */
327
+ readonly at: string;
328
+ readonly jdUt1: number;
329
+ readonly jdTt: number;
330
+ /** True when the body moved backward through the longitude. */
331
+ readonly retrograde: boolean;
332
+ }
333
+ interface EventsResult {
334
+ readonly status: "ok";
335
+ readonly kind: "longitude-crossing";
336
+ readonly events: readonly CalcEvent[];
337
+ /** Longitude evaluations made. */
338
+ readonly samples: number;
339
+ readonly bounds: {
340
+ readonly timing: CalcBound;
341
+ };
342
+ readonly receipt: CalcReceipt<EventsRequest>;
343
+ }
344
+ /**
345
+ * Every instant in (from, to] when `body` sits on `longitude`: the engine's
346
+ * crossing search (searchLongitudeCrossings) on its apparent geocentric
347
+ * longitudes, under an optional budget of evaluations.
348
+ */
349
+ declare function events(request: EventsRequest): EventsResult | CalcRefusal;
350
+ interface ChartRequest {
351
+ readonly time: CalcTime;
352
+ /** Without a place there are no angles or houses. */
353
+ readonly place?: CalcLocation;
354
+ /** Default "whole". */
355
+ readonly houseSystem?: HouseSystem;
356
+ /** False: `time` is a reference instant, with no angles or houses. Default true. */
357
+ readonly timeKnown?: boolean;
358
+ /** Time-resolution assertions, as BirthInput.flags takes them. */
359
+ readonly timeFlags?: readonly ChartFlag[];
360
+ readonly zodiac?: CalcZodiac;
361
+ }
362
+ interface ChartResult {
363
+ readonly status: "ok";
364
+ /** The chart natalChart() gives for the same instant (to the millisecond), place, settings and ΔT: tropical. */
365
+ readonly chart: Chart;
366
+ /** In the sidereal zodiac, the chart's longitudes as `@zodiacs/engine/vedic`'s siderealChart() gives them; null in the tropical zodiac. */
367
+ readonly sidereal: CalcSiderealChart | null;
368
+ readonly receipt: CalcReceipt<ChartRequest>;
369
+ }
370
+ /** A chart's sidereal longitudes, degrees in [0, 360), as siderealChart() gives them. */
371
+ interface CalcSiderealChart {
372
+ /** The ayanamsa at the chart's instant and on its clock, degrees, whose true value is subtracted. */
373
+ readonly ayanamsa: CalcAyanamsaValue;
374
+ /** The chart's bodies, in its order. */
375
+ readonly bodies: readonly {
376
+ readonly body: BodyName;
377
+ readonly lon: number;
378
+ }[];
379
+ /** Null when the chart has no angles. */
380
+ readonly ascendant: number | null;
381
+ readonly midheaven: number | null;
382
+ /** The house system as computed, after any polar fallback; null without houses. */
383
+ readonly houseSystem: HouseSystem | null;
384
+ /** First house first; whole-sign cusps start at the sidereal ascendant's sign. Null without houses. */
385
+ readonly cusps: readonly number[] | null;
386
+ }
387
+ /** A natal chart from the calc vocabulary: natalChart()'s chart, with a receipt. */
388
+ declare function chart(request: ChartRequest): ChartResult | CalcRefusal;
389
+
390
+ export { Angles, CALC_AYANAMSAS, CALC_BODIES, CALC_FRAMES, CALC_RECEIPT_SCHEMA, CALC_SPAN, type CalcAyanamsa, type CalcAyanamsaModel, type CalcAyanamsaValue, type CalcBody, type CalcBound, type CalcBounds, type CalcCenter, type CalcCorrection, type CalcEvent, type CalcFlags, type CalcFrame, type CalcInstant, type CalcLocation, type CalcPlace, type CalcPosition, type CalcReceipt, type CalcRefusal, type CalcRequest, type CalcScale, type CalcSiderealChart, type CalcSpan, type CalcTime, type CalcUserAyanamsa, type CalcZodiac, Chart, ChartFlag, type ChartRequest, type ChartResult, DeltaT, type EventsRequest, type EventsResult, HouseSystem, type HousesRequest, type HousesResult, TimeScale, calc, chart, events, houses };