StackUpMovetype
One move at Stack Up: a card laid on a building pile (from the hand, the top of the stock, or the top of one of your own discard piles), a card put on a discard pile, which ends the turn, or a pass when there is nothing in hand to discard.
Import it
import type { StackUpMove } from "@johnmorrisdotca/toranpu/stack-up";
Definition
type StackUpMove = {
play: CardId;
from: "hand" | "stock";
to: number;
} | {
play: CardId;
from: "discard";
pile: number;
to: number;
} | {
discard: CardId;
to: number;
} | {
pass: true;
};
Examples
import type { StackUpMove } from "@johnmorrisdotca/toranpu/stack-up";
const value: StackUpMove = { play: "n01", from: "hand", to: 0 };
console.log(value);{ play: 'n01', from: 'hand', to: 0 }What it prints (run when this page was built)