@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,313 @@
|
|
|
1
|
+
import { SystemNameParts } from './astro/system-name.js';
|
|
2
|
+
import { SectorGridPosition } from './astro/sector-name.js';
|
|
3
|
+
import { SystemAddressInput } from './astro/system-address-input.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Origins of Elite Dangerous **naming regions** and the fallback that synthesises
|
|
7
|
+
* an origin for any procedural sector.
|
|
8
|
+
*
|
|
9
|
+
* Encoding a system name to an `id64` needs its region's origin (in internal
|
|
10
|
+
* units, 32 per light-year, measured from the galaxy corner). Hand-authored
|
|
11
|
+
* regions — nebula/cluster sectors such as `Col 285 Sector` or
|
|
12
|
+
* `Cepheus Dark Region B` — have catalogued origins that are *not* aligned to the
|
|
13
|
+
* boxel grid, so they are looked up from data. Any other region is a plain
|
|
14
|
+
* procedural sector whose origin is simply its grid position times the sector
|
|
15
|
+
* size.
|
|
16
|
+
*
|
|
17
|
+
* The catalogue derives from the EDTS reference implementation and community procedural-naming
|
|
18
|
+
* research, cross-checked against EDSM/Spansh; see [`data/astro/SOURCES.md`](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/data/astro/SOURCES.md) for
|
|
19
|
+
* provenance.
|
|
20
|
+
*
|
|
21
|
+
* The catalogue is loaded once from shared JSON ([`data/astro/`](https://github.com/DarkSession/Elite-Dangerous-Almanac/tree/main/data/astro)); the lookup map is
|
|
22
|
+
* an immutable module constant.
|
|
23
|
+
*
|
|
24
|
+
* @packageDocumentation
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A region's origin and extent, in internal units (32 per light-year, measured
|
|
29
|
+
* from the galaxy corner).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import type { NamingRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
|
|
34
|
+
*
|
|
35
|
+
* const origin: NamingRegionOrigin = {
|
|
36
|
+
* name: 'Example Sector',
|
|
37
|
+
* x0: 0, y0: 0, z0: 0,
|
|
38
|
+
* sizeX: 40960, sizeY: 40960, sizeZ: 40960,
|
|
39
|
+
* };
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
interface NamingRegionOrigin {
|
|
43
|
+
/** The region name, as catalogued. */
|
|
44
|
+
readonly name: string;
|
|
45
|
+
/** Origin X in internal units. */
|
|
46
|
+
readonly x0: number;
|
|
47
|
+
/** Origin Y in internal units. */
|
|
48
|
+
readonly y0: number;
|
|
49
|
+
/** Origin Z in internal units. */
|
|
50
|
+
readonly z0: number;
|
|
51
|
+
/** Extent along X in internal units. */
|
|
52
|
+
readonly sizeX: number;
|
|
53
|
+
/** Extent along Y in internal units. */
|
|
54
|
+
readonly sizeY: number;
|
|
55
|
+
/** Extent along Z in internal units. */
|
|
56
|
+
readonly sizeZ: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Look up a hand-authored named region's catalogued origin.
|
|
60
|
+
*
|
|
61
|
+
* @param name - A named region in any casing, with optional surrounding whitespace.
|
|
62
|
+
* @returns Its canonical origin record, or `null` when it is not catalogued.
|
|
63
|
+
* @throws {TypeError} If `name` is present and not a string. A nullish
|
|
64
|
+
* `name` is a miss, answered the way an unrecognised one is.
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { getHandAuthoredRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
|
|
68
|
+
*
|
|
69
|
+
* getHandAuthoredRegionOrigin(' PLEIADES SECTOR ')?.name; // -> 'Pleiades Sector'
|
|
70
|
+
* getHandAuthoredRegionOrigin('Synuefe'); // -> null
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function getHandAuthoredRegionOrigin(name: string): NamingRegionOrigin | null;
|
|
74
|
+
/**
|
|
75
|
+
* Resolve a region name to its origin.
|
|
76
|
+
*
|
|
77
|
+
* Hand-authored regions come from the catalogue; any other name is treated as a
|
|
78
|
+
* procedural sector and its origin synthesised from the sector grid. Returns
|
|
79
|
+
* `null` only when the name is neither catalogued nor a valid procedural sector.
|
|
80
|
+
*
|
|
81
|
+
* @param name - A region (sector) name in any casing.
|
|
82
|
+
* @returns The region origin, or `null` if the name cannot be resolved.
|
|
83
|
+
* @throws {TypeError} If `name` is present and not a string. A nullish
|
|
84
|
+
* `name` is a miss, answered the way an unrecognised one is.
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* import { resolveNamingRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
|
|
88
|
+
*
|
|
89
|
+
* resolveNamingRegionOrigin('Pleiades Sector'); // catalogued, hand-authored origin
|
|
90
|
+
* resolveNamingRegionOrigin('Synuefe'); // origin derived from its grid position
|
|
91
|
+
* resolveNamingRegionOrigin('not a region'); // -> null
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
declare function resolveNamingRegionOrigin(name: string): NamingRegionOrigin | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The Elite Dangerous **system address** (`id64`) — the 64-bit integer that
|
|
98
|
+
* uniquely identifies a system and encodes its procedural origin.
|
|
99
|
+
*
|
|
100
|
+
* The address packs, from the low bit up: the size class (3 bits), then the
|
|
101
|
+
* boxel's absolute grid position split per axis into a sector coordinate and a
|
|
102
|
+
* within-sector offset, and finally the sequence number. Field widths shift with
|
|
103
|
+
* the size class, which is why every accessor is parameterised by it. A second,
|
|
104
|
+
* "modulated" layout ({@link encodeModSystemAddress}) is used by some tools and
|
|
105
|
+
* regroups the same information.
|
|
106
|
+
*
|
|
107
|
+
* These functions are pure bit arithmetic over {@link NamingRegionOrigin} values that
|
|
108
|
+
* the caller supplies; resolving a region name to an origin lives in
|
|
109
|
+
* `./naming-region-origins`. All packing uses `BigInt`, since fields reach bit 55 and JS
|
|
110
|
+
* number bitwise operators truncate to 32 bits.
|
|
111
|
+
*
|
|
112
|
+
* @packageDocumentation
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
/** The edge of one procedural sector in internal units (1280 ly × 32 units/ly). */
|
|
116
|
+
declare const SECTOR_INTERNAL_SIZE = 40960;
|
|
117
|
+
/**
|
|
118
|
+
* Return the boxel edge for a size class in internal units (32 units per ly).
|
|
119
|
+
*
|
|
120
|
+
* @param sizeClass - An integer from 0 through 7.
|
|
121
|
+
* @returns The boxel edge in internal units (320 through 40960). Divide by 32 for
|
|
122
|
+
* light-years, or use `boxelEdgeLy` from `./mass-code`.
|
|
123
|
+
* @throws {RangeError} If `sizeClass` is outside 0–7.
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { boxelInternalSize } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
127
|
+
*
|
|
128
|
+
* boxelInternalSize(3); // -> 2560 internal units
|
|
129
|
+
* boxelInternalSize(3) / 32; // -> 80 ly, the edge of a d-class boxel
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
declare function boxelInternalSize(sizeClass: number): number;
|
|
133
|
+
/**
|
|
134
|
+
* A boxel's position on the per-size-class boxel grid, counted from the galaxy corner.
|
|
135
|
+
*
|
|
136
|
+
* @remarks
|
|
137
|
+
* These are grid indices, not light-years: one step is one boxel edge, which depends on
|
|
138
|
+
* the size class ({@link boxelEdgeLy} from `./mass-code` converts).
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* import { decodeSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
143
|
+
* import type { AbsoluteBoxel } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
144
|
+
*
|
|
145
|
+
* const boxel: AbsoluteBoxel = decodeSystemAddress(3309179996515n).absoluteBoxel;
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
interface AbsoluteBoxel {
|
|
149
|
+
/** Boxel index along the galactic X axis. */
|
|
150
|
+
readonly x: number;
|
|
151
|
+
/** Boxel index along the galactic Y axis. */
|
|
152
|
+
readonly y: number;
|
|
153
|
+
/** Boxel index along the galactic Z axis. */
|
|
154
|
+
readonly z: number;
|
|
155
|
+
}
|
|
156
|
+
/** A system address decoded into its geometric components. */
|
|
157
|
+
interface DecodedAddress {
|
|
158
|
+
/** Size class 0–7 (mass code `a`–`h`). */
|
|
159
|
+
readonly sizeClass: number;
|
|
160
|
+
/** The sector's position on the galaxy grid. */
|
|
161
|
+
readonly sectorGridPosition: SectorGridPosition;
|
|
162
|
+
/** The boxel's base-26 index within the sector (the "boxel code"). */
|
|
163
|
+
readonly boxelCode: number;
|
|
164
|
+
/** The system sequence number (`N2`). */
|
|
165
|
+
readonly sequence: number;
|
|
166
|
+
/** The boxel's absolute position on the per-size-class boxel grid. */
|
|
167
|
+
readonly absoluteBoxel: AbsoluteBoxel;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Absolute boxel indices of a name's boxel code, relative to the galaxy origin.
|
|
171
|
+
*
|
|
172
|
+
* This is the inverse of the decode split: it turns the base-26 boxel code back
|
|
173
|
+
* into a grid position by adding the region origin (snapped down to the boxel
|
|
174
|
+
* grid). It throws rather than emit a wrong address when the origin has a negative
|
|
175
|
+
* coordinate, when N1 overflows the code, when the boxel code falls outside the
|
|
176
|
+
* region, or when the resulting sector cannot be represented by the address bits.
|
|
177
|
+
*
|
|
178
|
+
* @param sizeClass - Size class 0–7 (mass code `a`–`h`).
|
|
179
|
+
* @param boxelCode - The base-26 boxel code ({@link lettersToBoxelCode}).
|
|
180
|
+
* @param origin - The resolved region origin (internal units, 32 per light-year).
|
|
181
|
+
* @returns The boxel's absolute indices on the per-size-class boxel grid, measured
|
|
182
|
+
* from the galaxy corner.
|
|
183
|
+
* @throws {RangeError} If `sizeClass` is outside 0–7, the origin has a negative
|
|
184
|
+
* coordinate, or the code or the resulting sector is out of range.
|
|
185
|
+
*/
|
|
186
|
+
declare function boxelCodeToAbsoluteBoxel(sizeClass: number, boxelCode: number, origin: NamingRegionOrigin): AbsoluteBoxel;
|
|
187
|
+
/**
|
|
188
|
+
* Boxel code (base-26 index) of an absolute boxel relative to a region origin,
|
|
189
|
+
* or `null` when the boxel does not sit inside that region.
|
|
190
|
+
*
|
|
191
|
+
* Used by the hand-authored-sector override: the same physical boxel yields a
|
|
192
|
+
* different boxel code under a hand-authored region whose origin differs from
|
|
193
|
+
* the procedural sector's. This is the inverse of {@link boxelCodeToAbsoluteBoxel}.
|
|
194
|
+
*
|
|
195
|
+
* @param sizeClass - Size class 0–7 (mass code `a`–`h`).
|
|
196
|
+
* @param absoluteBoxel - The boxel's absolute grid indices, as
|
|
197
|
+
* {@link decodeSystemAddress} returns in `absoluteBoxel`.
|
|
198
|
+
* @param origin - The region origin to measure against (internal units, 32 per
|
|
199
|
+
* light-year), from `./naming-region-origins`.
|
|
200
|
+
* @returns The base-26 boxel code within that region, or `null` when the boxel lies
|
|
201
|
+
* outside the region or the origin has a negative coordinate.
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts
|
|
204
|
+
* import { resolveNamingRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
|
|
205
|
+
* import { absoluteBoxelToBoxelCode, decodeSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
206
|
+
*
|
|
207
|
+
* declare const id64: bigint;
|
|
208
|
+
*
|
|
209
|
+
* const { sizeClass, absoluteBoxel } = decodeSystemAddress(id64);
|
|
210
|
+
* absoluteBoxelToBoxelCode(sizeClass, absoluteBoxel, resolveNamingRegionOrigin('Pleiades Sector')!);
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
declare function absoluteBoxelToBoxelCode(sizeClass: number, absoluteBoxel: AbsoluteBoxel, origin: NamingRegionOrigin): number | null;
|
|
214
|
+
/**
|
|
215
|
+
* Decode a system address into its geometric components.
|
|
216
|
+
*
|
|
217
|
+
* @param id64 - The 64-bit system address, as a `bigint`, a normally parsed
|
|
218
|
+
* journal `number`, or a decimal `string` (see {@link SystemAddressInput}).
|
|
219
|
+
* @returns The decoded size class, sector, boxel code, sequence and absolute boxel.
|
|
220
|
+
* @throws {TypeError} If `id64` is not a usable address representation (a
|
|
221
|
+
* non-integer, or a `number` so large it has already been rounded).
|
|
222
|
+
* @throws {RangeError} If `id64` is negative or does not fit in 64 bits.
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* import { decodeSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
226
|
+
* declare const event: { SystemAddress: number }; // an `FSDJump` line, parsed
|
|
227
|
+
*
|
|
228
|
+
* decodeSystemAddress(3309179996515n);
|
|
229
|
+
* // -> { sizeClass: 3, sectorGridPosition: { sectorX: 39, sectorY: 31, sectorZ: 18 }, … }
|
|
230
|
+
*
|
|
231
|
+
* decodeSystemAddress(event.SystemAddress); // a journal number works too
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
declare function decodeSystemAddress(id64: SystemAddressInput): DecodedAddress;
|
|
235
|
+
/**
|
|
236
|
+
* Decode a **modulated** system address into its geometric components.
|
|
237
|
+
*
|
|
238
|
+
* @remarks
|
|
239
|
+
* The modulated form is an alternative bit-layout of the *same* system, used by
|
|
240
|
+
* some community tools and data dumps. If you have a normal `id64` (the usual
|
|
241
|
+
* case — journal, EDSM, EDDN, Spansh all use it), reach for
|
|
242
|
+
* {@link decodeSystemAddress} instead; use this only when a source specifically
|
|
243
|
+
* hands you a modulated address.
|
|
244
|
+
*
|
|
245
|
+
* @param id64 - The 64-bit modulated system address, as a `bigint`, a safe-integer
|
|
246
|
+
* `number`, or a decimal `string` (see {@link SystemAddressInput}). A modulated
|
|
247
|
+
* address packs the sector into the high bits, so it routinely exceeds `2^53`;
|
|
248
|
+
* those values must be supplied as a `bigint` or string because a JS `number` has
|
|
249
|
+
* already lost precision.
|
|
250
|
+
* @returns The decoded components (same shape as {@link decodeSystemAddress}).
|
|
251
|
+
* @throws {TypeError} If `id64` is not a usable address representation.
|
|
252
|
+
* @throws {RangeError} If `id64` is negative or does not fit in 64 bits.
|
|
253
|
+
* @example
|
|
254
|
+
* ```ts
|
|
255
|
+
* import { decodeModSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
256
|
+
*
|
|
257
|
+
* declare const modAddressFromSomeTool: bigint;
|
|
258
|
+
*
|
|
259
|
+
* decodeModSystemAddress(modAddressFromSomeTool).sectorGridPosition;
|
|
260
|
+
* // -> { sectorX, sectorY, sectorZ }
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
declare function decodeModSystemAddress(id64: SystemAddressInput): DecodedAddress;
|
|
264
|
+
/**
|
|
265
|
+
* Encode system-name parts and a resolved region origin into a system address.
|
|
266
|
+
*
|
|
267
|
+
* @param parts - The parsed system-name parts, as {@link parseSystemName} returns
|
|
268
|
+
* (letters and mass code are zero-based numeric indices, not characters).
|
|
269
|
+
* @param origin - The region origin (internal units), from
|
|
270
|
+
* `resolveNamingRegionOrigin` in `./naming-region-origins`.
|
|
271
|
+
* @returns The 64-bit system address.
|
|
272
|
+
* @throws {RangeError} If the mass code is outside 0–7, a letter is outside 0–25, `n1`
|
|
273
|
+
* is not one the boxel packer accepts, the origin has a negative coordinate, the name's boxel code or sector falls outside the
|
|
274
|
+
* address layout, or the sequence does not fit its size-class-dependent field.
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* import { resolveNamingRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
|
|
278
|
+
* import { encodeSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
279
|
+
* import { parseSystemName } from '@elite-dangerous-almanac/core/astro/system-name';
|
|
280
|
+
*
|
|
281
|
+
* const parts = parseSystemName('Synuefe EN-H d11-96')!;
|
|
282
|
+
* encodeSystemAddress(parts, resolveNamingRegionOrigin(parts.regionName)!); // -> 3309179996515n
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
declare function encodeSystemAddress(parts: SystemNameParts, origin: NamingRegionOrigin): bigint;
|
|
286
|
+
/**
|
|
287
|
+
* Encode system-name parts and a resolved region origin into a **modulated**
|
|
288
|
+
* address.
|
|
289
|
+
*
|
|
290
|
+
* @remarks
|
|
291
|
+
* Prefer {@link encodeSystemAddress} for the normal `id64`; use the modulated
|
|
292
|
+
* form only when a tool you are feeding expects that specific layout.
|
|
293
|
+
*
|
|
294
|
+
* @param parts - The parsed system-name parts, as {@link parseSystemName} returns.
|
|
295
|
+
* @param origin - The region origin (internal units), from `resolveNamingRegionOrigin`.
|
|
296
|
+
* @returns The 64-bit modulated system address. These routinely exceed `2^53`, so
|
|
297
|
+
* keep them as `bigint` (or a decimal string) rather than a JS `number`.
|
|
298
|
+
* @throws {RangeError} If the mass code is outside 0–7, a letter is outside 0–25, `n1`
|
|
299
|
+
* is not one the boxel packer accepts, the origin has a negative coordinate, the name's boxel code or sector falls outside the
|
|
300
|
+
* address layout, or the sequence does not fit the 15-bit modulated field.
|
|
301
|
+
* @example
|
|
302
|
+
* ```ts
|
|
303
|
+
* import { resolveNamingRegionOrigin } from '@elite-dangerous-almanac/core/astro/naming-region-origins';
|
|
304
|
+
* import { encodeModSystemAddress } from '@elite-dangerous-almanac/core/astro/system-address';
|
|
305
|
+
* import { parseSystemName } from '@elite-dangerous-almanac/core/astro/system-name';
|
|
306
|
+
*
|
|
307
|
+
* const parts = parseSystemName('Synuefe EN-H d11-96')!;
|
|
308
|
+
* encodeModSystemAddress(parts, resolveNamingRegionOrigin(parts.regionName)!).toString();
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
declare function encodeModSystemAddress(parts: SystemNameParts, origin: NamingRegionOrigin): bigint;
|
|
312
|
+
|
|
313
|
+
export { type AbsoluteBoxel as A, type DecodedAddress as D, type NamingRegionOrigin as N, SECTOR_INTERNAL_SIZE as S, absoluteBoxelToBoxelCode as a, boxelCodeToAbsoluteBoxel as b, boxelInternalSize as c, decodeModSystemAddress as d, decodeSystemAddress as e, encodeModSystemAddress as f, encodeSystemAddress as g, getHandAuthoredRegionOrigin as h, resolveNamingRegionOrigin as r };
|