@zodiacs/engine 0.1.1-rc.16 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +1478 -0
  2. package/LICENSING.md +184 -30
  3. package/NOTICE +81 -14
  4. package/README.md +345 -67
  5. package/dist/{api-VOW6Umy5.d.ts → api-ChL1N2Sr.d.ts} +44 -7
  6. package/dist/ayanamsa-ClFzkKmV.d.ts +135 -0
  7. package/dist/calc.d.ts +218 -21
  8. package/dist/calc.js +580 -160
  9. package/dist/chunk-2PZYJQV5.js +83 -0
  10. package/dist/chunk-47ERTK5X.js +27 -0
  11. package/dist/{chunk-O3NJRGJ2.js → chunk-4XOYTBLS.js} +1 -1
  12. package/dist/chunk-767FTO7O.js +48 -0
  13. package/dist/{chunk-N4B5JNMA.js → chunk-7Y2F2IWN.js} +40 -28
  14. package/dist/chunk-B4M2Y7FT.js +96 -0
  15. package/dist/{chunk-KHBLFXFG.js → chunk-B5LKF437.js} +29 -28
  16. package/dist/{chunk-ONBZ4HK7.js → chunk-BHJXUY67.js} +4 -2
  17. package/dist/{chunk-PFGUCNOK.js → chunk-BMDASNPB.js} +6 -6
  18. package/dist/chunk-I3L4POY7.js +18 -0
  19. package/dist/{chunk-I7O5EGFV.js → chunk-LNGURVNH.js} +3 -3
  20. package/dist/{chunk-4NV4ZEFZ.js → chunk-NNOSOOWS.js} +4 -4
  21. package/dist/chunk-OVXQQEXL.js +41 -0
  22. package/dist/{chunk-WOU7JVD3.js → chunk-QLIEEICB.js} +205 -194
  23. package/dist/chunk-RMBWKZI2.js +130 -0
  24. package/dist/{chunk-AECKV73C.js → chunk-TSS2SZWQ.js} +8 -2
  25. package/dist/{chunk-L6ZHWJZ6.js → chunk-TZVPZHZM.js} +51 -29
  26. package/dist/chunk-WBTWY2OB.js +478 -0
  27. package/dist/chunk-Y4E3WJU5.js +87 -0
  28. package/dist/chunk-YPU3MDNI.js +852 -0
  29. package/dist/conventions.d.ts +70 -0
  30. package/dist/conventions.js +26 -0
  31. package/dist/crossings.d.ts +22 -10
  32. package/dist/crossings.js +1 -1
  33. package/dist/de440-pack.d.ts +43 -0
  34. package/dist/de440-pack.js +16 -0
  35. package/dist/de440.d.ts +113 -0
  36. package/dist/de440.js +19 -0
  37. package/dist/deltat.d.ts +28 -3
  38. package/dist/deltat.js +1 -1
  39. package/dist/ephemeris-exTSqBgb.d.ts +60 -0
  40. package/dist/geo.d.ts +46 -13
  41. package/dist/geo.js +4 -2
  42. package/dist/{houses-q1O2GGp4.d.ts → houses-Bh7GCnPi.d.ts} +14 -4
  43. package/dist/houses-extra.d.ts +22 -7
  44. package/dist/houses-extra.js +4 -2
  45. package/dist/index.d.ts +36 -49
  46. package/dist/index.js +54 -34
  47. package/dist/{internal-math-CmJ9xtaW.d.ts → internal-math-CxenuGfm.d.ts} +41 -27
  48. package/dist/internal-math.d.ts +4 -3
  49. package/dist/internal-math.js +14 -12
  50. package/dist/internal.d.ts +16 -7
  51. package/dist/internal.js +27 -6
  52. package/dist/lite-composite.js +114 -0
  53. package/dist/lite-declinations.js +253 -0
  54. package/dist/lite-dignities.js +333 -0
  55. package/dist/lite-sect.js +72 -0
  56. package/dist/lite.d.ts +82 -0
  57. package/dist/lite.js +4 -0
  58. package/dist/receipt.d.ts +3 -268
  59. package/dist/receipt.js +202 -89
  60. package/dist/reference-span-CILpclrz.d.ts +40 -0
  61. package/dist/{rulers-9wljfVaO.d.ts → rulers-CSSWtiWF.d.ts} +7 -2
  62. package/dist/sky.d.ts +26 -10
  63. package/dist/sky.js +23 -14
  64. package/dist/techniques.d.ts +160 -21
  65. package/dist/techniques.js +157 -89
  66. package/dist/time-bands-CZA9AlLg.d.ts +36 -0
  67. package/dist/time-scale-DIFNa0gz.d.ts +47 -0
  68. package/dist/time.d.ts +81 -0
  69. package/dist/time.js +74 -0
  70. package/dist/timing.d.ts +55 -17
  71. package/dist/timing.js +33 -45
  72. package/dist/types-DpPdtXgO.d.ts +335 -0
  73. package/dist/vedic.d.ts +150 -123
  74. package/dist/vedic.js +398 -440
  75. package/dist/window.d.ts +102 -80
  76. package/dist/window.js +108 -51
  77. package/dist/zone-history-BxmDCcTK.d.ts +290 -0
  78. package/package.json +26 -3
  79. package/dist/chunk-2OWGBT3O.js +0 -219
  80. package/dist/types-B4MCoCCS.d.ts +0 -228
