import type { Chart, Zodiac } from "./chart.js"; import type { AspectPhase } from "./electional.js"; import { ChartPattern } from "./patterns.js"; import { ChartSignature } from "./signature.js"; import type { Realm, Certainty } from "./provenance.js"; import type { Profection } from "./profections.js"; import type { CompositePlacement, SynastryAspectHit, SynastryOverlays, TransitHit } from "./relational.js"; /** Atom kinds in an {@link InterpretationContext}. */ export type FactKind = "placement" | "aspect" | "pattern" | "signature" | "angle" | "dispositor" | "reception" | "star" | "lot" | "transit" | "synastry" | "composite" | "timelord" | "dignity" | "nakshatra" | "varga" | "yoga" | "parallel" | "outOfBounds"; interface FactAtomBase { /** Stable, content-addressable id, e.g. `"placement:mars"` or * `"aspect:mars~saturn:square"`. Interpretations cite this. */ id: string; kind: FactKind; /** Body ids this atom concerns (empty for body-less signature facets). */ bodies: string[]; /** Transparent salience (higher = more prominent); see {@link SalienceWeights}. */ salience: number; /** Plain-language statement of the fact -- no interpretation. */ text: string; } export interface PlacementAtom extends FactAtomBase { kind: "placement"; body: string; sign: string; signDeg: number; house: number; retrograde: boolean; dignities: string[]; } export interface AspectAtom extends FactAtomBase { kind: "aspect"; a: string; b: string; aspect: string; /** Orb from exact, degrees. */ orb: number; /** Applying, separating, or exact -- from the two bodies' speeds. */ phase: AspectPhase; /** Closeness in `[0, 1]`: `1` exact, `0` at the orb limit. */ strength: number; } export interface PatternAtom extends FactAtomBase { kind: "pattern"; /** Configuration kind, e.g. `"t_square"`, `"grand_trine"`. */ pattern: string; /** Focal body for a T-square or yod. */ apex?: string; } export interface SignatureAtom extends FactAtomBase { kind: "signature"; /** Which facet of the structural signature this states. */ facet: "element" | "modality" | "sign" | "ruler"; value: string; } export interface AngleAtom extends FactAtomBase { kind: "angle"; angle: "asc" | "mc" | "vertex" | "eastPoint"; sign: string; signDeg: number; } export interface DispositorAtom extends FactAtomBase { kind: "dispositor"; body: string; /** The classical ruler of the body's sign (equals `body` when in domicile). */ dispositor: string; /** The body occupies its own domicile -- a chain terminus / final dispositor. */ final: boolean; } export interface ReceptionAtom extends FactAtomBase { kind: "reception"; /** The dignities the reception runs through: a single dignity when both * bodies receive by the same (`"domicile"`, `"exaltation"`, `"triplicity"`), * else a sorted pair for a mixed reception (e.g. `"domicile-exaltation"`). */ by: string; } export interface StarAtom extends FactAtomBase { kind: "star"; /** The body conjunct the fixed star. */ body: string; /** Catalog star name (see {@link Engine.starNames}). */ star: string; /** Orb from exact conjunction, degrees. */ orb: number; } export interface LotAtom extends FactAtomBase { kind: "lot"; /** Hermetic lot name, e.g. `"fortune"` (see {@link HERMETIC_LOTS}). */ lot: string; sign: string; signDeg: number; house: number; } export interface TransitAtom extends FactAtomBase { kind: "transit"; transit: string; natal: string; aspect: string; orb: number; phase: AspectPhase; strength: number; natalHouse: number; } export interface SynastryAtom extends FactAtomBase { kind: "synastry"; mode: "aspect" | "overlay"; a?: string; b?: string; aspect?: string; orb?: number; strength?: number; body?: string; partner?: "a" | "b"; house?: number; } export interface CompositeAtom extends FactAtomBase { kind: "composite"; body: string; sign: string; signDeg: number; } export interface TimelordAtom extends FactAtomBase { kind: "timelord"; system: "profection" | "zr" | "firdaria" | "dasha"; level: string; lord: string; sign?: string; } export interface DignityAtom extends FactAtomBase { kind: "dignity"; facet: "term" | "face" | "triplicity" | "almuten"; body: string; ruler?: string; } export interface NakshatraAtom extends FactAtomBase { kind: "nakshatra"; body: string; name: string; pada: number; lord: string; } export interface VargaAtom extends FactAtomBase { kind: "varga"; division: number; body: string; sign: string; } export interface YogaAtom extends FactAtomBase { kind: "yoga"; yoga: string; planets: string[]; } /** A parallel or contraparallel of declination. Sepharial: parallels are * "more correctly speaking, positions, and not aspects" -- two bodies can * hold one while unaspected in longitude, which is why this is its own atom * kind rather than an aspect variant. */ export interface ParallelAtom extends FactAtomBase { kind: "parallel"; a: string; b: string; declination: "parallel" | "contraparallel"; /** Distance from exact (|decA - decB| or |decA + decB|), degrees. */ orb: number; } /** A body beyond the Sun's maximum declination (the obliquity of the * ecliptic, ~23.44 deg) -- "out of bounds". */ export interface OutOfBoundsAtom extends FactAtomBase { kind: "outOfBounds"; body: string; /** The body's declination, degrees. */ dec: number; /** Degrees beyond the obliquity bound (always positive). */ margin: number; } export type FactAtom = PlacementAtom | AspectAtom | PatternAtom | SignatureAtom | AngleAtom | DispositorAtom | ReceptionAtom | StarAtom | LotAtom | TransitAtom | SynastryAtom | CompositeAtom | TimelordAtom | DignityAtom | NakshatraAtom | VargaAtom | YogaAtom | ParallelAtom | OutOfBoundsAtom; /** A chart as a flat, ranked list of {@link FactAtom}s. */ export interface InterpretationContext { jdUt: number; zodiac: Zodiac; /** Atoms sorted by descending {@link FactAtomBase.salience}, then `id`. */ atoms: FactAtom[]; /** What the chart is, when supplied via {@link ContextOptions.provenance} -- * framing for an interpreter (a forecast is provisional, a mythic chart is a * symbol, not a biography). */ realm?: Realm; /** How firmly the instant is known. When not `"exact"`, time-sensitive atoms * (the Moon, the angles) are damped, since their positions are less certain. */ certainty?: Certainty; } /** Additive salience weights. Each contribution is documented at its use site; * override any subset through {@link ContextOptions.salience}. */ export interface SalienceWeights { /** Every atom starts here. */ base: number; /** Added when the Sun or Moon is involved. */ luminary: number; /** Added for an angular house (1/4/7/10) or an angle atom. */ angular: number; /** Added to the placement of the Ascendant ruler. */ chartRuler: number; /** Added per essential dignity a body holds. */ dignity: number; /** Added to a hard aspect (conjunction/square/opposition). */ hardAspect: number; /** Base salience of a whole configuration (T-square, grand trine, ...). */ pattern: number; /** Added to a dispositor link (and again when it is a final dispositor). */ dispositor: number; /** Added to a mutual reception. */ reception: number; /** Added to a body's conjunction with a fixed star. */ star: number; /** Added to a Hermetic lot (the Part of Fortune and its companions). */ lot: number; /** Added to a transit-to-natal aspect. */ transit: number; /** Added to a synastry aspect or house overlay. */ synastry: number; /** Added to a composite midpoint placement. */ composite: number; /** Added to an active time-lord period. */ timelord: number; /** Added to a finer essential-dignity fact. */ dignityFine: number; /** Added to a nakshatra / varga / yoga fact. */ vedic: number; /** Added to a parallel or contraparallel of declination (Heindel reads * parallels as amplifiers on the order of a conjunction). */ parallel: number; /** Added to an out-of-bounds body. */ outOfBounds: number; } export declare const DEFAULT_SALIENCE: SalienceWeights; export interface ContextOptions { /** Salience weights to override (merged over {@link DEFAULT_SALIENCE}). */ salience?: Partial; /** Precomputed patterns/signature, to avoid recomputing them. */ patterns?: ChartPattern[]; signature?: ChartSignature; /** The chart's grounding. Carried onto the context; an inexact `certainty` * damps time-sensitive atoms. Wire from {@link realize}'s result. */ provenance?: { realm?: Realm; certainty?: Certainty; }; /** Fixed-star conjunctions to project as `star` atoms. The engine does not * compute these from a bare {@link Chart} (the star catalog lives in the * data pack), so a caller supplies them, e.g. from * {@link Engine.starConjunctions}. */ stars?: { body: string; star: string; orb: number; }[]; /** Hermetic lots to project as `lot` atoms, e.g. from {@link Engine.lots}. */ lots?: { lot: string; sign: string; signDeg: number; house: number; }[]; /** Transit-to-natal hits, e.g. from {@link transitAspects}. */ transits?: TransitHit[]; /** Synastry aspects and/or house overlays between two charts. */ synastry?: { aspects?: SynastryAspectHit[]; overlays?: SynastryOverlays; }; /** Composite midpoint placements, e.g. from {@link compositePlacements}. */ composite?: CompositePlacement[]; /** Active time-lord periods at a target instant (caller-supplied). */ timelords?: { profection?: Profection; zr?: { l1: string; l2: string; l3: string; l4: string; lot?: string; }; firdaria?: { major: string | null; sub: string | null; day?: boolean; }; dasha?: { maha: string; antar?: string | null; pratyantar?: string | null; moon_nakshatra?: string; }; }; /** Orb for parallels/contraparallels of declination, degrees (default 1.0, * matching {@link declinationAspects}). Declination atoms are always * computed from the chart's own `dec` values; this only tunes the orb. */ declinationOrb?: number; /** Vedic structure facts (caller-supplied or auto from sidereal chart). */ vedic?: { /** Project nakshatras for these bodies from the chart longitudes. */ nakshatraBodies?: string[]; /** Project varga D-n for these bodies (default `[9]` when set true). */ vargas?: number[] | true; yogas?: { yoga: string; planets: string[]; }[]; }; } /** * Project a {@link Chart} into a ranked list of {@link FactAtom}s -- the * substrate an interpretation layer consumes. Pure and deterministic; computes * applying/separating and a normalized strength for each aspect that the bare * {@link Chart.aspects} list omits. * * @param chart A chart from {@link Engine.chart} / {@link Engine.chartAt}. * @param opts Salience overrides, orb policy, and precomputed reductions. * @returns The {@link InterpretationContext}; `atoms` are sorted by salience. */ export declare function interpretationContext(chart: Chart, opts?: ContextOptions): InterpretationContext; export {};