import type { ElementSet } from "../satellites/types.ts"; import { type Credit, type DataSource } from "../data-door.ts"; import { type SatellitePass } from "./passes.ts"; type Lang = "en" | "ja"; /** * The `` custom element: the passes of satellites over a place as a list, with the sky dome and the facts of the one pressed. Importing this entry point registers the tag once; it needs `satellite.js` (an optional peer). * Give it the place with `latitude`, `longitude` and `height` (metres), the orbit data with the `elements` property (OMM `ElementSet`s) or `elements-src` (an address, read once when the element comes into the page, through `fetchElements`' politeness rules), * and choose what it lists with `days` (1 to 14, 5 by default), `show` (`visible`, the default, or `all`), `sky` (`civil`, `nautical`, `astronomical` or `night`: the lightest sky a pass may be seen in), `satellite` (a NORAD number, to list one of several sets), * `from` (the first moment, an ISO date; the time of the page's first use by default), `min-altitude`, and `lang` (`en` or `ja`; the page's language by default). The times are in the browser's time zone unless `time-zone` names one (`Asia/Tokyo`) or * `utc-offset` gives hours from UTC (`9`, `-3.5`); UTC is always shown beside them. `selected` (the ISO time of a pass's highest point) is the pass pressed. It sends `chikyu-pass-select` with the pass when one is pressed, and `chikyu-passes` each time the list is made. * * @example * ```ts no-run * import type { ChikyuPasses } from "@johnmorrisdotca/chikyu-earth/passes/element"; * * const passes = document.createElement("chikyu-passes") as ChikyuPasses; * passes.setAttribute("latitude", "35.68"); * passes.setAttribute("longitude", "139.69"); * passes.setAttribute("elements-src", "https://example.org/elements/bright.json"); * document.body.append(passes); * passes.addEventListener("chikyu-pass-select", (event) => console.log((event as CustomEvent).detail.pass.highest.compass)); * ``` */ export declare class ChikyuPasses extends HTMLElement { #private; static observedAttributes: string[]; /** The orbit data the passes are worked out from. Setting it works the passes out again. */ get elements(): readonly ElementSet[]; set elements(sets: readonly ElementSet[]); /** * The outside sources of orbital elements (the data door): each carries its own licence and credit (`elementsFrom` makes one of an address), is read once when it is added, and its sets are worked out with the page's own. * Assign a list to replace them; a source that is refused throws a `TypeError` and nothing changes. A property, never an attribute: data is not text. */ get sources(): readonly DataSource[]; set sources(list: readonly unknown[]); /** Adds a source of orbital elements: checked at once (a `TypeError` for one that is refused). Returns the function that takes it away. */ addSource(source: unknown): () => void; /** Takes a source away by its id. Returns whether there was one. */ removeSource(id: string): boolean; /** Switches a source off (`false`) or on again, and keeps it in the element. The attribute `data="own"` ignores every outside source at once. */ enableSource(id: string, on: boolean): void; /** * Whose orbit data is in the list now: each source of the data door that gave a satellite to a pass listed, with how many satellites (`used`). `creditLine(credits, "en" | "ja")` from `@johnmorrisdotca/chikyu-earth/door` writes them * as a line with the licences, and the element shows that line under the list (after the text of the `credit` attribute, which stays). `chikyu-creditschange` fires when this set changes, with `detail: { credits }`. */ credits(): Credit[]; /** The passes listed now, earliest first. */ get passes(): readonly SatellitePass[]; /** The pass pressed, or undefined. */ get selectedPass(): SatellitePass | undefined; /** The first moment the list covers, milliseconds since the Unix epoch. */ get from(): number; /** The language of the words: the `lang` attribute, else the page's. */ get language(): Lang; connectedCallback(): void; attributeChangedCallback(name: string): void; /** Press the pass at `index` in `passes` (or none). */ select(index: number | undefined): void; } declare global { interface HTMLElementTagNameMap { "chikyu-passes": ChikyuPasses; } } export {};