@elite-dangerous-almanac/core 0.1.0-beta.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/LICENSE +48 -0
- package/PROVENANCE/SNAPSHOTS.md +36 -0
- package/PROVENANCE/astro/SOURCES.md +94 -0
- package/PROVENANCE/commodities/SOURCES.md +41 -0
- package/PROVENANCE/materials/SOURCES.md +69 -0
- package/PROVENANCE/ships/SOURCES.md +1580 -0
- package/README.md +148 -0
- package/THIRD_PARTY_NOTICES.md +202 -0
- package/dist/astro/codex-region-lookup.d.ts +169 -0
- package/dist/astro/codex-region-lookup.js +1 -0
- package/dist/astro/codex-region-lookup.js.map +1 -0
- package/dist/astro/codex-region.d.ts +149 -0
- package/dist/astro/codex-region.js +1 -0
- package/dist/astro/codex-region.js.map +1 -0
- package/dist/astro/galaxy-grid.d.ts +83 -0
- package/dist/astro/galaxy-grid.js +1 -0
- package/dist/astro/galaxy-grid.js.map +1 -0
- package/dist/astro/hand-authored-regions.d.ts +121 -0
- package/dist/astro/hand-authored-regions.js +1 -0
- package/dist/astro/hand-authored-regions.js.map +1 -0
- package/dist/astro/index.d.ts +140 -0
- package/dist/astro/index.js +1 -0
- package/dist/astro/index.js.map +1 -0
- package/dist/astro/mass-code.d.ts +55 -0
- package/dist/astro/mass-code.js +1 -0
- package/dist/astro/mass-code.js.map +1 -0
- package/dist/astro/naming-region-origins.d.ts +4 -0
- package/dist/astro/naming-region-origins.js +1 -0
- package/dist/astro/naming-region-origins.js.map +1 -0
- package/dist/astro/nebulae-all.d.ts +40 -0
- package/dist/astro/nebulae-all.js +1 -0
- package/dist/astro/nebulae-all.js.map +1 -0
- package/dist/astro/nebulae-planetary.d.ts +37 -0
- package/dist/astro/nebulae-planetary.js +1 -0
- package/dist/astro/nebulae-planetary.js.map +1 -0
- package/dist/astro/nebulae-procgen.d.ts +36 -0
- package/dist/astro/nebulae-procgen.js +1 -0
- package/dist/astro/nebulae-procgen.js.map +1 -0
- package/dist/astro/nebulae-real.d.ts +37 -0
- package/dist/astro/nebulae-real.js +1 -0
- package/dist/astro/nebulae-real.js.map +1 -0
- package/dist/astro/nebulae.d.ts +169 -0
- package/dist/astro/nebulae.js +1 -0
- package/dist/astro/nebulae.js.map +1 -0
- package/dist/astro/permit-locked-regions.d.ts +54 -0
- package/dist/astro/permit-locked-regions.js +1 -0
- package/dist/astro/permit-locked-regions.js.map +1 -0
- package/dist/astro/permit-locked-systems.d.ts +74 -0
- package/dist/astro/permit-locked-systems.js +1 -0
- package/dist/astro/permit-locked-systems.js.map +1 -0
- package/dist/astro/permit-locks.d.ts +130 -0
- package/dist/astro/permit-locks.js +1 -0
- package/dist/astro/permit-locks.js.map +1 -0
- package/dist/astro/procedural-system.d.ts +228 -0
- package/dist/astro/procedural-system.js +1 -0
- package/dist/astro/procedural-system.js.map +1 -0
- package/dist/astro/sector-name.d.ts +87 -0
- package/dist/astro/sector-name.js +1 -0
- package/dist/astro/sector-name.js.map +1 -0
- package/dist/astro/system-address-input.d.ts +76 -0
- package/dist/astro/system-address-input.js +1 -0
- package/dist/astro/system-address-input.js.map +1 -0
- package/dist/astro/system-address.d.ts +4 -0
- package/dist/astro/system-address.js +1 -0
- package/dist/astro/system-address.js.map +1 -0
- package/dist/astro/system-name.d.ts +187 -0
- package/dist/astro/system-name.js +1 -0
- package/dist/astro/system-name.js.map +1 -0
- package/dist/chunk-2FHHMYDC.js +1 -0
- package/dist/chunk-2FHHMYDC.js.map +1 -0
- package/dist/chunk-462OKHXR.js +1 -0
- package/dist/chunk-462OKHXR.js.map +1 -0
- package/dist/chunk-5H74FKY7.js +1 -0
- package/dist/chunk-5H74FKY7.js.map +1 -0
- package/dist/chunk-6LUEKHO5.js +1 -0
- package/dist/chunk-6LUEKHO5.js.map +1 -0
- package/dist/chunk-76XKY2Y2.js +1 -0
- package/dist/chunk-76XKY2Y2.js.map +1 -0
- package/dist/chunk-7EE5VIHR.js +1 -0
- package/dist/chunk-7EE5VIHR.js.map +1 -0
- package/dist/chunk-A3NM7SAJ.js +1 -0
- package/dist/chunk-A3NM7SAJ.js.map +1 -0
- package/dist/chunk-A6XPYSVR.js +1 -0
- package/dist/chunk-A6XPYSVR.js.map +1 -0
- package/dist/chunk-AA3K5XUE.js +1 -0
- package/dist/chunk-AA3K5XUE.js.map +1 -0
- package/dist/chunk-AVZI6VKA.js +1 -0
- package/dist/chunk-AVZI6VKA.js.map +1 -0
- package/dist/chunk-B5TT26XE.js +1 -0
- package/dist/chunk-B5TT26XE.js.map +1 -0
- package/dist/chunk-BNILZXJD.js +1 -0
- package/dist/chunk-BNILZXJD.js.map +1 -0
- package/dist/chunk-BRDQUJXV.js +1 -0
- package/dist/chunk-BRDQUJXV.js.map +1 -0
- package/dist/chunk-BTPV5CIF.js +1 -0
- package/dist/chunk-BTPV5CIF.js.map +1 -0
- package/dist/chunk-CI3ACMRA.js +1 -0
- package/dist/chunk-CI3ACMRA.js.map +1 -0
- package/dist/chunk-COE5ADYJ.js +1 -0
- package/dist/chunk-COE5ADYJ.js.map +1 -0
- package/dist/chunk-CWAX3BSH.js +1 -0
- package/dist/chunk-CWAX3BSH.js.map +1 -0
- package/dist/chunk-DACZE3HX.js +1 -0
- package/dist/chunk-DACZE3HX.js.map +1 -0
- package/dist/chunk-DURKO7JU.js +1 -0
- package/dist/chunk-DURKO7JU.js.map +1 -0
- package/dist/chunk-E45EDCYH.js +1 -0
- package/dist/chunk-E45EDCYH.js.map +1 -0
- package/dist/chunk-ELIZXUMI.js +1 -0
- package/dist/chunk-ELIZXUMI.js.map +1 -0
- package/dist/chunk-EYGVDJ2I.js +1 -0
- package/dist/chunk-EYGVDJ2I.js.map +1 -0
- package/dist/chunk-FGXWVFN6.js +1 -0
- package/dist/chunk-FGXWVFN6.js.map +1 -0
- package/dist/chunk-GJCB2Z72.js +1 -0
- package/dist/chunk-GJCB2Z72.js.map +1 -0
- package/dist/chunk-HI7FCS3G.js +1 -0
- package/dist/chunk-HI7FCS3G.js.map +1 -0
- package/dist/chunk-HKXXFIRI.js +1 -0
- package/dist/chunk-HKXXFIRI.js.map +1 -0
- package/dist/chunk-HTB52N6S.js +1 -0
- package/dist/chunk-HTB52N6S.js.map +1 -0
- package/dist/chunk-I7PIDRMU.js +1 -0
- package/dist/chunk-I7PIDRMU.js.map +1 -0
- package/dist/chunk-IH4NXKVW.js +1 -0
- package/dist/chunk-IH4NXKVW.js.map +1 -0
- package/dist/chunk-INNFH37U.js +1 -0
- package/dist/chunk-INNFH37U.js.map +1 -0
- package/dist/chunk-J2PNZQY4.js +1 -0
- package/dist/chunk-J2PNZQY4.js.map +1 -0
- package/dist/chunk-JQG4C67D.js +1 -0
- package/dist/chunk-JQG4C67D.js.map +1 -0
- package/dist/chunk-JTQVWIGL.js +1 -0
- package/dist/chunk-JTQVWIGL.js.map +1 -0
- package/dist/chunk-JWJ7RSZC.js +1 -0
- package/dist/chunk-JWJ7RSZC.js.map +1 -0
- package/dist/chunk-K3AMV27L.js +1 -0
- package/dist/chunk-K3AMV27L.js.map +1 -0
- package/dist/chunk-K7F6WC4T.js +1 -0
- package/dist/chunk-K7F6WC4T.js.map +1 -0
- package/dist/chunk-K7L7SMIR.js +1 -0
- package/dist/chunk-K7L7SMIR.js.map +1 -0
- package/dist/chunk-KG4EWDZZ.js +1 -0
- package/dist/chunk-KG4EWDZZ.js.map +1 -0
- package/dist/chunk-KMFUCORC.js +1 -0
- package/dist/chunk-KMFUCORC.js.map +1 -0
- package/dist/chunk-L2ZZXEZM.js +1 -0
- package/dist/chunk-L2ZZXEZM.js.map +1 -0
- package/dist/chunk-L747RVPO.js +1 -0
- package/dist/chunk-L747RVPO.js.map +1 -0
- package/dist/chunk-MFV4VZFP.js +1 -0
- package/dist/chunk-MFV4VZFP.js.map +1 -0
- package/dist/chunk-NWPK6Q3S.js +1 -0
- package/dist/chunk-NWPK6Q3S.js.map +1 -0
- package/dist/chunk-PMJG7PHU.js +1 -0
- package/dist/chunk-PMJG7PHU.js.map +1 -0
- package/dist/chunk-PP2VSA6M.js +1 -0
- package/dist/chunk-PP2VSA6M.js.map +1 -0
- package/dist/chunk-Q22LXT53.js +1 -0
- package/dist/chunk-Q22LXT53.js.map +1 -0
- package/dist/chunk-Q5MR36RW.js +1 -0
- package/dist/chunk-Q5MR36RW.js.map +1 -0
- package/dist/chunk-Q5XOGATC.js +1 -0
- package/dist/chunk-Q5XOGATC.js.map +1 -0
- package/dist/chunk-QTDBO7R2.js +1 -0
- package/dist/chunk-QTDBO7R2.js.map +1 -0
- package/dist/chunk-R4OD62HV.js +1 -0
- package/dist/chunk-R4OD62HV.js.map +1 -0
- package/dist/chunk-RD73TFGS.js +1 -0
- package/dist/chunk-RD73TFGS.js.map +1 -0
- package/dist/chunk-RIT6MOO5.js +1 -0
- package/dist/chunk-RIT6MOO5.js.map +1 -0
- package/dist/chunk-RVSXKQHE.js +1 -0
- package/dist/chunk-RVSXKQHE.js.map +1 -0
- package/dist/chunk-S4DBNX2B.js +1 -0
- package/dist/chunk-S4DBNX2B.js.map +1 -0
- package/dist/chunk-S4UWCHL6.js +1 -0
- package/dist/chunk-S4UWCHL6.js.map +1 -0
- package/dist/chunk-SQS7672E.js +1 -0
- package/dist/chunk-SQS7672E.js.map +1 -0
- package/dist/chunk-TLNHETGC.js +1 -0
- package/dist/chunk-TLNHETGC.js.map +1 -0
- package/dist/chunk-U6TMCYA6.js +1 -0
- package/dist/chunk-U6TMCYA6.js.map +1 -0
- package/dist/chunk-V4C6FIE2.js +1 -0
- package/dist/chunk-V4C6FIE2.js.map +1 -0
- package/dist/chunk-VXVUEF5U.js +1 -0
- package/dist/chunk-VXVUEF5U.js.map +1 -0
- package/dist/chunk-VZXL5KBR.js +1 -0
- package/dist/chunk-VZXL5KBR.js.map +1 -0
- package/dist/chunk-VZZ2XIRE.js +1 -0
- package/dist/chunk-VZZ2XIRE.js.map +1 -0
- package/dist/chunk-WV5YM7H5.js +1 -0
- package/dist/chunk-WV5YM7H5.js.map +1 -0
- package/dist/chunk-Y2MUIE5W.js +1 -0
- package/dist/chunk-Y2MUIE5W.js.map +1 -0
- package/dist/chunk-Z43DN4PY.js +1 -0
- package/dist/chunk-Z43DN4PY.js.map +1 -0
- package/dist/chunk-Z4GTTB7I.js +1 -0
- package/dist/chunk-Z4GTTB7I.js.map +1 -0
- package/dist/chunk-Z4OUB4SJ.js +1 -0
- package/dist/chunk-Z4OUB4SJ.js.map +1 -0
- package/dist/chunk-ZFT56QFR.js +1 -0
- package/dist/chunk-ZFT56QFR.js.map +1 -0
- package/dist/chunk-ZNCXENNB.js +1 -0
- package/dist/chunk-ZNCXENNB.js.map +1 -0
- package/dist/commodities/commodities-all.d.ts +25 -0
- package/dist/commodities/commodities-all.js +1 -0
- package/dist/commodities/commodities-all.js.map +1 -0
- package/dist/commodities/commodities-rare.d.ts +34 -0
- package/dist/commodities/commodities-rare.js +1 -0
- package/dist/commodities/commodities-rare.js.map +1 -0
- package/dist/commodities/commodities-standard.d.ts +34 -0
- package/dist/commodities/commodities-standard.js +1 -0
- package/dist/commodities/commodities-standard.js.map +1 -0
- package/dist/commodities/commodities.d.ts +142 -0
- package/dist/commodities/commodities.js +1 -0
- package/dist/commodities/commodities.js.map +1 -0
- package/dist/commodities/index.d.ts +30 -0
- package/dist/commodities/index.js +1 -0
- package/dist/commodities/index.js.map +1 -0
- package/dist/galactic-position-shLkm4Qg.d.ts +30 -0
- package/dist/materials/index.d.ts +47 -0
- package/dist/materials/index.js +1 -0
- package/dist/materials/index.js.map +1 -0
- package/dist/materials/materials-all.d.ts +26 -0
- package/dist/materials/materials-all.js +1 -0
- package/dist/materials/materials-all.js.map +1 -0
- package/dist/materials/materials-encoded.d.ts +31 -0
- package/dist/materials/materials-encoded.js +1 -0
- package/dist/materials/materials-encoded.js.map +1 -0
- package/dist/materials/materials-manufactured.d.ts +32 -0
- package/dist/materials/materials-manufactured.js +1 -0
- package/dist/materials/materials-manufactured.js.map +1 -0
- package/dist/materials/materials-raw.d.ts +31 -0
- package/dist/materials/materials-raw.js +1 -0
- package/dist/materials/materials-raw.js.map +1 -0
- package/dist/materials/materials.d.ts +277 -0
- package/dist/materials/materials.js +1 -0
- package/dist/materials/materials.js.map +1 -0
- package/dist/materials/micro-resources-all.d.ts +28 -0
- package/dist/materials/micro-resources-all.js +1 -0
- package/dist/materials/micro-resources-all.js.map +1 -0
- package/dist/materials/micro-resources-component.d.ts +29 -0
- package/dist/materials/micro-resources-component.js +1 -0
- package/dist/materials/micro-resources-component.js.map +1 -0
- package/dist/materials/micro-resources-consumable.d.ts +29 -0
- package/dist/materials/micro-resources-consumable.js +1 -0
- package/dist/materials/micro-resources-consumable.js.map +1 -0
- package/dist/materials/micro-resources-data.d.ts +29 -0
- package/dist/materials/micro-resources-data.js +1 -0
- package/dist/materials/micro-resources-data.js.map +1 -0
- package/dist/materials/micro-resources-item.d.ts +29 -0
- package/dist/materials/micro-resources-item.js +1 -0
- package/dist/materials/micro-resources-item.js.map +1 -0
- package/dist/materials/micro-resources.d.ts +136 -0
- package/dist/materials/micro-resources.js +1 -0
- package/dist/materials/micro-resources.js.map +1 -0
- package/dist/ship-loadout-Ba63RDf-.d.ts +1059 -0
- package/dist/ships/ammunition.d.ts +107 -0
- package/dist/ships/ammunition.js +1 -0
- package/dist/ships/ammunition.js.map +1 -0
- package/dist/ships/armour.d.ts +134 -0
- package/dist/ships/armour.js +1 -0
- package/dist/ships/armour.js.map +1 -0
- package/dist/ships/blueprint-costs.d.ts +128 -0
- package/dist/ships/blueprint-costs.js +1 -0
- package/dist/ships/blueprint-costs.js.map +1 -0
- package/dist/ships/blueprint-journal.d.ts +116 -0
- package/dist/ships/blueprint-journal.js +1 -0
- package/dist/ships/blueprint-journal.js.map +1 -0
- package/dist/ships/blueprints.d.ts +103 -0
- package/dist/ships/blueprints.js +1 -0
- package/dist/ships/blueprints.js.map +1 -0
- package/dist/ships/decorative-modifications.d.ts +176 -0
- package/dist/ships/decorative-modifications.js +1 -0
- package/dist/ships/decorative-modifications.js.map +1 -0
- package/dist/ships/engineering-options.d.ts +246 -0
- package/dist/ships/engineering-options.js +1 -0
- package/dist/ships/engineering-options.js.map +1 -0
- package/dist/ships/engineering.d.ts +229 -0
- package/dist/ships/engineering.js +1 -0
- package/dist/ships/engineering.js.map +1 -0
- package/dist/ships/experimental-effect-costs.d.ts +56 -0
- package/dist/ships/experimental-effect-costs.js +1 -0
- package/dist/ships/experimental-effect-costs.js.map +1 -0
- package/dist/ships/experimental-effects.d.ts +62 -0
- package/dist/ships/experimental-effects.js +1 -0
- package/dist/ships/experimental-effects.js.map +1 -0
- package/dist/ships/index.d.ts +205 -0
- package/dist/ships/index.js +1 -0
- package/dist/ships/index.js.map +1 -0
- package/dist/ships/jump-range.d.ts +115 -0
- package/dist/ships/jump-range.js +1 -0
- package/dist/ships/jump-range.js.map +1 -0
- package/dist/ships/loadout-calculations.d.ts +109 -0
- package/dist/ships/loadout-calculations.js +1 -0
- package/dist/ships/loadout-calculations.js.map +1 -0
- package/dist/ships/loadout-validation.d.ts +80 -0
- package/dist/ships/loadout-validation.js +1 -0
- package/dist/ships/loadout-validation.js.map +1 -0
- package/dist/ships/module-capabilities.d.ts +205 -0
- package/dist/ships/module-capabilities.js +1 -0
- package/dist/ships/module-capabilities.js.map +1 -0
- package/dist/ships/modules-all.d.ts +43 -0
- package/dist/ships/modules-all.js +1 -0
- package/dist/ships/modules-all.js.map +1 -0
- package/dist/ships/modules-core.d.ts +40 -0
- package/dist/ships/modules-core.js +1 -0
- package/dist/ships/modules-core.js.map +1 -0
- package/dist/ships/modules-hardpoint.d.ts +42 -0
- package/dist/ships/modules-hardpoint.js +1 -0
- package/dist/ships/modules-hardpoint.js.map +1 -0
- package/dist/ships/modules-internal.d.ts +40 -0
- package/dist/ships/modules-internal.js +1 -0
- package/dist/ships/modules-internal.js.map +1 -0
- package/dist/ships/modules-utility.d.ts +40 -0
- package/dist/ships/modules-utility.js +1 -0
- package/dist/ships/modules-utility.js.map +1 -0
- package/dist/ships/modules.d.ts +755 -0
- package/dist/ships/modules.js +1 -0
- package/dist/ships/modules.js.map +1 -0
- package/dist/ships/power.d.ts +168 -0
- package/dist/ships/power.js +1 -0
- package/dist/ships/power.js.map +1 -0
- package/dist/ships/pre-engineered-stats.d.ts +147 -0
- package/dist/ships/pre-engineered-stats.js +1 -0
- package/dist/ships/pre-engineered-stats.js.map +1 -0
- package/dist/ships/pre-engineered.d.ts +215 -0
- package/dist/ships/pre-engineered.js +1 -0
- package/dist/ships/pre-engineered.js.map +1 -0
- package/dist/ships/resistances.d.ts +208 -0
- package/dist/ships/resistances.js +1 -0
- package/dist/ships/resistances.js.map +1 -0
- package/dist/ships/shields.d.ts +221 -0
- package/dist/ships/shields.js +1 -0
- package/dist/ships/shields.js.map +1 -0
- package/dist/ships/ship-loadout.d.ts +16 -0
- package/dist/ships/ship-loadout.js +1 -0
- package/dist/ships/ship-loadout.js.map +1 -0
- package/dist/ships/ships.d.ts +191 -0
- package/dist/ships/ships.js +1 -0
- package/dist/ships/ships.js.map +1 -0
- package/dist/ships/slef.d.ts +318 -0
- package/dist/ships/slef.js +1 -0
- package/dist/ships/slef.js.map +1 -0
- package/dist/ships/slots.d.ts +418 -0
- package/dist/ships/slots.js +1 -0
- package/dist/ships/slots.js.map +1 -0
- package/dist/ships/source-purchase.d.ts +132 -0
- package/dist/ships/source-purchase.js +1 -0
- package/dist/ships/source-purchase.js.map +1 -0
- package/dist/ships/weapons.d.ts +380 -0
- package/dist/ships/weapons.js +1 -0
- package/dist/ships/weapons.js.map +1 -0
- package/dist/system-address-DYsN1qOT.d.ts +313 -0
- package/package.json +375 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The 42 **galactic codex regions** of Elite Dangerous, as structured per-region
|
|
3
|
+
* objects.
|
|
4
|
+
*
|
|
5
|
+
* Every star system in the galaxy belongs to exactly one of 42 named regions (plus
|
|
6
|
+
* an implicit "outside the map"). This module exposes each region as a
|
|
7
|
+
* {@link CodexRegion} object carrying its id, name and pre-computed footprint —
|
|
8
|
+
* area, axis-aligned bounds and centroid on the galactic plane — so consumers can
|
|
9
|
+
* read per-region facts without touching the (much larger) lookup geometry.
|
|
10
|
+
* Resolving a *coordinate or `id64`* to a region lives in `./codex-region-lookup`,
|
|
11
|
+
* which loads the separate cell grid.
|
|
12
|
+
*
|
|
13
|
+
* The region ids and names come from klightspeed's EliteDangerousRegionMap; the
|
|
14
|
+
* footprint fields are derived from its grayscale region map. See the attribution
|
|
15
|
+
* in [`data/astro/galactic-regions.jsonc`](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/data/astro/galactic-regions.jsonc).
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Region ids are 1–42; id `0` means "outside the mapped region grid" and has no
|
|
19
|
+
* {@link CodexRegion} object.
|
|
20
|
+
*
|
|
21
|
+
* @packageDocumentation
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* A 2-D point on the galactic plane (X east/west, Z toward/away from the core),
|
|
25
|
+
* in light-years.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import type { GalacticPlanePosition } from '@elite-dangerous-almanac/core/astro/codex-region';
|
|
30
|
+
*
|
|
31
|
+
* const point: GalacticPlanePosition = { x: 0, z: 0 };
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
interface GalacticPlanePosition {
|
|
35
|
+
/** Galactic X coordinate, in light-years. */
|
|
36
|
+
readonly x: number;
|
|
37
|
+
/** Galactic Z coordinate, in light-years. */
|
|
38
|
+
readonly z: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Axis-aligned bounds of a region on the galactic plane, in light-years.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* The region map is two-dimensional (X/Z only); the vertical Y axis is not encoded,
|
|
45
|
+
* so regions have no Y extent here.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* import type { CodexRegionBounds } from '@elite-dangerous-almanac/core/astro/codex-region';
|
|
50
|
+
*
|
|
51
|
+
* const bounds: CodexRegionBounds = {
|
|
52
|
+
* minX: -100, maxX: 100, minZ: -200, maxZ: 200,
|
|
53
|
+
* };
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
interface CodexRegionBounds {
|
|
57
|
+
/** Minimum galactic X, in light-years. */
|
|
58
|
+
readonly minX: number;
|
|
59
|
+
/** Maximum galactic X, in light-years. */
|
|
60
|
+
readonly maxX: number;
|
|
61
|
+
/** Minimum galactic Z, in light-years. */
|
|
62
|
+
readonly minZ: number;
|
|
63
|
+
/** Maximum galactic Z, in light-years. */
|
|
64
|
+
readonly maxZ: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A single Elite Dangerous galactic codex region.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* Footprint fields ({@link CodexRegion.areaLy2}, {@link CodexRegion.bounds},
|
|
71
|
+
* {@link CodexRegion.centroid}) are approximations derived from the ≈49.35 ly
|
|
72
|
+
* region grid, not survey-precise figures.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* import { getCodexRegionByName } from '@elite-dangerous-almanac/core/astro/codex-region';
|
|
77
|
+
* import type { CodexRegion } from '@elite-dangerous-almanac/core/astro/codex-region';
|
|
78
|
+
*
|
|
79
|
+
* const innerOrionSpur: CodexRegion | null = getCodexRegionByName('Inner Orion Spur');
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
interface CodexRegion {
|
|
83
|
+
/** Region id, 1–42. Stable across releases; matches the codex region ordering. */
|
|
84
|
+
readonly id: number;
|
|
85
|
+
/** Human-readable region name, e.g. `"Inner Orion Spur"`. */
|
|
86
|
+
readonly name: string;
|
|
87
|
+
/**
|
|
88
|
+
* Grayscale value this region has in the upstream `RegionMap.png`
|
|
89
|
+
* (`0xA8` for region 1, decreasing by 4 per id). Useful when cross-referencing
|
|
90
|
+
* the source image.
|
|
91
|
+
*/
|
|
92
|
+
readonly grayscale: number;
|
|
93
|
+
/** Number of grid cells the region occupies (each cell ≈49.35 ly square). */
|
|
94
|
+
readonly cellCount: number;
|
|
95
|
+
/** Approximate footprint area on the galactic plane, in square light-years. */
|
|
96
|
+
readonly areaLy2: number;
|
|
97
|
+
/** Axis-aligned bounds on the galactic plane, in light-years. */
|
|
98
|
+
readonly bounds: CodexRegionBounds;
|
|
99
|
+
/** Cell-weighted centroid on the galactic plane, in light-years. */
|
|
100
|
+
readonly centroid: GalacticPlanePosition;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* All 42 galactic regions, ordered by id (index `i` holds region id `i + 1`).
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* This loads only `galactic-regions.jsonc` (region metadata); the lookup cell grid
|
|
107
|
+
* lives in a separate module, so importing this never bundles it.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* import { CODEX_REGIONS } from '@elite-dangerous-almanac/core/astro/codex-region';
|
|
112
|
+
*
|
|
113
|
+
* CODEX_REGIONS.length; // -> 42
|
|
114
|
+
* CODEX_REGIONS[0]?.name; // -> 'Galactic Centre'
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
declare const CODEX_REGIONS: readonly CodexRegion[];
|
|
118
|
+
/**
|
|
119
|
+
* Look up a region by its id.
|
|
120
|
+
*
|
|
121
|
+
* @param id - Region id, 1–42.
|
|
122
|
+
* @returns The {@link CodexRegion}, or `null` if `id` is `0` (outside the map)
|
|
123
|
+
* or otherwise unknown.
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { getCodexRegion } from '@elite-dangerous-almanac/core/astro/codex-region';
|
|
127
|
+
*
|
|
128
|
+
* getCodexRegion(18)?.name; // -> 'Inner Orion Spur'
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
declare function getCodexRegion(id: number): CodexRegion | null;
|
|
132
|
+
/**
|
|
133
|
+
* Look up a region by name (case-insensitive).
|
|
134
|
+
*
|
|
135
|
+
* @param name - The region name, e.g. `"Inner Orion Spur"`. Matching ignores case
|
|
136
|
+
* and surrounding whitespace.
|
|
137
|
+
* @returns The {@link CodexRegion}, or `null` if no region has that name.
|
|
138
|
+
* @throws {TypeError} If `name` is present and not a string. A nullish
|
|
139
|
+
* `name` is a miss, answered the way an unrecognised one is.
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* import { getCodexRegionByName } from '@elite-dangerous-almanac/core/astro/codex-region';
|
|
143
|
+
*
|
|
144
|
+
* getCodexRegionByName('the void')?.id; // -> 42
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
declare function getCodexRegionByName(name: string): CodexRegion | null;
|
|
148
|
+
|
|
149
|
+
export { CODEX_REGIONS, type CodexRegion, type CodexRegionBounds, type GalacticPlanePosition, getCodexRegion, getCodexRegionByName };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{CODEX_REGIONS,getCodexRegion,getCodexRegionByName}from"../chunk-NWPK6Q3S.js"; //# sourceMappingURL=codex-region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { G as GalacticPosition } from '../galactic-position-shLkm4Qg.js';
|
|
2
|
+
import { SectorGridPosition } from './sector-name.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Turning a **galactic position** into a place on the procedural naming grid.
|
|
6
|
+
*
|
|
7
|
+
* `./sector-name` maps a *sector index* to a name, and `./system-address` works in
|
|
8
|
+
* *internal units* (32 per light-year, measured from the galaxy's corner). Neither
|
|
9
|
+
* speaks the units a consumer actually holds: light-years with Sol at the origin,
|
|
10
|
+
* as reported by the player journal, EDSM and Spansh. This module is the bridge —
|
|
11
|
+
* it converts {@link GalacticPosition} to the {@link SectorGridPosition} those functions
|
|
12
|
+
* want, so `sectorNameFromGridPosition` can be driven from real data.
|
|
13
|
+
*
|
|
14
|
+
* The three coordinate conventions on the public surface, in one place:
|
|
15
|
+
*
|
|
16
|
+
* | Convention | Unit | Origin | Where |
|
|
17
|
+
* | --- | --- | --- | --- |
|
|
18
|
+
* | {@link GalacticPosition} | light-years | Sol | journal, EDSM, Spansh, this module's input |
|
|
19
|
+
* | {@link SectorGridPosition} | 1280 ly sector cubes (0–127) | galaxy corner | `sectorNameFromGridPosition` |
|
|
20
|
+
* | internal units | 1/32 light-year | galaxy corner | `NamingRegionOrigin`, boxel maths |
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The galaxy's origin corner in galactic light-years — the point sector index
|
|
27
|
+
* `0/0/0` starts at.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Sector and boxel positions are measured from this corner, which is why an
|
|
31
|
+
* `id64`'s grid position has to be offset by it to become a position relative to
|
|
32
|
+
* Sol. The same triple is published as `CODEX_REGION_MAP_X0` / `_Y0` / `_Z0` by
|
|
33
|
+
* `./codex-region-lookup` (where it arrives with the region-cell data); it is
|
|
34
|
+
* repeated here as a plain constant so converting a coordinate never pulls in the
|
|
35
|
+
* region grid. A test asserts the two agree.
|
|
36
|
+
*/
|
|
37
|
+
declare const GALAXY_ORIGIN: Readonly<GalacticPosition>;
|
|
38
|
+
/** Edge length of one procedural sector cube, in light-years. */
|
|
39
|
+
declare const SECTOR_EDGE_LY = 1280;
|
|
40
|
+
/**
|
|
41
|
+
* The sector cube a galactic position falls in.
|
|
42
|
+
*
|
|
43
|
+
* @param position - Galactic position in **light-years, Sol at the origin** (a journal
|
|
44
|
+
* `StarPos`, an EDSM/Spansh coordinate, a `ProceduralSystem.position`).
|
|
45
|
+
* @returns The integer {@link SectorGridPosition} of the 1280 ly sector cube containing
|
|
46
|
+
* that point, ready for {@link sectorNameFromGridPosition}.
|
|
47
|
+
* @throws {RangeError} If the position lies outside the 128×128×128 sector grid
|
|
48
|
+
* (i.e. outside the addressable galaxy). The message names the offending position.
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { sectorGridPositionFromGalacticPosition } from '@elite-dangerous-almanac/core/astro/galaxy-grid';
|
|
52
|
+
*
|
|
53
|
+
* // Synuefe EN-H d11-96 sits at (751, -179, -91) per EDSM
|
|
54
|
+
* sectorGridPositionFromGalacticPosition({ x: 751, y: -179, z: -91 });
|
|
55
|
+
* // -> { sectorX: 39, sectorY: 31, sectorZ: 18 }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare function sectorGridPositionFromGalacticPosition(position: GalacticPosition): SectorGridPosition;
|
|
59
|
+
/**
|
|
60
|
+
* The procedural sector name for a galactic position.
|
|
61
|
+
*
|
|
62
|
+
* The one-call form of {@link sectorGridPositionFromGalacticPosition} followed by
|
|
63
|
+
* {@link sectorNameFromGridPosition} — "which sector is this point in?".
|
|
64
|
+
*
|
|
65
|
+
* @param position - Galactic position in **light-years, Sol at the origin**.
|
|
66
|
+
* @returns The canonically-cased procedural sector name (e.g. `Synuefe`,
|
|
67
|
+
* `Blae Eock`).
|
|
68
|
+
* @throws {RangeError} If the position lies outside the sector grid, or the grid
|
|
69
|
+
* slot has no procedurally assigned name.
|
|
70
|
+
* @remarks
|
|
71
|
+
* This is always the *procedural* sector. A system inside a hand-authored region
|
|
72
|
+
* (Pleiades, Coalsack, …) is named after that region instead — resolve those with
|
|
73
|
+
* {@link findHandAuthoredRegionAt} from `./hand-authored-regions`.
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* import { sectorNameFromGalacticPosition } from '@elite-dangerous-almanac/core/astro/galaxy-grid';
|
|
77
|
+
*
|
|
78
|
+
* sectorNameFromGalacticPosition({ x: 751, y: -179, z: -91 }); // -> 'Synuefe'
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
declare function sectorNameFromGalacticPosition(position: GalacticPosition): string;
|
|
82
|
+
|
|
83
|
+
export { GALAXY_ORIGIN, SECTOR_EDGE_LY, sectorGridPositionFromGalacticPosition, sectorNameFromGalacticPosition };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{GALAXY_ORIGIN,SECTOR_EDGE_LY,sectorGridPositionFromGalacticPosition,sectorNameFromGalacticPosition}from"../chunk-U6TMCYA6.js"; //# sourceMappingURL=galaxy-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { G as GalacticPosition } from '../galactic-position-shLkm4Qg.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hand-authored named sectors, resolved by galactic position.
|
|
5
|
+
*
|
|
6
|
+
* The procedural generator only produces the boxel name for a position. Systems
|
|
7
|
+
* that physically fall inside a hand-authored nebula or cluster region (Pleiades,
|
|
8
|
+
* Coalsack, the NGC/IC/Col catalogues, …) are instead displayed by the game under
|
|
9
|
+
* that region's name. Each region is one or more spheres in galactic light-years
|
|
10
|
+
* (Sol at the origin); membership is first-match sphere containment.
|
|
11
|
+
*
|
|
12
|
+
* Sphere records are compiled and cross-checked against EDSM and Spansh; see
|
|
13
|
+
* [`data/astro/SOURCES.md`](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/data/astro/SOURCES.md) for provenance and source terms.
|
|
14
|
+
*
|
|
15
|
+
* The list is pre-sorted **smallest-radius-first**, which reproduces the game's
|
|
16
|
+
* overlap priority: when spheres overlap, the most specific (smallest) region
|
|
17
|
+
* wins. Data is loaded once from shared JSON ([`data/astro/`](https://github.com/DarkSession/Elite-Dangerous-Almanac/tree/main/data/astro)).
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* "Region" is overloaded in this galaxy. A {@link HandAuthoredRegion} is a *hand-authored
|
|
21
|
+
* named sector* (Pleiades, Coalsack, …) — not to be confused with a **procedural
|
|
22
|
+
* sector** (`./sector-name`) or a **galactic codex region** (`./codex-region`,
|
|
23
|
+
* the 42 codex zones). Use {@link findHandAuthoredRegionAt} here for the first, and
|
|
24
|
+
* `findCodexRegionAt` from `./codex-region-lookup` for the third.
|
|
25
|
+
*
|
|
26
|
+
* @packageDocumentation
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* One sphere of a hand-authored region (centre and radius in light-years).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import type { HandAuthoredSphere } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';
|
|
35
|
+
*
|
|
36
|
+
* const sphere: HandAuthoredSphere = { cx: -80.6, cy: -146.7, cz: -343.3, r: 100 };
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
interface HandAuthoredSphere {
|
|
40
|
+
/** Sphere centre X in light-years (Sol at origin). */
|
|
41
|
+
readonly cx: number;
|
|
42
|
+
/** Sphere centre Y in light-years. */
|
|
43
|
+
readonly cy: number;
|
|
44
|
+
/** Sphere centre Z in light-years. */
|
|
45
|
+
readonly cz: number;
|
|
46
|
+
/** Sphere radius in light-years. */
|
|
47
|
+
readonly r: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A hand-authored named sector: its canonical name and the spheres it occupies.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Whether the region needs a permit is not stored here — 28 of these regions are
|
|
54
|
+
* permit-locked, and `isPermitLockedRegionName` in `./permit-locks` is the single
|
|
55
|
+
* place that knows which. Pass {@link HandAuthoredRegion.name} to it.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { HAND_AUTHORED_REGIONS } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';
|
|
60
|
+
*
|
|
61
|
+
* const pleiades = HAND_AUTHORED_REGIONS.find((region) => region.name === 'Pleiades Sector');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
interface HandAuthoredRegion {
|
|
65
|
+
/** Canonically-cased region name, e.g. `Pleiades Sector`. */
|
|
66
|
+
readonly name: string;
|
|
67
|
+
/** The spheres whose union defines the region's volume. */
|
|
68
|
+
readonly spheres: readonly HandAuthoredSphere[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* All hand-authored regions, sorted smallest-radius-first (overlap priority).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* import { HAND_AUTHORED_REGIONS } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';
|
|
76
|
+
*
|
|
77
|
+
* HAND_AUTHORED_REGIONS[0]?.name;
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare const HAND_AUTHORED_REGIONS: readonly HandAuthoredRegion[];
|
|
81
|
+
/**
|
|
82
|
+
* The hand-authored region containing a galactic point, or `null` for procedural
|
|
83
|
+
* space.
|
|
84
|
+
*
|
|
85
|
+
* Because {@link HAND_AUTHORED_REGIONS} is sorted smallest-radius-first, the first region
|
|
86
|
+
* whose sphere set contains the point is the most specific one — matching the
|
|
87
|
+
* game's overlap priority.
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* This resolves a *hand-authored named sector* only. For the codex region a point
|
|
91
|
+
* falls in, use `findCodexRegionAt` from `./codex-region-lookup` instead.
|
|
92
|
+
*
|
|
93
|
+
* @param position - Galactic position in light-years (Sol at origin). All three axes
|
|
94
|
+
* are used — hand-authored regions are 3-D spheres, so `y` matters here (unlike the
|
|
95
|
+
* flat `findCodexRegionAt`). A {@link ProceduralSystem.position} value can be passed directly.
|
|
96
|
+
* @returns The containing region, or `null` if the point is in procedural space.
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* import { findHandAuthoredRegionAt } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';
|
|
100
|
+
*
|
|
101
|
+
* findHandAuthoredRegionAt({ x: -80.6, y: -146.7, z: -343.3 })?.name;
|
|
102
|
+
* // -> 'Pleiades Sector'
|
|
103
|
+
* ```
|
|
104
|
+
* @example
|
|
105
|
+
* Resolving a permit lock from a position — the exact route, since it does not
|
|
106
|
+
* depend on how the system is named:
|
|
107
|
+
* ```ts
|
|
108
|
+
* import type { GalacticPosition } from '@elite-dangerous-almanac/core/astro';
|
|
109
|
+
* import { findHandAuthoredRegionAt } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';
|
|
110
|
+
*
|
|
111
|
+
* declare const position: GalacticPosition;
|
|
112
|
+
*
|
|
113
|
+
* import { isPermitLockedRegionName } from '@elite-dangerous-almanac/core/astro/permit-locked-regions';
|
|
114
|
+
*
|
|
115
|
+
* const region = findHandAuthoredRegionAt(position);
|
|
116
|
+
* const needsPermit = region !== null && isPermitLockedRegionName(region.name);
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
declare function findHandAuthoredRegionAt(position: GalacticPosition): HandAuthoredRegion | null;
|
|
120
|
+
|
|
121
|
+
export { HAND_AUTHORED_REGIONS, type HandAuthoredRegion, type HandAuthoredSphere, findHandAuthoredRegionAt };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{HAND_AUTHORED_REGIONS,findHandAuthoredRegionAt}from"../chunk-AVZI6VKA.js"; //# sourceMappingURL=hand-authored-regions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Astrophysical data and calculations for the Elite Dangerous galaxy.
|
|
3
|
+
*
|
|
4
|
+
* This entry point re-exports the astro feature area's general API. Every symbol here
|
|
5
|
+
* is also reachable from its own module, so bundlers can drop anything you do not use.
|
|
6
|
+
* The 42-region coordinate lookup stays on `./codex-region-lookup`: its map geometry is
|
|
7
|
+
* large enough that native ESM and namespace consumers must opt into it explicitly.
|
|
8
|
+
*
|
|
9
|
+
* **Start with {@link ProceduralSystem}** — it composes the pieces below into one
|
|
10
|
+
* immutable handle (name ⇄ `id64`, sector, mass code, hand-authored regions). Drop
|
|
11
|
+
* to the individual functions when you need just one calculation.
|
|
12
|
+
*
|
|
13
|
+
* **A note on the word "region".** It means four different things here; the
|
|
14
|
+
* exports are grouped to keep them apart:
|
|
15
|
+
* - *procedural sector* — {@link sectorNameFromGridPosition} & co. (the boxel grid name).
|
|
16
|
+
* - *naming-region origin* — {@link resolveNamingRegionOrigin} (a sector's corner, for `id64`).
|
|
17
|
+
* - *hand-authored region* — {@link findHandAuthoredRegionAt} (Pleiades, Coalsack, …).
|
|
18
|
+
* - *galactic codex region* —
|
|
19
|
+
* {@link astro/codex-region-lookup!findCodexRegionAt | findCodexRegionAt} (one of the 42 codex zones).
|
|
20
|
+
*
|
|
21
|
+
* None of those is the **nebula catalogue** — the nebulae themselves, and where
|
|
22
|
+
* they are: {@link nearestNebulae} & co. over {@link REAL_NEBULAE},
|
|
23
|
+
* {@link PROCGEN_NEBULAE}, and — on their own subpaths, so importing one never bundles
|
|
24
|
+
* the rest — {@link astro/nebulae-planetary!PLANETARY_NEBULAE | PLANETARY_NEBULAE} and
|
|
25
|
+
* {@link astro/nebulae-all!ALL_NEBULAE | ALL_NEBULAE}.
|
|
26
|
+
*
|
|
27
|
+
* **Coordinate spaces have different shapes.**
|
|
28
|
+
* {@link GalacticPosition} is `{x, y, z}` in light-years with Sol at the origin — what the journal,
|
|
29
|
+
* EDSM and Spansh report, and what {@link findHandAuthoredRegionAt} and
|
|
30
|
+
* {@link nearestNebulae} take.
|
|
31
|
+
* {@link SectorGridPosition} uses `{sectorX, sectorY, sectorZ}` integer indices on the
|
|
32
|
+
* 1280 ly naming grid, which is what {@link sectorNameFromGridPosition} takes. The
|
|
33
|
+
* distinct axis names prevent accidentally passing light-years as sector indices.
|
|
34
|
+
* Convert a real position with {@link sectorGridPositionFromGalacticPosition} (or go
|
|
35
|
+
* straight to {@link sectorNameFromGalacticPosition}).
|
|
36
|
+
*
|
|
37
|
+
* {@link astro/codex-region-lookup!findCodexRegionAt | findCodexRegionAt} reads only
|
|
38
|
+
* `{x, z}`, because the region map is an X/Z projection; it takes a `GalacticPosition`
|
|
39
|
+
* as it comes and ignores the `y`.
|
|
40
|
+
*
|
|
41
|
+
* **Permit locks** are six similarly-named lookups; {@link permitLockForSystemName}
|
|
42
|
+
* is the one to start from (it answers for both kinds of lock, from a name alone).
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* Start here: a name in, an `id64` out, and back again.
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { ProceduralSystem } from '@elite-dangerous-almanac/core/astro/procedural-system';
|
|
49
|
+
*
|
|
50
|
+
* const system = ProceduralSystem.fromName('Synuefe EN-H d11-96');
|
|
51
|
+
* system?.systemAddress; // -> 3309179996515n
|
|
52
|
+
* system?.namingRegionName; // -> 'Synuefe'
|
|
53
|
+
* system?.massCode; // -> 'd'
|
|
54
|
+
*
|
|
55
|
+
* ProceduralSystem.fromSystemAddress(3309179996515n).name; // -> 'Synuefe EN-H d11-96'
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* `fromName` returns `null` for a string that is not a procedural name — Sol and the
|
|
59
|
+
* other hand-named systems are deliberately outside this type.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* The four meanings of "region", all answered for one position — the Pleiades. They
|
|
63
|
+
* disagree, which is the point: each names a different thing.
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { sectorNameFromGalacticPosition } from '@elite-dangerous-almanac/core/astro/galaxy-grid';
|
|
67
|
+
* import { resolveNamingRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
|
|
68
|
+
* import { findHandAuthoredRegionAt } from '@elite-dangerous-almanac/core/astro/hand-authored-regions';
|
|
69
|
+
* import { findCodexRegionAt } from '@elite-dangerous-almanac/core/astro/codex-region-lookup';
|
|
70
|
+
*
|
|
71
|
+
* const position = { x: -81.625, y: -151.3125, z: -376.0625 };
|
|
72
|
+
*
|
|
73
|
+
* sectorNameFromGalacticPosition(position); // -> 'Synuefai' procedural sector
|
|
74
|
+
* findHandAuthoredRegionAt(position)?.name; // -> 'Pleiades Sector' hand-authored region
|
|
75
|
+
* findCodexRegionAt(position)?.name; // -> 'Inner Orion Spur' codex region
|
|
76
|
+
* resolveNamingRegionOrigin('Synuefai')?.x0; // -> 1556480 naming-region origin
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* And the nebula catalogue, which is none of those — it answers "what is *near* here":
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* import { nearestNebulae } from '@elite-dangerous-almanac/core/astro/nebulae';
|
|
83
|
+
* import { REAL_NEBULAE } from '@elite-dangerous-almanac/core/astro/nebulae-real';
|
|
84
|
+
*
|
|
85
|
+
* const position = { x: -81.625, y: -151.3125, z: -376.0625 };
|
|
86
|
+
*
|
|
87
|
+
* nearestNebulae(position, REAL_NEBULAE, 2).map((n) => [n.name, n.distanceLy]);
|
|
88
|
+
* // -> [['Pleiades', 32.74…], ['Taurus Dark Region', 91.07…]]
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* The catalogue argument is required here rather than defaulted: `ALL_NEBULAE` is
|
|
92
|
+
* 431.7 KiB, so importing it must be your decision.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* The two coordinate spaces, side by side. Light-years and sector indices are both
|
|
96
|
+
* three numbers, so the axis names are what stop you mixing them up.
|
|
97
|
+
*
|
|
98
|
+
* ```ts
|
|
99
|
+
* import { sectorGridPositionFromGalacticPosition } from '@elite-dangerous-almanac/core/astro/galaxy-grid';
|
|
100
|
+
* import { sectorNameFromGridPosition } from '@elite-dangerous-almanac/core/astro/sector-name';
|
|
101
|
+
*
|
|
102
|
+
* // GalacticPosition: light-years from Sol — what a journal or EDSM gives you.
|
|
103
|
+
* const position = { x: -81.625, y: -151.3125, z: -376.0625 };
|
|
104
|
+
*
|
|
105
|
+
* // SectorGridPosition: integer indices on the 1280 ly naming grid.
|
|
106
|
+
* const grid = sectorGridPositionFromGalacticPosition(position);
|
|
107
|
+
* grid; // -> { sectorX: 38, sectorY: 31, sectorZ: 18 }
|
|
108
|
+
*
|
|
109
|
+
* sectorNameFromGridPosition(grid); // -> 'Synuefai'
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* Permit locks come in two kinds, and one lookup answers for both from a name alone.
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { permitLockForSystemName } from '@elite-dangerous-almanac/core/astro/permit-locks';
|
|
117
|
+
*
|
|
118
|
+
* permitLockForSystemName('Sol')?.kind; // -> 'system' individually locked
|
|
119
|
+
* permitLockForSystemName('Col 70 Sector AB-C d1-23')?.kind; // -> 'region' the whole region is locked
|
|
120
|
+
* permitLockForSystemName('Synuefe EN-H d11-96'); // -> null not locked at all
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @packageDocumentation
|
|
124
|
+
*/
|
|
125
|
+
export { ProceduralSystem } from './procedural-system.js';
|
|
126
|
+
export { G as GalacticPosition } from '../galactic-position-shLkm4Qg.js';
|
|
127
|
+
export { BoxelLetters, IsProceduralSystemNameOptions, SystemNameParts, boxelCodeToLetters, canonicalizeSystemName, formatSystemName, isProceduralSystemName, lettersToBoxelCode, parseSystemName } from './system-name.js';
|
|
128
|
+
export { A as AbsoluteBoxel, D as DecodedAddress, N as NamingRegionOrigin, S as SECTOR_INTERNAL_SIZE, a as absoluteBoxelToBoxelCode, b as boxelCodeToAbsoluteBoxel, c as boxelInternalSize, d as decodeModSystemAddress, e as decodeSystemAddress, f as encodeModSystemAddress, g as encodeSystemAddress, h as getHandAuthoredRegionOrigin, r as resolveNamingRegionOrigin } from '../system-address-DYsN1qOT.js';
|
|
129
|
+
export { SystemAddressInput, toSystemAddress, tryToSystemAddress } from './system-address-input.js';
|
|
130
|
+
export { SectorGridPosition, canonicalizeSectorName, sectorGridPositionFromName, sectorNameFromGridPosition } from './sector-name.js';
|
|
131
|
+
export { GALAXY_ORIGIN, SECTOR_EDGE_LY, sectorGridPositionFromGalacticPosition, sectorNameFromGalacticPosition } from './galaxy-grid.js';
|
|
132
|
+
export { BASE_BOXEL_LY, MASS_CODE_COUNT, boxelEdgeLy, massCodeToSizeClass, sizeClassToMassCode } from './mass-code.js';
|
|
133
|
+
export { HAND_AUTHORED_REGIONS, HandAuthoredRegion, HandAuthoredSphere, findHandAuthoredRegionAt } from './hand-authored-regions.js';
|
|
134
|
+
export { PermitLock, isPermitLockedSystemName, permitLockForSystemName } from './permit-locks.js';
|
|
135
|
+
export { CODEX_REGIONS, CodexRegion, CodexRegionBounds, GalacticPlanePosition, getCodexRegion, getCodexRegionByName } from './codex-region.js';
|
|
136
|
+
export { Nebula, NebulaType, NebulaWithDistance, getNebulaByName, nearestNebulae, nebulaeWithin } from './nebulae.js';
|
|
137
|
+
export { REAL_NEBULAE } from './nebulae-real.js';
|
|
138
|
+
export { PROCGEN_NEBULAE } from './nebulae-procgen.js';
|
|
139
|
+
export { PERMIT_LOCKED_REGIONS, isPermitLockedRegionName, permitLockedRegionForSystemName } from './permit-locked-regions.js';
|
|
140
|
+
export { PERMIT_LOCKED_SYSTEMS, PermitLockedSystem, permitLockedSystemForAddress, permitLockedSystemForName } from './permit-locked-systems.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{getNebulaByName,nearestNebulae,nebulaeWithin}from"../chunk-ZFT56QFR.js";export{isPermitLockedSystemName,permitLockForSystemName}from"../chunk-MFV4VZFP.js";export{PERMIT_LOCKED_SYSTEMS,permitLockedSystemForAddress,permitLockedSystemForName}from"../chunk-WV5YM7H5.js";export{ProceduralSystem}from"../chunk-VXVUEF5U.js";export{boxelCodeToLetters,canonicalizeSystemName,formatSystemName,isProceduralSystemName,lettersToBoxelCode,parseSystemName}from"../chunk-JWJ7RSZC.js";export{PERMIT_LOCKED_REGIONS,isPermitLockedRegionName,permitLockedRegionForSystemName}from"../chunk-VZXL5KBR.js";export{CODEX_REGIONS,getCodexRegion,getCodexRegionByName}from"../chunk-NWPK6Q3S.js";export{GALAXY_ORIGIN,SECTOR_EDGE_LY,sectorGridPositionFromGalacticPosition,sectorNameFromGalacticPosition}from"../chunk-U6TMCYA6.js";export{HAND_AUTHORED_REGIONS,findHandAuthoredRegionAt}from"../chunk-AVZI6VKA.js";export{BASE_BOXEL_LY,MASS_CODE_COUNT,boxelEdgeLy,massCodeToSizeClass,sizeClassToMassCode}from"../chunk-DACZE3HX.js";export{getHandAuthoredRegionOrigin,resolveNamingRegionOrigin}from"../chunk-Z4GTTB7I.js";export{SECTOR_INTERNAL_SIZE,absoluteBoxelToBoxelCode,boxelCodeToAbsoluteBoxel,boxelInternalSize,decodeModSystemAddress,decodeSystemAddress,encodeModSystemAddress,encodeSystemAddress}from"../chunk-BTPV5CIF.js";export{toSystemAddress,tryToSystemAddress}from"../chunk-IH4NXKVW.js";export{canonicalizeSectorName,sectorGridPositionFromName,sectorNameFromGridPosition}from"../chunk-J2PNZQY4.js"; export{PROCGEN_NEBULAE}from"../chunk-K7F6WC4T.js";export{REAL_NEBULAE}from"../chunk-HI7FCS3G.js"; //# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mass-code helpers for Elite Dangerous procedural system names.
|
|
3
|
+
*
|
|
4
|
+
* The lower-case letter after the number-pair in a name (the `d` in
|
|
5
|
+
* `Synuefe EN-H d11-96`) is its **mass code** `a`–`h`. It selects the size of the
|
|
6
|
+
* boxel the system was generated in: an `a` boxel is 10 ly on a side and each
|
|
7
|
+
* subsequent code doubles it, up to `h` at 1280 ly (a whole sector). Internally
|
|
8
|
+
* the same value is the 0–7 **size class** used by the system-address bit layout.
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
/** Number of mass codes (`a`–`h`) / distinct size classes. */
|
|
13
|
+
declare const MASS_CODE_COUNT = 8;
|
|
14
|
+
/** Edge length of an `a`-class boxel, in light-years. */
|
|
15
|
+
declare const BASE_BOXEL_LY = 10;
|
|
16
|
+
/**
|
|
17
|
+
* Convert a mass-code letter to its 0–7 size class.
|
|
18
|
+
*
|
|
19
|
+
* @param code - A single letter `a`–`h` (case-insensitive).
|
|
20
|
+
* @returns The size class 0–7.
|
|
21
|
+
* @throws {TypeError} If `code` is not a string. A mass code is a required argument
|
|
22
|
+
* rather than a key to search for, so a missing one is loud too.
|
|
23
|
+
* @throws {RangeError} If `code` is a string but not a single letter in `a`–`h`.
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { massCodeToSizeClass } from '@elite-dangerous-almanac/core/astro/mass-code';
|
|
27
|
+
*
|
|
28
|
+
* massCodeToSizeClass('d'); // -> 3
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare function massCodeToSizeClass(code: string): number;
|
|
32
|
+
/**
|
|
33
|
+
* Convert a 0–7 size class to its mass-code letter.
|
|
34
|
+
*
|
|
35
|
+
* @param sizeClass - An integer 0–7.
|
|
36
|
+
* @returns The mass-code letter `a`–`h`.
|
|
37
|
+
* @throws {RangeError} If `sizeClass` is outside 0–7.
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { sizeClassToMassCode } from '@elite-dangerous-almanac/core/astro/mass-code';
|
|
41
|
+
*
|
|
42
|
+
* sizeClassToMassCode(3); // -> 'd'
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare function sizeClassToMassCode(sizeClass: number): string;
|
|
46
|
+
/**
|
|
47
|
+
* Edge length, in light-years, of a boxel of the given size class.
|
|
48
|
+
*
|
|
49
|
+
* @param sizeClass - An integer 0–7 (mass codes `a`–`h`).
|
|
50
|
+
* @returns The boxel edge length in light-years (10, 20, … 1280).
|
|
51
|
+
* @throws {RangeError} If `sizeClass` is not an integer from 0 through 7.
|
|
52
|
+
*/
|
|
53
|
+
declare function boxelEdgeLy(sizeClass: number): number;
|
|
54
|
+
|
|
55
|
+
export { BASE_BOXEL_LY, MASS_CODE_COUNT, boxelEdgeLy, massCodeToSizeClass, sizeClassToMassCode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{BASE_BOXEL_LY,MASS_CODE_COUNT,boxelEdgeLy,massCodeToSizeClass,sizeClassToMassCode}from"../chunk-DACZE3HX.js"; //# sourceMappingURL=mass-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{getHandAuthoredRegionOrigin,resolveNamingRegionOrigin}from"../chunk-Z4GTTB7I.js";export{SECTOR_INTERNAL_SIZE}from"../chunk-BTPV5CIF.js"; //# sourceMappingURL=naming-region-origins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Nebula } from './nebulae.js';
|
|
2
|
+
import '../galactic-position-shLkm4Qg.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The **complete** nebula catalogue: real, planetary and procedurally generated
|
|
6
|
+
* nebulae in one array.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* **This module pulls in every nebula catalogue (~432 KiB bundled)** — it exists for
|
|
10
|
+
* consumers that really do want to search all 5835 records (a "nearest nebula to my
|
|
11
|
+
* position" tool, say). If you only need one class, import that catalogue's module
|
|
12
|
+
* (`./nebulae-real`, `./nebulae-planetary`, `./nebulae-procgen`) and nothing else
|
|
13
|
+
* gets bundled.
|
|
14
|
+
*
|
|
15
|
+
* Data from EDAstro; see [ATTRIBUTIONS.md](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/ATTRIBUTIONS.md) for credit and licence terms.
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Every catalogued nebula — the concatenation of `REAL_NEBULAE`,
|
|
22
|
+
* `PLANETARY_NEBULAE` and `PROCGEN_NEBULAE`, in that order (each class sorted by
|
|
23
|
+
* name).
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Filter on {@link Nebula.type} to narrow it down after the fact — though importing
|
|
27
|
+
* the single catalogue you need is cheaper, since it keeps the others out of your
|
|
28
|
+
* bundle entirely.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { ALL_NEBULAE } from '@elite-dangerous-almanac/core/astro/nebulae-all';
|
|
33
|
+
*
|
|
34
|
+
* ALL_NEBULAE.length; // -> 5835
|
|
35
|
+
* ALL_NEBULAE.filter((n) => n.type === 'procgen').length; // -> 166
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const ALL_NEBULAE: readonly Nebula[];
|
|
39
|
+
|
|
40
|
+
export { ALL_NEBULAE };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PLANETARY_NEBULAE}from"../chunk-Z4OUB4SJ.js";import{PROCGEN_NEBULAE}from"../chunk-K7F6WC4T.js";import{REAL_NEBULAE}from"../chunk-HI7FCS3G.js"; var ALL_NEBULAE=Object.freeze([...REAL_NEBULAE,...PLANETARY_NEBULAE,...PROCGEN_NEBULAE]);export{ALL_NEBULAE};//# sourceMappingURL=nebulae-all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/astro/nebulae-all.ts"],"names":["PLANETARY_NEBULAE","PROCGEN_NEBULAE","REAL_NEBULAE","ALL_NEBULAE","Object","freeze"],"mappings":"O,wMAuCO,IAAMG,YAAiCC,OAAOC,OAAO,IACrDH,gBACAF,qBACAC,yBACNE"}
|