Skip to content

ships.TypeAlias.LoadoutSlot

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

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

Type Alias: LoadoutSlot

LoadoutSlot = BuildSlot & object

Defined in: src/ships/loadout-slot.ts:64

A point-in-time, deeply frozen view of one hull mount.

The view is detached from its ShipLoadout; after an edit that changes the build, call ShipLoadout.slots again for the current view. Mutations and candidate filtering stay on ShipLoadout and take the slot key, leaving this value serializable and free of lifecycle rules.

Type Declaration

immovableReason?

readonly optional immovableReason?: ImmovableReason

Machine-readable reason the mount cannot currently be emptied: cargoHatch for the built-in hatch, requiredSlot for a core or armour mount, or moduleLimit when removing a fitted allowance-increasing module would leave too many limited modules. Absent when removable is true.

module

readonly module: FittedModule | null

Frozen fitted-module snapshot, or null when this mount is empty.

name

readonly name: string

Human-readable label, e.g. "Frame Shift Drive".

removable

readonly removable: boolean

Whether ShipLoadout.removeModule may empty this mount.

Examples

Walking a build's mounts. Slot keys come from the game and are not derivable from position, so read the slot's key rather than composing one.

import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
import type { LoadoutEvent } from '@elite-dangerous-almanac/core/ships/slef';

declare const event: LoadoutEvent;

// Figures below are one build's — a Federal Corvette.
const build = ShipLoadout.fromLoadout(event);

build.slots().length; // -> 38   every mount on the hull
build.slots('hardpoint').length; // -> 7

const first = build.slots('hardpoint')[0];
first?.key; // -> 'HugeHardpoint1'      what ShipLoadout.setModule takes
first?.name; // -> 'Huge Hardpoint 1'   what a UI shows
first?.size; // -> 4
first?.module?.symbol; // -> 'hpt_beamlaser_gimbal_huge'; undefined when the mount is empty

The view is a snapshot, not a handle — re-read it after an edit.

import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
import { HARDPOINT_MODULES } from '@elite-dangerous-almanac/core/ships/modules-hardpoint';
import { getModuleBySymbol } from '@elite-dangerous-almanac/core/ships/modules';

const build = ShipLoadout.empty('Sidewinder');
const before = build.slots('hardpoint')[0];
before?.key; // -> 'SmallHardpoint1'
before?.module; // -> null

const pulse = getModuleBySymbol('Hpt_PulseLaser_Fixed_Small', HARDPOINT_MODULES);
if (pulse) build.setModule('SmallHardpoint1', pulse);

before?.module; // -> still null — `before` describes the build as it was
build.slots('hardpoint')[0]?.module?.symbol; // -> 'Hpt_PulseLaser_Fixed_Small'

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