@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
package/dist/vedic.d.ts CHANGED
@@ -1,120 +1,13 @@
1
- import { T as TimeScaleName, u as TimeScale, D as DateInput, B as BodyName, H as HouseSystem, c as ChartFlag, b as Chart, d as BirthInput, Z as ZodiacSign } from './types-BsWaqwU_.js';
2
- import { DeltaT } from './deltat.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;
62
- /** When `value` holds: a TT Julian date within the Date range, or a UTC instant, read on the engine's time basis. */
63
- readonly epoch: DateInput | {
64
- readonly julianDateTT: number;
65
- };
66
- /** The mean ayanamsa at `epoch` as `model` computes it, degrees, in [−360, 360]. */
67
- readonly value: number;
68
- /** Arcseconds per Julian year, in [−3600, 3600]: a linear ayanamsa. */
69
- readonly rate?: number;
70
- /**
71
- * Without `rate`: the model `value` was computed with, default "engine"
72
- * (`value` then holds at `epoch`); an older model's zodiac is held at
73
- * J2000.0, as for the built-ins.
74
- */
75
- readonly model?: AyanamsaPrecessionModel;
76
- }
77
- /** A caller's ayanamsa, frozen. Refuses a built-in name, both `rate` and `model`, and out-of-range values. */
78
- declare function userAyanamsa(input: UserAyanamsaInput): AyanamsaDefinition;
79
- /** An ayanamsa at an instant; made only by `ayanamsa`. Degrees throughout. */
80
- interface AyanamsaValue {
81
- /** The definition's name. */
82
- readonly ayanamsa: string;
83
- /** The instant as given, ISO 8601, on the scale `timeScale.input` names (UTC unless the options say otherwise). */
84
- readonly utc: string;
85
- /** How the instant became UT1 and TT, as a chart's `timeScale` (docs/time.md). */
86
- readonly timeScale: TimeScale;
87
- readonly julianDateTT: number;
88
- /** The ΔT (TT − UT1) the instant was read with: its time basis's, or the pin. */
89
- readonly deltaT: DeltaT;
90
- /** Referred to the mean equinox and ecliptic of date, in (−180, 180]. */
91
- readonly mean: number;
92
- /** The engine's nutation in longitude Δψ. */
93
- readonly nutation: number;
94
- /** mean + nutation: subtract it from the engine's tropical longitudes. */
95
- readonly true: number;
96
- /** "outside-reference-span" when the instant, or an epoch definition's epoch, is outside REFERENCE_SPAN. */
97
- readonly flags: readonly "outside-reference-span"[];
98
- }
99
- /** Options for ayanamsa. */
100
- interface AyanamsaOptions {
101
- /** A fixed ΔT (TT − UT1) in seconds, as BirthInput.deltaT; the engine's time basis when absent. */
102
- readonly deltaT?: number;
103
- /** The scale the instant is on, as BirthInput.timeScale: "utc" (default), "ut1" or "tt". */
104
- readonly timeScale?: TimeScaleName;
105
- }
106
- /**
107
- * The mean and true ayanamsa of a definition at an instant, read as a chart
108
- * reads its own: on the engine's time basis, or a pinned ΔT, and refused
109
- * outside EPHEMERIS_SPAN. `true` adds the engine's nutation (five IAU 2000B
110
- * terms, within 0.270″ of the full series), which cancels from sidereal
111
- * longitudes.
112
- */
113
- declare function ayanamsa(definition: AyanamsaName | AyanamsaDefinition, at: DateInput, options?: AyanamsaOptions): AyanamsaValue;
1
+ import { B as BodyName, H as HouseSystem, g as ChartFlag, D as DateInput, d as Chart, h as BirthInput, Z as ZodiacSign } from './types-B-yb_tGL.js';
2
+ import { b as AyanamsaValue, A as AyanamsaName, c as AyanamsaDefinition } from './ayanamsa--YQ46fET.js';
3
+ export { d as AYANAMSAS, e as AyanamsaFlag, f as AyanamsaOptions, a as AyanamsaPrecessionModel, C as CatalogueStar, E as EpochAyanamsa, L as LinearAyanamsa, S as StarAyanamsa, U as UserAyanamsaInput, g as ayanamsa, u as userAyanamsa } from './ayanamsa--YQ46fET.js';
4
+ import './deltat.js';
114
5
 
115
6
  /**
116
7
  * A sidereal longitude of date, frozen. Only siderealLongitude,
117
- * declareSiderealLongitude and siderealChart make one; copies are refused.
8
+ * declareSiderealLongitude and siderealChart make one; copies are refused,
9
+ * including one through JSON or structuredClone, although the type has no
10
+ * brand to say so (docs/vedic.md, *Frames*).
118
11
  */
