@zodiacs/engine 0.1.1-rc.15 → 0.1.1-rc.16

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 (43) hide show
  1. package/CHANGELOG.md +433 -0
  2. package/LICENSING.md +175 -8
  3. package/NOTICE +93 -0
  4. package/README.md +255 -59
  5. package/dist/{api-CoB_kqE3.d.ts → api-VOW6Umy5.d.ts} +4 -5
  6. package/dist/calc.d.ts +279 -0
  7. package/dist/calc.js +853 -0
  8. package/dist/{chunk-MFF3VKO3.js → chunk-2OWGBT3O.js} +1 -1
  9. package/dist/{chunk-ZHVI3KWJ.js → chunk-4NV4ZEFZ.js} +1 -1
  10. package/dist/chunk-A3U2ZS2W.js +29 -0
  11. package/dist/{chunk-OYGRVGXD.js → chunk-I7O5EGFV.js} +3 -3
  12. package/dist/{chunk-CWI4YUDL.js → chunk-L6ZHWJZ6.js} +9 -9
  13. package/dist/chunk-N4B5JNMA.js +473 -0
  14. package/dist/chunk-O3NJRGJ2.js +56 -0
  15. package/dist/{chunk-ZZPITHQS.js → chunk-WOU7JVD3.js} +194 -60
  16. package/dist/crossings.d.ts +1 -1
  17. package/dist/geo.d.ts +1 -1
  18. package/dist/geo.js +15 -458
  19. package/dist/houses-extra.d.ts +81 -0
  20. package/dist/houses-extra.js +337 -0
  21. package/dist/{internal-math-BbktkHCc.d.ts → houses-q1O2GGp4.d.ts} +3 -159
  22. package/dist/index.d.ts +5 -4
  23. package/dist/index.js +17 -17
  24. package/dist/internal-math-CmJ9xtaW.d.ts +160 -0
  25. package/dist/internal-math.d.ts +3 -2
  26. package/dist/internal-math.js +2 -2
  27. package/dist/internal.d.ts +1 -1
  28. package/dist/internal.js +3 -3
  29. package/dist/receipt.d.ts +31 -6
  30. package/dist/receipt.js +13 -7
  31. package/dist/rulers-9wljfVaO.d.ts +10 -0
  32. package/dist/sky.d.ts +158 -0
  33. package/dist/sky.js +377 -0
  34. package/dist/techniques.d.ts +410 -0
  35. package/dist/techniques.js +830 -0
  36. package/dist/timing.d.ts +69 -10
  37. package/dist/timing.js +86 -33
  38. package/dist/{types-BsWaqwU_.d.ts → types-B4MCoCCS.d.ts} +2 -2
  39. package/dist/vedic.d.ts +3 -4
  40. package/dist/vedic.js +26 -43
  41. package/dist/window.d.ts +178 -0
  42. package/dist/window.js +961 -0
  43. package/package.json +23 -3
