import { Engine, BodyId, Zodiac } from "./chart.js"; export declare const QUERY_ASPECTS: Record; export type Interval = [number, number]; /** Margin function (true where >= 0) carrying the bodies it depends on. */ export interface Predicate { (engine: Engine, t: number): number; bodies: Set; } /** * A {@link Predicate} that holds while `body` is within `orb` degrees of an * exact aspect to `target`. Feed it to {@link when} to find the time windows, * or compose it with {@link allOf}/{@link anyOf}. * * @param body The transiting body. * @param kind Aspect name, e.g. `"conjunction"`, `"square"`, `"trine"`, * `"opposition"`, `"sextile"`. * @param target The aspect target: a fixed ecliptic longitude in degrees (e.g. * a natal point) or another body id (a mutual aspect). * @param orb Half-width of the window in degrees. Defaults to `1.0`. * @param zodiac Zodiac for the longitudes. Defaults to tropical. * @returns A predicate, true while within orb of the exact aspect. * @throws Error if `kind` is not a known aspect. * @example * ```ts * const natalSun = 79.3; * when(engine, aspect("saturn", "square", natalSun, 1), jd0, jd1); // Saturn squares * ``` */ export declare function aspect(body: BodyId, kind: string, target: number | BodyId, orb?: number, zodiac?: Zodiac): Predicate; /** True while `body` is in `sign` (index 0=Aries..11=Pisces, or name). */ export declare function inSign(body: BodyId, sign: number | string, zodiac?: Zodiac): Predicate; /** True while `body` is in apparent retrograde motion. */ export declare function retrograde(body: BodyId, zodiac?: Zodiac): Predicate; /** True while `body` is direct or stationary. */ export declare function notRetrograde(body: BodyId, zodiac?: Zodiac): Predicate; /** True where every predicate is true (interval intersection). */ export declare function allOf(...preds: Predicate[]): Predicate; /** True where any predicate is true (interval union). */ export declare function anyOf(...preds: Predicate[]): Predicate; /** True where `pred` is false (interval complement). */ export declare function notOf(pred: Predicate): Predicate; export interface WhenOptions { step?: number; maxIntervals?: number; } /** * Solve for the time intervals within `[jdStart, jdEnd]` (UT Julian Days) where * a {@link Predicate} holds. Predicates compose from {@link aspect}, * {@link inSign}, {@link retrograde}, {@link notRetrograde}, and the * {@link allOf}/{@link anyOf} combinators, so one call answers questions like * "when is Venus in Taurus while Mercury is direct?". * * Returned intervals are sorted and disjoint; endpoints touching the range * bounds are clamped. The scan step defaults to 0.125 d when a fast body (Moon, * nodes, Lilith) is involved and 1 d otherwise — override it with `opts.step`. * * @param engine The engine used to evaluate positions. * @param predicate A celestial predicate (see {@link aspect}, {@link inSign}). * @param jdStart Start of the search window, Julian Day (UT). * @param jdEnd End of the search window, Julian Day (UT). * @param opts `step` (scan resolution in days) and `maxIntervals`. * @returns Sorted, disjoint `[startUt, endUt]` intervals where the predicate is * true. * @example * ```ts * const windows = when( * engine, * allOf(inSign("venus", "Taurus"), notRetrograde("mercury")), * julianDay(2025, 1, 1), julianDay(2026, 1, 1), * ); * ``` */ export declare function when(engine: Engine, predicate: Predicate, jdStart: number, jdEnd: number, opts?: WhenOptions): Interval[];