-
Notifications
You must be signed in to change notification settings - Fork 0
SystemRecordInput
Imported from @elite-dangerous-almanac/galaxy-map.
What a host passes to addSystems. It is the shape of an EDSM or a Spansh dump
record. The type states the contract and the reader holds it: every field is still
checked at run time, because the data comes from a file or a network call the
compiler does not see.
The index signature lets a record carry fields the reader drops, so a caller does not have to strip a dump record first.
[
field:string]:unknown
A field the reader drops.
readonlyoptionalallegiance?:string
readonlyoptionalbodyCount?:number
readonlyoptionalcategories?: readonlystring[]
The names of categories the table holds, in the order the marker reads them. The first one gives the colour, the style and the draw range. A record may name none, which the reader takes while the category table is empty.
readonlycoords:object
The position in game coordinates, in light years.
readonlyx:number
readonlyy:number
readonlyz:number
readonlyoptionaldescription?:string
A paragraph about the system, which the HUD shows.
readonlyoptionalgovernment?:string
readonlyoptionalicons?: readonlySystemIconInput[]
Up to 4 icons over the marker, lowest first. An entry is the symbol of a built-in
icon or an object with the host's own url and the color of its arrow. It is the
one optional field a bad value rejects the record for, rather than drops.
readonlyoptionalid64?:string|number|bigint
The 64-bit system id. JSON.parse loses digits above 2^53, so a host that needs
every digit passes a string or a bigint.
readonlyoptionalimages?: readonlySystemImage[]
Up to 8 pictures, which the HUD shows as thumbnails.
readonlyname:string
readonlyoptionalpopulation?:number
readonlyoptionalprimaryCategory?:undefined
The two names categories replaces. Each one is never, so a record that carries
it fails the compile.
The ban has to sit in the type. The index signature below turns off TypeScript's
excess-property check, so a record naming primaryCategory beside categories
would compile clean and the reader would drop it with no word to the caller.
readonlyoptionalprimaryEconomy?:string
readonlyoptionalprimaryStar?:string
The class of the primary star, for example K5 V.
readonlyoptionalsecondaryCategories?:undefined
readonlyoptionalsecurity?:string
Examples
Interfaces
- AddReport
- Category
- CategoryInput
- CategoryReject
- CategoryReport
- DatasetContent
- DatasetEntry
- DatasetInfo
- DatasetLoadResult
- DatasetView
- FlyToOptions
- FlyToTarget
- FragmentWriter
- FragmentWriterOptions
- GalaxyMap
- GalaxyMapOptions
- HudAction
- HudHandle
- HudInfoFields
- HudOptions
- InteractionSwitches
- Line
- LineInput
- MapView
- NebulaSource
- RealSystem
- Reject
- ResolvedIcon
- ShapeInfo
- ShapeReject
- ShapeReport
- Sphere
- SphereInput
- StartView
- SystemDetailValue
- SystemDetails
- SystemImage
- SystemRecordInput