@@ -0,0 +1,160 @@
1
+ import { g as AspectType, c as BodyPosition, n as Aspect, Z as ZodiacSign, u as SignDefinition } from './types-B4MCoCCS.js';
2
+ import './houses-q1O2GGp4.js';
3
+
4
+ interface AspectDefinition {
5
+ type: AspectType;
6
+ angle: number;
7
+ orb: number;
8
+ luminaryOrb: number;
9
+ }
10
+ declare const ASPECT_TYPES: readonly ["conjunction", "sextile", "square", "trine", "opposition"];
11
+ declare const ASPECTS: readonly [{
12
+ readonly type: "conjunction";
13
+ readonly angle: 0;
14
+ readonly orb: 8;
15
+ readonly luminaryOrb: 10;
16
+ }, {
17
+ readonly type: "sextile";
18
+ readonly angle: 60;
19
+ readonly orb: 4;
20
+ readonly luminaryOrb: 5;
21
+ }, {
22
+ readonly type: "square";
23
+ readonly angle: 90;
24
+ readonly orb: 7;
25
+ readonly luminaryOrb: 8;
26
+ }, {
27
+ readonly type: "trine";
28
+ readonly angle: 120;
29
+ readonly orb: 7;
30
+ readonly luminaryOrb: 8;
31
+ }, {
32
+ readonly type: "opposition";
33
+ readonly angle: 180;
34
+ readonly orb: 8;
35
+ readonly luminaryOrb: 10;
36
+ }];
37
+ declare const ASPECT_BODIES: Set<string>;
38
+ /** Whether an aspect's orb is shrinking, growing, or neither, at an instant. */
39
+ type AspectMotion = "applying" | "separating" | "stationary";
40
+ /**
41
+ * Below this relative speed, in degrees per day, two bodies are treated as
42
+ * not moving against each other, and the aspect as neither applying nor
43
+ * separating.
44
+ */
45
+ declare const STATIONARY_RELATIVE_SPEED = 1e-9;
46
+ /**
47
+ * The motion of an aspect at the chart instant, from the two longitudes and
48
+ * their speeds (degrees per day). It is applying when the orb is strictly
49
+ * decreasing: the sign of the orb's rate of change, not a step forward in
50
+ * time, decides. An exact aspect (orb 0) can only separate.
51
+ */
52
+ declare function aspectMotion(a: {
53
+ lon: number;
54
+ speed: number;
55
+ }, b: {
56
+ lon: number;
57
+ speed: number;
58
+ }, angle: number): AspectMotion;
59
+ /** Unsigned angular separation in [0, 180]. */
60
+ declare function separation(a: number, b: number): number;
61
+ declare function matchAspect(aBody: string, aLongitude: number, bBody: string, bLongitude: number): {
62
+ definition: AspectDefinition;
63
+ orb: number;
64
+ } | null;
65
+ declare function findAspects(bodies: readonly BodyPosition[]): Aspect[];
66
+
67
+ declare const ELEMENTS: readonly ["fire", "earth", "air", "water"];
68
+ declare const MODALITIES: readonly ["cardinal", "fixed", "mutable"];
69
+ declare const SIGNS: readonly [{
70
+ readonly slug: "aries";
71
+ readonly name: "Aries";
72
+ readonly element: "fire";
73
+ readonly modality: "cardinal";
74
+ readonly polarity: "day";
75
+ readonly naturalHouse: 1;
76
+ }, {
77
+ readonly slug: "taurus";
78
+ readonly name: "Taurus";
79
+ readonly element: "earth";
80
+ readonly modality: "fixed";
81
+ readonly polarity: "night";
82
+ readonly naturalHouse: 2;
83
+ }, {
84
+ readonly slug: "gemini";
85
+ readonly name: "Gemini";
86
+ readonly element: "air";
87
+ readonly modality: "mutable";
88
+ readonly polarity: "day";
89
+ readonly naturalHouse: 3;
90
+ }, {
91
+ readonly slug: "cancer";
92
+ readonly name: "Cancer";
93
+ readonly element: "water";
94
+ readonly modality: "cardinal";
95
+ readonly polarity: "night";
96
+ readonly naturalHouse: 4;
97
+ }, {
98
+ readonly slug: "leo";
99
+ readonly name: "Leo";
100
+ readonly element: "fire";
101
+ readonly modality: "fixed";
102
+ readonly polarity: "day";
103
+ readonly naturalHouse: 5;
104
+ }, {
105
+ readonly slug: "virgo";
106
+ readonly name: "Virgo";
107
+ readonly element: "earth";
108
+ readonly modality: "mutable";
109
+ readonly polarity: "night";
110
+ readonly naturalHouse: 6;
111
+ }, {
112
+ readonly slug: "libra";
113
+ readonly name: "Libra";
114
+ readonly element: "air";
115
+ readonly modality: "cardinal";
116
+ readonly polarity: "day";
117
+ readonly naturalHouse: 7;
118
+ }, {
119
+ readonly slug: "scorpio";
120
+ readonly name: "Scorpio";
121
+ readonly element: "water";
122
+ readonly modality: "fixed";
123
+ readonly polarity: "night";
124
+ readonly naturalHouse: 8;
125
+ }, {
126
+ readonly slug: "sagittarius";
127
+ readonly name: "Sagittarius";
128
+ readonly element: "fire";
129
+ readonly modality: "mutable";
130
+ readonly polarity: "day";
131
+ readonly naturalHouse: 9;
132
+ }, {
133
+ readonly slug: "capricorn";
134
+ readonly name: "Capricorn";
135
+ readonly element: "earth";
136
+ readonly modality: "cardinal";
137
+ readonly polarity: "night";
138
+ readonly naturalHouse: 10;
139
+ }, {
140
+ readonly slug: "aquarius";
141
+ readonly name: "Aquarius";
142
+ readonly element: "air";
143
+ readonly modality: "fixed";
144
+ readonly polarity: "day";
145
+ readonly naturalHouse: 11;
146
+ }, {
147
+ readonly slug: "pisces";
148
+ readonly name: "Pisces";
149
+ readonly element: "water";
150
+ readonly modality: "mutable";
151
+ readonly polarity: "night";
152
+ readonly naturalHouse: 12;
153
+ }];
154
+ declare const SIGN_NAMES: readonly ZodiacSign[];
155
+ declare function normalizeLongitude(lon: number): number;
156
+ declare function signIndexForLongitude(lon: number): number;
157
+ declare function signForLongitude(lon: number): SignDefinition;
158
+ declare function degreeInSign(lon: number): number;
159
+
160
+ export { ASPECTS as A, ELEMENTS as E, MODALITIES as M, SIGNS as S, ASPECT_BODIES as a, ASPECT_TYPES as b, type AspectDefinition as c, type AspectMotion as d, SIGN_NAMES as e, STATIONARY_RELATIVE_SPEED as f, aspectMotion as g, degreeInSign as h, findAspects as i, signForLongitude as j, signIndexForLongitude as k, matchAspect as m, normalizeLongitude as n, separation as s };
@@ -1,3 +1,4 @@
1
- export { A as ASPECTS, a as ASPECT_BODIES, b as ASPECT_TYPES, c as AngleInput, d as AspectDefinition, e as AspectMotion, H as HOUSE_SYSTEMS, P as PLACIDUS_POLAR_FALLBACK, f as POLAR_FALLBACK, g as POLAR_UNDEFINED_HOUSE_SYSTEMS, i as STATIONARY_RELATIVE_SPEED, j as alcabitiusCusps, k as aspectMotion, l as campanusCusps, m as computeAngles, n as computeHouses, p as eastPointOf, q as equalCusps, r as equalMcCusps, s as findAspects, t as houseOf, u as isPolarUndefinedHouseSystem, v as kochCusps, w as matchAspect, x as meanObliquity, y as meridianCusps, z as morinusCusps, B as normalizeLongitude, C as placidusCusps, D as porphyryCusps, F as ramcOf, G as regiomontanusCusps, I as separation, L as topocentricCusps, N as vehlowCusps, O as vertexOf, Q as wholeSignCusps } from './internal-math-BbktkHCc.js';
2
- export { A as Angles, j as Aspect, k as AspectType, B as BodyName, a as BodyPosition, b as Chart, c as ChartFlag, C as ChartInput, l as ENGINE_VERSION, n as HouseNumber, H as HouseSystem, o as Houses } from './types-BsWaqwU_.js';
1
+ export { A as ASPECTS, a as ASPECT_BODIES, b as ASPECT_TYPES, c as AspectDefinition, d as AspectMotion, f as STATIONARY_RELATIVE_SPEED, g as aspectMotion, i as findAspects, m as matchAspect, n as normalizeLongitude, s as separation } from './internal-math-CmJ9xtaW.js';
2
+ export { A as AngleInput, H as HOUSE_SYSTEMS, P as PLACIDUS_POLAR_FALLBACK, a as POLAR_FALLBACK, b as POLAR_UNDEFINED_HOUSE_SYSTEMS, c as alcabitiusCusps, d as campanusCusps, e as computeAngles, f as computeHouses, g as eastPointOf, h as equalCusps, i as equalMcCusps, j as houseOf, k as isPolarUndefinedHouseSystem, l as kochCusps, m as meanObliquity, n as meridianCusps, o as morinusCusps, p as placidusCusps, q as porphyryCusps, r as ramcOf, s as regiomontanusCusps, t as topocentricCusps, v as vehlowCusps, u as vertexOf, w as wholeSignCusps } from './houses-q1O2GGp4.js';
3
+ export { A as Angles, n as Aspect, g as AspectType, B as BodyName, c as BodyPosition, d as Chart, e as ChartFlag, C as ChartInput, o as ENGINE_VERSION, b as HouseNumber, H as HouseSystem, a as Houses } from './types-B4MCoCCS.js';
3
4
  import './deltat.js';
