@zodiacs/engine 1.0.0 → 2.0.0-rc.2

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 (70) hide show
  1. package/CHANGELOG.md +1244 -0
  2. package/LICENSING.md +172 -27
  3. package/NOTICE +78 -12
  4. package/README.md +344 -59
  5. package/dist/{api-WbxJ4Wj-.d.ts → api-C_SVd9BJ.d.ts} +39 -3
  6. package/dist/{ayanamsa--YQ46fET.d.ts → ayanamsa-Clgkekhh.d.ts} +2 -1
  7. package/dist/calc.d.ts +91 -4
  8. package/dist/calc.js +368 -126
  9. package/dist/chunk-CV53HA7R.js +87 -0
  10. package/dist/chunk-EEW7746S.js +83 -0
  11. package/dist/{chunk-WS3TDSP3.js → chunk-FVGA776A.js} +7 -3
  12. package/dist/chunk-HNVGWN3S.js +852 -0
  13. package/dist/chunk-I3L4POY7.js +18 -0
  14. package/dist/{chunk-FTX3JDJA.js → chunk-IXFUYEUF.js} +65 -29
  15. package/dist/{chunk-7TRLIFFI.js → chunk-LWZS7HI3.js} +1 -1
  16. package/dist/{chunk-CHSYDKBL.js → chunk-N4UQLCBN.js} +3 -3
  17. package/dist/{chunk-YIITY7Q7.js → chunk-NX4PHQBL.js} +34 -22
  18. package/dist/chunk-OVXQQEXL.js +41 -0
  19. package/dist/{chunk-SRXBTP5H.js → chunk-PNXIA7MI.js} +217 -192
  20. package/dist/chunk-RMBWKZI2.js +130 -0
  21. package/dist/{chunk-DMGHYCDI.js → chunk-SCRO6HWB.js} +5 -3
  22. package/dist/{chunk-OG4OYTJJ.js → chunk-T6F4FYYS.js} +1 -129
  23. package/dist/chunk-UXY4RU57.js +48 -0
  24. package/dist/{chunk-PFGUCNOK.js → chunk-WONTOC5W.js} +7 -6
  25. package/dist/conventions.d.ts +70 -0
  26. package/dist/conventions.js +26 -0
  27. package/dist/crossings.d.ts +15 -4
  28. package/dist/de440-pack.d.ts +43 -0
  29. package/dist/de440-pack.js +16 -0
  30. package/dist/de440.d.ts +113 -0
  31. package/dist/de440.js +19 -0
  32. package/dist/ephemeris-D1lM832F.d.ts +64 -0
  33. package/dist/geo.d.ts +28 -7
  34. package/dist/geo.js +2 -2
  35. package/dist/houses-extra.d.ts +5 -4
  36. package/dist/{houses-CFERsAlK.d.ts → houses-icK01yXi.d.ts} +3 -3
  37. package/dist/index.d.ts +8 -6
  38. package/dist/index.js +40 -28
  39. package/dist/{internal-math-DJJ8BYex.d.ts → internal-math-BGX23p4h.d.ts} +2 -2
  40. package/dist/internal-math.d.ts +4 -3
  41. package/dist/internal-math.js +14 -12
  42. package/dist/internal.d.ts +16 -7
  43. package/dist/internal.js +25 -4
  44. package/dist/lite-composite.js +114 -0
  45. package/dist/lite-declinations.js +253 -0
  46. package/dist/lite-dignities.js +333 -0
  47. package/dist/lite-sect.js +72 -0
  48. package/dist/lite.d.ts +82 -0
  49. package/dist/lite.js +4 -0
  50. package/dist/receipt.d.ts +3 -2
  51. package/dist/receipt.js +156 -67
  52. package/dist/{rulers-Dla6h_Sm.d.ts → rulers-CpS9qkvu.d.ts} +1 -1
  53. package/dist/sky.d.ts +4 -3
  54. package/dist/sky.js +17 -10
  55. package/dist/techniques.d.ts +102 -6
  56. package/dist/techniques.js +131 -56
  57. package/dist/time-bands-CZA9AlLg.d.ts +36 -0
  58. package/dist/time-scale-DIFNa0gz.d.ts +47 -0
  59. package/dist/time.d.ts +81 -0
  60. package/dist/time.js +74 -0
  61. package/dist/timing.d.ts +6 -5
  62. package/dist/timing.js +24 -17
  63. package/dist/types-BCnyWBQZ.d.ts +352 -0
  64. package/dist/vedic.d.ts +112 -4
  65. package/dist/vedic.js +369 -14
  66. package/dist/window.d.ts +22 -2
  67. package/dist/window.js +86 -28
  68. package/dist/{zone-history-ghdyO0Sc.d.ts → zone-history-0XzMGx9V.d.ts} +32 -10
  69. package/package.json +24 -3
  70. package/dist/types-B-yb_tGL.d.ts +0 -240
@@ -41,15 +41,16 @@ function validateBirthSettings(birth) {
41
41
  ...latitude === void 0 ? {} : { latitude, longitude }
42
42
  };
43
43
  }
