astroceleste-engine 0.0.7 → 0.0.9

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/NOTICE CHANGED
@@ -32,3 +32,25 @@ bias and sidereal time (src/frames/), light-time, gravitational deflection and a
32
32
  Ephemeris data: NASA JPL planetary ephemerides (DE440s and others) are public domain
33
33
  works of the U.S. Government, fetched at build/run time and not distributed here, except
34
34
  for a one-year DE440s excerpt used by the tests (tests/data/de440s_2000.bsp).
35
+
36
+ The Zi Wei Dou Shu star brightness table (src/chinese/ziwei.rs) is taken from iztro
37
+ (https://github.com/SylarLong/iztro), used under the MIT license:
38
+
39
+ Copyright (c) 2023 All Contributors
40
+
41
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
42
+ software and associated documentation files (the "Software"), to deal in the Software
43
+ without restriction, including without limitation the rights to use, copy, modify,
44
+ merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
45
+ permit persons to whom the Software is furnished to do so, subject to the following
46
+ conditions:
47
+
48
+ The above copyright notice and this permission notice shall be included in all copies
49
+ or substantial portions of the Software.
50
+
51
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
52
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
53
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
54
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
55
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
56
+ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -45,6 +45,14 @@ export class Engine {
45
45
  readonly coverage: Float64Array | undefined;
46
46
  }
47
47
 
48
+ /**
49
+ * The Four Pillars of a birth (ISO 8601 UTC) at `longitude` (degrees east) where civil
50
+ * time was `utcOffsetMinutes` ahead of UTC, from its Chinese `calendar` (the chart's
51
+ * `chinese_calendar`). `options`: `{ solar_time?, zi_hour?, sex?, luck_pillars? }`, or
52
+ * `undefined` for the defaults. No kernel is needed.
53
+ */
54
+ export function bazi(calendar: any, birth: string, longitude: number, utcOffsetMinutes: number, options: any): any;
55
+
48
56
  /**
49
57
  * A computed chart's dignities (condition, sect, receptions) judged again under `scheme`
50
58
  * ("lilly" or "dorothean"). No kernel is needed.
@@ -88,11 +96,20 @@ export function synastry(chart_a_planets: any, chart_b_planets: any, orb_setting
88
96
  */
89
97
  export function timeLords(birth: string, sun_longitude: number, ascendant_longitude: number, start: string, end: string): any;
90
98
 
99
+ /**
100
+ * The Zi Wei Dou Shu chart of a birth (ISO 8601 UTC) at `longitude` (degrees east) where
101
+ * civil time was `utcOffsetMinutes` ahead of UTC, from its Chinese `calendar` (the chart's
102
+ * `chinese_calendar`). `options`: `{ solar_time?, zi_hour?, sex?, leap_month? }`, or
103
+ * `undefined` for the defaults. No kernel is needed.
104
+ */
105
+ export function ziWei(calendar: any, birth: string, longitude: number, utcOffsetMinutes: number, options: any): any;
106
+
91
107
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
92
108
 
93
109
  export interface InitOutput {
94
110
  readonly memory: WebAssembly.Memory;
95
111
  readonly __wbg_engine_free: (a: number, b: number) => void;
112
+ readonly bazi: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
96
113
  readonly chartDignities: (a: any, b: number, c: number) => [number, number, number];
97
114
  readonly degreeQualities: (a: number) => [number, number, number];
98
115
  readonly degreeQualityTable: () => [number, number, number];
@@ -110,6 +127,7 @@ export interface InitOutput {
110
127
  readonly julianDay: (a: number, b: number) => [number, number, number];
111
128
  readonly synastry: (a: any, b: any, c: any) => [number, number, number];
112
129
  readonly timeLords: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
130
+ readonly ziWei: (a: any, b: number, c: number, d: number, e: number, f: any) => [number, number, number];
113
131
  readonly __wbindgen_malloc: (a: number, b: number) => number;
114
132
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
115
133
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -129,6 +129,28 @@ export class Engine {
129
129
  }
130
130
  if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
131
131
 
132
+ /**
133
+ * The Four Pillars of a birth (ISO 8601 UTC) at `longitude` (degrees east) where civil
134
+ * time was `utcOffsetMinutes` ahead of UTC, from its Chinese `calendar` (the chart's
135
+ * `chinese_calendar`). `options`: `{ solar_time?, zi_hour?, sex?, luck_pillars? }`, or
136
+ * `undefined` for the defaults. No kernel is needed.
137
+ * @param {any} calendar
138
+ * @param {string} birth
139
+ * @param {number} longitude
140
+ * @param {number} utcOffsetMinutes
141
+ * @param {any} options
142
+ * @returns {any}
143
+ */
144
+ export function bazi(calendar, birth, longitude, utcOffsetMinutes, options) {
145
+ const ptr0 = passStringToWasm0(birth, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
146
+ const len0 = WASM_VECTOR_LEN;
147
+ const ret = wasm.bazi(calendar, ptr0, len0, longitude, utcOffsetMinutes, options);
148
+ if (ret[2]) {
149
+ throw takeFromExternrefTable0(ret[1]);
150
+ }
151
+ return takeFromExternrefTable0(ret[0]);
152
+ }
153
+
132
154
  /**
133
155
  * A computed chart's dignities (condition, sect, receptions) judged again under `scheme`
134
156
  * ("lilly" or "dorothean"). No kernel is needed.
@@ -261,6 +283,28 @@ export function timeLords(birth, sun_longitude, ascendant_longitude, start, end)
261
283
  }
262
284
  return takeFromExternrefTable0(ret[0]);
263
285
  }
286
+
287
+ /**
288
+ * The Zi Wei Dou Shu chart of a birth (ISO 8601 UTC) at `longitude` (degrees east) where
289
+ * civil time was `utcOffsetMinutes` ahead of UTC, from its Chinese `calendar` (the chart's
290
+ * `chinese_calendar`). `options`: `{ solar_time?, zi_hour?, sex?, leap_month? }`, or
291
+ * `undefined` for the defaults. No kernel is needed.
292
+ * @param {any} calendar
293
+ * @param {string} birth
294
+ * @param {number} longitude
295
+ * @param {number} utcOffsetMinutes
296
+ * @param {any} options
297
+ * @returns {any}
298
+ */
299
+ export function ziWei(calendar, birth, longitude, utcOffsetMinutes, options) {
300
+ const ptr0 = passStringToWasm0(birth, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
301
+ const len0 = WASM_VECTOR_LEN;
302
+ const ret = wasm.ziWei(calendar, ptr0, len0, longitude, utcOffsetMinutes, options);
303
+ if (ret[2]) {
304
+ throw takeFromExternrefTable0(ret[1]);
305
+ }
306
+ return takeFromExternrefTable0(ret[0]);
307
+ }
264
308
  function __wbg_get_imports() {
265
309
  const import0 = {
266
310
  __proto__: null,
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "astroceleste-engine",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for astroceleste-engine",
5
- "version": "0.0.7",
5
+ "version": "0.0.9",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",