Documentation / @interstellar-tools/types
@interstellar-tools/types
Shared TypeScript types (3D tuples, branded radians, unit-carrying values, celestial body interfaces) used across the monorepo to keep APIs predictable and safe.
Documentation
The full documentation lives at phun-ky.net/interstellar-tools:
- Getting started: installation, unit conventions and recommended practices
- API reference for
@interstellar-tools/types: every export, with formulas, parameters and examples
Installation
- Node.js version 22.9.0 or higher
shell
npm i --save @interstellar-tools/typesInterfaces
| Interface | Description |
|---|---|
| ForceResultInterface | Result of a Newtonian gravitational force computation between two point masses. |
Type Aliases
| Type Alias | Description |
|---|---|
| Matrix3x3Type | Immutable 3×3 matrix of numbers. |
| Vector3DTupleType | A read-only 3D vector tuple [x, y, z]. |
Celestial Bodies
| Name | Description |
|---|---|
| AsteroidBeltInterface | Represents an asteroid belt within the solar system simulation. |
| AsteroidInterface | Canonical shape for an asteroid record: identity, dynamics, and optional visualization aides. |
| BlackHoleInterface | Represents a black hole at the center of a galaxy. |
| CartesianCoordinatesInterface | Represents 2D coordinates, for example a point on a drawn orbit. |
| CometInterface | Represents a comet in the solar system simulation. |
| DisplayInterface | How a body is drawn: everything about rendering, kept apart from its physical data and its orbit. |
| GalaxyInterface | Represents a galaxy in the universe simulation. |
| MoonInterface | Represents a moon (natural satellite) orbiting a planet. |
| PlanetInterface | Represents a planet or planetoid. |
| StarInterface | Represents a star. |
| SystemInterface | Represents a system: the barycenter (centre of mass) that its members orbit. |
| AsteroidBeltsType | Type alias for a collection of asteroid belts. |
| AsteroidCategory | More specific group/category for dynamical families or special bodies. |
| AsteroidSpectralType | Spectral (taxonomic) class based on reflectance spectra & albedo. |
| AsteroidsType | Convenience alias for a list of asteroids. |
| AsteroidType | High-level orbital class of an asteroid (by dynamical region). |
| BlackHolesType | Type alias for a collection of black holes. |
| CelestialBodiesType | A list of celestial bodies of any kind: stars, planets, moons, comets and asteroids, mixed. |
| CelestialBodyType | Type alias representing a single celestial body. |
| CometsType | Type alias for an array of comets. |
| GalaxiesType | Type alias for a collection of galaxies. |
| MoonsType | Type alias for a collection of moons. |
| PlanetsType | Type alias for a collection of planets. |
| StarsType | Type alias for a collection of stars. |
| SystemKindType | Kind of system a barycenter holds together. |
| SystemsType | Type alias for a collection of systems. |
Distance
| Name | Description |
|---|---|
| DistanceInterface | Represents a distance measurement with an associated unit. |
| Represents a measurement with an associated unit. | |
| DistanceUnitAliasType | Human-friendly distance unit aliases accepted at input time. |
| DistanceUnitType | Canonical distance unit symbols for astronomy/space visualization. |
Numeric
| Name | Description |
|---|---|
| ValueInterface | Represents a numerical value. |
| DegreesType | Angle in degrees (branded nominal type). |
| Radians | Angle in radians (branded nominal type). |
Orbits
| Name | Description |
|---|---|
| FullOrbitInterface | An OrbitInterface with every orientation element given: i, w, om and q. Comets and asteroids carry these. |
| OrbitInterface | Kepler orbital elements of one body around its parent. |
| CwState | Clohessy–Wiltshire / Hill relative-motion state vector in the LVLH frame. |
| CwStateDerivative | Time derivative of CwState for CW/Hill dynamics. |
| PeriApoRadiiType | Peri/apoapsis radii pair. |
Temporal
| Name | Description |
|---|---|
| TemporalInterface | Typed container for a scalar duration, combining a numeric value (from ValueInterface) with a canonical TemporalUnitType unit. |
| TimeStepInterface | Represents a time step measurement in simulation, restricted to days. |
| TemporalUnitAliasType | Human-friendly temporal unit aliases accepted at input time. |
| TemporalUnitType | Canonical temporal unit symbols for spacetime/physics durations. |