@interstellar-tools/types 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/celestial-bodies/asteroid-belts.d.ts +47 -0
- package/dist/celestial-bodies/asteroid-belts.d.ts.map +1 -0
- package/dist/celestial-bodies/asteroid-belts.js +2 -0
- package/dist/celestial-bodies/asteroid-belts.js.map +1 -0
- package/dist/celestial-bodies/asteroids.d.ts +191 -0
- package/dist/celestial-bodies/asteroids.d.ts.map +1 -0
- package/dist/celestial-bodies/asteroids.js +2 -0
- package/dist/celestial-bodies/asteroids.js.map +1 -0
- package/dist/celestial-bodies/celestial-bodies.d.ts +45 -0
- package/dist/celestial-bodies/celestial-bodies.d.ts.map +1 -0
- package/dist/celestial-bodies/celestial-bodies.js +2 -0
- package/dist/celestial-bodies/celestial-bodies.js.map +1 -0
- package/dist/celestial-bodies/comets.d.ts +94 -0
- package/dist/celestial-bodies/comets.d.ts.map +1 -0
- package/dist/celestial-bodies/comets.js +2 -0
- package/dist/celestial-bodies/comets.js.map +1 -0
- package/dist/celestial-bodies/galaxies.d.ts +82 -0
- package/dist/celestial-bodies/galaxies.d.ts.map +1 -0
- package/dist/celestial-bodies/galaxies.js +2 -0
- package/dist/celestial-bodies/galaxies.js.map +1 -0
- package/dist/celestial-bodies/index.d.ts +10 -0
- package/dist/celestial-bodies/index.d.ts.map +1 -0
- package/dist/celestial-bodies/index.js +10 -0
- package/dist/celestial-bodies/index.js.map +1 -0
- package/dist/celestial-bodies/moons.d.ts +75 -0
- package/dist/celestial-bodies/moons.d.ts.map +1 -0
- package/dist/celestial-bodies/moons.js +2 -0
- package/dist/celestial-bodies/moons.js.map +1 -0
- package/dist/celestial-bodies/planets.d.ts +96 -0
- package/dist/celestial-bodies/planets.d.ts.map +1 -0
- package/dist/celestial-bodies/planets.js +2 -0
- package/dist/celestial-bodies/planets.js.map +1 -0
- package/dist/celestial-bodies/stars.d.ts +100 -0
- package/dist/celestial-bodies/stars.d.ts.map +1 -0
- package/dist/celestial-bodies/stars.js +2 -0
- package/dist/celestial-bodies/stars.js.map +1 -0
- package/dist/celestial-bodies/systems.d.ts +18 -0
- package/dist/celestial-bodies/systems.d.ts.map +1 -0
- package/dist/celestial-bodies/systems.js +2 -0
- package/dist/celestial-bodies/systems.js.map +1 -0
- package/dist/distance.d.ts +111 -0
- package/dist/distance.d.ts.map +1 -0
- package/dist/distance.js +2 -0
- package/dist/distance.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/numeric.d.ts +31 -0
- package/dist/numeric.d.ts.map +1 -0
- package/dist/numeric.js +6 -0
- package/dist/numeric.js.map +1 -0
- package/dist/temporal.d.ts +100 -0
- package/dist/temporal.d.ts.map +1 -0
- package/dist/temporal.js +2 -0
- package/dist/temporal.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { DistanceInterface, MeasureInterface } from '../distance';
|
|
2
|
+
import { Radians } from '../numeric';
|
|
3
|
+
import { TemporalInterface } from '../temporal';
|
|
4
|
+
/**
|
|
5
|
+
* Represents **2D coordinates** for planetary positioning.
|
|
6
|
+
*
|
|
7
|
+
* @property {number} x - The x-coordinate.
|
|
8
|
+
* @property {number} y - The y-coordinate.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const position: CartesianCoordinatesInterface = { x: 100, y: 200 };
|
|
13
|
+
* ```
|
|
14
|
+
* @category Celestial Bodies
|
|
15
|
+
*/
|
|
16
|
+
export interface CartesianCoordinatesInterface {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Represents a **planet** in the solar system simulation.
|
|
22
|
+
*
|
|
23
|
+
* **Orbital Properties:**
|
|
24
|
+
* - **Semi-major axis (`a`)**: Defines the planet’s orbit size in **Astronomical Units (AU)**.
|
|
25
|
+
* - **Orbital eccentricity (`e`)**: Determines how elliptical the orbit is ($0 =$ circular, closer to $1 =$ highly elliptical).
|
|
26
|
+
* - **Orbital period (`period`)**: Time taken for one full orbit in **Earth days**.
|
|
27
|
+
* - **True anomaly (`angle`)**: The planet’s current position in its orbit (in **radians**).
|
|
28
|
+
*
|
|
29
|
+
* **Classification & Visualization:**
|
|
30
|
+
* - **Type (`type`)**: Scientific classification of the planet (e.g., **terrestrial, gas giant, ice planet**).
|
|
31
|
+
* - **Category (`category`)**: Defines whether the object is a **planet** or a **planetoid**.
|
|
32
|
+
* - **Color (`color`)**: Used for visual representation in simulations.
|
|
33
|
+
* - **Size (`radius`)**: Physical planet radius in **kilometers (km)**.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const earth: PlanetInterface = {
|
|
38
|
+
* name: 'Earth',
|
|
39
|
+
* type: 'terrestrial planet',
|
|
40
|
+
* category: 'planet',
|
|
41
|
+
* color: '#4287f5',
|
|
42
|
+
* system: 'Sun',
|
|
43
|
+
* radius: { value: 6371, unit: 'km' },
|
|
44
|
+
* a: { value: 1.0, unit: 'au' },
|
|
45
|
+
* e: 0.0167,
|
|
46
|
+
* period: { value: 365.25, unit: 'd' },
|
|
47
|
+
* angle: 0,
|
|
48
|
+
* x: { value: 0, unit: 'au' },
|
|
49
|
+
* y: { value: 1, unit: 'au' },
|
|
50
|
+
* z: { value: 0, unit: 'au' }
|
|
51
|
+
* };
|
|
52
|
+
* ```
|
|
53
|
+
* @category Celestial Bodies
|
|
54
|
+
*/
|
|
55
|
+
export interface PlanetInterface {
|
|
56
|
+
/** Name of the planet (e.g., "Earth", "Mars"). */
|
|
57
|
+
name: string;
|
|
58
|
+
/** Type classification of the planet. */
|
|
59
|
+
type: 'chthonian planet' | 'carbon planet' | 'coreless planet' | 'desert planet' | 'gas dwarf' | 'gas giant' | 'helium planet' | 'hycean planet' | 'ice giant' | 'ice planet' | 'iron planet' | 'lava planet' | 'ocean planet' | 'proto planet' | 'puffy planet' | 'super-puff' | 'silicate planet' | 'terrestrial planet';
|
|
60
|
+
/** Defines whether the object is a planet or a planetoid. */
|
|
61
|
+
category: 'planet' | 'planetoid';
|
|
62
|
+
/** Visual representation color. */
|
|
63
|
+
color: string;
|
|
64
|
+
/** The planetary system in which the planet exists. */
|
|
65
|
+
system: string;
|
|
66
|
+
/** Physical radius of the planet in kilometres. */
|
|
67
|
+
radius: DistanceInterface;
|
|
68
|
+
/** Semi-major axis of the orbit in AU. */
|
|
69
|
+
a: MeasureInterface;
|
|
70
|
+
/** Orbital eccentricity (0 = circular, closer to 1 = highly elliptical). */
|
|
71
|
+
e: number;
|
|
72
|
+
/** Semi-minor axis of the orbit (calculated from `a` and `e`). */
|
|
73
|
+
miA?: number;
|
|
74
|
+
/** X-offset for the ellipse focus (accounts for eccentricity). */
|
|
75
|
+
focus_x?: number;
|
|
76
|
+
/** Current orbital position in radians (True Anomaly). */
|
|
77
|
+
angle: Radians;
|
|
78
|
+
/** X-coordinate in a distance-based system. */
|
|
79
|
+
x: DistanceInterface;
|
|
80
|
+
/** Y-coordinate in a distance-based system. */
|
|
81
|
+
y: DistanceInterface;
|
|
82
|
+
/** Z-coordinate in a distance-based system. */
|
|
83
|
+
z: DistanceInterface;
|
|
84
|
+
/** Orbital period in Earth days. Negative values indicate counter clockwise orbit */
|
|
85
|
+
period: TemporalInterface;
|
|
86
|
+
/** Precomputed orbital path points for visualization (optional). */
|
|
87
|
+
orbitPath?: CartesianCoordinatesInterface[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Type alias for a collection of **planets**.
|
|
91
|
+
*
|
|
92
|
+
* @typedef {PlanetInterface[]} PlanetsType
|
|
93
|
+
* @category Celestial Bodies
|
|
94
|
+
*/
|
|
95
|
+
export type PlanetsType = PlanetInterface[];
|
|
96
|
+
//# sourceMappingURL=planets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planets.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/planets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,6BAA6B;IAC5C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EACA,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,WAAW,GACX,WAAW,GACX,eAAe,GACf,eAAe,GACf,WAAW,GACX,YAAY,GACZ,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,GACd,cAAc,GACd,YAAY,GACZ,iBAAiB,GACjB,oBAAoB,CAAC;IACzB,6DAA6D;IAC7D,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,MAAM,EAAE,iBAAiB,CAAC;IAC1B,0CAA0C;IAC1C,CAAC,EAAE,gBAAgB,CAAC;IACpB,4EAA4E;IAC5E,CAAC,EAAE,MAAM,CAAC;IACV,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,CAAC,EAAE,iBAAiB,CAAC;IACrB,+CAA+C;IAC/C,CAAC,EAAE,iBAAiB,CAAC;IACrB,+CAA+C;IAC/C,CAAC,EAAE,iBAAiB,CAAC;IACrB,qFAAqF;IACrF,MAAM,EAAE,iBAAiB,CAAC;IAC1B,oEAAoE;IACpE,SAAS,CAAC,EAAE,6BAA6B,EAAE,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planets.js","sourceRoot":"","sources":["../../src/celestial-bodies/planets.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { DistanceInterface, MeasureInterface } from '../distance';
|
|
2
|
+
import { Radians } from '../numeric';
|
|
3
|
+
import { TemporalInterface } from '../temporal';
|
|
4
|
+
import { CartesianCoordinatesInterface } from './planets';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a **star system**, which can be a planetary system or a stellar system.
|
|
7
|
+
*
|
|
8
|
+
* @property {string} name - Name of the star system.
|
|
9
|
+
* @property {'planetary system' | 'stellar system'} type - Specifies if it is a **planetary system** or a **stellar system**.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const solarSystem: StarSystemInterface = {
|
|
14
|
+
* name: 'Solar System',
|
|
15
|
+
* type: 'planetary system'
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
* @category Celestial Bodies
|
|
19
|
+
*/
|
|
20
|
+
export interface StarSystemInterface {
|
|
21
|
+
name: string;
|
|
22
|
+
type: 'planetary system' | 'stellar system';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents a **star** in a planetary or stellar system.
|
|
26
|
+
*
|
|
27
|
+
* **Orbital & Physical Properties:**
|
|
28
|
+
* - **Semi-major axis (`a`)**: Defines the star’s orbit size (AU or light-years).
|
|
29
|
+
* - **Orbital eccentricity (`e`)**: Determines how elliptical the orbit is.
|
|
30
|
+
* - **Orbital period (`period`)**: Time taken for one full orbit. Negative values indicates counter clockwise direction.
|
|
31
|
+
* - **True anomaly (`angle`)**: The star’s current position in its orbit (in **radians**).
|
|
32
|
+
* - **Radius (`radius`)**: Physical size of the star.
|
|
33
|
+
*
|
|
34
|
+
* **Classification & Visualization:**
|
|
35
|
+
* - **Type (`type`)**: Classification of the star (e.g., **main-sequence star, white dwarf**).
|
|
36
|
+
* - **Category (`category`)**: Defined as `'star'`.
|
|
37
|
+
* - **Color (`color`)**: Used for visual representation.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const sun: StarInterface = {
|
|
42
|
+
* name: 'Sun',
|
|
43
|
+
* type: 'G-type main-sequence',
|
|
44
|
+
* category: 'star',
|
|
45
|
+
* system: solarSystem,
|
|
46
|
+
* radius: { value: 695700, unit: 'km' },
|
|
47
|
+
* color: '#ffcc00',
|
|
48
|
+
* a: { value: 0, unit: 'au' },
|
|
49
|
+
* e: 0,
|
|
50
|
+
* period: { value: 0, unit: 'years' },
|
|
51
|
+
* angle: 0,
|
|
52
|
+
* x: { value: 0, unit: 'au' },
|
|
53
|
+
* y: { value: 0, unit: 'au' },
|
|
54
|
+
* z: { value: 0, unit: 'au' }
|
|
55
|
+
* };
|
|
56
|
+
* ```
|
|
57
|
+
* @category Celestial Bodies
|
|
58
|
+
*/
|
|
59
|
+
export interface StarInterface {
|
|
60
|
+
/** Name of the star. */
|
|
61
|
+
name: string;
|
|
62
|
+
/** Classification of the star (e.g., main-sequence, red giant, white dwarf). */
|
|
63
|
+
type: string;
|
|
64
|
+
/** Defines the category as a star. */
|
|
65
|
+
category: 'star';
|
|
66
|
+
/** The system in which the star exists. */
|
|
67
|
+
system: StarSystemInterface;
|
|
68
|
+
/** Physical radius of the star. */
|
|
69
|
+
radius: DistanceInterface;
|
|
70
|
+
/** Visual representation color. */
|
|
71
|
+
color: string;
|
|
72
|
+
/** Semi-major axis of the orbit (AU or light-years). */
|
|
73
|
+
a: MeasureInterface;
|
|
74
|
+
/** Orbital eccentricity (0 = circular, closer to 1 = highly elliptical). */
|
|
75
|
+
e: number;
|
|
76
|
+
/** Semi-minor axis of the orbit (calculated from `a` and `e`). */
|
|
77
|
+
miA?: number;
|
|
78
|
+
/** X-offset for the ellipse focus (accounts for eccentricity). */
|
|
79
|
+
focus_x?: number;
|
|
80
|
+
/** Current orbital position in radians (True Anomaly). */
|
|
81
|
+
angle: Radians;
|
|
82
|
+
/** X-coordinate in a distance-based system. */
|
|
83
|
+
x: DistanceInterface;
|
|
84
|
+
/** Y-coordinate in a distance-based system. */
|
|
85
|
+
y: DistanceInterface;
|
|
86
|
+
/** Z-coordinate in a distance-based system. */
|
|
87
|
+
z: DistanceInterface;
|
|
88
|
+
/** Orbital period of the star. Negative values indicate counter clockwise direction. */
|
|
89
|
+
period: TemporalInterface;
|
|
90
|
+
/** Precomputed orbital path points for visualization (optional). */
|
|
91
|
+
orbitPath?: CartesianCoordinatesInterface[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Type alias for a collection of **stars**.
|
|
95
|
+
*
|
|
96
|
+
* @typedef {StarInterface[]} StarsType
|
|
97
|
+
* @category Celestial Bodies
|
|
98
|
+
*/
|
|
99
|
+
export type StarsType = StarInterface[];
|
|
100
|
+
//# sourceMappingURL=stars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stars.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/stars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,kBAAkB,GAAG,gBAAgB,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,mCAAmC;IACnC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,CAAC,EAAE,gBAAgB,CAAC;IACpB,4EAA4E;IAC5E,CAAC,EAAE,MAAM,CAAC;IACV,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,EAAE,OAAO,CAAC;IACf,+CAA+C;IAC/C,CAAC,EAAE,iBAAiB,CAAC;IACrB,+CAA+C;IAC/C,CAAC,EAAE,iBAAiB,CAAC;IACrB,+CAA+C;IAC/C,CAAC,EAAE,iBAAiB,CAAC;IACrB,wFAAwF;IACxF,MAAM,EAAE,iBAAiB,CAAC;IAC1B,oEAAoE;IACpE,SAAS,CAAC,EAAE,6BAA6B,EAAE,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stars.js","sourceRoot":"","sources":["../../src/celestial-bodies/stars.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a star system within the space visualization.
|
|
3
|
+
* @category Celestial Bodies
|
|
4
|
+
*/
|
|
5
|
+
export interface SystemInterface {
|
|
6
|
+
/** Name of the star system. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** List of star names in the system. */
|
|
9
|
+
stars: string[];
|
|
10
|
+
/** Distance from the Sun in light-years. */
|
|
11
|
+
distance: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Type alias for a collection of star systems.
|
|
15
|
+
* @category Celestial Bodies
|
|
16
|
+
*/
|
|
17
|
+
export type SystemsType = SystemInterface[];
|
|
18
|
+
//# sourceMappingURL=systems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../../src/celestial-bodies/systems.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systems.js","sourceRoot":"","sources":["../../src/celestial-bodies/systems.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ValueInterface } from './numeric';
|
|
2
|
+
/**
|
|
3
|
+
* @showCategories
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Canonical **distance unit symbols** for astronomy/space visualization.
|
|
8
|
+
*
|
|
9
|
+
* ## Design principles
|
|
10
|
+
* - **Canonical symbols only** (no plurals / long names) for stable math & serialization.
|
|
11
|
+
* - Uses **meters** as the [SI](https://en.wikipedia.org/wiki/International_System_of_Units) base; larger units have conventional scientific definitions.
|
|
12
|
+
*
|
|
13
|
+
* ## Conventions
|
|
14
|
+
* - **`au`** — Astronomical Unit (IAU 2012 B2): **149 597 870 700 m** (lowercase `au` is the IAU symbol).
|
|
15
|
+
* - **`ly` family** — Light-year based on the **Julian year**:
|
|
16
|
+
* `1 ly = c × 365.25 d = 9 460 730 472 580 800 m` (with `kly = 10³ ly`, `Mly = 10⁶ ly`, `Gly = 10⁹ ly`).
|
|
17
|
+
* - **`pc` family** — Parsec defined from the arcsecond parallax:
|
|
18
|
+
* `1 pc = au × (648000 / π) ≈ 3.085677581×10¹⁶ m` (`kpc/Mpc/Gpc` are ×10³/×10⁶/×10⁹).
|
|
19
|
+
*
|
|
20
|
+
* ## Members
|
|
21
|
+
* - [SI](https://en.wikipedia.org/wiki/International_System_of_Units) base & common multiple: `m`, `km`
|
|
22
|
+
* - Astronomical: `au`
|
|
23
|
+
* - Light-year family: `ly`, `kly`, `Mly`, `Gly`
|
|
24
|
+
* - Parsec family: `pc`, `kpc`, `Mpc`, `Gpc`
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* // Example shape often used alongside this type:
|
|
29
|
+
* type Distance = { value: number; unit: DistanceUnitType };
|
|
30
|
+
*
|
|
31
|
+
* const d1: Distance = { value: 1, unit: 'au' };
|
|
32
|
+
* const d2: Distance = { value: 3.26, unit: 'ly' };
|
|
33
|
+
* const d3: Distance = { value: 8, unit: 'kpc' };
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 — definition of the astronomical unit)
|
|
37
|
+
* @see https://en.wikipedia.org/wiki/Light-year (Light-year based on Julian year)
|
|
38
|
+
* @see https://en.wikipedia.org/wiki/Parsec (Parsec definition & meter equivalence)
|
|
39
|
+
* @category Distance
|
|
40
|
+
*/
|
|
41
|
+
export type DistanceUnitType = 'm' | 'km' | 'au' | 'ly' | 'kly' | 'Mly' | 'Gly' | 'pc' | 'kpc' | 'Mpc' | 'Gpc';
|
|
42
|
+
/**
|
|
43
|
+
* Human-friendly **distance unit aliases** accepted at input time.
|
|
44
|
+
*
|
|
45
|
+
* These strings should be parsed and **normalized** to canonical {@link DistanceUnitType}
|
|
46
|
+
* (e.g., `"AU"` → `"au"`, `"lightyears"` → `"ly"`, `"kiloparsecs"` → `"kpc"`).
|
|
47
|
+
*
|
|
48
|
+
* ## Scope & conventions
|
|
49
|
+
* - **Canonical vs. aliases**: This type is for *inputs*. Convert to canonical symbols
|
|
50
|
+
* (`m`, `km`, `au`, `ly/kly/Mly/Gly`, `pc/kpc/Mpc/Gpc`) before math or serialization.
|
|
51
|
+
* - **Case-sensitive** and **exact** matches: tokens are matched exactly as listed here.
|
|
52
|
+
* For example, `"AU"` is valid (alias) while `"au"` is the canonical symbol (not part of this alias type).
|
|
53
|
+
* - **IAU symbol**: canonical astronomical unit is lowercase **`au`**; we accept `"AU"`, `"Au"`,
|
|
54
|
+
* and textual forms as aliases.
|
|
55
|
+
* - **Light-year and parsec families**: long names (with/without hyphens) normalize to their
|
|
56
|
+
* canonical symbols (`ly/kly/Mly/Gly`, `pc/kpc/Mpc/Gpc`). By convention, `ly` uses the
|
|
57
|
+
* **Julian year** (consistent with your temporal units).
|
|
58
|
+
*
|
|
59
|
+
* ### Typical flow
|
|
60
|
+
* 1) Accept `DistanceUnitAliasType | DistanceUnitType` at your API boundary.
|
|
61
|
+
* 2) Normalize to `DistanceUnitType` (e.g., via `normalizeDistanceUnit`).
|
|
62
|
+
* 3) Perform calculations using canonical units only.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* // Assuming `normalizeDistanceUnit` and `NORMALIZE_DISTANCE_UNIT` are defined:
|
|
67
|
+
* normalizeDistanceUnit('AU'); // 'au'
|
|
68
|
+
* normalizeDistanceUnit('lightyears'); // 'ly'
|
|
69
|
+
* normalizeDistanceUnit('kilolightyears'); // 'kly'
|
|
70
|
+
* normalizeDistanceUnit('parsecs'); // 'pc'
|
|
71
|
+
* normalizeDistanceUnit('Mpc'); // 'Mpc' (already canonical)
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @see DistanceUnitType for the canonical symbol set.
|
|
75
|
+
* @see https://www.iau.org/static/resolutions/IAU2012_English.pdf (IAU 2012 B2 — astronomical unit, symbol "au")
|
|
76
|
+
* @see https://en.wikipedia.org/wiki/Light-year (Light-year; Julian-year convention)
|
|
77
|
+
* @see https://en.wikipedia.org/wiki/Parsec (Parsec definition)
|
|
78
|
+
* @category Distance
|
|
79
|
+
*/
|
|
80
|
+
export type DistanceUnitAliasType = 'meter' | 'meters' | 'metre' | 'metres' | 'kilometer' | 'kilometers' | 'kilometre' | 'kilometres' | 'AU' | 'Au' | 'astronomical-unit' | 'astronomical-units' | 'astronomical unit' | 'astronomical units' | 'lightyear' | 'lightyears' | 'light-year' | 'light-years' | 'kilolightyear' | 'kilolightyears' | 'kly' | 'megalightyear' | 'megalightyears' | 'Mly' | 'gigalightyear' | 'gigalightyears' | 'Gly' | 'parsec' | 'parsecs' | 'kiloparsec' | 'kiloparsecs' | 'kpc' | 'megaparsec' | 'megaparsecs' | 'Mpc' | 'gigaparsec' | 'gigaparsecs' | 'Gpc';
|
|
81
|
+
/**
|
|
82
|
+
* Represents a measurement with an associated unit.
|
|
83
|
+
*
|
|
84
|
+
* @extends ValueInterface
|
|
85
|
+
* @property {DistanceUnitType} unit - The unit of measurement.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const planetRadius: MeasureInterface = { value: 6371, unit: 'km' };
|
|
90
|
+
* ```
|
|
91
|
+
* @category Distance
|
|
92
|
+
*/
|
|
93
|
+
export interface MeasureInterface extends ValueInterface {
|
|
94
|
+
unit: DistanceUnitType;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Represents a distance measurement with an associated unit.
|
|
98
|
+
*
|
|
99
|
+
* @extends ValueInterface
|
|
100
|
+
* @property {DistanceUnitType} unit - The unit of distance measurement.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const distanceToAlphaCentauri: DistanceInterface = { value: 4.367, unit: 'lightyears' };
|
|
105
|
+
* ```
|
|
106
|
+
* @category Distance
|
|
107
|
+
*/
|
|
108
|
+
export interface DistanceInterface extends ValueInterface {
|
|
109
|
+
unit: DistanceUnitType;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=distance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distance.d.ts","sourceRoot":"","sources":["../src/distance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,gBAAgB,GACxB,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,GACL,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,MAAM,qBAAqB,GAE7B,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GAER,WAAW,GACX,YAAY,GACZ,WAAW,GACX,YAAY,GAEZ,IAAI,GACJ,IAAI,GACJ,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,GAEpB,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,KAAK,GACL,eAAe,GACf,gBAAgB,GAChB,KAAK,GACL,eAAe,GACf,gBAAgB,GAChB,KAAK,GAEL,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,aAAa,GACb,KAAK,GACL,YAAY,GACZ,aAAa,GACb,KAAK,GACL,YAAY,GACZ,aAAa,GACb,KAAK,CAAC;AAEV;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
|
package/dist/distance.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distance.js","sourceRoot":"","sources":["../src/distance.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,cAAc,YAAY,CAAC;AAE3B,cAAc,WAAW,CAAC;AAE1B,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,cAAc,YAAY,CAAC;AAE3B,cAAc,WAAW,CAAC;AAE1B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @showCategories
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a numerical value.
|
|
7
|
+
*
|
|
8
|
+
* @property {number} value - The numeric value of the measurement.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const distance: ValueInterface = { value: 100 };
|
|
13
|
+
* ```
|
|
14
|
+
* @category Numeric
|
|
15
|
+
*/
|
|
16
|
+
export interface ValueInterface {
|
|
17
|
+
value: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Type alias representing an angle in **radians**.
|
|
21
|
+
*
|
|
22
|
+
* @typedef {number} Radians
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const angle: Radians = Math.PI / 2; // 90 degrees in radians
|
|
27
|
+
* ```
|
|
28
|
+
* @category Numeric
|
|
29
|
+
*/
|
|
30
|
+
export type Radians = number;
|
|
31
|
+
//# sourceMappingURL=numeric.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../src/numeric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC"}
|
package/dist/numeric.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric.js","sourceRoot":"","sources":["../src/numeric.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ValueInterface } from './numeric';
|
|
2
|
+
/**
|
|
3
|
+
* @showCategories
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Canonical **temporal unit symbols** for spacetime/physics **durations**.
|
|
8
|
+
*
|
|
9
|
+
* ## Design principles
|
|
10
|
+
* - **Canonical symbols only** (no plurals): stable for math and serialization.
|
|
11
|
+
* - **Durations, not timestamps/"ago"** semantics.
|
|
12
|
+
* - **Days** are the [SI](https://en.wikipedia.org/wiki/International_System_of_Units) day: exactly **86 400 s**.
|
|
13
|
+
* - **Years** are the **Julian year** (astronomy) by convention: **365.25 d = 31 557 600 s**.
|
|
14
|
+
* This keeps `yr/kyr/Myr/Gyr` numerically crisp for large-scale calculations.
|
|
15
|
+
* - Microseconds use the Unicode micro sign **`μs`**. If your environment is ASCII-only,
|
|
16
|
+
* normalize external inputs (e.g. `"us"` → `"μs"`) **before** using this type.
|
|
17
|
+
*
|
|
18
|
+
* ## Members
|
|
19
|
+
* - Subsecond [SI](https://en.wikipedia.org/wiki/International_System_of_Units): `ms`, `μs`, `ns`, `ps`, `fs`, `as`, `zs`, `ys`
|
|
20
|
+
* - Base [SI](https://en.wikipedia.org/wiki/International_System_of_Units): `s`
|
|
21
|
+
* - Convenient larger units: `min`, `h`, `d`
|
|
22
|
+
* - Astronomical year family (durations): `yr`, `kyr`, `Myr`, `Gyr`
|
|
23
|
+
*
|
|
24
|
+
* ::: info
|
|
25
|
+
*
|
|
26
|
+
* If you need to accept user-friendly aliases (e.g. `"seconds"`, `"us"`, `"hours"`),
|
|
27
|
+
* map them to these canonical symbols in a normalization step outside this type.
|
|
28
|
+
*
|
|
29
|
+
* :::
|
|
30
|
+
*
|
|
31
|
+
* @see https://www.bipm.org/en/publications/si-brochure ([SI](https://en.wikipedia.org/wiki/International_System_of_Units) Brochure — second & day)
|
|
32
|
+
* @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year used for `yr`)
|
|
33
|
+
* @category Temporal
|
|
34
|
+
*/
|
|
35
|
+
export type TemporalUnitType = 's' | 'ms' | 'μs' | 'ns' | 'ps' | 'fs' | 'as' | 'zs' | 'ys' | 'min' | 'h' | 'd' | 'yr' | 'kyr' | 'Myr' | 'Gyr';
|
|
36
|
+
/**
|
|
37
|
+
* Human-friendly **temporal unit aliases** accepted at input time.
|
|
38
|
+
*
|
|
39
|
+
* These strings could be parsed and **normalized** to your canonical `TemporalUnitType`
|
|
40
|
+
* (e.g., `"seconds"` → `"s"`, `"us"` → `"μs"`, `"megayears"` → `"Myr"`).
|
|
41
|
+
*
|
|
42
|
+
* ## Scope & conventions
|
|
43
|
+
* - **Durations only** (not timestamps or "ago" semantics).
|
|
44
|
+
* - **Day** is the [SI](https://en.wikipedia.org/wiki/International_System_of_Units) day: exactly **86 400 s**.
|
|
45
|
+
* - **Year-family** (`yr`, `kyr`, `Myr`, `Gyr`) is based on the **Julian year**
|
|
46
|
+
* (365.25 d = 31 557 600 s) for stable large-scale calculations.
|
|
47
|
+
* - **ASCII micro**: `"us"` is accepted and normalized to `"μs"`.
|
|
48
|
+
* - **Geology-style** tokens (`Ma`, `Ga`, `megaannum`, `gigaannum`) are accepted
|
|
49
|
+
* but normalized to `Myr`/`Gyr` **as durations** (not "million years ago").
|
|
50
|
+
* - **Case-sensitive**: tokens are matched exactly as listed.
|
|
51
|
+
*
|
|
52
|
+
* ## Recommended flow
|
|
53
|
+
* 1) Accept `TemporalUnitAliasType` from users/IO.
|
|
54
|
+
* 2) Normalize to `TemporalUnitType`.
|
|
55
|
+
* 3) Use only canonical units for arithmetic, storage, and serialization.
|
|
56
|
+
*
|
|
57
|
+
* @see https://www.bipm.org/en/publications/si-brochure ([SI](https://en.wikipedia.org/wiki/International_System_of_Units) Brochure — second & day)
|
|
58
|
+
* @see https://en.wikipedia.org/wiki/Julian_year_(astronomy) (Julian year used for `yr`/`kyr`/`Myr`/`Gyr`)
|
|
59
|
+
* @see https://en.wikipedia.org/wiki/Year#SI_multiples (Usage of `ka`/`Ma`/`Ga` vs `kyr`/`Myr`/`Gyr`)
|
|
60
|
+
* @category Temporal
|
|
61
|
+
*/
|
|
62
|
+
export type TemporalUnitAliasType = 'second' | 'seconds' | 'millisecond' | 'milliseconds' | 'microsecond' | 'microseconds' | 'us' | 'minute' | 'minutes' | 'hour' | 'hours' | 'day' | 'days' | 'year' | 'years' | 'yr' | 'yrs' | 'kiloyear' | 'kiloyears' | 'kyr' | 'megayear' | 'megayears' | 'megaannum' | 'megaannums' | 'Myr' | 'Ma' | 'gigayear' | 'gigayears' | 'gigaannum' | 'gigaannums' | 'Gyr' | 'Ga';
|
|
63
|
+
/**
|
|
64
|
+
* Typed container for a scalar **duration**, combining a numeric `value`
|
|
65
|
+
* (from {@link ValueInterface}) with a canonical {@link TemporalUnitType} `unit`.
|
|
66
|
+
*
|
|
67
|
+
* ## Conventions
|
|
68
|
+
* - **Durations only** (not timestamps or "ago" semantics).
|
|
69
|
+
* - `unit` must be a **canonical symbol** (e.g., `'s'`, `'min'`, `'h'`, `'d'`, `'yr'`, `'Myr'`).
|
|
70
|
+
* If you accept user-friendly aliases (e.g., `"seconds"`, `"hours"`), normalize them **before** constructing this type.
|
|
71
|
+
* - Day is the **SI day** (86 400 s) and year-family uses the **Julian year** (365.25 d).
|
|
72
|
+
*
|
|
73
|
+
* $$
|
|
74
|
+
* \text{seconds} \;=\; \text{value} \times \mathrm{SECONDS\_PER}[\text{unit}]
|
|
75
|
+
* $$
|
|
76
|
+
*
|
|
77
|
+
*
|
|
78
|
+
* @see {@link TemporalUnitType}
|
|
79
|
+
* @category Temporal
|
|
80
|
+
*/
|
|
81
|
+
export interface TemporalInterface extends ValueInterface {
|
|
82
|
+
/** Canonical temporal unit symbol (case-sensitive). */
|
|
83
|
+
unit: TemporalUnitType;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Represents a **time step measurement** in simulation, restricted to days.
|
|
87
|
+
*
|
|
88
|
+
* @extends ValueInterface
|
|
89
|
+
* @property {'day'} unit - The unit is always **days**.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const timeStep: TimeStepInterface = { value: 1, unit: 'day' };
|
|
94
|
+
* ```
|
|
95
|
+
* @category Temporal
|
|
96
|
+
*/
|
|
97
|
+
export interface TimeStepInterface extends ValueInterface {
|
|
98
|
+
unit: 'd';
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=temporal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal.d.ts","sourceRoot":"","sources":["../src/temporal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,gBAAgB,GAExB,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GAEJ,KAAK,GACL,GAAG,GACH,GAAG,GAEH,IAAI,GACJ,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,qBAAqB,GAC7B,QAAQ,GACR,SAAS,GACT,aAAa,GACb,cAAc,GACd,aAAa,GACb,cAAc,GACd,IAAI,GACJ,QAAQ,GACR,SAAS,GACT,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,KAAK,GACL,UAAU,GACV,WAAW,GACX,KAAK,GACL,UAAU,GACV,WAAW,GACX,WAAW,GACX,YAAY,GACZ,KAAK,GACL,IAAI,GACJ,UAAU,GACV,WAAW,GACX,WAAW,GACX,YAAY,GACZ,KAAK,GACL,IAAI,CAAC;AAET;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,uDAAuD;IACvD,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,IAAI,EAAE,GAAG,CAAC;CACX"}
|
package/dist/temporal.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal.js","sourceRoot":"","sources":["../src/temporal.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@interstellar-tools/types",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "types",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"types"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://phun-ky.net/projects/interstellar-tools",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/phun-ky/interstellar-tools/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/phun-ky/interstellar-tools.git"
|
|
15
|
+
},
|
|
16
|
+
"funding": "https://github.com/phun-ky/interstellar-tools?sponsor=1",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "Alexander Vassbotn Røyne-Helgesen <alexander@phun-ky.net>",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"scripts": {
|
|
33
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
34
|
+
"release": "release-it",
|
|
35
|
+
"test": "tsx --test **/__tests__/**/*.spec.ts",
|
|
36
|
+
"pretest:ci": "rm -rf coverage && mkdir -p coverage",
|
|
37
|
+
"test:ci": "glob -c \"node --import tsx --test --no-warnings --experimental-test-coverage --test-reporter=cobertura --test-reporter-destination=coverage/cobertura-coverage.xml --test-reporter=spec --test-reporter-destination=stdout\" \"**/__tests__/**/*.spec.ts\""
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^24.0.3",
|
|
41
|
+
"eslint": "^9.27.0",
|
|
42
|
+
"eslint-config-phun-ky": "^1.0.3",
|
|
43
|
+
"prettier": "^3.5.3",
|
|
44
|
+
"typescript": "^5.8.3"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=22.9.0",
|
|
48
|
+
"npm": ">=11.5.1"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
}
|
|
53
|
+
}
|