feat(mnswpr): re-export mnswpr types
This commit is contained in:
parent
af649d9c90
commit
e50eb001db
3 changed files with 20 additions and 1 deletions
7
packages/mnswpr/core/index.d.ts
vendored
7
packages/mnswpr/core/index.d.ts
vendored
|
|
@ -2,6 +2,13 @@ export { Grid } from "./grid/grid.js";
|
|||
export { GameSession } from "./session/session.js";
|
||||
export { replay } from "./session/replay.js";
|
||||
export { levels } from "../levels.js";
|
||||
export type Layout = import("./minesweeper/board.js").Layout;
|
||||
export type LayoutCell = import("./minesweeper/board.js").LayoutCell;
|
||||
export type Config = import("./minesweeper/board.js").Config;
|
||||
export type Move = import("./minesweeper/rules.js").Move;
|
||||
export type MoveEvent = import("./minesweeper/rules.js").MoveEvent;
|
||||
export type MoveEventType = import("./minesweeper/rules.js").MoveEventType;
|
||||
export type Phase = import("./minesweeper/rules.js").Phase;
|
||||
export { eightWay, orthogonal } from "./grid/neighbors.js";
|
||||
export { toJSON, fromJSON } from "./grid/serialize.js";
|
||||
export { mulberry32, randInt } from "./session/rng.js";
|
||||
|
|
|
|||
|
|
@ -23,3 +23,15 @@ export { generateBoard, validateLayout } from './minesweeper/board.js'
|
|||
|
||||
// Shared level presets (also consumed by the DOM client)
|
||||
export { levels } from '../levels.js'
|
||||
|
||||
// Public type aliases — re-exported so consumers can
|
||||
// `import type { Layout, … } from '@cozy-games/mnswpr/core'` against the barrel,
|
||||
// without reaching into internal `core/minesweeper/*` modules or an ambient shim.
|
||||
// These are type-only; they add nothing to the runtime bundle.
|
||||
/** @typedef {import('./minesweeper/board.js').Layout} Layout */
|
||||
/** @typedef {import('./minesweeper/board.js').LayoutCell} LayoutCell */
|
||||
/** @typedef {import('./minesweeper/board.js').Config} Config */
|
||||
/** @typedef {import('./minesweeper/rules.js').Move} Move */
|
||||
/** @typedef {import('./minesweeper/rules.js').MoveEvent} MoveEvent */
|
||||
/** @typedef {import('./minesweeper/rules.js').MoveEventType} MoveEventType */
|
||||
/** @typedef {import('./minesweeper/rules.js').Phase} Phase */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@cozy-games/mnswpr",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"description": "Classic Minesweeper browser game",
|
||||
"author": "Ayo",
|
||||
"type": "module",
|
||||
|
|
|
|||
Loading…
Reference in a new issue