NearestOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The options of nearest, within, closestApproach and conjunctions that mean the same in each.
インポート
import type { NearestOptions } from "@johnmorrisdotca/wakusei-planets/nearest";
定義
interface NearestOptions {
count?: number;
within?: number;
kind?: NearestKind | readonly NearestKind[];
bodies?: readonly BodyId[];
by?: "sky" | "space";
date?: When;
observer?: Viewpoint;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
count (省略可) | number | undefined | How many to return. Default 5, or all of those inside |
within (省略可) | number | undefined | Only those this close: degrees for |
kind (省略可) | "moon" | "star" | "planet" | "dwarf-planet" | readonly ("moon" | "star" | "planet" | "dwarf-planet")[] | undefined | Only this kind of body, or any of these kinds. |
bodies (省略可) | readonly BodyId[] | undefined | Search only these bodies. Default: every body. |
by (省略可) | "sky" | "space" | undefined |
|
date (省略可) | When | undefined | The moment, a |
observer (省略可) | Viewpoint | undefined | Where the sky is seen from; ignored by |
例
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, jupiter出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。