Reference · Native Minesweeper player
MountOptionstype
Initial game, appearance, control, and lifecycle callbacks for a mounted board.
Import it
import type { MountOptions } from "@johnmorrisdotca/jirai/play";
Definition
type MountOptions = DrawOptions & {
settings?: Settings;
progress?: string;
controls?: boolean;
onChange?: (game: Game) => void;
onFinish?: (game: Game) => void;
onError?: (error: Error) => void;
};
Members
| Name | Type | Description |
|---|---|---|
material (optional) | Material | undefined | |
pieces (optional) | Pieces | undefined | |
language (optional) | Language | undefined | |
hint (optional) | number | null | undefined | |
settings (optional) | Settings | undefined | |
progress (optional) | string | undefined | |
controls (optional) | boolean | undefined | |
onChange (optional) | ((game: Game) => void) | undefined | |
onFinish (optional) | ((game: Game) => void) | undefined | |
onError (optional) | ((error: Error) => void) | undefined |
Examples
import type { Settings } from "@johnmorrisdotca/jirai";
import type { MountOptions } from "@johnmorrisdotca/jirai/play";
const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
const value: MountOptions = {settings,language:"ja",material:"wood",pieces:"flags"};
console.log(value);{
settings: {
width: 3,
height: 3,
mines: 1,
grid: 'square',
noGuess: false,
opening: 'clear',
seed: 42
},
language: 'ja',
material: 'wood',
pieces: 'flags'
}What it prints (run when this page was built)