@@ -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-B4MCoCCS.js';
1
+ import { B as BodyName } from './types-DpPdtXgO.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.
@@ -19,15 +20,16 @@ interface LongitudeCrossing {
19
20
  retrograde: boolean;
20
21
  }
21
22
  /** A longitude source: the ecliptic longitude of `body` at `date`, in degrees. */
22
- type BodyLongitudeAt = (body: BodyName, date: Date) => number;
23
+ type BodyLongitudeAt<B extends string = BodyName> = (body: B, date: Date) => number;
24
+ /** A key not named here is refused with a RangeError. */
23
25
  interface CrossingSearchOptions {
24
26
  /** Days between coarse samples. Defaults to 5. */
25
- stepDays?: number;
27
+ readonly stepDays?: number | undefined;
26
28
  /**
27
29
  * The most longitude evaluations the search may make, refinements
28
30
  * included: a positive integer, or `Infinity`. Defaults to no limit.
29
31
  */
30
- maxSamples?: number;
32
+ readonly maxSamples?: number | undefined;
31
33
  }
32
34
  /**
33
35
  * A search either completes, with every crossing it found, or is refused
@@ -38,6 +40,14 @@ type CrossingSearchResult = {
38
40
  crossings: LongitudeCrossing[];
39
41
  /** Longitude evaluations made. */