@@ -24,7 +24,7 @@ import {
24
24
  vehlowCusps,
25
25
  vertexOf,
26
26
  wholeSignCusps
27
- } from "./chunk-ZHVI3KWJ.js";
27
+ } from "./chunk-4NV4ZEFZ.js";
28
28
  import {
29
29
  ASPECTS,
30
30
  ASPECT_BODIES,
@@ -36,7 +36,7 @@ import {
36
36
  matchAspect,
37
37
  normalizeLongitude,
38
38
  separation
39
- } from "./chunk-MFF3VKO3.js";
39
+ } from "./chunk-2OWGBT3O.js";
40
40
  export {
41
41
  ASPECTS,
42
42
  ASPECT_BODIES,
@@ -1,4 +1,4 @@
1
- import { B as BodyName, a as BodyPosition, C as ChartInput, b as Chart } from './types-BsWaqwU_.js';
1
+ import { B as BodyName, c as BodyPosition, C as ChartInput, d as Chart } from './types-B4MCoCCS.js';
2
2
  import './deltat.js';
3
3
 
4
4
  /** Apparent longitude at a UTC instant, on the engine's time basis. */
package/dist/internal.js CHANGED
@@ -3,11 +3,11 @@ import {
3
3
  computeBodies,
4
4
  computeChart,
5
5
  longitudeSpeed
6
- } from "./chunk-ZZPITHQS.js";
7
- import "./chunk-ZHVI3KWJ.js";
6
+ } from "./chunk-WOU7JVD3.js";
8
7
  import "./chunk-KHBLFXFG.js";
