リファレンス · 検索ボックス用の名前の一覧 (明るい星とメシエ天体ごとに、英語・日本語の名前、符号、星座、順位の重み、アドレスに使える ID、向ける先を持つ行。IDと名前で引けます)
searchNames関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The rows whose names match what was typed: those with a name that starts with it first (an exact name before those), then those that contain it, each by weight (bright and well known first).
インポート
import { searchNames } from "@johnmorrisdotca/hoshi-stars/names";
定義
function searchNames(text: string, options?: { limit?: number; kinds?: readonly NameKind[]; }): NameRow[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | What was typed. |
options (省略可) | { limit?: number; kinds?: readonly NameKind[]; } |
|
戻り値
NameRow[]
The rows, best first.
例
import { searchNames } from "@johnmorrisdotca/hoshi-stars/names";
console.log(searchNames("andromeda", { limit: 3 }).map((row) => row.id));[ 'm31', 'alpheratz', 'mirach' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。