Skip to content

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:

Installation ​

npm
shell
npm i --save @interstellar-tools/types

Interfaces ​

InterfaceDescription
ForceResultInterfaceResult of a Newtonian gravitational force computation between two point masses.

Type Aliases ​

Type AliasDescription
Matrix3x3TypeImmutable 3×3 matrix of numbers.
Vector3DTupleTypeA read-only 3D vector tuple [x, y, z].

Celestial Bodies ​

NameDescription
AsteroidBeltInterfaceRepresents an asteroid belt within the solar system simulation.
AsteroidInterfaceCanonical shape for an asteroid record: identity, dynamics, and optional visualization aides.
BlackHoleInterfaceRepresents a black hole at the center of a galaxy.
CartesianCoordinatesInterfaceRepresents 2D coordinates, for example a point on a drawn orbit.
CometInterfaceRepresents a comet in the solar system simulation.
DisplayInterfaceHow a body is drawn: everything about rendering, kept apart from its physical data and its orbit.
GalaxyInterfaceRepresents a galaxy in the universe simulation.
MoonInterfaceRepresents a moon (natural satellite) orbiting a planet.
PlanetInterfaceRepresents a planet or planetoid.
StarInterfaceRepresents a star.
SystemInterfaceRepresents a system: the barycenter (centre of mass) that its members orbit.
AsteroidBeltsTypeType alias for a collection of asteroid belts.
AsteroidCategoryMore specific group/category for dynamical families or special bodies.
AsteroidSpectralTypeSpectral (taxonomic) class based on reflectance spectra & albedo.
AsteroidsTypeConvenience alias for a list of asteroids.
AsteroidTypeHigh-level orbital class of an asteroid (by dynamical region).
BlackHolesTypeType alias for a collection of black holes.
CelestialBodiesTypeA list of celestial bodies of any kind: stars, planets, moons, comets and asteroids, mixed.
CelestialBodyTypeType alias representing a single celestial body.
CometsTypeType alias for an array of comets.
GalaxiesTypeType alias for a collection of galaxies.
MoonsTypeType alias for a collection of moons.
PlanetsTypeType alias for a collection of planets.
StarsTypeType alias for a collection of stars.
SystemKindTypeKind of system a barycenter holds together.
SystemsTypeType alias for a collection of systems.

Distance ​

NameDescription
DistanceInterfaceRepresents a distance measurement with an associated unit.
MeasureInterfaceRepresents a measurement with an associated unit.
DistanceUnitAliasTypeHuman-friendly distance unit aliases accepted at input time.
DistanceUnitTypeCanonical distance unit symbols for astronomy/space visualization.

Numeric ​

NameDescription
ValueInterfaceRepresents a numerical value.
DegreesTypeAngle in degrees (branded nominal type).
RadiansAngle in radians (branded nominal type).

Orbits ​

NameDescription
FullOrbitInterfaceAn OrbitInterface with every orientation element given: i, w, om and q. Comets and asteroids carry these.
OrbitInterfaceKepler orbital elements of one body around its parent.
CwStateClohessy–Wiltshire / Hill relative-motion state vector in the LVLH frame.
CwStateDerivativeTime derivative of CwState for CW/Hill dynamics.
PeriApoRadiiTypePeri/apoapsis radii pair.

Temporal ​

NameDescription
TemporalInterfaceTyped container for a scalar duration, combining a numeric value (from ValueInterface) with a canonical TemporalUnitType unit.
TimeStepInterfaceRepresents a time step measurement in simulation, restricted to days.
TemporalUnitAliasTypeHuman-friendly temporal unit aliases accepted at input time.
TemporalUnitTypeCanonical temporal unit symbols for spacetime/physics durations.