リファレンス · 名前の一覧の小さな最初のかたまり (固有名のある335個の星と110個のメシエ天体。全体と同じ行で、最初に約20 kBだけ読み込む検索ボックス用)
searchNames関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The rows of the small chunk 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. A star without a common name is not here: a page that wants it loads /names after this.
インポート
import { searchNames } from "@johnmorrisdotca/hoshi-stars/names/named";
定義
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/named";
console.log(searchNames("andromeda", { limit: 3 }).map((row) => row.id));[ 'm31', 'alpheratz', 'mirach' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。