Variant型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 type { Variant } from "@johnmorrisdotca/uchusen-rockets";
定義
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;
};
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
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 (省略可) | 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 (省略可) | Readonly<Record<string, string>> | undefined | A slot's part when it is not this variant's own: a part shared with another rocket. |
note (省略可) | string | undefined | What a reader should be told about it. |
lineupView (省略可) | "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 (省略可) | Inspector | undefined | The panel that goes with the viewer: sections, specification, notes and insets. |
view (省略可) | { tiltMax: number; } | undefined | How the viewer's controls may move it. |
例
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' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。