import { type AstroskInitOptions, type CalcResult, type HousesResult, type JdConversion, type RevjulResult, type SetEphePathOptions, type UtcDate } from './types.js'; import { type CalcFlags, type HouseSystem, type Planet, type SidMode } from './constants.js'; export declare class Astrosk { private mod; private ephePath; private closed; private scratchD6; private scratchD13; private scratchD8; private scratchErr; private scratchStar; private constructor(); /** * Create and initialize an Astrosk instance. * Loads the WASM module and configures the ephemeris path. */ static init(options?: AstroskInitOptions): Promise; /** * Point Swiss Ephemeris at a source of ephemeris files and load them. * * Three modes, auto-detected from `source`: * * 1. **Node directory** — an existing local filesystem path * (e.g. `C:/ephe` or `/usr/share/ephe`). Every requested file is * read with `fs.readFile` and copied into the WASM virtual FS at * `/ephe/`. * * 2. **Browser / network URL base** — anything that looks like a URL * (`http://...`, `https://...`, or a path starting with `/` when * running in a browser). Files are fetched from * `/` and written into the virtual FS. * * 3. **Already-mounted virtual FS path** — if `source` is a path that * already exists inside the WASM FS (e.g. files preloaded via * `loadEphemerisFile`), no I/O is performed; the path is just * passed to `swe_set_ephe_path`. * * The internal Swiss Ephemeris path is always set to `/ephe` inside the * virtual FS (regardless of where the source bytes came from). */ setEphePath(source: string, options?: SetEphePathOptions): Promise; private ensureVirtualDir; private classifyEpheSource; private loadEpheFromNodeDir; private loadEpheFromUrlBase; /** Set the JPL ephemeris file name (default 'de441.eph' if used). */ setJplFile(name: string): void; /** * Load an ephemeris (.se1 or .eph or text) file into the virtual FS at * `${ephePath}/${name}`. Provide the file contents as bytes; this is the * recommended way to ship ephemeris in browser apps: * * const bytes = await fetch('/assets/ephe/sepl_18.se1') * .then(r => r.arrayBuffer()); * astrosk.loadEphemerisFile('sepl_18.se1', new Uint8Array(bytes)); */ loadEphemerisFile(name: string, data: Uint8Array): void; /** Set the sidereal mode (ayanamsa). */ setSidMode(mode: SidMode, t0?: number, ayan_t0?: number): void; /** Set topocentric observer location (lon east-positive, lat, altitude m). */ setTopo(lon: number, lat: number, altitude?: number): void; /** Convert calendar date+hour to Julian Day. */ julday(year: number, month: number, day: number, hour: number, gregFlag?: 1): number; /** Convert Julian Day back to year/month/day/hour. */ revjul(jd: number, gregFlag?: 1): RevjulResult; /** Convert UTC calendar date to (jd_ut, jd_et). */ utcToJd(date: UtcDate, gregFlag?: 1): JdConversion; /** Delta T (seconds) at a Julian Day. */ deltaT(jd: number): number; /** Apparent sidereal time (hours) at a UT Julian Day, Greenwich. */ sidtime(jd: number): number; /** Compute body position at a Universal Time Julian Day. */ calcUt(jdUt: number, body: Planet, flags?: CalcFlags): CalcResult; /** Compute body position at an Ephemeris Time (Terrestrial Time) Julian Day. */ calc(jdEt: number, body: Planet, flags?: CalcFlags): CalcResult; private calcInternal; /** Look up the canonical name for a planet number. */ getPlanetName(planet: number): string; /** Ayanamsa (degrees) at UT Julian Day, current sidereal mode. */ getAyanamsaUt(jdUt: number): number; /** Ayanamsa at TT Julian Day. */ getAyanamsa(jdEt: number): number; /** * Ayanamsa with full precision and explicit flags (recommended API since * Swiss Ephemeris 2.05). Returns the ayanamsa in degrees; throws on error. */ getAyanamsaExUt(jdUt: number, flags?: number): number; /** Name of the currently-set ayanamsa. */ getAyanamsaName(mode: SidMode): string; /** Compute house cusps and angles. */ houses(jdUt: number, lat: number, lon: number, hsys?: HouseSystem): HousesResult; /** Compute houses with sidereal/extra flags. */ housesEx(jdUt: number, flags: number, lat: number, lon: number, hsys?: HouseSystem): HousesResult; degnorm(deg: number): number; difdegn(p1: number, p2: number): number; difdeg2n(p1: number, p2: number): number; /** Library version string (e.g. "2.10.03"). */ version(): string; /** Free all native resources. The instance is no longer usable. */ close(): void; private checkOpen; private callStr; } //# sourceMappingURL=astrosk.d.ts.map