Reference · Satellites: orbital elements in, positions out
FetchElementsOptionstype
What fetchElements can be told. Every one has a safe default.
Import it
import type { FetchElementsOptions } from "@johnmorrisdotca/chikyu-earth/satellites";
Definition
interface FetchElementsOptions {
minIntervalMs?: number;
blockedMs?: number;
maxBytes?: number;
maxSets?: number;
store?: Pick<Storage, "getItem" | "setItem" | "removeItem"> | null;
fetch?: typeof fetch;
now?: () => number;
signal?: AbortSignal;
}
Members
| Name | Type | Description |
|---|---|---|
minIntervalMs (optional) | 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 (optional) | number | undefined | How long a source that answered anything but 200 (or did not answer) is left alone (1 hour by default). |
maxBytes (optional) | number | undefined | The most bytes of answer read (20 million by default). |
maxSets (optional) | number | undefined | The most element sets kept (50,000 by default). |
store (optional) | Pick<Storage, "getItem" | "setItem" | "removeItem"> | null | undefined | Where answers and refusals are kept between page loads: |
fetch (optional) | ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) | undefined | The fetch function (the browser's by default). |
now (optional) | (() => number) | undefined | The time, in milliseconds since the Unix epoch ( |
signal (optional) | AbortSignal | undefined |
Examples
import type { FetchElementsOptions } from "@johnmorrisdotca/chikyu-earth/satellites";
const options: FetchElementsOptions = { minIntervalMs: 3 * 3_600_000 };
console.log(options.minIntervalMs);10800000What it prints (run when this page was built)