リファレンス · データの入口(自分で用意した星やディープスカイ天体を、ライセンスと出典つきのソースとして渡し、いま画面にあるのは誰のデータかを示します)
withObjects関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Adds the deep-sky objects of outside sources to the page's own. Each source is checked by validateSource (a TypeError at once for an empty credit, no licence or a clashing id), read once, and every record is checked: a position that is not on
the sky, a number that is not finite, no id, an unknown kind or an id that is taken is left out and counted, never returned. A source that throws or holds more than 200,000 records is failed and adds nothing.
To switch a source off, leave it out of the next call.
インポート
import { withObjects } from "@johnmorrisdotca/hoshi-stars/door";
定義
function withObjects(sources: readonly ObjectSource[], options?: { own?: readonly DeepSkyObject[]; signal?: AbortSignal; }): Promise<ObjectsRead>
引数
| 名前 | 型 | 説明 |
|---|---|---|
sources | readonly ObjectSource[] | The object sources. |
options (省略可) | { own?: readonly DeepSkyObject[]; signal?: AbortSignal; } |
|
戻り値
Promise<ObjectsRead>
The objects, their credits, and what was left out.
例
import { messier } from "@johnmorrisdotca/hoshi-stars/deep-sky";
import { creditLine, withObjects, type ObjectSource } from "@johnmorrisdotca/hoshi-stars/door";
declare const myObjects: ObjectSource;
const read = await withObjects([myObjects], { own: messier() });
console.log(read.objects.length, read.skipped, creditLine(read.credits, "en"));この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。