/** * @zendir/ui - Local Type Definitions * * UI-domain types (`Quaternion`, `Vector3D`, `PointingMode`, etc.) used by * the visualization components. These live in `@zendir/ui` because they * describe what the UI renders — they are NOT shipped by `zendir-ts`, * which is REST-only and intentionally minimal. * * Helpers like `estimateOrbitalPeriod` / `estimateOrbitalVelocity` are * pure client-side approximations used for quick UI estimates; for * physics-accurate values, fetch the real properties from the engine * via `client.getProperties(...)`. */ /** * A named, colored data category — the SDK's shared concept for any secondary * grouping dimension (teams, squads, subsystems, mission phases, etc.). * * Components that support category-aware coloring accept `CategoryDef` arrays * and/or a `categoryId` field on individual data items. The `CategoryPalette` * utility resolves ids → colors/labels consistently across an entire dashboard. * * @example * const categories: CategoryDef[] = [ * { id: 'alpha', label: 'Team Alpha', color: '#2dccff' }, * { id: 'bravo', label: 'Team Bravo', color: '#fce83a' }, * ]; */ export interface CategoryDef { /** Stable unique identifier (string or numeric) */ id: string | number; /** Human-readable display name */ label: string; /** CSS color used for visual accents (stripes, rings, swatches, series lines) */ color: string; /** Optional icon name from the Astro icon set */ icon?: string; /** Arbitrary metadata for app-specific needs */ meta?: Record; } export interface SpacecraftPosition { /** Optional spacecraft id (when combined with Spacecraft) */ id?: string; /** Optional display name */ name?: string; /** Latitude in degrees (-90 to 90) */ latitude: number; /** Longitude in degrees (-180 to 180) */ longitude: number; /** Altitude in kilometers */ altitude: number; /** Velocity in km/s */ velocity?: number; /** Heading in degrees */ heading?: number; /** Timestamp */ timestamp?: string; /** Orbit type (e.g. LEO, GEO) */ orbitType?: string; /** Orbital inclination in degrees */ inclination?: number; /** Health/operational status using AstroUXDS 6-level system */ status?: "off" | "standby" | "normal" | "caution" | "serious" | "critical"; } export interface Spacecraft { id: string; name: string; noradId?: number; type?: string; /** Status using AstroUXDS 6-level system */ status?: "off" | "standby" | "normal" | "caution" | "serious" | "critical"; } export interface GroundStation { id: string; name: string; latitude: number; longitude: number; elevation?: number; /** Minimum elevation angle for visibility (degrees) */ minElevation?: number; network?: string; } export interface GroundTrackPoint { latitude: number; longitude: number; altitude: number; timestamp: string; } /** * Developer-defined toggle in a Layers panel. The component that owns the * panel only renders the toggle UI — it does NOT render the layer's * content. The consumer app listens to the panel's `onChange` and * renders/hides its own overlay accordingly. * * Used by both `` (2D map overlays) and the upcoming * `` for the 3D viewer. */ export interface LayerDef { /** Unique identifier (e.g. 'heatmap', 'coverage', 'spacecraft'). */ id: string; /** Display label in the Layers panel. */ label: string; /** Whether the layer is on by default (default true). */ defaultEnabled?: boolean; /** Optional grouping bucket for the panel ('overlays', 'objects', etc.). */ category?: string; } /** * @deprecated Use `LayerDef`. Alias kept for backward compatibility with * existing `` consumers. */ export type MapLayerDef = LayerDef; export interface AccessData { stationId: string; stationName: string; spacecraftId: string; aos: string; los: string; maxElevation: number; azimuthAos?: number; azimuthLos?: number; /** Whether link is currently accessible */ isAccessible?: boolean; /** Current elevation angle (degrees) */ elevation?: number; /** Current azimuth (degrees) */ azimuth?: number; /** Slant range in km */ slantRange?: number; /** Signal strength 0-100 */ signalStrength?: number; /** Link budget details */ linkBudget?: { receivedPower?: number; snr?: number; dataRate?: number; }; } export interface AccessWindow { aos: string; los: string; maxElevation: number; stationId: string; /** Start time (ISO or ms) */ startTime?: string | number; /** Duration in seconds */ duration?: number; } export interface TelemetryData { timestamp: string; subsystems: { power?: { status: string; batteryLevel?: number; solarArrayOutput?: number; voltage?: number; solarGeneration?: number; consumption?: number; }; thermal?: { status: string; cpuTemp?: number; batteryTemp?: number; }; comms?: { status: string; signalStrength?: number; dataRate?: number; downlinkRate?: number; transmitterStatus?: string; packetsQueued?: number; bytesTransmitted?: number; packetsTransmitted?: number; }; attitude?: { status: string; pointingError?: number; eulerAngles?: EulerAngles; targetMode?: string; }; }; /** Health status (convenience alias / extended) */ health?: { status?: string; anomalies?: Array<{ id: string; message: string; severity?: string; }>; }; /** Power (convenience alias for subsystems.power / extended) */ power?: { status?: string; batteryLevel?: number; solarArrayOutput?: number; voltage?: number; solarGeneration?: number; consumption?: number; }; /** Attitude (convenience alias / extended) */ attitude?: { status?: string; eulerAngles?: EulerAngles; targetMode?: string; pointingError?: number; }; /** Communications (convenience alias / extended) */ communications?: { status?: string; signalStrength?: number; dataRate?: number; downlinkRate?: number; transmitterStatus?: string; packetsQueued?: number; bytesTransmitted?: number; packetsTransmitted?: number; }; alerts?: Array<{ id: string; severity: string; message: string; timestamp: string; }>; } export interface OrbitalElements { semiMajorAxis: number; eccentricity: number; inclination: number; raan: number; argumentOfPerigee: number; trueAnomaly: number; period?: number; epoch?: string; } export interface Quaternion { x: number; y: number; z: number; w: number; } export interface EulerAngles { roll: number; pitch: number; yaw: number; } export interface AngularVelocity { x: number; y: number; z: number; } export interface AttitudeData { quaternion: Quaternion; eulerAngles: EulerAngles; angularVelocity: AngularVelocity; targetMode?: string; /** Pointing error in degrees */ pointingError?: number; /** Target direction vector [x, y, z] */ targetDirection?: [number, number, number]; } export type PointingMode = "nadir" | "sun" | "target" | "inertial" | "velocity"; export interface EclipseInfo { inEclipse: boolean; timeToEclipse: number; eclipseDuration: number; sunlightDuration: number; /** Umbra duration in seconds */ umbraDuration?: number; /** Penumbra duration in seconds */ penumbraDuration?: number; /** Seconds until sunlight (when in eclipse) */ timeToSunlight?: number; } export interface DetailedLinkBudget { spacecraftId: string; groundStationId: string; frequency: number; eirp: number; pathLoss: number; atmosphericLoss: number; receiverGain: number; systemNoiseTemp: number; cnoRequired: number; cnoActual: number; margin: number; dataRate: number; } export interface ThermalZone { id: string; name: string; temperature: number; minLimit: number; maxLimit: number; } export interface ThermalData { timestamp: string; zones: ThermalZone[]; averageTemp: number; hottest: { zone: string; temp: number; }; coldest: { zone: string; temp: number; }; } export interface ThrusterStatus { id: string; name: string; status: "ready" | "firing" | "disabled" | "error"; fuelFlow?: number; } export interface PropulsionSummary { fuelRemaining: number; fuelCapacity: number; thrusterStatus: ThrusterStatus[]; deltaVRemaining: number; deltaVUsed: number; lastManeuver?: string; } export interface ReactionWheelData { /** Unique wheel identifier */ id: string; /** Display name (e.g. "RW-X", "RW-1") */ name: string; /** Mounted axis */ axis: "X" | "Y" | "Z" | "skew"; /** Current stored angular momentum in N·m·s */ momentumNms: number; /** Maximum momentum capacity in N·m·s */ maxMomentumNms: number; /** Current wheel speed in RPM */ speedRpm: number; /** Maximum wheel speed in RPM */ maxSpeedRpm: number; /** Operational status */ status: "nominal" | "saturated" | "desaturating" | "off" | "error"; /** Power consumption in Watts */ powerW?: number; /** Bearing temperature in °C */ temperatureC?: number; } /** LVLH (Local Vertical Local Horizontal) frame vector */ export interface LVLHVector { /** Radial component (local vertical, positive away from Earth) */ radial: number; /** In-track component (along velocity vector) */ inTrack: number; /** Cross-track component (normal to orbital plane) */ crossTrack: number; } /** Time-stamped LVLH state for trajectory plotting */ export interface LVLHState { /** Timestamp in milliseconds */ time: number; /** Position in LVLH frame (km) */ position: LVLHVector; /** Velocity in LVLH frame (km/s) */ velocity: LVLHVector; } /** Thruster firing event */ export interface ThrusterFireEvent { /** Event timestamp in milliseconds */ time: number; /** Thruster ID */ thrusterId: string; /** Display name */ name: string; /** Delta-V magnitude in m/s */ deltaVMs: number; /** Delta-V direction in LVLH frame (unit vector) */ deltaVDirection?: LVLHVector; /** Burn duration in seconds */ durationSeconds: number; /** Event type */ type: "impulsive" | "finite" | "continuous"; } export type PlanetId = "sun" | "mercury" | "venus" | "earth" | "moon" | "mars" | "jupiter" | "saturn" | "uranus" | "neptune" | "pluto"; export interface PlanetInfo { id: PlanetId; name: string; radius: number; /** @deprecated Use radius */ radiusKm?: number; mass: number; semiMajorAxis: number; /** Distance from Sun in AU (alias for semiMajorAxis) */ distanceFromSunAU?: number; orbitalPeriod: number; color: string; } /** * Estimate orbital period from altitude (simplified) */ export declare function estimateOrbitalPeriod(altitudeKm: number): number; /** * Estimate orbital velocity from altitude (simplified) */ export declare function estimateOrbitalVelocity(altitudeKm: number): number; /** * Convert AU to kilometers */ export declare function auToKm(au: number): number; /** * Normalize planet name to PlanetId */ export declare function normalizePlanetName(name: string): PlanetId | null; /** * Get planet info by ID */ export declare function getPlanet(id: PlanetId): PlanetInfo | undefined; /** * Planet data (simplified) */ export declare const PLANETS: PlanetInfo[];