Skip to content

ships.Function.getShipSlots

github-actions[bot] edited this page Aug 26, 2026 · 73 revisions

@elite-dangerous-almanac/core / ships / getShipSlots

Function: getShipSlots()

getShipSlots(symbol): ShipSlots | null

Defined in: src/ships/ships.ts:240

A hull's slot layout as a self-contained ShipSlots, ready to feed enumerateSlots.

Parameters

symbol

string

The internal identifier, e.g. "Anaconda". Leading/trailing whitespace and case are ignored.

Returns

ShipSlots | null

The hull's slot layout, or null if no hull with that symbol is carried. This is a projection of the slot-bearing fields already on Ship, all four of which every carried hull has, so a symbol that resolves always has a layout.

Remarks

This is the read-only layout, for your own outfitting UI (feed it to enumerateSlots). To assemble and edit an actual build — fit modules, engineer them, read jump range — start a ShipLoadout instead and use its live slots() / slots('core') views.

Throws

If symbol is present and not a string. A nullish symbol is a miss, answered the way an unrecognised one is.

Example

import { getShipSlots } from '@elite-dangerous-almanac/core/ships/ships';

getShipSlots('anaconda')?.hardpoints;
// -> [{ size: 4 }, { size: 3 }, { size: 3 }, { size: 3 }, { size: 2 }, ...]
getShipSlots('LakonMiner')?.hardpoints[0];
// -> { size: 3, restriction: 'mining', name: 'LargeMiningHardpoint1' }
getShipSlots('Anaconda')?.optional?.at(-2);   // -> { size: 1, name: 'Slot14_Size1' }
getShipSlots('Sidewinder')?.optional?.at(-2); // -> { size: 1 } — the rules fit

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally