本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · 人工衛星: 軌道要素から位置を計算

FetchElementsOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

What fetchElements can be told. Every one has a safe default.

インポート

import type { FetchElementsOptions } from "@johnmorrisdotca/chikyu-earth/satellites";

定義

interface FetchElementsOptions {
    minIntervalMs?: number;
    blockedMs?: number;
    maxBytes?: number;
    maxSets?: number;
    store?: Pick<Storage, "getItem" | "setItem" | "removeItem"> | null;
    fetch?: typeof fetch;
    now?: () => number;
    signal?: AbortSignal;
}

メンバー

名前型説明
minIntervalMs (省略可)number | undefined

The shortest time between two requests to the same address; within it the answer already read is returned (2 hours by default: CelesTrak's elements change every 2 hours and it asks for one download an update).

blockedMs (省略可)number | undefined

How long a source that answered anything but 200 (or did not answer) is left alone (1 hour by default).

maxBytes (省略可)number | undefined

The most bytes of answer read (20 million by default).

maxSets (省略可)number | undefined

The most element sets kept (50,000 by default).

store (省略可)Pick<Storage, "getItem" | "setItem" | "removeItem"> | null | undefined

Where answers and refusals are kept between page loads: localStorage by default where there is one; null keeps them for this page only.

fetch (省略可)((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) | undefined

The fetch function (the browser's by default).

now (省略可)(() => number) | undefined

The time, in milliseconds since the Unix epoch (Date.now by default).

signal (省略可)AbortSignal | undefined

例

import type { FetchElementsOptions } from "@johnmorrisdotca/chikyu-earth/satellites";

const options: FetchElementsOptions = { minIntervalMs: 3 * 3_600_000 };
console.log(options.minIntervalMs);
10800000

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。