Skip to content

Documentation / @interstellar-tools/types / TemporalInterface

Interface: TemporalInterface ​

Defined in: temporal.ts:136

Typed container for a scalar duration, combining a numeric value (from ValueInterface) with a canonical TemporalUnitType unit.

Conventions ​

  • Durations only (not timestamps or "ago" semantics).
  • unit must be a canonical symbol (e.g., 's', 'min', 'h', 'd', 'yr', 'Myr'). If you accept user-friendly aliases (e.g., "seconds", "hours"), normalize them before constructing this type.
  • Day is the SI day (86 400 s) and year-family uses the Julian year (365.25 d).
seconds=value×SECONDS_PER[unit]

See ​

TemporalUnitType

Extends ​

Properties ​

unit ​

ts
unit: TemporalUnitType;

Defined in: temporal.ts:138

Canonical temporal unit symbol (case-sensitive).


value ​

ts
value: number;

Defined in: numeric.ts:18

The numeric value of the measurement.

Inherited from ​

ValueInterface.value