GemSwapLessonStep型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One bilingual native lesson instruction and the corresponding action or tick step.
インポート
import type { GemSwapLessonStep } from "@johnmorrisdotca/houseki/gem-swap";
定義
type GemSwapLessonStep = {
readonly kind: 'action';
readonly id: string;
readonly action: Action;
readonly accepted: boolean;
readonly reason?: string;
readonly event?: string;
readonly cell?: number;
readonly text: {
readonly en: string;
readonly ja: string;
};
} | {
readonly kind: 'ticks';
readonly id: string;
readonly count: number;
readonly event?: string;
readonly outcome?: string;
readonly cell?: number;
readonly text: {
readonly en: string;
readonly ja: string;
};
};
例
import type { GemSwapLessonStep } from "@johnmorrisdotca/houseki/gem-swap";
import { GEM_SWAP_LESSONS } from "@johnmorrisdotca/houseki/gem-swap";
const value: GemSwapLessonStep = GEM_SWAP_LESSONS[0].steps[0];
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'kind', 'id', 'action', 'accepted', 'reason', 'text' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。