import { PositionString, IBaseSearchInfo, IScoreInfo, Move, IBaseSearchOptions, IBaseSearchResult } from '@multi-game-engines/core'; /** * Branded Type for FEN (Forsyth-Edwards Notation) strings. */ type FEN = PositionString<"FEN">; /** * チェス用の探索オプション。 */ interface IChessSearchOptions extends IBaseSearchOptions { fen?: FEN | undefined; depth?: number | undefined; time?: number | undefined; nodes?: number | undefined; } /** * チェス用の思考情報。 */ interface IChessSearchInfo extends IBaseSearchInfo { depth?: number | undefined; seldepth?: number | undefined; score?: IScoreInfo | undefined; nodes?: number | undefined; nps?: number | undefined; time?: number | undefined; pv?: Move[] | undefined; hashfull?: number | undefined; multipv?: number | undefined; } /** * チェス用の探索結果。 */ interface IChessSearchResult extends IBaseSearchResult { bestMove: Move | null; ponder?: Move | null | undefined; } /** * チェスの駒識別子。 */ type ChessPiece = "P" | "N" | "B" | "R" | "Q" | "K" | "p" | "n" | "b" | "r" | "q" | "k"; /** * Parsed FEN result containing the 2D board array and turn metadata. */ interface ParsedFEN { /** 8x8 grid of pieces. board[0] is Rank 8, board[7] is Rank 1. */ board: (ChessPiece | null)[][]; /** Whose turn it is: 'w' for White, 'b' for Black. */ turn: "w" | "b"; } /** * FEN 形式の文字列を厳密に検証し、Branded Type を返します。 */ declare function createFEN(pos: string): FEN; declare function isValidChessPiece(char: string): char is ChessPiece; /** * FEN 文字列を解析して 2D 盤面配列に変換します。 */ declare function parseFEN(fen: FEN): ParsedFEN; export { type ChessPiece, type FEN, type IChessSearchInfo, type IChessSearchOptions, type IChessSearchResult, type ParsedFEN, createFEN, isValidChessPiece, parseFEN };