40
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")[];
41
51
  } | {
42
52
  status: "refused";
43
53
  reason: "sample-budget";
@@ -61,9 +71,11 @@ type CrossingSearchResult = {
61
71
  * the direction of the sample before it. Offsets of 90° or more are read as
62
72
  * the far side of the circle, not a crossing.
63
73
  *
64
- * A plain scan loses both crossings when a station falls between two samples
65
- * just past the target: at a 5-day step, a Saturn station within 0.0103° of
66
- * 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
67
79
  * without the offset changing sign, and the turning sample is within reach of
68
80
  * the local curvature, a golden-section search finds the extremum. Both
69
81
  * crossings are bisected when it passes the target, and one is reported, as
@@ -77,7 +89,7 @@ type CrossingSearchResult = {
77
89
  * {@link searchLongitudeCrossingsWith} bounds it. Throws RangeError for an
78
90
  * invalid window, target or step, and for a non-finite longitude.
79
91
  */
80
- declare function findLongitudeCrossingsWith(longitudeAt: BodyLongitudeAt, body: BodyName, targetLongitude: number, from: Date, to: Date, stepDays?: number): LongitudeCrossing[];
92
+ declare function findLongitudeCrossingsWith<B extends string = BodyName>(longitudeAt: BodyLongitudeAt<B>, body: B, targetLongitude: number, from: Date, to: Date, stepDays?: number): LongitudeCrossing[];
81
93
  /**
82
94
  * The search {@link findLongitudeCrossingsWith} makes, with the step as
83
95
  * `options.stepDays` (default 5), under an optional budget of longitude
@@ -86,6 +98,6 @@ declare function findLongitudeCrossingsWith(longitudeAt: BodyLongitudeAt, body:
86
98
  * refinement would pass it; either way it returns a typed refusal with no
87
99
  * crossings rather than throwing. Invalid input still throws RangeError.
88
100
  */
89
- declare function searchLongitudeCrossingsWith(longitudeAt: BodyLongitudeAt, body: BodyName, targetLongitude: number, from: Date, to: Date, options?: CrossingSearchOptions): CrossingSearchResult;
101
+ declare function searchLongitudeCrossingsWith<B extends string = BodyName>(longitudeAt: BodyLongitudeAt<B>, body: B, targetLongitude: number, from: Date, to: Date, options?: CrossingSearchOptions): CrossingSearchResult;
90
102
 
91
- export { type BodyLongitudeAt, type CrossingSearchOptions, type CrossingSearchResult, type LongitudeCrossing, findLongitudeCrossingsWith, searchLongitudeCrossingsWith };
103
+ export { type BodyLongitudeAt, BodyName, type CrossingSearchOptions, type CrossingSearchResult, type LongitudeCrossing, findLongitudeCrossingsWith, searchLongitudeCrossingsWith };
package/dist/crossings.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  findLongitudeCrossingsWith,
3
3
  searchLongitudeCrossingsWith
4
- } from "./chunk-AECKV73C.js";
4
+ } from "./chunk-TSS2SZWQ.js";
5
5
  export {
6
6
  findLongitudeCrossingsWith,
7
7
  searchLongitudeCrossingsWith
@@ -0,0 +1,43 @@
1
+ import { De440Source } from './de440.js';
2
+ import './types-DpPdtXgO.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-767FTO7O.js";
7
+ import "./chunk-YPU3MDNI.js";
8
+ import "./chunk-Y4E3WJU5.js";
9
+ import "./chunk-NNOSOOWS.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-DpPdtXgO.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-YPU3MDNI.js";
9
+ import "./chunk-Y4E3WJU5.js";
10
+ import "./chunk-NNOSOOWS.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
+ };
package/dist/deltat.d.ts CHANGED
@@ -30,6 +30,14 @@
30
30
  * a calibrated 1-σ. Sources, licences and every number:
31
31
  * docs/platform/evidence/deltat-2026-09-25/ in the Zodiacs site repository.
32
32
  */
33
+ /**
34
+ * Where a ΔT came from: one of the model's segments above; "pinned", a
35
+ * caller's pin; or, on the IERS basis ("iers-utc/1", docs/time.md), the source
36
+ * of its UT1 − UTC, "observed" or "predicted". "fallback" is the IERS basis
37
+ * with UT1 − UTC taken as 0 ± 0.9 s past the table's ends, which rc.15's first
38
+ * cut recorded and receipts from it carry; later releases do not give it, and
39
+ * keep it so those records stay readable.
40
+ */
33
41
  type DeltaTSegment = "long-term" | "reconstructed" | "observed" | "predicted" | "extrapolated" | "pinned" | "fallback";
34
42
  /** ΔT with its band and provenance: this model, "iers-utc/1" (docs/time.md), or a caller's pin, whose sigma, table and tableDigest are null. */
35
43
  interface DeltaT {
@@ -43,7 +51,14 @@ interface DeltaT {
43
51
  tableDigest: string | null;
44
52
  segment: DeltaTSegment;
45
53
  }
46
- /** The part of the model refreshed from IERS. It changes only with an engine release. */
54
+ /**
55
+ * The part of the model refreshed from IERS. It changes only with an engine
56
+ * release. Its shape is the model's, "zodiacs-deltat/1": yearly knots to the
57
+ * last observed day, then four to the last predicted one, with `from` a year
58
+ * and the two ends MJDs. A refresh keeps that shape; a model that needs
59
+ * another would be a new model, with a new name and its own export beside
60
+ * this one. Each ΔT names the table it came from (`table`, `tableDigest`).
61
+ */
47
62
  interface DeltaTTable {
48
63
  /** Date of the last observed IERS day (YYYY-MM-DD). */
49
64
  readonly version: string;
@@ -65,9 +80,19 @@ interface DeltaTTable {
65
80
  declare const DELTA_T_MODEL = "zodiacs-deltat/1";
66
81
  /** This release's table: IERS files of 2026-09-24. Frozen. */
67
82
  declare const DELTA_T_TABLE: DeltaTTable;
68
- /** ΔT at astronomy-engine's UT (days since J2000.0), with its band and the part of the model that answered. */
83
+ /**
84
+ * ΔT of the model alone at astronomy-engine's UT, days since 2000-01-01T12:00
85
+ * on UT1 (not epoch milliseconds), with its band and the part of the model
86
+ * that answered. A chart from 1972 to the end of the IERS UT1 table uses IERS
87
+ * instead (`iers-utc/1`; docs/time.md), so its ΔT can differ from this.
88
+ * RangeError for a non-finite input.
89
+ */
69
90
  declare function deltaTAt(ut: number): DeltaT;
70
- /** For astronomy-engine's SetDeltaTFunction: UT days in, seconds out. Allocation-free. */
91
+ /**
92
+ * For astronomy-engine's SetDeltaTFunction: UT days since 2000-01-01T12:00
93
+ * in, the model's seconds out. Allocation-free. RangeError for a non-finite
94
+ * input.
95
+ */
71
96
  declare function deltaT(ut: number): number;
72
97
 
73
98
  export { DELTA_T_MODEL, DELTA_T_TABLE, type DeltaT, type DeltaTSegment, type DeltaTTable, deltaT, deltaTAt };
package/dist/deltat.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  DELTA_T_TABLE,
4
4
  deltaT,
5
5
  deltaTAt
6
- } from "./chunk-ONBZ4HK7.js";
6
+ } from "./chunk-BHJXUY67.js";
7
7
  export {
8
8
  DELTA_T_MODEL,
9
9
  DELTA_T_TABLE,
@@ -0,0 +1,60 @@
1
+ import { P as PositionSource, B as BodyName, c as BodyPosition, C as ChartInput, d as Chart } from './types-DpPdtXgO.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
+ declare function computeBodies(date: Date): BodyPosition[];
58
+ declare function computeChart(input: ChartInput): Chart;
59
+
60
+ 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, f as BirthInput } from './types-B4MCoCCS.js';
2
- import { NatalLocalResolution } from './receipt.js';
1
+ import { H as HouseSystem, h as BirthInput } from './types-DpPdtXgO.js';
2
+ import { T as TransitionCause, N as NatalLocalResolution } from './zone-history-BxmDCcTK.js';
3
3
  import './deltat.js';
4
+ import './time-scale-DIFNa0gz.js';
4
5
 
5
6
  interface City {
6
7
  name: string;
@@ -71,19 +72,25 @@ interface CalendarNote {
71
72
  kind: "old-style" | "new-style";
72
73
  adoption: Readonly<GregorianAdoption>;
73
74
  }
74
- /** The note for a Gregorian date (as resolved) written in `calendar`, or null. */
75
+ /**
76
+ * The note for a Gregorian date (as resolved, YYYY-MM-DD) written in
77
+ * `calendar`, or null; null too for a country the table does not date. A date
78
+ * that is not a valid Gregorian YYYY-MM-DD, a calendar other than "gregorian"
79
+ * and "julian", or a country that is not a nonempty string throws a
80
+ * RangeError.
81
+ */
75
82
  declare function calendarNote(gregorianDate: string, calendar: CalendarName, country: string): CalendarNote | null;
76
83
 
77
- /** The pinned tzdb release: its version, archive digest and the form its histories were compiled from. */
84
+ /**
85
+ * The pinned tzdb release: its version, archive digest and the form its histories were compiled from. The
86
+ * version and digest are typed as strings, because a release that updates the time-zone data changes them.
87
+ */
78
88
  declare const TZDB: Readonly<{
79
- readonly version: "2025c";
80
- readonly sha256: "4aa79e4effee53fc4029ffe5f6ebe97937282ebcdf386d5d2da91ce84142f957";
81
- readonly form: "main+backzone";
89
+ version: string;
90
+ sha256: string;
91
+ form: "main+backzone";
82
92
  }>;
83
93
 
84
- /** What changed at a transition, from the tzdb record. */
85
- type TransitionCause = "dst" | "legal-change" | "date-line";
86
-
87
94
  /** How to read a wall time (docs/time.md). Unknown keys and values throw RangeError. */
88
95
  interface LocalTimeOptions {
89
96
  /** The birthplace, degrees east: its own mean time replaces the zone's local mean time. */
@@ -92,7 +99,15 @@ interface LocalTimeOptions {
92
99
  calendar?: CalendarName | undefined;
93
100
  /** ISO 3166-1 alpha-2 code, or the country's name in tzdata's iso3166.tab, for `calendarNote`. */
94
101
  country?: string | undefined;
102
+ /**
103
+ * Which instant a wall time the clock showed twice takes: "earlier" (the
104
+ * default), its first pass, or "later", its second. It changes nothing for
105
+ * any other wall time; a skipped one moves forward either way.
106
+ */
107
+ fold?: FoldChoice | undefined;
95
108
  }
109
+ /** The pass of a repeated wall time to take: the first ("earlier") or the second ("later"). */
110
+ type FoldChoice = "earlier" | "later";
96
111
  /** A change of the clock that read the wall time. */
97
112
  interface ZoneTransition {
98
113
  /** UTC, ISO 8601. */
@@ -149,12 +164,21 @@ interface LocalBirthInput {
149
164
  timeKnown?: boolean;
150
165
  calendar?: CalendarName;
151
166
  country?: string;
167
+ /** Which pass of a repeated wall time the birth was in; "earlier" by default (as `LocalTimeOptions`). */
168
+ fold?: FoldChoice;
152
169
  }
153
- /** UTC offset for an IANA timezone at a UTC instant, from the host's Intl. */
170
+ /**
171
+ * UTC offset for an IANA timezone at a UTC instant, minutes east, from the
172
+ * host's Intl: a cross-check on the host's time-zone data. zoneOffsetAt is the
173
+ * engine's own answer, the one its wall times use; the two agree from 1970
174
+ * where the host has tzdata 2025c, and before 1970 they can differ, because
175
+ * Intl does not carry the history this package ships.
176
+ */
154
177
  declare function offsetAt(timeZone: string, utcMilliseconds: number): number;
155
178
  /**
156
179
  * Resolve a local wall time in an IANA zone to UTC: a repeated one takes the
157
- * earlier instant, a skipped one moves forward by the jump. Before 1970 the
180
+ * earlier instant, or the later one with `options.fold` "later"; a skipped
181
+ * one moves forward by the jump. Before 1970 the
158
182
  * shipped tzdb 2025c history answers, loaded by `prepareLocalTime` (a wall
159
183
  * time before 1970-01-02 throws otherwise); from 1970, and in the fixed Etc
160
184
  * zones, the host's Intl.
@@ -173,6 +197,15 @@ declare function prepareLocalTime(date: string, timeZone: string): Promise<void>
173
197
  * and in the fixed zones, Intl.
174
198
  */
175
199
  declare function zoneOffsetAt(timeZone: string, utcMilliseconds: number): number;
200
+ /**
201
+ * Thrown when an answer needs a zone's history before 1970 and
202
+ * `prepareLocalTime` has not loaded it. An Error, not a RangeError: the input
203
+ * is valid, and awaiting `prepareLocalTime(date, timeZone)` first answers it.
204
+ */
205
+ declare class ZoneHistoryNotLoadedError extends Error {
206
+ readonly name = "ZoneHistoryNotLoadedError";
207
+ constructor();
208
+ }
176
209
  /** A local birth resolved, with how its wall time was read and the receipt's `reference`. */
177
210
  interface LocalBirthResolution {
178
211
  birth: BirthInput;
@@ -184,4 +217,4 @@ declare function resolveLocalBirth(input: LocalBirthInput): LocalBirthResolution
184
217
  /** Convert a local birth form into the explicit UTC input accepted by the core. */
185
218
  declare function resolveBirth(input: LocalBirthInput): BirthInput;
186
219
 
187
- 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, type TransitionCause, type ZoneTransition, calendarNote, createGeoNamesClient, gregorianAdoption, gregorianToJulian, julianToGregorian, offsetAt, prepareLocalTime, resolveBirth, resolveLocalBirth, resolveLocalToUtc, zoneOffsetAt };
220
+ 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
@@ -2,6 +2,7 @@ import {
2
2
  GREGORIAN_ADOPTION,
3
3
  GREGORIAN_ADOPTION_SOURCES,
4
4
  TZDB,
5
+ ZoneHistoryNotLoadedError,
5
6
  calendarNote,
6
7
  gregorianAdoption,
7
8
  offsetAt,
@@ -10,12 +11,12 @@ import {
10
11
  resolveLocalBirth,
11
12
  resolveLocalToUtc,
12
13
  zoneOffsetAt
13
- } from "./chunk-N4B5JNMA.js";
14
+ } from "./chunk-7Y2F2IWN.js";
14
15
  import {
15
16
  gregorianToJulian,
16
17
  julianToGregorian
17
18
  } from "./chunk-KFTJMMG7.js";
18
- import "./chunk-PFGUCNOK.js";
19
+ import "./chunk-BMDASNPB.js";
19
20
 
20
21
  // src/geo/geonames.ts
21
22
  var fold = (value) => value.normalize("NFD").replace(/[\u0300-\u036f]/gu, "").toLowerCase();
@@ -160,6 +161,7 @@ export {
160
161
  GREGORIAN_ADOPTION,
161
162
  GREGORIAN_ADOPTION_SOURCES,
162
163
  TZDB,
164
+ ZoneHistoryNotLoadedError,
163
165
  calendarNote,
164
166
  createGeoNamesClient,
165
167
  gregorianAdoption,