CubeOption型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One choice.
インポート
import type { CubeOption } from "@johnmorrisdotca/kyuubu";
定義
type CubeOption = {
id: string;
group: OptionGroup;
kind: OptionKind;
default?: string | number | boolean;
choices?: readonly string[];
choiceLabels?: Readonly<Record<string, Readonly<Record<string, string>>>>;
range?: {
min: number;
max: number;
step: number;
};
names: {
view?: string;
player?: string;
cube?: string;
turning?: string;
cuboid?: string;
cuboidPlayer?: string;
cuboidElement?: string;
};
factor?: {
player?: number;
};
say: Record<KyuubuLanguage, {
label: string;
help: string;
}>;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | string | Its one name, in kebab case: what the builder's controls and its address call it. |
group | OptionGroup | |
kind | OptionKind | |
default (省略可) | string | number | boolean | undefined | What it is when nothing is said: the same as leaving it out. Absent where leaving it out is its own state (no theme, no scale). |
choices (省略可) | readonly string[] | undefined | The ways to choose from, for a |
choiceLabels (省略可) | Readonly<Record<string, Readonly<Record<string, string>>>> | undefined | The words for each choice, by language; the value itself is what is written in code. |
range (省略可) | { min: number; max: number; step: number; } | undefined | The least, the most and the step, for a |
names | { view?: string; player?: string; cube?: string; turning?: string; cuboid?: string; cuboidPlayer?: string; cuboidElement?: string; } | What each way of making a cube calls it: |
factor (省略可) | { player?: number; } | undefined | What the player's option is worth in this option's own unit: |
say | Record<KyuubuLanguage, { label: string; help: string; }> | The label and the one plain line, in each language. |
例
import type { CubeOption } from "@johnmorrisdotca/kyuubu";
import { CUBE_OPTIONS } from "@johnmorrisdotca/kyuubu";
const value: CubeOption = CUBE_OPTIONS[0]!;
console.log(value.id);size出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。