9
8
  import "./chunk-ONBZ4HK7.js";
10
- import "./chunk-MFF3VKO3.js";
9
+ import "./chunk-4NV4ZEFZ.js";
10
+ import "./chunk-2OWGBT3O.js";
11
11
  export {
12
12
  bodyLongitude,
13
13
  computeBodies,
package/dist/receipt.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as TimeScaleName, H as HouseSystem, c as ChartFlag, b as Chart, d as BirthInput } from './types-BsWaqwU_.js';
1
+ import { T as TimeScaleName, H as HouseSystem, e as ChartFlag, d as Chart, f as BirthInput } from './types-B4MCoCCS.js';
2
2
  import './deltat.js';
3
3
 
4
4
  /** Zodiacs-owned draft vocabulary; not an industry interoperability standard. */
@@ -134,11 +134,13 @@ declare const CONVENTIONS_RC8: Readonly<{
134
134
  readonly longitudeUnit: "degrees-[0,360)";
135
135
  }>;
136
136
  /**
137
- * The conventions this engine records: the rc.8 set, with the time basis in
138
- * the result (`result.timeScale`, docs/time.md) and local times resolved on
139
- * the shipped tzdb history before 1970, their flags from its records.
137
+ * The conventions engine version 0.1.1-rc.15 recorded: the rc.8 set, with the
138
+ * time basis in the result (`result.timeScale`, docs/time.md) and local times
139
+ * resolved on the shipped tzdb history before 1970, their flags from its
140
+ * records. Its engine took astronomy-engine's nutation, the five largest terms
141
+ * of IAU 2000B, which the set does not name. Its receipts stay readable.
140
142
  */
