@zodiacs/engine 0.1.1-rc.15 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +891 -0
- package/LICENSING.md +192 -12
- package/NOTICE +96 -2
- package/README.md +296 -66
- package/dist/{api-CoB_kqE3.d.ts → api-WbxJ4Wj-.d.ts} +15 -10
- package/dist/ayanamsa--YQ46fET.d.ts +134 -0
- package/dist/calc.d.ts +390 -0
- package/dist/calc.js +1039 -0
- package/dist/chunk-47ERTK5X.js +27 -0
- package/dist/chunk-7TRLIFFI.js +56 -0
- package/dist/chunk-A3U2ZS2W.js +29 -0
- package/dist/{chunk-KHBLFXFG.js → chunk-B5LKF437.js} +29 -28
- package/dist/{chunk-ONBZ4HK7.js → chunk-BHJXUY67.js} +4 -2
- package/dist/{chunk-OYGRVGXD.js → chunk-CHSYDKBL.js} +3 -3
- package/dist/{chunk-ZHVI3KWJ.js → chunk-DMGHYCDI.js} +4 -4
- package/dist/{chunk-CWI4YUDL.js → chunk-FTX3JDJA.js} +21 -18
- package/dist/{chunk-MFF3VKO3.js → chunk-OG4OYTJJ.js} +47 -42
- package/dist/{chunk-ZZPITHQS.js → chunk-SRXBTP5H.js} +199 -65
- package/dist/{chunk-AECKV73C.js → chunk-TSS2SZWQ.js} +8 -2
- package/dist/chunk-WS3TDSP3.js +474 -0
- package/dist/chunk-YIITY7Q7.js +483 -0
- 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 +17 -458
- package/dist/{internal-math-BbktkHCc.d.ts → houses-CFERsAlK.d.ts} +14 -160
- package/dist/houses-extra.d.ts +95 -0
- package/dist/houses-extra.js +339 -0
- package/dist/index.d.ts +34 -48
- package/dist/index.js +31 -23
- package/dist/internal-math-DJJ8BYex.d.ts +174 -0
- package/dist/internal-math.d.ts +3 -2
- 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 -243
- package/dist/receipt.js +78 -37
- package/dist/reference-span-CILpclrz.d.ts +40 -0
- package/dist/rulers-Dla6h_Sm.d.ts +15 -0
- package/dist/sky.d.ts +173 -0
- package/dist/sky.js +379 -0
- package/dist/techniques.d.ts +453 -0
- package/dist/techniques.js +823 -0
- package/dist/timing.d.ts +113 -17
- package/dist/timing.js +98 -64
- package/dist/{types-BsWaqwU_.d.ts → types-B-yb_tGL.d.ts} +23 -11
- package/dist/vedic.d.ts +42 -124
- package/dist/vedic.js +44 -458
- package/dist/window.d.ts +180 -0
- package/dist/window.js +960 -0
- package/dist/zone-history-ghdyO0Sc.d.ts +268 -0
- package/package.json +25 -3
package/dist/window.d.ts
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { H as HouseSystem, B as BodyName, Z as ZodiacSign, b as HouseNumber, f as AspectType, D as DateInput } from './types-B-yb_tGL.js';
|
|
2
|
+
import './deltat.js';
|
|
3
|
+
|
|
4
|
+
/** The schema id of a birth window. */
|
|
5
|
+
declare const BIRTH_WINDOW_SCHEMA = "zodiacs.birth-window.v1";
|
|
6
|
+
/** How far this release's switch instants have been checked; a later release may check them further and say so here. */
|
|
7
|
+
declare const WINDOW_VERIFICATION: string;
|
|
8
|
+
/** The longest window accepted: 48 hours, in milliseconds. A minor release may accept a longer one. */
|
|
9
|
+
declare const MAX_WINDOW_MS: number;
|
|
10
|
+
/**
|
|
11
|
+
* Upper bounds on each body's longitude rate, degrees per day: twice the
|
|
12
|
+
* largest rate the engine's own positions reach from 1800 to 2200, scanned
|
|
13
|
+
* every hour for the Moon and the nodes, every three hours for Mercury, Venus
|
|
14
|
+
* and Mars, every six for the Sun and daily for the rest.
|
|
15
|
+
*/
|
|
16
|
+
declare const WINDOW_RATE_BOUNDS: Readonly<Record<BodyName, number>>;
|
|
17
|
+
/** A rounding model: the true instant is uniform over the rounding unit of the record. */
|
|
18
|
+
interface WindowRounding {
|
|
19
|
+
/** The recorded time, resolved to an instant. */
|
|
20
|
+
readonly recorded: DateInput;
|
|
21
|
+
/** The rounding unit, in minutes. */
|
|
22
|
+
readonly minutes: number;
|
|
23
|
+
/**
|
|
24
|
+
* "nearest" (the default): the record is the nearest multiple of the unit,
|
|
25
|
+
* so the true instant lies within half a unit of it. "down": the record is
|
|
26
|
+
* the start of its unit, as a clock read without rounding up.
|
|
27
|
+
*/
|
|
28
|
+
readonly mode?: "nearest" | "down";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A window of possible birth instants, resolved by the caller, and a place.
|
|
32
|
+
* Give `start` and `end`, or `at` and `minutes` for [at − minutes, at +
|
|
33
|
+
* minutes), or only `rounding`, whose unit is then the window.
|
|
34
|
+
*/
|
|
35
|
+
interface BirthWindowInput {
|
|
36
|
+
/** The first instant of the window. */
|
|
37
|
+
readonly start?: DateInput;
|
|
38
|
+
/** The end of the window, which it does not include. */
|
|
39
|
+
readonly end?: DateInput;
|
|
40
|
+
readonly at?: DateInput;
|
|
41
|
+
/** Minutes either side of `at`, to the nearest millisecond. */
|
|
42
|
+
readonly minutes?: number;
|
|
43
|
+
readonly latitude: number;
|
|
44
|
+
readonly longitude: number;
|
|
45
|
+
/** Defaults to "whole", as for natalChart. */
|
|
46
|
+
readonly houseSystem?: HouseSystem;
|
|
47
|
+
/** A second prior for the cells' shares; its unit must lie inside the window. */
|
|
48
|
+
readonly rounding?: WindowRounding;
|
|
49
|
+
}
|
|
50
|
+
interface WindowAspect {
|
|
51
|
+
readonly a: BodyName;
|
|
52
|
+
readonly b: BodyName;
|
|
53
|
+
readonly type: AspectType;
|
|
54
|
+
}
|
|
55
|
+
/** The discrete features of the chart, as natalChart would give them, throughout a cell. */
|
|
56
|
+
interface WindowFeatures {
|
|
57
|
+
/** Each body's sign; null for the nodes inside an unresolved interval. */
|
|
58
|
+
readonly signs: Readonly<Record<BodyName, ZodiacSign | null>>;
|
|
59
|
+
readonly ascendant: ZodiacSign;
|
|
60
|
+
readonly midheaven: ZodiacSign;
|
|
61
|
+
/**
|
|
62
|
+
* Each body's house, as houseOf gives it from the chart's cusps; null for
|
|
63
|
+
* the nodes inside an unresolved interval where the houses are whole signs.
|
|
64
|
+
*/
|
|
65
|
+
readonly houses: Readonly<Record<BodyName, HouseNumber | null>>;
|
|
66
|
+
/** The aspects in orb, in natalChart's pair order. */
|
|
67
|
+
readonly aspects: readonly WindowAspect[];
|
|
68
|
+
/** The house system used: the requested one, or "whole" where Placidus or Koch falls back. */
|
|
69
|
+
readonly houseSystem: HouseSystem;
|
|
70
|
+
}
|
|
71
|
+
interface BirthWindowCell {
|
|
72
|
+
/** First instant of the cell. */
|
|
73
|
+
readonly start: Date;
|
|
74
|
+
/** End of the cell, which it does not include. */
|
|
75
|
+
readonly end: Date;
|
|
76
|
+
readonly milliseconds: number;
|
|
77
|
+
/** Share of the window under a uniform prior. */
|
|
78
|
+
readonly share: number;
|
|
79
|
+
/** Share under the rounding model, when one was given. */
|
|
80
|
+
readonly roundedShare?: number;
|
|
81
|
+
readonly features: WindowFeatures;
|
|
82
|
+
}
|
|
83
|
+
/** A change to or from null opens or closes an unresolved interval; it is not a crossing. */
|
|
84
|
+
type WindowChange = {
|
|
85
|
+
readonly feature: "sign";
|
|
86
|
+
readonly body: BodyName;
|
|
87
|
+
readonly from: ZodiacSign | null;
|
|
88
|
+
readonly to: ZodiacSign | null;
|
|
89
|
+
} | {
|
|
90
|
+
readonly feature: "ascendant" | "midheaven";
|
|
91
|
+
readonly from: ZodiacSign;
|
|
92
|
+
readonly to: ZodiacSign;
|
|
93
|
+
} | {
|
|
94
|
+
readonly feature: "house";
|
|
95
|
+
readonly body: BodyName;
|
|
96
|
+
readonly from: HouseNumber | null;
|
|
97
|
+
readonly to: HouseNumber | null;
|
|
98
|
+
} | {
|
|
99
|
+
readonly feature: "aspect";
|
|
100
|
+
readonly a: BodyName;
|
|
101
|
+
readonly b: BodyName;
|
|
102
|
+
readonly from: AspectType | null;
|
|
103
|
+
readonly to: AspectType | null;
|
|
104
|
+
} | {
|
|
105
|
+
readonly feature: "house-system";
|
|
106
|
+
readonly from: HouseSystem;
|
|
107
|
+
readonly to: HouseSystem;
|
|
108
|
+
};
|
|
109
|
+
interface BirthWindowSwitch {
|
|
110
|
+
/**
|
|
111
|
+
* The first millisecond with the new features: the engine's value at the
|
|
112
|
+
* millisecond before differs, so the crossing lies in (at − 1 ms, at].
|
|
113
|
+
*/
|
|
114
|
+
readonly at: Date;
|
|
115
|
+
readonly changes: readonly WindowChange[];
|
|
116
|
+
}
|
|
117
|
+
/** Where the node's jitter would outlast the budget: these features are null in every cell of [start, end). */
|
|
118
|
+
interface WindowUnresolved {
|
|
119
|
+
readonly start: Date;
|
|
120
|
+
/** The first instant at which they are resolved again. */
|
|
121
|
+
readonly end: Date;
|
|
122
|
+
readonly milliseconds: number;
|
|
123
|
+
readonly features: readonly {
|
|
124
|
+
readonly feature: "sign" | "house";
|
|
125
|
+
readonly body: "North Node" | "South Node";
|
|
126
|
+
}[];
|
|
127
|
+
}
|
|
128
|
+
type BirthWindowFlag = "polar-fallback"
|
|
129
|
+
/** An interval's end-to-end change broke a bound; completeness is then not established. */
|
|
130
|
+
| "bound-exceeded"
|
|
131
|
+
/** The result lists unresolved intervals. */
|
|
132
|
+
| "node-unresolved";
|
|
133
|
+
interface BirthWindow {
|
|
134
|
+
readonly schema: typeof BIRTH_WINDOW_SCHEMA;
|
|
135
|
+
/** How far the switch instants have been checked: dense one-second sampling, not proof. */
|
|
136
|
+
readonly verification: string;
|
|
137
|
+
readonly start: Date;
|
|
138
|
+
readonly end: Date;
|
|
139
|
+
readonly latitude: number;
|
|
140
|
+
readonly longitude: number;
|
|
141
|
+
/** The requested house system. */
|
|
142
|
+
readonly houseSystem: HouseSystem;
|
|
143
|
+
readonly rounding: {
|
|
144
|
+
readonly recorded: Date;
|
|
145
|
+
readonly minutes: number;
|
|
146
|
+
readonly mode: "nearest" | "down";
|
|
147
|
+
readonly start: Date;
|
|
148
|
+
readonly end: Date;
|
|
149
|
+
} | null;
|
|
150
|
+
/** Cells in time order; they tile [start, end). */
|
|
151
|
+
readonly cells: readonly BirthWindowCell[];
|
|
152
|
+
/** Switches in time order, one per cell boundary. */
|
|
153
|
+
readonly switches: readonly BirthWindowSwitch[];
|
|
154
|
+
/** Intervals left unresolved, in time order; empty unless `node-unresolved` is flagged. */
|
|
155
|
+
readonly unresolved: readonly WindowUnresolved[];
|
|
156
|
+
readonly flags: readonly BirthWindowFlag[];
|
|
157
|
+
readonly engineVersion: string;
|
|
158
|
+
}
|
|
159
|
+
/** Thrown when a window needs more evaluated instants than the search allows. An Error, not a RangeError. */
|
|
160
|
+
declare class WindowBudgetError extends Error {
|
|
161
|
+
readonly name = "WindowBudgetError";
|
|
162
|
+
/** The instants the search allows; a later release may allow more. */
|
|
163
|
+
readonly limit: number;
|
|
164
|
+
constructor();
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Partition a birth-time window, [start, end) of at most 48 hours inside
|
|
168
|
+
* REFERENCE_SPAN, into cells within which each body's sign and house, the
|
|
169
|
+
* signs of the ascendant and midheaven, the aspects in orb and any Placidus or
|
|
170
|
+
* Koch fallback are constant. Values are the engine's own at each millisecond,
|
|
171
|
+
* as a lone natalChart call computes them. Where the search's bounds hold
|
|
172
|
+
* (README), each cell holds natalChart's features at every millisecond, except
|
|
173
|
+
* the nodes' in the intervals listed in `unresolved`, which are null. Labelled
|
|
174
|
+
* {@link WINDOW_VERIFICATION}: checked against dense sampling, not proven.
|
|
175
|
+
* Throws RangeError for invalid input, and WindowBudgetError, which is not a
|
|
176
|
+
* RangeError, when the search would need more than two million instants.
|
|
177
|
+
*/
|
|
178
|
+
declare function birthWindow(input: BirthWindowInput): BirthWindow;
|
|
179
|
+
|
|
180
|
+
export { BIRTH_WINDOW_SCHEMA, type BirthWindow, type BirthWindowCell, type BirthWindowFlag, type BirthWindowInput, type BirthWindowSwitch, MAX_WINDOW_MS, WINDOW_RATE_BOUNDS, WINDOW_VERIFICATION, type WindowAspect, WindowBudgetError, type WindowChange, type WindowFeatures, type WindowRounding, type WindowUnresolved, birthWindow };
|