119
12
  interface SiderealLongitude {
120
13
  readonly frame: "sidereal";
@@ -144,11 +37,13 @@ interface SiderealDeclaration {
144
37
  /** A label for the zodiac the value is in: nonempty, trimmed, at most 80 characters. */
145
38
  readonly ayanamsa: string;
146
39
  /** Its instant, needed only by the dasha functions. */
147
- readonly at?: DateInput;
40
+ readonly at?: DateInput | undefined;
148
41
  }
149
42
  /**
150
43
  * A longitude the caller asserts is already sidereal (from another program,
151
44
  * a table, a test). The engine cannot check the claim; it records the label.
45
+ * A declaration key not named in SiderealDeclaration is refused with a
46
+ * RangeError, so that a misspelt `at` is not an instant silently left out.
152
47
  */
153
48
  declare function declareSiderealLongitude(longitude: number, declaration: SiderealDeclaration): SiderealLongitude;
154
49
  /** A chart body's sidereal longitude. */
@@ -246,7 +141,12 @@ interface VargaPosition {
246
141
  */
247
142
  declare function vargaOf(position: SiderealLongitude, varga: VargaName, scheme?: VargaScheme): VargaPosition;
248
143
 
249
- /** Traditional sign rulers, Aries to Pisces (BPHS 4, Santhanam 1984). */
144
+ /**
145
+ * Traditional sign rulers, Aries to Pisces (BPHS 4, Santhanam 1984): the same
146
+ * rulers as `@zodiacs/engine/techniques`'s DOMICILE_RULERS and
147
+ * `@zodiacs/engine/timing`'s TRADITIONAL_RULERS. Each entry point carries its
148
+ * own copy, so that none imports another; a test keeps the three equal.
149
+ */
250
150
  declare const SIGN_LORDS: readonly ["Mars", "Venus", "Mercury", "Moon", "Sun", "Mercury", "Venus", "Mars", "Jupiter", "Saturn", "Saturn", "Jupiter"];
251
151
  /** A traditional sign ruler. */
252
152
  type SignLord = (typeof SIGN_LORDS)[number];
@@ -292,13 +192,21 @@ declare const DASHA_YEAR_DAYS: Readonly<Record<DashaYearLength, number>>;
292
192
  declare const DASHA_LEVELS: readonly ["mahadasha", "antardasha", "pratyantardasha", "sookshmadasha", "pranadasha"];
293
193
  /** A level's name. */
294
194
  type DashaLevelName = (typeof DASHA_LEVELS)[number];
295
- /** Yogini dasha (BPHS 46.195–199): yogini, planet, years. */
195
+ /**
196
+ * Yogini dasha (BPHS 46.195–199): yogini, planet, years.
197
+ *
198
+ * @experimental As yoginiDasha is.
199
+ */
296
200
  declare const YOGINIS: readonly Readonly<{
297
201
  name: string;
298
202
  planet: string;
299
203
  years: number;
300
204
  }>[];
301
- /** Ashtottari lords in order, with their years (BPHS 46.17–20). */
205
+ /**
206
+ * Ashtottari lords in order, with their years (BPHS 46.17–20).
207
+ *
208
+ * @experimental As ashtottariDasha is.
209
+ */
302
210
  declare const ASHTOTTARI_YEARS: Readonly<{
303
211
  readonly Sun: 6;
304
212
  readonly Moon: 15;
@@ -329,10 +237,10 @@ interface DashaPeriod {
329
237
  /** Length in dasha years. */
330
238
  readonly years: number;
331
239
  }
332
- /** Options for the dasha functions. */
240
+ /** Options for the dasha functions. A key a function does not name is refused with a RangeError. */
333
241
  interface DashaOptions {
334
242
  /** "julian" (365.25 days, the default), "tropical" (365.2422) or "savana" (360). */
335
- readonly yearLength?: DashaYearLength;
243
+ readonly yearLength?: DashaYearLength | undefined;
336
244
  }
337
245
  /** A dasha system's result, frozen. */
338
246
  interface DashaResult {
@@ -366,7 +274,7 @@ declare function dashaSubperiods(period: DashaPeriod): readonly DashaPeriod[];
366
274
  /** Options for vimshottariAt. */
367
275
  interface DashaAtOptions extends DashaOptions {
368
276
  /** How many levels to descend, 1 (mahadasha) to 5 (prana); default 5. */
369
- readonly levels?: number;
277
+ readonly levels?: 1 | 2 | 3 | 4 | 5 | undefined;
370
278
  }
371
279
  /**
372
280
  * The Vimshottari periods running at `at`, mahadasha first, down to
@@ -374,21 +282,31 @@ interface DashaAtOptions extends DashaOptions {
374
282
  * `start` finds it. Outside the 120 years, a RangeError.
375
283
  */
376
284
  declare function vimshottariAt(moon: SiderealLongitude, at: DateInput, options?: DashaAtOptions): readonly DashaPeriod[];
377
- /** Options for yoginiDasha and ashtottariDasha. */
285
+ /**
286
+ * Options for yoginiDasha and ashtottariDasha.
287
+ *
288
+ * @experimental As those functions are.
289
+ */
378
290
  interface CycleOptions extends DashaOptions {
379
291
  /** Complete cycles of mahadashas to list, 1 to 10; default 1. */
380
- readonly cycles?: number;
292
+ readonly cycles?: number | undefined;
381
293
  }
382
294
  /**
383
295
  * Yogini mahadashas (BPHS 46.195–199): the nakshatra's number plus 3,
384
296
  * remainder by 8, gives the yogini at birth; 36 years a cycle.
297
+ *
298
+ * @experimental Mahadashas only, so far: the result may change in a minor
299
+ * release that adds the sub-periods.
385
300
  */
386
301
  declare function yoginiDasha(moon: SiderealLongitude, options?: CycleOptions): DashaResult;
387
302
  /**
388
303
  * Ashtottari mahadashas (BPHS 46.17–22): 28 nakshatras with Abhijit, from
389
304
  * Ardra in groups of 4, 3, 4, 3, …, each an equal share of its lord's years;
390
305
  * 108 years a cycle. When it applies (46.17–23) is for the caller to decide.
306
+ *
307
+ * @experimental Mahadashas only, so far, and traditions group the nakshatras
308
+ * differently: the result may change in a minor release.
391
309
  */
392
310
  declare function ashtottariDasha(moon: SiderealLongitude, options?: CycleOptions): DashaResult;
393
311
 
394
- export { ASHTOTTARI_YEARS, AYANAMSAS, type AyanamsaDefinition, type AyanamsaName, type AyanamsaOptions, type AyanamsaPrecessionModel, type AyanamsaValue, type CatalogueStar, type CycleOptions, DASHA_LEVELS, DASHA_YEAR_DAYS, type DashaAtOptions, type DashaLevelName, type DashaOptions, type DashaPeriod, type DashaResult, type DashaSystem, type DashaYearLength, type EpochAyanamsa, KP_SUBS, type KpLords, type KpSub, type LinearAyanamsa, NAKSHATRAS, type NakshatraName, type NakshatraPosition, SIGN_LORDS, type SiderealBody, type SiderealChart, type SiderealDeclaration, type SiderealLongitude, type SignLord, type StarAyanamsa, type UserAyanamsaInput, VARGAS, VIMSHOTTARI_LORDS, VIMSHOTTARI_YEARS, type VargaDefinition, type VargaName, type VargaPosition, type VargaScheme, type VimshottariLord, YOGINIS, ashtottariDasha, ayanamsa, dashaSubperiods, declareSiderealLongitude, kpLordsOf, nakshatraOf, siderealChart, siderealLongitude, userAyanamsa, vargaOf, vimshottariAt, vimshottariDasha, yoginiDasha };
312
+ export { ASHTOTTARI_YEARS, AyanamsaDefinition, AyanamsaName, AyanamsaValue, type CycleOptions, DASHA_LEVELS, DASHA_YEAR_DAYS, type DashaAtOptions, type DashaLevelName, type DashaOptions, type DashaPeriod, type DashaResult, type DashaSystem, type DashaYearLength, KP_SUBS, type KpLords, type KpSub, NAKSHATRAS, type NakshatraName, type NakshatraPosition, SIGN_LORDS, type SiderealBody, type SiderealChart, type SiderealDeclaration, type SiderealLongitude, type SignLord, VARGAS, VIMSHOTTARI_LORDS, VIMSHOTTARI_YEARS, type VargaDefinition, type VargaName, type VargaPosition, type VargaScheme, type VimshottariLord, YOGINIS, ashtottariDasha, dashaSubperiods, declareSiderealLongitude, kpLordsOf, nakshatraOf, siderealChart, siderealLongitude, vargaOf, vimshottariAt, vimshottariDasha, yoginiDasha };