141
- declare const CONVENTIONS: Readonly<{
143
+ declare const CONVENTIONS_RC15: Readonly<{
142
144
  readonly deltaT: "tt-minus-ut1;value-in-result";
143
145
  readonly timeScale: "tt-from-leap-seconds-and-ut1-from-iers-1972-to-table-end;delta-t-model-otherwise;in-result";
144
146
  readonly localTime: "tzdb-shards-before-1970;host-intl-from-1970;flags-from-transition-record";
@@ -152,10 +154,33 @@ declare const CONVENTIONS: Readonly<{
152
154
  readonly moonNodes: "instantaneous-geocentric-moon-orbit-plane";
153
155
  readonly longitudeUnit: "degrees-[0,360)";
154
156
  }>;
155
- type ConventionSet = typeof CONVENTIONS | typeof CONVENTIONS_RC8 | typeof CONVENTIONS_RC7 | typeof CONVENTIONS_RC3;
157
+ /**
158
+ * The conventions this engine records: the rc.15 set, naming the nutation,
159
+ * the engine's own IAU 2000B series (all 77 luni-solar terms and the planetary
160
+ * offsets, src/nutation.ts) with the two largest complementary terms of the
161
+ * equation of the equinoxes, and the Moon as astronomy-engine's geocentric
162
+ * series (GeoMoon) turned to the ecliptic of date by it.
163
+ */
164
+ declare const CONVENTIONS: Readonly<{
165
+ readonly moonPosition: "astronomy-engine-geo-moon;no-light-time;no-aberration";
166
+ readonly nutation: "iau2000b;equation-of-equinoxes-with-two-complementary-terms";
167
+ readonly deltaT: "tt-minus-ut1;value-in-result";
168
+ readonly timeScale: "tt-from-leap-seconds-and-ut1-from-iers-1972-to-table-end;delta-t-model-otherwise;in-result";
169
+ readonly localTime: "tzdb-shards-before-1970;host-intl-from-1970;flags-from-transition-record";
170
+ readonly planetPositions: "aberrated-geocentric-ecliptic-of-date;no-deflection";
171
+ readonly angles: "gast-and-true-obliquity";
172
+ readonly speed: "degrees-per-day;central-difference-plus-minus-0.001-day;nodes-plus-minus-0.25-day";
173
+ readonly aspects: "major-aspects;sun-moon-eight-planets;no-nodes;applying-instantaneous-orb-rate";
174
+ readonly calendar: "proleptic-gregorian";
175
+ readonly zodiac: "tropical";
176
+ readonly moonNodes: "instantaneous-geocentric-moon-orbit-plane";
177
+ readonly longitudeUnit: "degrees-[0,360)";
178
+ }>;
179
+ type ConventionSet = typeof CONVENTIONS | typeof CONVENTIONS_RC15 | typeof CONVENTIONS_RC8 | typeof CONVENTIONS_RC7 | typeof CONVENTIONS_RC3;
156
180
  /** Every conventions set a receipt may carry, the current one first. */
157
181
  declare const NATAL_RECEIPT_CONVENTION_SETS: readonly [
158
182
  typeof CONVENTIONS,
183
+ typeof CONVENTIONS_RC15,
159
184
  typeof CONVENTIONS_RC8,
160
185
  typeof CONVENTIONS_RC7,
161
186
  typeof CONVENTIONS_RC3
package/dist/receipt.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  EPHEMERIS,
25
25
  SIGNS,
26
26
  aspectMotion
27
- } from "./chunk-MFF3VKO3.js";
27
+ } from "./chunk-2OWGBT3O.js";
28
28
 
29
29
  // src/receipt-json.ts
30
30
  function parseReceiptJson(json, limits) {
@@ -205,18 +205,24 @@ var CONVENTIONS_RC8 = Object.freeze({
205
205
  moonPosition: "astronomy-engine-ecliptic-geo-moon;no-light-time;no-aberration",
206
206
  deltaT: "tt-minus-ut1;ut1-read-as-utc;value-in-result"
207
207
  });
208
- var CONVENTIONS = Object.freeze({
208
+ var CONVENTIONS_RC15 = Object.freeze({
209
209
  ...CONVENTIONS_RC8,
210
210
  deltaT: "tt-minus-ut1;value-in-result",
211
211
  timeScale: "tt-from-leap-seconds-and-ut1-from-iers-1972-to-table-end;delta-t-model-otherwise;in-result",
212
212
  localTime: "tzdb-shards-before-1970;host-intl-from-1970;flags-from-transition-record"
213
213
  });
214
- var NATAL_RECEIPT_CONVENTION_SETS = Object.freeze([CONVENTIONS, CONVENTIONS_RC8, CONVENTIONS_RC7, CONVENTIONS_RC3]);
214
+ var CONVENTIONS = Object.freeze({
215
+ ...CONVENTIONS_RC15,
216
+ moonPosition: "astronomy-engine-geo-moon;no-light-time;no-aberration",
217
+ nutation: "iau2000b;equation-of-equinoxes-with-two-complementary-terms"
218
+ });
219
+ var NATAL_RECEIPT_CONVENTION_SETS = Object.freeze([CONVENTIONS, CONVENTIONS_RC15, CONVENTIONS_RC8, CONVENTIONS_RC7, CONVENTIONS_RC3]);
215
220
  var RC3_TO_RC6 = /^0\.1\.1-rc\.[3-6](?:\+[A-Za-z0-9.-]+)?$/;
216
221
  var RC7 = /^0\.1\.1-rc\.7(?:\+[A-Za-z0-9.-]+)?$/;
217
222
  var RC8_TO_RC14 = /^0\.1\.1-rc\.(?:[89]|1[0-4])(?:\+[A-Za-z0-9.-]+)?$/;
223
+ var RC15 = /^0\.1\.1-rc\.15(?:\+[A-Za-z0-9.-]+)?$/;
218
224
  var before = (version2, release) => compareVersions(version2, release) < 0;
219
- var TIME_BASIS_RELEASE = "0.1.1-rc.15";
225
+ var NUTATION_RELEASE = "0.1.1-rc.16";
220
226
  var RC9_RELEASE = "0.1.1-rc.9";
221
227
  var RC10_RELEASE = "0.1.1-rc.10";
222
228
  var COVERAGE = Object.freeze({
@@ -789,8 +795,8 @@ function validateEnvelope(input) {
789
795
  if (timeKnown && Math.abs(coords.latitude) === 90) fail("unsupported_feature");
790
796
  }
791
797
  const conventions = conventionSet(receipt.conventions);
792
- const current = conventions === CONVENTIONS || conventions === CONVENTIONS_RC8;
793
- const timeBasis2 = conventions === CONVENTIONS;
798
+ const timeBasis2 = conventions === CONVENTIONS || conventions === CONVENTIONS_RC15;
799
+ const current = timeBasis2 || conventions === CONVENTIONS_RC8;
794
800
  if (timeBasis2 !== Object.hasOwn(receipt, "timeScale")) fail("invalid_shape");
795
801
  const scale = timeBasis2 ? choice(receipt.timeScale, TIME_SCALE_NAMES) : null;
796
802
  const result = validateResult(
@@ -831,7 +837,7 @@ function validateEnvelope(input) {
831
837
  }
832
838
  validateProvenance(receipt.provenance, engineVersion);
833
839
  validateLocal(receipt.localResolution, receipt, timeBasis2);
834
- if (conventions === CONVENTIONS_RC3 && !RC3_TO_RC6.test(engineVersion) || conventions === CONVENTIONS_RC7 && !RC7.test(engineVersion) || conventions === CONVENTIONS_RC8 && !RC8_TO_RC14.test(engineVersion) || timeBasis2 && before(engineVersion, TIME_BASIS_RELEASE) || !HOUSE_SYSTEMS_BEFORE_RC9.includes(requested) && before(engineVersion, RC9_RELEASE) || !HOUSE_SYSTEMS_BEFORE_RC10.includes(requested) && before(engineVersion, RC10_RELEASE))
840
+ if (conventions === CONVENTIONS_RC3 && !RC3_TO_RC6.test(engineVersion) || conventions === CONVENTIONS_RC7 && !RC7.test(engineVersion) || conventions === CONVENTIONS_RC8 && !RC8_TO_RC14.test(engineVersion) || conventions === CONVENTIONS_RC15 && !RC15.test(engineVersion) || conventions === CONVENTIONS && before(engineVersion, NUTATION_RELEASE) || !HOUSE_SYSTEMS_BEFORE_RC9.includes(requested) && before(engineVersion, RC9_RELEASE) || !HOUSE_SYSTEMS_BEFORE_RC10.includes(requested) && before(engineVersion, RC10_RELEASE))
835
841
  fail("inconsistent_result");
836
842
  fixedFields(receipt.coverage, COVERAGE);
837
843
  if (envelope.extensions !== void 0) record(envelope.extensions);
@@ -0,0 +1,10 @@
1
+ import { Z as ZodiacSign } from './types-B4MCoCCS.js';
2
+
3
+ /** The seven visible planets of the traditional rulership scheme. */
4
+ type TraditionalPlanet = "Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn";
5
+ /** The traditional domicile ruler of each sign; the outer planets rule none. */
6
+ declare const TRADITIONAL_RULERS: Readonly<Record<ZodiacSign, TraditionalPlanet>>;
7
+ /** The seven planets in descending order of their spheres, Saturn to the Moon. */
8
+ declare const CHALDEAN_ORDER: readonly TraditionalPlanet[];
9
+
10
+ export { CHALDEAN_ORDER as C, type TraditionalPlanet as T, TRADITIONAL_RULERS as a };
package/dist/sky.d.ts ADDED
@@ -0,0 +1,158 @@
1
+ import { B as BodyName, D as DateInput } from './types-B4MCoCCS.js';
2
+ import { T as TraditionalPlanet } from './rulers-9wljfVaO.js';
3
+ export { C as CHALDEAN_ORDER } from './rulers-9wljfVaO.js';
4
+ import './deltat.js';
5
+
6
+ /** A body the sky functions accept: the Sun, the Moon and the planets. */
7
+ type SkyBody = Exclude<BodyName, "North Node" | "South Node">;
8
+ /** A place: geodetic latitude and longitude in degrees (east positive) and height in metres. */
9
+ interface Observer {
10
+ latitude: number;
11
+ longitude: number;
12
+ /** Metres above the WGS84 ellipsoid, from −10,000 to 100,000; 0 when absent. */
13
+ height?: number;
14
+ }
15
+ /** The point of the disc that meets the horizon. Planets are always taken at their centre. */
16
+ type Limb = "upper" | "centre" | "lower";
17
+ /** `"standard"`: 34′ of refraction at the horizon. `"none"`: the geometric horizon. */
18
+ type Refraction = "standard" | "none";
19
+ interface SkyOptions {
20
+ /** `"upper"` for the Sun and Moon unless given; the planets accept only `"centre"`. */
21
+ limb?: Limb;
22
+ /** `"standard"` unless given. */
23
+ refraction?: Refraction;
24
+ /** Most position evaluations the searches may make: a positive integer or `Infinity` (default). */
25
+ maxSamples?: number;
26
+ }
27
+ interface SkyDayOptions extends SkyOptions {
28
+ /** The clock that defines the day, minutes east of UTC. Default: the observer's local mean time, longitude × 4. */
29
+ utcOffsetMinutes?: number;
30
+ }
31
+ type SkyEventKind = "rise" | "set" | "upper-transit" | "lower-transit";
32
+ interface SkyEvent {
33
+ readonly kind: SkyEventKind;
34
+ readonly at: Date;
35
+ /** Geometric (unrefracted) topocentric altitude of the body's centre, degrees. */
36
+ readonly altitude: number;
37
+ /** Topocentric azimuth of the centre, degrees from north through east, in [0, 360). */
38
+ readonly azimuth: number;
39
+ }
40
+ /**
41
+ * `"never-rises"` and `"never-sets"`: the window holds no rise and no set, and
42
+ * the body stayed below (polar night, for the Sun) or above (polar day) the
43
+ * horizon of the conventions throughout. `"outside-reference-span"`: the
44
+ * window reaches outside `REFERENCE_SPAN`.
45
+ */
46
+ type SkyFlag = "never-rises" | "never-sets" | "outside-reference-span";
47
+ interface SkyConventions {
48
+ readonly limb: Limb;
49
+ readonly refraction: Refraction;
50
+ /** The refraction at the horizon, arcminutes: 34 or 0. */
51
+ readonly refractionArcmin: number;
52
+ }
53
+ interface SkyWindow {
54
+ readonly body: SkyBody;
55
+ readonly observer: Readonly<Required<Observer>>;
56
+ readonly from: Date;
57
+ readonly to: Date;
58
+ readonly conventions: SkyConventions;
59
+ readonly flags: readonly SkyFlag[];
60
+ /** Position evaluations the searches made. */
61
+ readonly samples: number;
62
+ }
63
+ /** A search either completes, with every event in the window, or is refused whole. */
64
+ type SkyEvents = (SkyWindow & {
65
+ readonly status: "complete";
66
+ readonly events: readonly SkyEvent[];
67
+ }) | (SkyWindow & {
68
+ readonly status: "refused";
69
+ readonly reason: "sample-budget";
70
+ readonly events: readonly [];
71
+ });
72
+ /** Refraction at the horizon, arcminutes (USNO, Rise, Set, and Twilight Definitions). */
73
+ declare const STANDARD_REFRACTION_ARCMIN = 34;
74
+ /** Radii for the semi-diameter, km: the Sun's (959.64″ at 1 au), the Moon's IAU mean radius. */
75
+ declare const SKY_RADII_KM: Readonly<{
76
+ Sun: 696000;
77
+ Moon: 1737.4;
78
+ }>;
79
+ /**
80
+ * Every rise, set, upper transit and lower transit of `body` in [from, to),
81
+ * for `observer`, in time order.
82
+ *
83
+ * A rise or set is the instant the geometric topocentric altitude of the
84
+ * body's centre equals −(refraction) − (semi-diameter) for the upper limb
85
+ * (+ for the lower, 0 for the centre). A transit is the instant the
86
+ * topocentric hour angle is 0° (upper) or 180° (lower). Throws RangeError for
87
+ * an unknown body, observer field or option, an invalid window, or an instant
88
+ * outside `EPHEMERIS_SPAN`.
89
+ */
90
+ declare function skyEvents(body: SkyBody, observer: Observer, from: DateInput, to: DateInput, options?: SkyOptions): SkyEvents;
91
+ /**
92
+ * The events of one calendar day on a clock `utcOffsetMinutes` east of UTC
93
+ * (by default the observer's local mean time): `skyEvents` over that day.
94
+ */
95
+ declare function skyEventsOn(body: SkyBody, observer: Observer, date: string, options?: SkyDayOptions): SkyEvents;
96
+
97
+ /** The ruler of each weekday, Sunday first (Cassius Dio 37.18–19). */
98
+ declare const PLANETARY_DAY_RULERS: readonly TraditionalPlanet[];
99
+ interface PlanetaryHour {
100
+ /** 1 to 24: hours 1–12 are the day's, 13–24 the night's. */
101
+ readonly number: number;
102
+ readonly period: "day" | "night";
103
+ readonly ruler: TraditionalPlanet;
104
+ readonly start: Date;
105
+ /** Exclusive; the next hour's start. */
106
+ readonly end: Date;
107
+ }
108
+ interface PlanetaryDayBase {
109
+ /** The calendar date whose sunrise begins the day, on the clock of `utcOffsetMinutes`. */
110
+ readonly date: string;
111
+ readonly utcOffsetMinutes: number;
112
+ /** 0 for Sunday to 6 for Saturday. */
113
+ readonly weekday: number;
114
+ /** The weekday's ruler, which rules the first hour. */
115
+ readonly ruler: TraditionalPlanet;
116
+ readonly conventions: SkyConventions;
117
+ readonly flags: readonly SkyFlag[];
118
+ readonly samples: number;
119
+ }
120
+ /**
121
+ * `"complete"`: the Sun rose on the date, set, and rose again, and the 24
122
+ * hours are given. `"no-sunrise"`: the date's 24 hours on the chosen clock
123
+ * hold no sunrise, in polar day or night (`flags` says which) or when the
124
+ * clock's midnight falls next to sunrise. `"no-sunset"`: the Sun rose but did
125
+ * not set within three days of the date's start, as polar day begins.
126
+ * `"no-next-sunrise"`: it rose and set but did not rise again within those
127
+ * three days, as polar night begins. `"refused"`: the sample budget ran out.
128
+ */
129
+ type PlanetaryDay = (PlanetaryDayBase & {
130
+ readonly status: "complete";
131
+ readonly sunrise: Date;
132
+ readonly sunset: Date;
133
+ readonly nextSunrise: Date;
134
+ readonly hours: readonly PlanetaryHour[];
135
+ }) | (PlanetaryDayBase & {
136
+ readonly status: "no-sunrise" | "no-sunset" | "no-next-sunrise" | "refused";
137
+ readonly sunrise: null;
138
+ readonly sunset: null;
139
+ readonly nextSunrise: null;
140
+ readonly hours: readonly [];
141
+ });
142
+ /**
143
+ * The planetary day that begins at the Sun's first rise on `date` (YYYY-MM-DD
144
+ * on the clock `utcOffsetMinutes` east of UTC, by default the observer's local
145
+ * mean time): the day's ruler, sunrise, sunset, the next sunrise and the 24
146
+ * hours. Rise and set follow the options of `skyEvents` for the Sun.
147
+ */
148
+ declare function planetaryHours(observer: Observer, date: string, options?: SkyDayOptions): PlanetaryDay;
149
+ /**
150
+ * The planetary hour running at `at`, with its day: the day whose sunrise is
151
+ * the last at or before `at`. `hour` is null when that day is not complete.
152
+ */
153
+ declare function planetaryHourAt(observer: Observer, at: DateInput, options?: SkyDayOptions): {
154
+ readonly day: PlanetaryDay;
155
+ readonly hour: PlanetaryHour | null;
156
+ };
157
+
158
+ export { type Limb, type Observer, PLANETARY_DAY_RULERS, type PlanetaryDay, type PlanetaryHour, type Refraction, SKY_RADII_KM, STANDARD_REFRACTION_ARCMIN, type SkyBody, type SkyConventions, type SkyDayOptions, type SkyEvent, type SkyEventKind, type SkyEvents, type SkyFlag, type SkyOptions, TraditionalPlanet, planetaryHourAt, planetaryHours, skyEvents, skyEventsOn };