Reference · Rockets, variants, parts and the fit check
Varianttype
One version of a rocket as data: its id, name, status, first flight, its parts from the bottom up, and the sourced facts about it.
Import it
import type { Variant } from "@johnmorrisdotca/uchusen-rockets";
Definition
interface Variant {
id: string;
rocket: string;
name: string;
status: VariantStatus;
firstWord?: string;
firstFlight: Figure<string>;
slots: readonly string[];
facts: VariantFacts;
partIds?: Readonly<Record<string, string>>;
note?: string;
lineupView?: "back" | "side";
inspector?: Inspector;
view?: {
tiltMax: number;
};
}
Members
| Name | Type | Description |
|---|---|---|
id | string | "v1", "v2" and so on; a label for what is not a numbered version. |
rocket | string | |
name | string | What it is called, in a line: "Block 3 (V3)". |
status | VariantStatus | |
firstWord (optional) | string | undefined | What to call its first date, when it is not a vehicle that flew: "In service". |
firstFlight | Figure<string> | When this variant, in this form, first flew. Its |
slots | readonly string[] | The parts this variant has, in stacking order from the bottom. |
facts | VariantFacts | |
partIds (optional) | Readonly<Record<string, string>> | undefined | A slot's part when it is not this variant's own: a part shared with another rocket. |
note (optional) | string | undefined | What a reader should be told about it. |
lineupView (optional) | "back" | "side" | undefined | The side a to-scale lineup shows of it when asked for the front, because the front hides what it is: the orbiter stands behind the Shuttle's tank. |
inspector (optional) | Inspector | undefined | The panel that goes with the viewer: sections, specification, notes and insets. |
view (optional) | { tiltMax: number; } | undefined | How the viewer's controls may move it. |
Examples
import { variantOf, type Variant } from "@johnmorrisdotca/uchusen-rockets";
const variant: Variant | undefined = variantOf("starship", "v3");
console.log(variant?.name, variant?.slots);Block 3 (V3) [ 'booster', 'ship' ]What it prints (run when this page was built)