44
- var FLAGS = [
45
- "dst-gap",
46
- "dst-fold",
47
- "lmt",
44
+ var DERIVED_FLAGS = [
48
45
  "no-time",
49
46
  "polar-fallback",
50
- "outside-reference-span"
47
+ "polar-angles",
48
+ "outside-reference-span",
49
+ "delta-t-extrapolated",
50
+ "de440-unavailable",
51
+ "outside-de440-span"
51
52
  ];
52
- var DERIVED_FLAGS = ["no-time", "polar-fallback", "outside-reference-span"];
53
+ var FLAGS = ["dst-gap", "dst-fold", "lmt", "calendar-unknown", ...DERIVED_FLAGS];
53
54
  function snapshotFlags(value) {
54
55
  const length = Array.isArray(value) ? Object.getOwnPropertyDescriptor(value, "length")?.value : void 0;
55
56
  if (typeof length !== "number" || !Number.isInteger(length) || length < 0 || length > 64) {
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The ids a natal envelope names, by the rule of the conventions set that
3
+ * carries them (src/receipt.ts), and the id syntax they are written in. The
4
+ * receipt codec and `./conventions` share this module; it imports none.
5
+ */
6
+ /** The id of a namespace and a value, such as `zodiac:tropical`. Throws a RangeError for a malformed one. */
7
+ declare function conventionId(namespace: string, value: string): string;
8
+ /** The fields of a natal envelope (`./receipt`) that name conventions. */
9
+ interface NatalConventionFields {
10
+ receipt: {
11
+ conventions: Readonly<Record<string, string>>;
12
+ coverage: Readonly<Record<string, string>>;
13
+ houses: {
14
+ requested: string;
15
+ actual: string | null;
16
+ absenceReason: string | null;
17
+ };
18
+ inputFlags: readonly string[];
19
+ resultFlags: readonly string[];
20
+ reference: string;
21
+ timeScale?: string;
22
+ engine: {
23
+ ephemeris?: {
24
+ name: string;
25
+ version: string;
26
+ };
27
+ };
28
+ };
29
+ result: {
30
+ deltaT?: {
31
+ model: string;
32
+ segment: string;
33
+ };
34
+ timeScale?: {
35
+ input: string;
36
+ basis: string;
37
+ ut1MinusUtc: {
38
+ source: string;
39
+ } | null;
40
+ };
41
+ };
42
+ }
43
+ /**
44
+ * The ids a natal envelope names, in code-unit order, each once. From the
45
+ * receipt: each conventions and coverage field's key and value
46
+ * (`zodiac:tropical`), the requested and actual house systems
47
+ * (`house:placidus`), why there are no houses (`house-absence:unknown-time`),
48
+ * each flag (`flag:no-time`), the reference (`reference:supplied-instant`),
49
+ * the instant's scale (`time-scale:utc`) and the ephemeris
50
+ * (`ephemeris:astronomy-engine@2.1.19`). From the result: the ΔT model and
51
+ * segment (`deltat-model:iers-utc/1`), the time basis (`time-basis:iers`) and
52
+ * the source of UT1 − UTC (`ut1-source:observed`). Receipts of the
53
+ * conventions set from 1.1.0-rc.1 carry them as `conventionIds`. This is that
54
+ * set's rule; another rule would come with another set.
55
+ */
56
+ declare function natalConventionIds(envelope: NatalConventionFields): string[];
57
+
58
+ /** The registry's page. An id's address is this URL with the id, through encodeURI, as its fragment. */
59
+ declare const CONVENTIONS_REGISTRY: string;
60
+ /** An id split at its first colon: the parts of the string `conventionId` returns. */
61
+ interface ConventionIdParts {
62
+ namespace: string;
63
+ value: string;
64
+ }
65
+ /** An id's namespace and value. Throws a RangeError for a malformed id. */
66
+ declare function parseConventionId(id: string): ConventionIdParts;
67
+ /** An id's address: `CONVENTIONS_REGISTRY`, `#` and the id through encodeURI. Throws a RangeError for a malformed id. */
68
+ declare function conventionAddress(id: string): string;
69
+
70
+ export { CONVENTIONS_REGISTRY, type ConventionIdParts, type NatalConventionFields, conventionAddress, conventionId, natalConventionIds, parseConventionId };
@@ -0,0 +1,26 @@
1
+ import {
2
+ conventionId,
3
+ natalConventionIds
4
+ } from "./chunk-OVXQQEXL.js";
5
+
6
+ // src/conventions.ts
7
+ var CONVENTIONS_REGISTRY = "https://zodiacs.org/developers/conventions/";
8
+ function parseConventionId(id) {
9
+ const colon = typeof id === "string" ? id.indexOf(":") : -1;
10
+ if (colon < 0) throw new RangeError("A convention id is a namespace, a colon and a value.");
11
+ const namespace = id.slice(0, colon);
12
+ const value = id.slice(colon + 1);
13
+ conventionId(namespace, value);
14
+ return { namespace, value };
15
+ }
16
+ function conventionAddress(id) {
17
+ parseConventionId(id);
18
+ return `${CONVENTIONS_REGISTRY}#${encodeURI(id)}`;
19
+ }
20
+ export {
21
+ CONVENTIONS_REGISTRY,
22
+ conventionAddress,
23
+ conventionId,
24
+ natalConventionIds,
25
+ parseConventionId
26
+ };
@@ -1,5 +1,6 @@
1
- import { B as BodyName } from './types-B-yb_tGL.js';
1
+ import { B as BodyName } from './types-BCnyWBQZ.js';
2
2
  import './deltat.js';
3
+ import './time-scale-DIFNa0gz.js';
3
4
 
4
5
  /**
5
6
  * The instants a body sits exactly on an ecliptic longitude.
@@ -39,6 +40,14 @@ type CrossingSearchResult = {
39
40
  crossings: LongitudeCrossing[];
40
41
  /** Longitude evaluations made. */
41
42
  samples: number;
43
+ /**
44
+ * Set by the root entry's `searchLongitudeCrossings`, on the engine's
45
+ * own ephemeris: `"de440-unavailable"` or `"outside-de440-span"` where
46
+ * a longitude of the search was astronomy-engine's as a fallback from
47
+ * the shipped DE440 pack, or empty. Absent from a search on a caller's
48
+ * longitudes.
49
+ */
50
+ flags?: ("de440-unavailable" | "outside-de440-span")[];
42
51
  } | {
43
52
  status: "refused";
44
53
  reason: "sample-budget";
@@ -62,9 +71,11 @@ type CrossingSearchResult = {
62
71
  * the direction of the sample before it. Offsets of 90° or more are read as
63
72
  * the far side of the circle, not a crossing.
64
73
  *
65
- * A plain scan loses both crossings when a station falls between two samples
66
- * just past the target: at a 5-day step, a Saturn station within 0.0103° of
67
- * it, or a Jupiter station within 0.0205°. Where the sampled motion turns
74
+ * A plain scan can lose both crossings when a station takes the body less
75
+ * than |f″|h²/8 past the target (f″ the second derivative of its longitude at
76
+ * the station, h the step), since both can then fall between two samples: at
77
+ * a 5-day step, up to 0.0056° for Saturn and 0.011° for Jupiter at their
78
+ * stations from 2019 to 2024. Where the sampled motion turns
68
79
  * without the offset changing sign, and the turning sample is within reach of
69
80
  * the local curvature, a golden-section search finds the extremum. Both
70
81
  * crossings are bisected when it passes the target, and one is reported, as
@@ -0,0 +1,43 @@
1
+ import { De440Source } from './de440.js';
2
+ import './types-BCnyWBQZ.js';
3
+ import './deltat.js';
4
+ import './time-scale-DIFNa0gz.js';
5
+
6
+ /** The pack this entry ships, and the kernel it was refitted from. */
7
+ interface De440PackDescription {
8
+ /** The sealed pack's file name where it was compiled. */
9
+ readonly file: string;
10
+ /** The SHA-256 of the sealed pack, lower-case hexadecimal: a source's `ephemeris.version`. */
11
+ readonly sha256: string;
12
+ /** The sealed pack's size in bytes. */
13
+ readonly bytes: number;
14
+ /** The first and last calendar years the pack was compiled for; a source refuses an instant outside its coverage. */
15
+ readonly fromYear: number;
16
+ readonly toYear: number;
17
+ /** NAIF's kernel the series were refitted from. */
18
+ readonly kernel: {
19
+ readonly file: string;
20
+ readonly sha256: string;
21
+ };
22
+ }
23
+ /** `de440-1790-2210.v2.zeph`, refitted from NAIF's `de440.bsp`. */
24
+ declare const DE440_PACK: De440PackDescription;
25
+ /** The shipped pack's bytes, a new array at each call. They are not checked here; `openShippedDe440Pack` checks them. */
26
+ declare function de440PackBytes(): Uint8Array;
27
+ /**
28
+ * A DE440 source on the shipped pack, opened without a promise: the first
29
+ * call decodes the pack and opens it with `openDe440PackSync`, expecting
30
+ * `DE440_PACK.sha256`; later calls give the same source, which holds no
31
+ * state that a caller can change. If the pack cannot be opened (its bytes
32
+ * are not the sealed pack's, or the runtime has no `atob`), the first call
33
+ * throws, and every later call throws the same error without trying again.
34
+ * The root entry's default source is this one.
35
+ */
36
+ declare function shippedDe440Source(): De440Source;
37
+ /**
38
+ * The same source as `shippedDe440Source`, as a promise, as 1.1.0-rc.8's
39
+ * draft gave it: it rejects where that function throws.
40
+ */
41
+ declare function openShippedDe440Pack(): Promise<De440Source>;
42
+
43
+ export { DE440_PACK, type De440PackDescription, de440PackBytes, openShippedDe440Pack, shippedDe440Source };
@@ -0,0 +1,16 @@
1
+ import {
2
+ DE440_PACK,
3
+ de440PackBytes,
4
+ openShippedDe440Pack,
5
+ shippedDe440Source
6
+ } from "./chunk-UXY4RU57.js";
7
+ import "./chunk-HNVGWN3S.js";
8
+ import "./chunk-CV53HA7R.js";
9
+ import "./chunk-SCRO6HWB.js";
10
+ import "./chunk-RMBWKZI2.js";
11
+ export {
12
+ DE440_PACK,
13
+ de440PackBytes,
14
+ openShippedDe440Pack,
15
+ shippedDe440Source
16
+ };
@@ -0,0 +1,113 @@
1
+ import { P as PositionSource } from './types-BCnyWBQZ.js';
2
+ import './deltat.js';
3
+ import './time-scale-DIFNa0gz.js';
4
+
5
+ /**
6
+ * A sealed ephemeris pack (`ZODEPH02`): the header, checked before anything
7
+ * is read through it, and the Chebyshev records it describes. The format,
8
+ * its checks and the evaluator are the research runtime's
9
+ * (examples/precision-alpha/src/core/container.mjs and ephemeris.mjs in the
10
+ * site repository), operation for operation, so a position read here equals
11
+ * the runtime's bit for bit. Positions are kilometres and velocities
12
+ * kilometres per second, in the ICRF, at TDB seconds past J2000.
13
+ *
14
+ * Environment-neutral: no file or network access. The caller hands over the
15
+ * bytes; they are copied, so nothing the caller does afterwards can change
16
+ * what was checked.
17
+ */
18
+ /** Every way a pack or a request on it can be refused. */
19
+ type De440ErrorCode = "not-a-pack" | "unsupported-version" | "too-large" | "truncated" | "bad-header" | "bad-geometry" | "digest-mismatch" | "unknown-body" | "out-of-coverage" | "bad-instant" | "bad-geometry-of-sky";
20
+ /** A refusal with a code a caller can branch on. Messages carry no file paths. */
21
+ declare class De440Error extends Error {
22
+ readonly code: De440ErrorCode;
23
+ constructor(code: De440ErrorCode, message: string);
24
+ }
25
+
26
+ /** The bodies this reduction places. */
27
+ declare const REDUCED_BODIES: readonly ["Sun", "Moon", "Mercury", "Venus", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"];
28
+ type ReducedBody = (typeof REDUCED_BODIES)[number];
29
+ /** Bodies the kernel stores as a planetary-system barycentre, not a centre. */
30
+ declare const BARYCENTRE_NOT_CENTRE: readonly ["Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"];
31
+
32
+ /**
33
+ * `@zodiacs/engine/de440`: positions from JPL's DE440, through a sealed pack
34
+ * of Chebyshev series refitted from it, for the engine to compute charts,
35
+ * positions and events with (`withEphemeris` in the root entry).
36
+ *
37
+ * This entry fetches nothing: the caller gives the bytes (of a pack compiled
38
+ * from its own copy of NAIF's `de440.bsp`, or of the one the package ships,
39
+ * which the root entry and `@zodiacs/engine/de440/pack` open themselves) and
40
+ * names the SHA-256 it expects. `openDe440Pack` hashes the whole file and
41
+ * refuses any other bytes, then checks the pack's own trailer and header.
42
+ * The returned source keeps a private copy of the bytes.
43
+ *
44
+ * The reduction is the research runtime's with its shipped options
45
+ * (`src/de440/reduce.ts` says what it applies). Mars to Pluto are
46
+ * planetary-system barycentres, not planet centres. Nothing in this entry's
47
+ * graph imports astronomy-engine. From 1.1.0-rc.9 the root entry imports
48
+ * this file, to open the shipped pack as its default source.
49
+ */
50
+
51
+ /** The ephemeris a receipt names when a chart or position came from a DE440 pack. */
52
+ declare const DE440_EPHEMERIS_NAME: "jpl-de440";
53
+ /** What a DE440 source says about itself. */
54
+ interface De440Source extends PositionSource {
55
+ /** `version` is the SHA-256 of the sealed pack the positions came from. */
56
+ readonly ephemeris: {
57
+ readonly name: typeof DE440_EPHEMERIS_NAME;
58
+ readonly version: string;
59
+ };
60
+ /**
61
+ * The light-path distance too, au, and from 1.1.0-rc.12 whether the body is
62
+ * behind the Sun's disc, where the reduction bends no light. `behind`, when
63
+ * given, is taken as that decision instead of making it at `ttDays`, as a
64
+ * speed's samples take the decision of their middle instant.
65
+ */
66
+ place(body: ReducedBody, ttDays: number, behind?: boolean): {
67
+ lon: number;
68
+ lat: number;
69
+ dist: number;
70
+ behindDisc: boolean;
71
+ };
72
+ /**
73
+ * The instants in [fromTtDays, toTtDays] (TT days past J2000.0), ascending,
74
+ * at which a place or the true node may step by more than rounding: where
75
+ * a read passes from one Chebyshev record of the pack to the next (within
76
+ * the pack's fitting budget, src/de440/reduce.ts). Between two neighbours
77
+ * every place is a smooth function of time. The birth-time window search
78
+ * treats each as a seam.
79
+ */
80
+ steps(fromTtDays: number, toTtDays: number): number[];
81
+ readonly pack: {
82
+ readonly sha256: string;
83
+ readonly bytes: number;
84
+ /** TDB seconds past J2000, the pack's coverage. */
85
+ readonly startEtSecTdb: number;
86
+ readonly stopEtSecTdb: number;
87
+ /** The compiler that made the pack, as its header names it, or null. */
88
+ readonly compiler: {
89
+ readonly name: string;
90
+ readonly version: string;
91
+ } | null;
92
+ };
93
+ }
94
+ interface De440OpenOptions {
95
+ /** The SHA-256 of the whole sealed pack file, lower-case hexadecimal, obtained from somewhere other than the pack. */
96
+ readonly expectDigest: string;
97
+ }
98
+ /**
99
+ * Open a sealed DE440 pack (`ZODEPH02`) held in memory. Rejects with a
100
+ * `De440Error` whose code says why: `digest-mismatch` when the file's SHA-256
101
+ * is not `expectDigest` or the pack's trailer does not match its contents,
102
+ * and the header codes of `src/de440/pack.ts` otherwise.
103
+ */
104
+ declare function openDe440Pack(bytes: Uint8Array, options: De440OpenOptions): Promise<De440Source>;
105
+ /**
106
+ * `openDe440Pack` without WebCrypto and without a promise: the same checks,
107
+ * with the engine's own SHA-256 (`src/de440/sha256.ts`), for code that
108
+ * cannot wait. It throws what `openDe440Pack` rejects with. The root entry
109
+ * opens the shipped pack with it.
110
+ */
111
+ declare function openDe440PackSync(bytes: Uint8Array, options: De440OpenOptions): De440Source;
112
+
113
+ export { BARYCENTRE_NOT_CENTRE, DE440_EPHEMERIS_NAME, De440Error, type De440ErrorCode, type De440OpenOptions, type De440Source, REDUCED_BODIES, type ReducedBody, openDe440Pack, openDe440PackSync };
package/dist/de440.js ADDED
@@ -0,0 +1,19 @@
1
+ import {
2
+ BARYCENTRE_NOT_CENTRE,
3
+ DE440_EPHEMERIS_NAME,
4
+ De440Error,
5
+ REDUCED_BODIES,
6
+ openDe440Pack,
7
+ openDe440PackSync
8
+ } from "./chunk-HNVGWN3S.js";
9
+ import "./chunk-CV53HA7R.js";
10
+ import "./chunk-SCRO6HWB.js";
11
+ import "./chunk-RMBWKZI2.js";
12
+ export {
13
+ BARYCENTRE_NOT_CENTRE,
14
+ DE440_EPHEMERIS_NAME,
15
+ De440Error,
16
+ REDUCED_BODIES,
17
+ openDe440Pack,
18
+ openDe440PackSync
19
+ };
@@ -0,0 +1,64 @@
1
+ import { P as PositionSource, B as BodyName, c as BodyPosition, C as ChartInput, d as Chart } from './types-BCnyWBQZ.js';
2
+
3
+ /** What a call outside `withEphemeris` computes on. */
4
+ type DefaultEphemerisName = "de440" | "astronomy-engine";
5
+ /** What `defaultEphemeris` reports. */
6
+ interface DefaultEphemeris {
7
+ /**
8
+ * `"de440"`: a call outside `withEphemeris` computes on the shipped DE440
9
+ * pack where `de440` says it can, and on astronomy-engine elsewhere.
10
+ * `"astronomy-engine"`: it computes on astronomy-engine always.
11
+ */
12
+ readonly name: DefaultEphemerisName;
13
+ /** The shipped pack as the default source. */
14
+ readonly de440: {
15
+ /** Whether the pack opened. When false, every default call is astronomy-engine's. */
16
+ readonly opened: boolean;
17
+ /** The pack's SHA-256, a chart's `ephemeris.version`, or null when it did not open. */
18
+ readonly version: string | null;
19
+ /**
20
+ * Days of TT from J2000.0 between which the default is the pack, the
21
+ * ends included: a day inside each end of the pack's coverage. Null when
22
+ * it did not open.
23
+ */
24
+ readonly fromTtDays: number | null;
25
+ readonly toTtDays: number | null;
26
+ /** Why the pack did not open, or null. */
27
+ readonly error: string | null;
28
+ };
29
+ }
30
+ /**
31
+ * What a call outside `withEphemeris` computes on. The first call opens the
32
+ * shipped pack if nothing has yet (which hashes its 2,489,664 bytes twice).
33
+ * A chart says which ephemeris it came from: `chart.ephemeris` names the
34
+ * pack, and is absent on a chart from astronomy-engine.
35
+ */
36
+ declare function defaultEphemeris(): DefaultEphemeris;
37
+ /**
38
+ * Choose what a call outside `withEphemeris` computes on, from now on:
39
+ * `"de440"` (the package's default) or `"astronomy-engine"`, which gives the
40
+ * positions 1.1.0-rc.7 and earlier gave at every instant. It is one setting
41
+ * for the whole module, so set it once, before computing; `withEphemeris`
42
+ * still overrides it for the calls inside.
43
+ */
44
+ declare function setDefaultEphemeris(name: DefaultEphemerisName): void;
45
+ /**
46
+ * Run `run` with every body position the engine computes taken from
47
+ * `positionSource` (for example `@zodiacs/engine/de440`'s), in place of the
48
+ * default source, then restore the one before, whatever happens. Charts computed inside name it
49
+ * (`chart.ephemeris`), and so do their receipts. `run` must be synchronous:
50
+ * a function that returns a promise would leave its later steps on another
51
+ * source, so that throws TypeError (after `run` has returned). Calls nest.
52
+ */
53
+ declare function withEphemeris<T>(positionSource: PositionSource, run: () => T): T;
54
+ /** Apparent longitude at a UTC instant, on the engine's time basis. */
55
+ declare function bodyLongitude(body: BodyName, date: Date): number;
56
+ declare function longitudeSpeed(body: BodyName, date: Date): number;
57
+ /**
58
+ * The positions at a UTC instant, as a chart's bodies; from 2.0.0, each row carries the flags
59
+ * a chart at that instant would (`instantFlags`), where there are any.
60
+ */
61
+ declare function computeBodies(date: Date): BodyPosition[];
62
+ declare function computeChart(input: ChartInput): Chart;
63
+
64
+ export { type DefaultEphemeris as D, computeChart as a, bodyLongitude as b, computeBodies as c, type DefaultEphemerisName as d, defaultEphemeris as e, longitudeSpeed as l, setDefaultEphemeris as s, withEphemeris as w };
package/dist/geo.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { H as HouseSystem, h as BirthInput } from './types-B-yb_tGL.js';
2
- import { T as TransitionCause, N as NatalLocalResolution } from './zone-history-ghdyO0Sc.js';
1
+ import { H as HouseSystem, h as BirthInput } from './types-BCnyWBQZ.js';
2
+ import { T as TransitionCause, N as NatalLocalResolution } from './zone-history-0XzMGx9V.js';
3
3
  import './deltat.js';
4
+ import './time-scale-DIFNa0gz.js';
4
5
 
5
6
  interface City {
6
7
  name: string;
@@ -96,9 +97,21 @@ interface LocalTimeOptions {
96
97
  longitude?: number | undefined;
97
98
  /** The calendar `date` is written in; "gregorian" by default. */
98
99
  calendar?: CalendarName | undefined;
99
- /** ISO 3166-1 alpha-2 code, or the country's name in tzdata's iso3166.tab, for `calendarNote`. */
100
+ /**
101
+ * ISO 3166-1 alpha-2 code, or the country's name in tzdata's iso3166.tab, for `calendarNote`. Without a country
102
+ * the table dates, a date that one of the adoption table's changeovers skipped, and the zone does not rule out,
103
+ * is flagged "calendar-unknown" (docs/time.md).
104
+ */
100
105
  country?: string | undefined;
106
+ /**
107
+ * Which instant a wall time the clock showed twice takes: "earlier" (the
108
+ * default), its first pass, or "later", its second. It changes nothing for
109
+ * any other wall time; a skipped one moves forward either way.
110
+ */
111
+ fold?: FoldChoice | undefined;
101
112
  }
113
+ /** The pass of a repeated wall time to take: the first ("earlier") or the second ("later"). */
114
+ type FoldChoice = "earlier" | "later";
102
115
  /** A change of the clock that read the wall time. */
103
116
  interface ZoneTransition {
104
117
  /** UTC, ISO 8601. */
@@ -112,8 +125,13 @@ interface LocalTimeResolution {
112
125
  utc: Date;
113
126
  /** Minutes east at the resolved instant; may be fractional. */
114
127
  offsetMinutes: number;
115
- /** A gap or fold of any cause ("dst-" names kept for compatibility; see `jump`), and a local mean time clock. */
116
- flags: ("dst-gap" | "dst-fold" | "lmt")[];
128
+ /**
129
+ * A gap or fold of any cause ("dst-" names kept for compatibility; see `jump`), a local mean time clock, and
130
+ * "calendar-unknown": no `country` the table dates, and a date that one of the adoption table's changeovers
131
+ * skipped and the zone does not rule out, so whether it was in civil use where it was written is not known
132
+ * (docs/time.md).
133
+ */
134
+ flags: ("dst-gap" | "dst-fold" | "lmt" | "calendar-unknown")[];
117
135
  /** The proleptic Gregorian date resolved. */
118
136
  date: string;
119
137
  writtenDate: string;
@@ -155,6 +173,8 @@ interface LocalBirthInput {
155
173
  timeKnown?: boolean;
156
174
  calendar?: CalendarName;
157
175
  country?: string;
176
+ /** Which pass of a repeated wall time the birth was in; "earlier" by default (as `LocalTimeOptions`). */
177
+ fold?: FoldChoice;
158
178
  }
159
179
  /**
160
180
  * UTC offset for an IANA timezone at a UTC instant, minutes east, from the
@@ -166,7 +186,8 @@ interface LocalBirthInput {
166
186
  declare function offsetAt(timeZone: string, utcMilliseconds: number): number;
167
187
  /**
168
188
  * Resolve a local wall time in an IANA zone to UTC: a repeated one takes the
169
- * earlier instant, a skipped one moves forward by the jump. Before 1970 the
189
+ * earlier instant, or the later one with `options.fold` "later"; a skipped
190
+ * one moves forward by the jump. Before 1970 the
170
191
  * shipped tzdb 2025c history answers, loaded by `prepareLocalTime` (a wall
171
192
  * time before 1970-01-02 throws otherwise); from 1970, and in the fixed Etc
172
193
  * zones, the host's Intl.
@@ -205,4 +226,4 @@ declare function resolveLocalBirth(input: LocalBirthInput): LocalBirthResolution
205
226
  /** Convert a local birth form into the explicit UTC input accepted by the core. */
206
227
  declare function resolveBirth(input: LocalBirthInput): BirthInput;
207
228
 
208
- export { type CalendarName, type CalendarNote, type City, GREGORIAN_ADOPTION, GREGORIAN_ADOPTION_SOURCES, type GeoNamesClient, type GeoNamesClientOptions, type GeoNamesIndexMetadata, type GregorianAdoption, type GregorianAdoptionSource, type LocalBirthInput, type LocalBirthResolution, type LocalTimeOptions, type LocalTimeResolution, TZDB, TransitionCause, ZoneHistoryNotLoadedError, type ZoneTransition, calendarNote, createGeoNamesClient, gregorianAdoption, gregorianToJulian, julianToGregorian, offsetAt, prepareLocalTime, resolveBirth, resolveLocalBirth, resolveLocalToUtc, zoneOffsetAt };
229
+ export { type CalendarName, type CalendarNote, type City, type FoldChoice, GREGORIAN_ADOPTION, GREGORIAN_ADOPTION_SOURCES, type GeoNamesClient, type GeoNamesClientOptions, type GeoNamesIndexMetadata, type GregorianAdoption, type GregorianAdoptionSource, type LocalBirthInput, type LocalBirthResolution, type LocalTimeOptions, type LocalTimeResolution, TZDB, TransitionCause, ZoneHistoryNotLoadedError, type ZoneTransition, calendarNote, createGeoNamesClient, gregorianAdoption, gregorianToJulian, julianToGregorian, offsetAt, prepareLocalTime, resolveBirth, resolveLocalBirth, resolveLocalToUtc, zoneOffsetAt };
package/dist/geo.js CHANGED
@@ -11,12 +11,12 @@ import {
11
11
  resolveLocalBirth,
12
12
  resolveLocalToUtc,
13
13
  zoneOffsetAt
14
- } from "./chunk-YIITY7Q7.js";
14
+ } from "./chunk-NX4PHQBL.js";
15
15
  import {
16
16
  gregorianToJulian,
17
17
  julianToGregorian
18
18
  } from "./chunk-KFTJMMG7.js";
19
- import "./chunk-PFGUCNOK.js";
19
+ import "./chunk-WONTOC5W.js";
20
20
 
21
21
  // src/geo/geonames.ts
22
22
  var fold = (value) => value.normalize("NFD").replace(/[\u0300-\u036f]/gu, "").toLowerCase();
@@ -1,6 +1,7 @@
1
- import { A as AngleInput } from './houses-CFERsAlK.js';
2
- import { H as HouseSystem, A as Angles } from './types-B-yb_tGL.js';
1
+ import { A as AngleInput } from './houses-icK01yXi.js';
2
+ import { H as HouseSystem, A as Angles } from './types-BCnyWBQZ.js';
3
3
  import './deltat.js';
4
+ import './time-scale-DIFNa0gz.js';
4
5
 
5
6
  /**
6
7
  * `@zodiacs/engine/houses`: the house position of a body with ecliptic
@@ -72,8 +73,8 @@ declare function housePosition(system: HouseSystem, input: AngleInput, body: Ecl
72
73
  * Munkasey's polar ascendant (Swiss Ephemeris's `ascmc[4]` to `ascmc[7]`).
73
74
  * Each is the ecliptic point of an oblique ascension under a pole, taken as
74
75
  * the formula gives it: inside the polar circle (and, for Munkasey's
75
- * co-ascendant, within 90° − ε of the equator) it can lie west of the
76
- * meridian, and it is not turned east as the ascendant is.
76
+ * co-ascendant, within ε of the equator) it can lie west of the meridian,
77
+ * and it is not turned east as the ascendant is.
77
78
  */
78
79
  declare function coAscendants(input: AngleInput): CoAscendants;
79
80
  /**
@@ -1,4 +1,4 @@
1
- import { A as Angles, H as HouseSystem, a as Houses, b as HouseNumber } from './types-B-yb_tGL.js';
1
+ import { A as Angles, H as HouseSystem, a as Houses, b as HouseNumber } from './types-BCnyWBQZ.js';
2
2
 
3
3
  declare const HOUSE_SYSTEMS: readonly ["whole", "placidus", "porphyry", "equal", "equal-mc", "vehlow", "koch", "regiomontanus", "campanus", "topocentric", "alcabitius", "morinus", "meridian"];
4
4
  /**
@@ -51,8 +51,8 @@ declare function wholeSignCusps(ascendant: number): number[];
51
51
  * circle, so the map is a contraction with slope at most 2q/3. The iteration
52
52
  * settles to 1e-9° within 64 steps except within about 1e-8° of the polar
53
53
  * limit, near the sidereal times at which a cusp's right ascension reaches 90°
54
- * or 270°: it needs up to 63 steps there, and the rounding of asin near ±1
55
- * moves each step by about the tolerance. Where it does not settle, the cusp
54
+ * or 270°, where the rounding of asin near ±1 can keep it from settling.
55
+ * Where it does not settle, the cusp
56
56
  * is found by bisection on RAMC + offset ± (90° m + 1°), across which
57
57
  * α − RAMC − offset − m·AD(α) increases strictly, so below the limit Placidus
58
58
  * never falls back. Near the limit, either way, a cusp carries the rounding of
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
- export { C as ChartDeclinations, D as DECLINATION_ORB, a as DECLINATION_ORB_LUMINARY, b as DEFAULT_DECLINATION_ORB_POLICY, c as DeclinationAspect, d as DeclinationAspectType, e as DeclinationBody, f as DeclinationOrbPolicy, g as DeclinationRow, h as Declinations, E as EquatorialCoordinates, N as NatalSource, R as RA_POLE_TOLERANCE, i as ReturnSeason, S as SUN_BOUND_LATITUDE, j as SaturnReturnResult, k as SaturnReturnSource, l as chartDeclinations, m as chartPoints, n as declinationOf, o as declinationOrb, p as declinationsForBodies, q as eclipticToEquatorial, r as findDeclinationAspects, s as findLongitudeCrossings, t as groupIntoSeasons, u as moonPhase, v as natalChart, w as positions, x as saturnReturn, y as searchLongitudeCrossings, z as synastry, A as transits } from './api-WbxJ4Wj-.js';
2
- import { D as DateInput, c as BodyPosition, k as Sect, l as MinimalBody, E as Element, I as InterAspect, m as Modality, P as PairSummary } from './types-B-yb_tGL.js';
3
- export { A as Angles, n as Aspect, f as AspectType, h as BirthInput, B as BodyName, d as Chart, g as ChartFlag, C as ChartInput, i as ChartPoints, o as DELTA_T_IERS_MODEL, p as ENGINE_VERSION, q as EPHEMERIS, b as HouseNumber, H as HouseSystem, a as Houses, L as LeapSeconds, M as MoonPhase, r as MoonPhaseName, s as PointName, t as PointPosition, u as Polarity, v as SignDefinition, S as SynastryResult, e as TimeScale, T as TimeScaleName, j as TransitResult, U as Ut1MinusUtc, Z as ZodiacSign } from './types-B-yb_tGL.js';
4
- import { A as AspectMotion } from './internal-math-DJJ8BYex.js';
5
- export { a as ASPECTS, b as ASPECT_BODIES, c as ASPECT_TYPES, d as AspectDefinition, E as ELEMENTS, M as MODALITIES, S as SIGNS, e as SIGN_NAMES, f as SIGN_SLUGS, g as STATIONARY_RELATIVE_SPEED, h as aspectMotion, i as degreeInSign, j as findAspects, m as matchAspect, n as normalizeLongitude, s as separation, k as signForLongitude, l as signIndexForLongitude } from './internal-math-DJJ8BYex.js';
6
- 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-CFERsAlK.js';
1
+ export { C as ChartDeclinations, D as DECLINATION_ORB, a as DECLINATION_ORB_LUMINARY, b as DEFAULT_DECLINATION_ORB_POLICY, c as DeclinationAspect, d as DeclinationAspectType, e as DeclinationBody, f as DeclinationOrbPolicy, g as DeclinationRow, h as Declinations, E as EquatorialCoordinates, N as NatalSource, R as RA_POLE_TOLERANCE, i as ReturnSeason, S as SUN_BOUND_LATITUDE, j as SaturnReturnResult, k as SaturnReturnSource, l as chartDeclinations, m as chartPoints, n as declinationOf, o as declinationOrb, p as declinationsForBodies, q as eclipticToEquatorial, r as findDeclinationAspects, s as findLongitudeCrossings, t as groupIntoSeasons, u as moonPhase, v as natalChart, w as positions, x as saturnReturn, y as searchLongitudeCrossings, z as synastry, A as transits } from './api-C_SVd9BJ.js';
2
+ export { D as DefaultEphemeris, d as DefaultEphemerisName, e as defaultEphemeris, s as setDefaultEphemeris, w as withEphemeris } from './ephemeris-D1lM832F.js';
3
+ import { e as DateInput, c as BodyPosition, j as Sect, k as MinimalBody, l as Element, I as InterAspect, m as Modality, n as PairSummary } from './types-BCnyWBQZ.js';
4
+ export { A as Angles, o as Aspect, f as AspectType, h as BirthInput, B as BodyName, d as Chart, g as ChartFlag, C as ChartInput, i as ChartPoints, p as ENGINE_VERSION, q as EPHEMERIS, E as EphemerisFallback, b as HouseNumber, H as HouseSystem, a as Houses, r as InstantFlag, M as MoonPhase, s as MoonPhaseName, t as PointName, u as PointPosition, v as Polarity, P as PositionSource, w as SignDefinition, x as SourceBody, S as SynastryResult, T as TransitResult, Z as ZodiacSign } from './types-BCnyWBQZ.js';
5
+ import { A as AspectMotion } from './internal-math-BGX23p4h.js';
6
+ export { a as ASPECTS, b as ASPECT_BODIES, c as ASPECT_TYPES, d as AspectDefinition, E as ELEMENTS, M as MODALITIES, S as SIGNS, e as SIGN_NAMES, f as SIGN_SLUGS, g as STATIONARY_RELATIVE_SPEED, h as aspectMotion, i as degreeInSign, j as findAspects, m as matchAspect, n as normalizeLongitude, s as separation, k as signForLongitude, l as signIndexForLongitude } from './internal-math-BGX23p4h.js';
7
+ 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-icK01yXi.js';
7
8
  export { DELTA_T_MODEL, DELTA_T_TABLE, DeltaT, DeltaTSegment, DeltaTTable, deltaT, deltaTAt } from './deltat.js';
9
+ export { D as DELTA_T_IERS_MODEL, L as LeapSeconds, T as TimeScale, a as TimeScaleName, U as Ut1MinusUtc } from './time-scale-DIFNa0gz.js';
8
10
  export { E as EPHEMERIS_SPAN, R as REFERENCE_SPAN, o as outsideReferenceSpan } from './reference-span-CILpclrz.js';
9
11
  export { BodyLongitudeAt, CrossingSearchOptions, CrossingSearchResult, LongitudeCrossing, findLongitudeCrossingsWith, searchLongitudeCrossingsWith } from './crossings.js';
10
12