import type { Satellites } from "../satellites/types.ts"; import { type LonLat } from "./math.ts"; export type PaintLength = "1d" | "1w" | "1m"; export type PaintSwath = "track" | "coverage"; export interface PaintSpec { /** A NORAD catalogue number, or `group:index` of a group set on the element. */ id: string; /** How long the trail is kept, in simulated time. `1d` when left out. */ length?: PaintLength; /** `track` paints the point under the satellite (the default). `coverage` paints where it is at least 10° above the horizon. */ swath?: PaintSwath; } export declare const paintLengthOf: (length: PaintLength | undefined) => PaintLength; export declare const paintSwathOf: (swath: PaintSwath | undefined) => PaintSwath; /** Minutes since the epoch, in 16 bits: the trail is at most a month, and 16 bits hold 45 days. */ export declare const paintMinute: (ms: number) => number; export interface PaintState { readonly data: Uint8Array; readonly width: number; readonly height: number; /** Stamps whose alpha is set. Clear puts it back to 0. */ readonly pixels: number; readonly on: boolean; readonly length: PaintLength; readonly swath: PaintSwath; /** The id now painted, or "" when painting is off. */ readonly id: string; /** Minutes of simulated time the shader keeps. */ readonly spanMinutes: number; set(spec: PaintSpec | null): void; clear(): void; /** * Stamp the ground crossed since the last call. `sample` is the satellite at a moment, or null when it cannot be placed. * Returns true when `data` changed and the picture should upload it. At rest, or with painting off, it returns false. * `periodMs` is one trip of the satellite round the Earth: samples are taken often enough that the line between two follows the orbit, however fast the clock. A clock run backwards lays down the older end of the length that it uncovers. */ step(ms: number, sample: (ms: number) => (LonLat & { heightKm: number; }) | null, periodMs?: number): boolean; } export declare function createPaintState(): PaintState; /** The satellite `id` names, in the groups now set: a NORAD number, or `group:index`. */ export declare function findPainted(groups: Iterable<[string, { satellites: Satellites; }]>, id: string): { satellites: Satellites; index: number; } | null; /** The ground under the painted satellite at `ms`, or null when it cannot be placed. */ export declare function paintedGround(groups: Iterable<[string, { satellites: Satellites; }]>, id: string, ms: number): (LonLat & { heightKm: number; }) | null; /** One trip of the painted satellite round the Earth, in milliseconds, from its mean motion; undefined when it is not found. */ export declare function paintedPeriod(groups: Iterable<[string, { satellites: Satellites; }]>, id: string): number | undefined;