NearestOptionstype
The options of nearest, within, closestApproach and conjunctions that mean the same in each.
Import it
import type { NearestOptions } from "@johnmorrisdotca/wakusei-planets/nearest";
Definition
interface NearestOptions {
count?: number;
within?: number;
kind?: NearestKind | readonly NearestKind[];
bodies?: readonly BodyId[];
by?: "sky" | "space";
date?: When;
observer?: Viewpoint;
}
Members
| Name | Type | Description |
|---|---|---|
count (optional) | number | undefined | How many to return. Default 5, or all of those inside |
within (optional) | number | undefined | Only those this close: degrees for |
kind (optional) | "moon" | "star" | "planet" | "dwarf-planet" | readonly ("moon" | "star" | "planet" | "dwarf-planet")[] | undefined | Only this kind of body, or any of these kinds. |
bodies (optional) | readonly BodyId[] | undefined | Search only these bodies. Default: every body. |
by (optional) | "sky" | "space" | undefined |
|
date (optional) | When | undefined | The moment, a |
observer (optional) | Viewpoint | undefined | Where the sky is seen from; ignored by |
Examples
import { nearest, type NearestOptions } from "@johnmorrisdotca/wakusei-planets/nearest";
const options: NearestOptions = { count: 3, kind: "planet", date: Date.UTC(2026, 10, 8) };
console.log(nearest("moon", options).map((row) => row.id).join(", "));venus, mercury, jupiterWhat it prints (run when this page was built)