Skip to content

ships.Interface.SourcePurchaseRecord

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

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

Interface: SourcePurchaseRecord

Defined in: src/ships/source-purchase.ts:54

An immutable snapshot of the credit figures carried by one captured loadout.

Every top-level figure can be null: absence means the source stated no value, not that the hull or modules were free. Likewise, moduleValues contains only individually priced slots. The snapshot remains unchanged when its owning ShipLoadout is edited because it describes the source capture, not the live fit.

Example

import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
import {
    getSourceModuleValue,
    sumSourceModuleValues,
} from '@elite-dangerous-almanac/core/ships/source-purchase';

declare const slefJson: string;

const build = ShipLoadout.fromSlef(slefJson);
const paid = build.sourcePurchase;
if (paid) {
    paid.hullValue; // captured hull price, or null
    getSourceModuleValue(paid, 'PowerPlant')?.value; // captured slot price
    sumSourceModuleValues(paid); // sum of individually priced modules
}

Properties

hullValue

readonly hullValue: number | null

Defined in: src/ships/source-purchase.ts:56

Hull cost in credits as the source stated it, or null if it stated none.


moduleCount

readonly moduleCount: number

Defined in: src/ships/source-purchase.ts:64

Total modules listed by the capture, including entries with no price.


modulesValue

readonly modulesValue: number | null

Defined in: src/ships/source-purchase.ts:58

Fitted-module cost in credits as the source stated it, or null if absent.


moduleValues

readonly moduleValues: readonly SourceModuleValue[]

Defined in: src/ships/source-purchase.ts:62

Individually priced slots, in capture order; unpriced slots are absent.


rebuy

readonly rebuy: number | null

Defined in: src/ships/source-purchase.ts:60

Insurance rebuy in credits as the source stated it, or null if absent.

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