@zodiacs/engine 0.1.1-rc.16 → 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.
- package/CHANGELOG.md +458 -0
- package/LICENSING.md +18 -5
- package/NOTICE +3 -2
- package/README.md +67 -33
- package/dist/{api-VOW6Umy5.d.ts → api-WbxJ4Wj-.d.ts} +12 -6
- package/dist/ayanamsa--YQ46fET.d.ts +134 -0
- package/dist/calc.d.ts +131 -20
- package/dist/calc.js +246 -60
- package/dist/chunk-47ERTK5X.js +27 -0
- package/dist/{chunk-O3NJRGJ2.js → chunk-7TRLIFFI.js} +1 -1
- package/dist/{chunk-KHBLFXFG.js → chunk-B5LKF437.js} +29 -28
- package/dist/{chunk-ONBZ4HK7.js → chunk-BHJXUY67.js} +4 -2
- package/dist/{chunk-I7O5EGFV.js → chunk-CHSYDKBL.js} +1 -1
- package/dist/{chunk-4NV4ZEFZ.js → chunk-DMGHYCDI.js} +4 -4
- package/dist/{chunk-L6ZHWJZ6.js → chunk-FTX3JDJA.js} +15 -12
- package/dist/{chunk-2OWGBT3O.js → chunk-OG4OYTJJ.js} +47 -42
- package/dist/{chunk-WOU7JVD3.js → chunk-SRXBTP5H.js} +7 -7
- package/dist/{chunk-AECKV73C.js → chunk-TSS2SZWQ.js} +8 -2
- package/dist/chunk-WS3TDSP3.js +474 -0
- package/dist/{chunk-N4B5JNMA.js → chunk-YIITY7Q7.js} +21 -11
- package/dist/crossings.d.ts +8 -7
- package/dist/crossings.js +1 -1
- package/dist/deltat.d.ts +28 -3
- package/dist/deltat.js +1 -1
- package/dist/geo.d.ts +33 -12
- package/dist/geo.js +3 -1
- package/dist/{houses-q1O2GGp4.d.ts → houses-CFERsAlK.d.ts} +12 -2
- package/dist/houses-extra.d.ts +19 -5
- package/dist/houses-extra.js +4 -2
- package/dist/index.d.ts +34 -49
- package/dist/index.js +21 -13
- package/dist/{internal-math-CmJ9xtaW.d.ts → internal-math-DJJ8BYex.d.ts} +41 -27
- package/dist/internal-math.d.ts +3 -3
- package/dist/internal-math.js +2 -2
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +5 -5
- package/dist/receipt.d.ts +2 -268
- package/dist/receipt.js +70 -35
- package/dist/reference-span-CILpclrz.d.ts +40 -0
- package/dist/{rulers-9wljfVaO.d.ts → rulers-Dla6h_Sm.d.ts} +7 -2
- package/dist/sky.d.ts +25 -10
- package/dist/sky.js +11 -9
- package/dist/techniques.d.ts +61 -18
- package/dist/techniques.js +39 -46
- package/dist/timing.d.ts +53 -16
- package/dist/timing.js +19 -38
- package/dist/{types-B4MCoCCS.d.ts → types-B-yb_tGL.d.ts} +23 -11
- package/dist/vedic.d.ts +42 -123
- package/dist/vedic.js +43 -440
- package/dist/window.d.ts +81 -79
- package/dist/window.js +26 -27
- package/dist/zone-history-ghdyO0Sc.d.ts +268 -0
- package/package.json +3 -1
package/dist/techniques.js
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readOptions
|
|
3
|
+
} from "./chunk-47ERTK5X.js";
|
|
1
4
|
import {
|
|
2
5
|
resolveLocalToUtc
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YIITY7Q7.js";
|
|
4
7
|
import "./chunk-KFTJMMG7.js";
|
|
5
8
|
import {
|
|
6
9
|
natalChart,
|
|
7
10
|
resolvedChart,
|
|
8
11
|
utcOf
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FTX3JDJA.js";
|
|
10
13
|
import {
|
|
11
14
|
dateFrom
|
|
12
15
|
} from "./chunk-CPALRSPC.js";
|
|
13
16
|
import {
|
|
14
17
|
findLongitudeCrossingsWith
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TSS2SZWQ.js";
|
|
16
19
|
import "./chunk-PFGUCNOK.js";
|
|
17
20
|
import {
|
|
18
21
|
bodyLongitude,
|
|
19
22
|
midpoint
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-SRXBTP5H.js";
|
|
21
24
|
import {
|
|
22
25
|
outsideReferenceSpan
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-B5LKF437.js";
|
|
27
|
+
import "./chunk-BHJXUY67.js";
|
|
25
28
|
import {
|
|
26
29
|
HOUSE_SYSTEMS
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-DMGHYCDI.js";
|
|
28
31
|
import {
|
|
29
32
|
ASPECTS,
|
|
30
|
-
|
|
33
|
+
ASPECT_BODY_SET,
|
|
31
34
|
SIGNS,
|
|
32
|
-
|
|
35
|
+
SIGN_SLUGS,
|
|
33
36
|
matchAspect,
|
|
34
37
|
normalizeLongitude,
|
|
35
38
|
signIndexForLongitude
|
|
36
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-OG4OYTJJ.js";
|
|
37
40
|
|
|
38
41
|
// src/techniques/shared.ts
|
|
39
42
|
var DAY_MS = 864e5;
|
|
@@ -56,19 +59,6 @@ function bodyName(value, label) {
|
|
|
56
59
|
if (typeof value === "string" && BODY_NAMES.includes(value)) return value;
|
|
57
60
|
throw new RangeError(`${label} must be a body name.`);
|
|
58
61
|
}
|
|
59
|
-
function readOptions(value, allowed, label) {
|
|
60
|
-
const out = /* @__PURE__ */ Object.create(null);
|
|
61
|
-
if (value === void 0) return out;
|
|
62
|
-
const prototype = value !== null && typeof value === "object" && !Array.isArray(value) ? Object.getPrototypeOf(value) : void 0;
|
|
63
|
-
if (prototype !== Object.prototype && prototype !== null) throw new RangeError(`${label} must be a plain options object.`);
|
|
64
|
-
for (const key of Reflect.ownKeys(value)) {
|
|
65
|
-
const slot = Object.getOwnPropertyDescriptor(value, key);
|
|
66
|
-
if (typeof key !== "string" || !allowed.includes(key)) throw new RangeError(`${label} has an unknown option: ${String(key)}.`);
|
|
67
|
-
if (!slot || !("value" in slot) || !slot.enumerable) throw new RangeError(`${label} must contain only plain data properties.`);
|
|
68
|
-
if (slot.value !== void 0) out[key] = slot.value;
|
|
69
|
-
}
|
|
70
|
-
return out;
|
|
71
|
-
}
|
|
72
62
|
function oneOf(value, allowed, fallback, label) {
|
|
73
63
|
if (value === void 0) return fallback;
|
|
74
64
|
if (typeof value === "string" && allowed.includes(value)) return value;
|
|
@@ -226,7 +216,7 @@ function compositeMidpoints(first, second) {
|
|
|
226
216
|
return Object.freeze(out);
|
|
227
217
|
}
|
|
228
218
|
function compositeAspects(points) {
|
|
229
|
-
const list = positions(points, "points").filter((point) =>
|
|
219
|
+
const list = positions(points, "points").filter((point) => ASPECT_BODY_SET.has(point.body));
|
|
230
220
|
const out = [];
|
|
231
221
|
list.forEach((a, i) => {
|
|
232
222
|
for (const b of list.slice(i + 1)) {
|
|
@@ -247,11 +237,14 @@ function wrapLongitude(value) {
|
|
|
247
237
|
return wrapped === -180 ? 180 : wrapped;
|
|
248
238
|
}
|
|
249
239
|
function davisonPlace(first, second, convention = "coordinates") {
|
|
250
|
-
|
|
251
|
-
|
|
240
|
+
const kind = oneOf(convention, PLACES, "coordinates", "convention");
|
|
241
|
+
const a = placeOf(first, "first");
|
|
242
|
+
const b = placeOf(second, "second");
|
|
243
|
+
if (kind === "coordinates") {
|
|
244
|
+
const east = ((b.longitude - a.longitude) % 360 + 360) % 360;
|
|
252
245
|
return Object.freeze({
|
|
253
|
-
latitude: (
|
|
254
|
-
longitude: wrapLongitude(
|
|
246
|
+
latitude: (a.latitude + b.latitude) / 2,
|
|
247
|
+
longitude: wrapLongitude(a.longitude + (east > 180 ? east - 360 : east) / 2)
|
|
255
248
|
});
|
|
256
249
|
}
|
|
257
250
|
const vector = ({ latitude, longitude }) => [
|
|
@@ -259,8 +252,8 @@ function davisonPlace(first, second, convention = "coordinates") {
|
|
|
259
252
|
Math.cos(latitude * DEG) * Math.sin(longitude * DEG),
|
|
260
253
|
Math.sin(latitude * DEG)
|
|
261
254
|
];
|
|
262
|
-
const [x1 = 0, y1 = 0, z1 = 0] = vector(
|
|
263
|
-
const [x2 = 0, y2 = 0, z2 = 0] = vector(
|
|
255
|
+
const [x1 = 0, y1 = 0, z1 = 0] = vector(a);
|
|
256
|
+
const [x2 = 0, y2 = 0, z2 = 0] = vector(b);
|
|
264
257
|
const [x, y, z] = [x1 + x2, y1 + y2, z1 + z2];
|
|
265
258
|
const horizontal = Math.hypot(x, y);
|
|
266
259
|
if (Math.hypot(horizontal, z) < 1e-12) throw new RangeError("Antipodal places have no single great-circle midpoint.");
|
|
@@ -282,12 +275,12 @@ function davisonChart(first, second, options) {
|
|
|
282
275
|
|
|
283
276
|
// src/techniques/void-of-course.ts
|
|
284
277
|
var VOID_BODIES = /* @__PURE__ */ Object.freeze({
|
|
285
|
-
modern: Object.freeze(["Sun", "Mercury", "Venus", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"]),
|
|
286
|
-
traditional: Object.freeze(["Sun", "Mercury", "Venus", "Mars", "Jupiter", "Saturn"])
|
|
278
|
+
modern: /* @__PURE__ */ Object.freeze(["Sun", "Mercury", "Venus", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"]),
|
|
279
|
+
traditional: /* @__PURE__ */ Object.freeze(["Sun", "Mercury", "Venus", "Mars", "Jupiter", "Saturn"])
|
|
287
280
|
});
|
|
288
281
|
var VOID_OF_COURSE_CONVENTION = /* @__PURE__ */ Object.freeze({
|
|
289
282
|
name: "last-exact-ptolemaic-aspect-to-sign-exit",
|
|
290
|
-
aspects: Object.freeze(["conjunction", "sextile", "square", "trine", "opposition"]),
|
|
283
|
+
aspects: /* @__PURE__ */ Object.freeze(["conjunction", "sextile", "square", "trine", "opposition"]),
|
|
291
284
|
defaultBodies: "modern",
|
|
292
285
|
source: "Lilly, Christian Astrology (1647), p. 112"
|
|
293
286
|
});
|
|
@@ -374,15 +367,15 @@ function windows(fromT, toT, bodies) {
|
|
|
374
367
|
from: new Date((lastAspect ?? entered).at.getTime()),
|
|
375
368
|
to: new Date(end),
|
|
376
369
|
lastAspect: lastAspect && Object.freeze(lastAspect),
|
|
377
|
-
sign:
|
|
378
|
-
nextSign:
|
|
370
|
+
sign: SIGN_SLUGS[entered.signIndex],
|
|
371
|
+
nextSign: SIGN_SLUGS[leaving.signIndex]
|
|
379
372
|
})
|
|
380
373
|
);
|
|
381
374
|
}
|
|
382
375
|
return out;
|
|
383
376
|
}
|
|
384
377
|
function moonIngresses(from, to) {
|
|
385
|
-
return Object.freeze(ingresses(...span(from, to)).map((row) => Object.freeze({ at: row.at, sign:
|
|
378
|
+
return Object.freeze(ingresses(...span(from, to)).map((row) => Object.freeze({ at: row.at, sign: SIGN_SLUGS[row.signIndex] })));
|
|
386
379
|
}
|
|
387
380
|
function moonAspects(from, to, options) {
|
|
388
381
|
const bodies = bodiesOf(options);
|
|
@@ -596,12 +589,12 @@ var EXALTATIONS = /* @__PURE__ */ Object.freeze({
|
|
|
596
589
|
Saturn: "libra"
|
|
597
590
|
});
|
|
598
591
|
var TRIPLICITY_LORDS = /* @__PURE__ */ Object.freeze({
|
|
599
|
-
fire: Object.freeze({ day: "Sun", night: "Jupiter", participating: "Saturn" }),
|
|
600
|
-
earth: Object.freeze({ day: "Venus", night: "Moon", participating: "Mars" }),
|
|
601
|
-
air: Object.freeze({ day: "Saturn", night: "Mercury", participating: "Jupiter" }),
|
|
602
|
-
water: Object.freeze({ day: "Venus", night: "Mars", participating: "Moon" })
|
|
592
|
+
fire: /* @__PURE__ */ Object.freeze({ day: "Sun", night: "Jupiter", participating: "Saturn" }),
|
|
593
|
+
earth: /* @__PURE__ */ Object.freeze({ day: "Venus", night: "Moon", participating: "Mars" }),
|
|
594
|
+
air: /* @__PURE__ */ Object.freeze({ day: "Saturn", night: "Mercury", participating: "Jupiter" }),
|
|
595
|
+
water: /* @__PURE__ */ Object.freeze({ day: "Venus", night: "Mars", participating: "Moon" })
|
|
603
596
|
});
|
|
604
|
-
var terms = (...rows) => Object.freeze(Object.fromEntries(
|
|
597
|
+
var terms = (...rows) => Object.freeze(Object.fromEntries(SIGN_SLUGS.map((sign, index) => [sign, Object.freeze(rows[index].map((row) => Object.freeze(row)))])));
|
|
605
598
|
var EGYPTIAN_TERMS = /* @__PURE__ */ terms(
|
|
606
599
|
[["Jupiter", 6], ["Venus", 12], ["Mercury", 20], ["Mars", 25], ["Saturn", 30]],
|
|
607
600
|
[["Venus", 8], ["Mercury", 14], ["Jupiter", 22], ["Saturn", 27], ["Mars", 30]],
|
|
@@ -617,12 +610,12 @@ var EGYPTIAN_TERMS = /* @__PURE__ */ terms(
|
|
|
617
610
|
[["Venus", 12], ["Jupiter", 16], ["Mercury", 19], ["Mars", 28], ["Saturn", 30]]
|
|
618
611
|
);
|
|
619
612
|
var CHALDEAN_FACES = /* @__PURE__ */ Object.freeze(
|
|
620
|
-
Array.from({ length: 36 }, (_, index) => ["Mars", "Sun", "Venus", "Mercury", "Moon", "Saturn", "Jupiter"][index % 7])
|
|
613
|
+
/* @__PURE__ */ Array.from({ length: 36 }, (_, index) => ["Mars", "Sun", "Venus", "Mercury", "Moon", "Saturn", "Jupiter"][index % 7])
|
|
621
614
|
);
|
|
622
|
-
var opposite = (sign) =>
|
|
615
|
+
var opposite = (sign) => SIGN_SLUGS[(SIGN_SLUGS.indexOf(sign) + 6) % 12];
|
|
623
616
|
var isClassical = (body) => CLASSICAL_PLANETS.includes(body);
|
|
624
617
|
function signName(value) {
|
|
625
|
-
if (typeof value === "string" &&
|
|
618
|
+
if (typeof value === "string" && SIGN_SLUGS.includes(value)) return value;
|
|
626
619
|
throw new RangeError("sign must be a lowercase zodiac sign name.");
|
|
627
620
|
}
|
|
628
621
|
function hasClassicalDignities(planet) {
|
|
@@ -647,7 +640,7 @@ function dignityFor(planet, sign) {
|
|
|
647
640
|
function dignityRulersAt(longitude) {
|
|
648
641
|
const lon = normalizeLongitude(finiteDegrees(longitude, "longitude"));
|
|
649
642
|
const index = signIndexForLongitude(lon);
|
|
650
|
-
const sign =
|
|
643
|
+
const sign = SIGN_SLUGS[index];
|
|
651
644
|
const degree = Math.max(0, lon - index * 30);
|
|
652
645
|
const row = EGYPTIAN_TERMS[sign];
|
|
653
646
|
const at = Math.max(0, row.findIndex(([, end]) => degree < end));
|
|
@@ -729,7 +722,7 @@ function signsOver(fromT, toT) {
|
|
|
729
722
|
const first = signIndexForLongitude(bodyLongitude("Moon", new Date(fromT)));
|
|
730
723
|
const last = signIndexForLongitude(bodyLongitude("Moon", new Date(toT)));
|
|
731
724
|
const count = (last - first + 12) % 12;
|
|
732
|
-
return Array.from({ length: count + 1 }, (_, step) =>
|
|
725
|
+
return Array.from({ length: count + 1 }, (_, step) => SIGN_SLUGS[(first + step) % 12]);
|
|
733
726
|
}
|
|
734
727
|
function moonSignsBetween(from, to) {
|
|
735
728
|
const fromT = dateFrom(from, "from").getTime();
|
package/dist/timing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TraditionalPlanet } from './rulers-
|
|
2
|
-
export { C as CHALDEAN_ORDER, a as TRADITIONAL_RULERS } from './rulers-
|
|
3
|
-
import { B as BodyName,
|
|
4
|
-
import { N as NatalSource } from './api-
|
|
1
|
+
import { T as TraditionalPlanet } from './rulers-Dla6h_Sm.js';
|
|
2
|
+
export { C as CHALDEAN_ORDER, a as TRADITIONAL_RULERS } from './rulers-Dla6h_Sm.js';
|
|
3
|
+
import { B as BodyName, s as PointName, Z as ZodiacSign, b as HouseNumber, D as DateInput, k as Sect } from './types-B-yb_tGL.js';
|
|
4
|
+
import { N as NatalSource } from './api-WbxJ4Wj-.js';
|
|
5
5
|
import './deltat.js';
|
|
6
6
|
import './crossings.js';
|
|
7
7
|
|
|
@@ -108,9 +108,9 @@ interface ProfectionAt {
|
|
|
108
108
|
/** Options for the dated profections. */
|
|
109
109
|
interface ProfectionOptions {
|
|
110
110
|
/** The natal body, angle or chart point to profect; `"Ascendant"` by default. */
|
|
111
|
-
readonly point?: ChartLongitudeName;
|
|
111
|
+
readonly point?: ChartLongitudeName | undefined;
|
|
112
112
|
/** `"solar"` by default. */
|
|
113
|
-
readonly months?: ProfectionMonthConvention;
|
|
113
|
+
readonly months?: ProfectionMonthConvention | undefined;
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* The profection year of an age, dated, with its months. Year n runs from the
|
|
@@ -203,12 +203,12 @@ interface FirdariaAt {
|
|
|
203
203
|
/** Options for the firdaria functions. */
|
|
204
204
|
interface FirdariaOptions {
|
|
205
205
|
/** Where the nodes fall by night; `"abu-mashar"` by default. */
|
|
206
|
-
readonly variant?: FirdariaVariant;
|
|
206
|
+
readonly variant?: FirdariaVariant | undefined;
|
|
207
207
|
}
|
|
208
208
|
/** Options for {@link firdaria}. */
|
|
209
209
|
interface FirdariaTimelineOptions extends FirdariaOptions {
|
|
210
210
|
/** 75-year cycles to date, 1 to 4; 1 by default. */
|
|
211
|
-
readonly cycles?: number;
|
|
211
|
+
readonly cycles?: number | undefined;
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
214
|
* The firdaria lords in order: by day the planets from the Sun, by night from
|
|
@@ -315,14 +315,14 @@ interface ReleasingAt {
|
|
|
315
315
|
/** Options for {@link releasingPeriods} and {@link zodiacalReleasing}. */
|
|
316
316
|
interface ReleasingOptions {
|
|
317
317
|
/** The deepest level, 1 to 4; 2 by default. */
|
|
318
|
-
readonly levels?: ReleasingLevel;
|
|
318
|
+
readonly levels?: ReleasingLevel | undefined;
|
|
319
319
|
/** `"valens-360"` by default. */
|
|
320
|
-
readonly years?: ReleasingYearConvention;
|
|
320
|
+
readonly years?: ReleasingYearConvention | undefined;
|
|
321
321
|
}
|
|
322
322
|
/** Options for {@link releasingAt} and {@link zodiacalReleasingAt}. */
|
|
323
323
|
interface ReleasingAtOptions {
|
|
324
324
|
/** `"valens-360"` by default. */
|
|
325
|
-
readonly years?: ReleasingYearConvention;
|
|
325
|
+
readonly years?: ReleasingYearConvention | undefined;
|
|
326
326
|
}
|
|
327
327
|
/**
|
|
328
328
|
* The periods of levels 1 to `options.levels` (2 by default) that overlap
|
|
@@ -406,17 +406,40 @@ declare function directLongitudes(rows: readonly {
|
|
|
406
406
|
*/
|
|
407
407
|
declare function solarArcDirections(natal: NatalSource, target: DateInput): SolarArcDirections;
|
|
408
408
|
|
|
409
|
-
/**
|
|
409
|
+
/**
|
|
410
|
+
* The bodies a return can be asked for.
|
|
411
|
+
*
|
|
412
|
+
* @experimental Added in 0.1.1-rc.16: how returns
|
|
413
|
+
* are grouped into passes, and the searches' steps, may change in a minor
|
|
414
|
+
* release.
|
|
415
|
+
*/
|
|
410
416
|
type ReturnBody = "Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto";
|
|
417
|
+
/**
|
|
418
|
+
* The bodies a return can be asked for, in the order of ReturnBody.
|
|
419
|
+
*
|
|
420
|
+
* @experimental Added in 0.1.1-rc.16: how returns
|
|
421
|
+
* are grouped into passes, and the searches' steps, may change in a minor
|
|
422
|
+
* release.
|
|
423
|
+
*/
|
|
411
424
|
declare const RETURN_BODIES: readonly ReturnBody[];
|
|
412
425
|
/**
|
|
413
426
|
* Days between the coarse samples of each body's search: two steps are
|
|
414
427
|
* shorter than the shortest time between two stations from 1800 to 2200
|
|
415
428
|
* (19.75 days for Mercury, 40.75 for Venus, 59.75 for Mars, longer for the
|
|
416
429
|
* others), and one step moves the Moon at most 15.4°.
|
|
430
|
+
*
|
|
431
|
+
* @experimental Added in 0.1.1-rc.16: how returns
|
|
432
|
+
* are grouped into passes, and the searches' steps, may change in a minor
|
|
433
|
+
* release.
|
|
417
434
|
*/
|
|
418
435
|
declare const RETURN_STEP_DAYS: Readonly<Record<ReturnBody, number>>;
|
|
419
|
-
/**
|
|
436
|
+
/**
|
|
437
|
+
* One return: an instant in the window at which the body is on its natal longitude.
|
|
438
|
+
*
|
|
439
|
+
* @experimental Added in 0.1.1-rc.16: how returns
|
|
440
|
+
* are grouped into passes, and the searches' steps, may change in a minor
|
|
441
|
+
* release.
|
|
442
|
+
*/
|
|
420
443
|
interface PlanetaryReturn {
|
|
421
444
|
readonly at: Date;
|
|
422
445
|
/** True when the body was moving backward through the degree. */
|
|
@@ -428,16 +451,26 @@ interface PlanetaryReturn {
|
|
|
428
451
|
*/
|
|
429
452
|
readonly pass: number;
|
|
430
453
|
}
|
|
431
|
-
/**
|
|
454
|
+
/**
|
|
455
|
+
* `stepDays` (default {@link RETURN_STEP_DAYS}) and `maxSamples`, a budget of longitude evaluations.
|
|
456
|
+
*
|
|
457
|
+
* @experimental Added in 0.1.1-rc.16: how returns
|
|
458
|
+
* are grouped into passes, and the searches' steps, may change in a minor
|
|
459
|
+
* release.
|
|
460
|
+
*/
|
|
432
461
|
interface PlanetaryReturnOptions {
|
|
433
|
-
stepDays?: number;
|
|
434
|
-
maxSamples?: number;
|
|
462
|
+
readonly stepDays?: number | undefined;
|
|
463
|
+
readonly maxSamples?: number | undefined;
|
|
435
464
|
}
|
|
436
465
|
/**
|
|
437
466
|
* The search's verdict with its returns: `"complete"` with every return it
|
|
438
467
|
* found, or `"refused"` with none when the budget ran out. Both carry the
|
|
439
468
|
* body, its natal longitude (the chart's, degrees in [0, 360)), the window,
|
|
440
469
|
* the longitude evaluations made (`samples`) and the result's flags.
|
|
470
|
+
*
|
|
471
|
+
* @experimental Added in 0.1.1-rc.16: how returns
|
|
472
|
+
* are grouped into passes, and the searches' steps, may change in a minor
|
|
473
|
+
* release.
|
|
441
474
|
*/
|
|
442
475
|
type PlanetaryReturns = {
|
|
443
476
|
readonly status: "complete";
|
|
@@ -467,6 +500,10 @@ type PlanetaryReturns = {
|
|
|
467
500
|
* search assumes smooth motion with at most one station in two steps; within
|
|
468
501
|
* that it finds a pair of returns around a station that falls between two
|
|
469
502
|
* samples. Invalid input throws RangeError. Frozen.
|
|
503
|
+
*
|
|
504
|
+
* @experimental Added in 0.1.1-rc.16: how returns
|
|
505
|
+
* are grouped into passes, and the searches' steps, may change in a minor
|
|
506
|
+
* release.
|
|
470
507
|
*/
|
|
471
508
|
declare function planetaryReturns(natal: NatalSource, body: ReturnBody, from: DateInput, to: DateInput, options?: PlanetaryReturnOptions): PlanetaryReturns;
|
|
472
509
|
|
package/dist/timing.js
CHANGED
|
@@ -2,11 +2,14 @@ import {
|
|
|
2
2
|
CHALDEAN_ORDER,
|
|
3
3
|
TRADITIONAL_RULERS
|
|
4
4
|
} from "./chunk-A3U2ZS2W.js";
|
|
5
|
+
import {
|
|
6
|
+
readOptions
|
|
7
|
+
} from "./chunk-47ERTK5X.js";
|
|
5
8
|
import {
|
|
6
9
|
PROGRESSION_DAYS_PER_YEAR,
|
|
7
10
|
progressedBodies,
|
|
8
11
|
progressedInstant
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CHSYDKBL.js";
|
|
10
13
|
import {
|
|
11
14
|
chartDeclinations,
|
|
12
15
|
chartPoints,
|
|
@@ -14,53 +17,31 @@ import {
|
|
|
14
17
|
resolvedChart,
|
|
15
18
|
searchLongitudeCrossings,
|
|
16
19
|
utcOf
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FTX3JDJA.js";
|
|
18
21
|
import {
|
|
19
22
|
dateFrom
|
|
20
23
|
} from "./chunk-CPALRSPC.js";
|
|
21
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-TSS2SZWQ.js";
|
|
22
25
|
import "./chunk-PFGUCNOK.js";
|
|
23
26
|
import {
|
|
24
27
|
bodyLongitude
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-SRXBTP5H.js";
|
|
26
29
|
import {
|
|
27
30
|
outsideReferenceSpan
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-B5LKF437.js";
|
|
32
|
+
import "./chunk-BHJXUY67.js";
|
|
33
|
+
import "./chunk-DMGHYCDI.js";
|
|
31
34
|
import {
|
|
32
|
-
|
|
35
|
+
SIGN_SLUGS,
|
|
33
36
|
degreeInSign,
|
|
34
37
|
normalizeLongitude,
|
|
35
38
|
signForLongitude,
|
|
36
39
|
signIndexForLongitude
|
|
37
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-OG4OYTJJ.js";
|
|
38
41
|
|
|
39
42
|
// src/timing/shared.ts
|
|
40
43
|
var DAY_MS = 864e5;
|
|
41
44
|
var MAX_DATE_MS = 864e13;
|
|
42
|
-
function readOptions(value, allowed, label) {
|
|
43
|
-
const out = /* @__PURE__ */ Object.create(null);
|
|
44
|
-
if (value === void 0) return out;
|
|
45
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
46
|
-
throw new RangeError(`${label} must be an options object.`);
|
|
47
|
-
}
|
|
48
|
-
const prototype = Object.getPrototypeOf(value);
|
|
49
|
-
if (prototype !== Object.prototype && prototype !== null) {
|
|
50
|
-
throw new RangeError(`${label} must be a plain options object.`);
|
|
51
|
-
}
|
|
52
|
-
for (const key of Reflect.ownKeys(value)) {
|
|
53
|
-
if (typeof key !== "string" || !allowed.includes(key)) {
|
|
54
|
-
throw new RangeError(`${label} has an unknown option: ${String(key)}.`);
|
|
55
|
-
}
|
|
56
|
-
const slot = Object.getOwnPropertyDescriptor(value, key);
|
|
57
|
-
if (!slot || !("value" in slot) || !slot.enumerable) {
|
|
58
|
-
throw new RangeError(`${label} must contain only plain data properties.`);
|
|
59
|
-
}
|
|
60
|
-
if (slot.value !== void 0) out[key] = slot.value;
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
45
|
function oneOf(value, allowed, fallback, label) {
|
|
65
46
|
if (value === void 0) return fallback;
|
|
66
47
|
if (typeof value === "string" && allowed.includes(value)) return value;
|
|
@@ -74,7 +55,7 @@ function integerIn(value, minimum, maximum, label) {
|
|
|
74
55
|
}
|
|
75
56
|
function startSign(value, label) {
|
|
76
57
|
if (typeof value === "string") {
|
|
77
|
-
const index =
|
|
58
|
+
const index = SIGN_SLUGS.indexOf(value);
|
|
78
59
|
if (index >= 0) return { index, lon: null };
|
|
79
60
|
} else if (typeof value === "number" && Number.isFinite(value)) {
|
|
80
61
|
const lon = normalizeLongitude(value);
|
|
@@ -86,7 +67,7 @@ function originOf(index, lon, point) {
|
|
|
86
67
|
return Object.freeze({ point, lon, sign: signAt(index) });
|
|
87
68
|
}
|
|
88
69
|
function signAt(index) {
|
|
89
|
-
const sign =
|
|
70
|
+
const sign = SIGN_SLUGS[(index % 12 + 12) % 12];
|
|
90
71
|
if (sign === void 0) throw new RangeError("Could not resolve zodiac sign.");
|
|
91
72
|
return sign;
|
|
92
73
|
}
|
|
@@ -558,15 +539,15 @@ var RELEASING_YEAR_CONVENTIONS = /* @__PURE__ */ Object.freeze([
|
|
|
558
539
|
]);
|
|
559
540
|
var DEFAULT_RELEASING_YEARS = "valens-360";
|
|
560
541
|
var RELEASING_UNIT_DAYS = /* @__PURE__ */ Object.freeze({
|
|
561
|
-
"valens-360": /* @__PURE__ */ Object.freeze([360, 30, 2.5,
|
|
562
|
-
"julian-365.25": /* @__PURE__ */ Object.freeze([365.25,
|
|
542
|
+
"valens-360": /* @__PURE__ */ Object.freeze([360, 30, 2.5, 0.20833333333333334]),
|
|
543
|
+
"julian-365.25": /* @__PURE__ */ Object.freeze([365.25, 30.4375, 2.5364583333333335, 0.2113715277777778])
|
|
563
544
|
});
|
|
564
545
|
var LEVEL4_UNIT_MS = /* @__PURE__ */ Object.freeze({
|
|
565
546
|
"valens-360": 18e6,
|
|
566
547
|
"julian-365.25": 18262500
|
|
567
548
|
});
|
|
568
549
|
var LEVEL_SCALE = /* @__PURE__ */ Object.freeze({ 1: 1728, 2: 144, 3: 12, 4: 1 });
|
|
569
|
-
var MINOR = /* @__PURE__ */ Object.freeze(/* @__PURE__ */
|
|
550
|
+
var MINOR = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ SIGN_SLUGS.map((sign) => VALENS_MINOR_YEARS[sign]));
|
|
570
551
|
var MAX_PERIODS = 1e5;
|
|
571
552
|
var CONVENTIONS = /* @__PURE__ */ new Map();
|
|
572
553
|
function conventionsFor3(years) {
|
|
@@ -802,7 +783,7 @@ function solarArcDirections(natal, target) {
|
|
|
802
783
|
}
|
|
803
784
|
|
|
804
785
|
// src/timing/planetary-returns.ts
|
|
805
|
-
var RETURN_BODIES = Object.freeze([
|
|
786
|
+
var RETURN_BODIES = /* @__PURE__ */ Object.freeze([
|
|
806
787
|
"Sun",
|
|
807
788
|
"Moon",
|
|
808
789
|
"Mercury",
|
|
@@ -814,7 +795,7 @@ var RETURN_BODIES = Object.freeze([
|
|
|
814
795
|
"Neptune",
|
|
815
796
|
"Pluto"
|
|
816
797
|
]);
|
|
817
|
-
var RETURN_STEP_DAYS = Object.freeze({
|
|
798
|
+
var RETURN_STEP_DAYS = /* @__PURE__ */ Object.freeze({
|
|
818
799
|
Sun: 5,
|
|
819
800
|
Moon: 1,
|
|
820
801
|
Mercury: 2,
|
|
@@ -2,6 +2,12 @@ import { DeltaT } from './deltat.js';
|
|
|
2
2
|
|
|
3
3
|
/** The scale an input instant is on. UTC unless a caller says otherwise. */
|
|
4
4
|
type TimeScaleName = "utc" | "ut1" | "tt";
|
|
5
|
+
/**
|
|
6
|
+
* The ΔT model name for a value derived from leap seconds and IERS UT1 − UTC:
|
|
7
|
+
* a chart's from 1972 to the end of the IERS UT1 table. DELTA_T_MODEL names
|
|
8
|
+
* the model used at every other instant.
|
|
9
|
+
*/
|
|
10
|
+
declare const DELTA_T_IERS_MODEL = "iers-utc/1";
|
|
5
11
|
/** UT1 − UTC as used: IERS observed or predicted, or 0 within 0.9 s outside the table. */
|
|
6
12
|
interface Ut1MinusUtc {
|
|
7
13
|
seconds: number;
|
|
@@ -32,12 +38,12 @@ type Modality = "cardinal" | "fixed" | "mutable";
|
|
|
32
38
|
type Polarity = "day" | "night";
|
|
33
39
|
type HouseNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
34
40
|
interface SignDefinition {
|
|
35
|
-
slug: ZodiacSign;
|
|
36
|
-
name: string;
|
|
37
|
-
element: Element;
|
|
38
|
-
modality: Modality;
|
|
39
|
-
polarity: Polarity;
|
|
40
|
-
naturalHouse: HouseNumber;
|
|
41
|
+
readonly slug: ZodiacSign;
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly element: Element;
|
|
44
|
+
readonly modality: Modality;
|
|
45
|
+
readonly polarity: Polarity;
|
|
46
|
+
readonly naturalHouse: HouseNumber;
|
|
41
47
|
}
|
|
42
48
|
type BodyName = "Sun" | "Moon" | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | "North Node" | "South Node";
|
|
43
49
|
type HouseSystem = "whole" | "placidus" | "porphyry" | "equal" | "equal-mc" | "vehlow" | "koch" | "regiomontanus" | "campanus" | "topocentric" | "alcabitius" | "morinus" | "meridian";
|
|
@@ -47,7 +53,11 @@ type ChartFlag = "dst-gap" | "dst-fold" | "lmt" | "no-time" | "polar-fallback" |
|
|
|
47
53
|
* when starting from a local wall time and IANA timezone.
|
|
48
54
|
*/
|
|
49
55
|
interface BirthInput {
|
|
50
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* The instant, on the scale `timeScale` names: UTC by default, and UT1 or
|
|
58
|
+
* TT when `timeScale` says so. The field keeps its name on every scale,
|
|
59
|
+
* because receipts record it under that name (docs/time.md).
|
|
60
|
+
*/
|
|
51
61
|
utc: DateInput;
|
|
52
62
|
/** "utc" (default), "ut1" or "tt" (docs/time.md). */
|
|
53
63
|
timeScale?: TimeScaleName;
|
|
@@ -69,6 +79,7 @@ interface BirthInput {
|
|
|
69
79
|
deltaT?: number;
|
|
70
80
|
}
|
|
71
81
|
interface ChartInput {
|
|
82
|
+
/** The instant as given, on the scale `timeScale` names (UTC when it is absent), as BirthInput.utc. */
|
|
72
83
|
utc: Date;
|
|
73
84
|
/** Present when the instant is not UTC. */
|
|
74
85
|
timeScale?: Exclude<TimeScaleName, "utc">;
|
|
@@ -215,14 +226,15 @@ interface MoonPhase {
|
|
|
215
226
|
name: MoonPhaseName;
|
|
216
227
|
waxing: boolean;
|
|
217
228
|
}
|
|
218
|
-
|
|
229
|
+
/** This package's version, as package.json names it. A string: it changes with every release. */
|
|
230
|
+
declare const ENGINE_VERSION: string;
|
|
219
231
|
/**
|
|
220
232
|
* The ephemeris underneath every position. The dependency is pinned to this
|
|
221
233
|
* exact version, so receipts can name it without asking the caller.
|
|
222
234
|
*/
|
|
223
235
|
declare const EPHEMERIS: Readonly<{
|
|
224
|
-
|
|
225
|
-
|
|
236
|
+
name: "astronomy-engine";
|
|
237
|
+
version: string;
|
|
226
238
|
}>;
|
|
227
239
|
|
|
228
|
-
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 LeapSeconds as L, type MoonPhase as M, type PairSummary as P, type SynastryResult as S, type TimeScaleName as T, type Ut1MinusUtc as U, type ZodiacSign as Z, type Houses as a, type HouseNumber as b, type BodyPosition as c, type Chart as d, type
|
|
240
|
+
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 LeapSeconds as L, type MoonPhase as M, type PairSummary as P, type SynastryResult as S, type TimeScaleName as T, type Ut1MinusUtc as U, type ZodiacSign as Z, type Houses as a, type HouseNumber as b, type BodyPosition as c, type Chart as d, type TimeScale as e, type AspectType as f, type ChartFlag as g, type BirthInput as h, type ChartPoints as i, type TransitResult as j, type Sect as k, type MinimalBody as l, type Modality as m, type Aspect as n, DELTA_T_IERS_MODEL as o, ENGINE_VERSION as p, EPHEMERIS as q, type MoonPhaseName as r, type PointName as s, type PointPosition as t, type Polarity as u, type SignDefinition as v };
|