chess-legal-moves
Version:
Analyses a given chess game position in Fen notation to return legal moves and provides the next game position after a given move
34 lines (33 loc) • 1.44 kB
TypeScript
/**
* Parses a string representing the chess board an array of 64 strings
* @param boardString - a string representing the board as the first part of FEN notation
* @returns an array of 64 strings representing the pieces and empty squares
*
* @internal
*/
export declare function parseBoard(boardString: string): string[];
/**
* Splits a board represented as a string into 8 strings representing the chessboard ranks
* @param boardString - a string representing the board as the first part of FEN notation
* @returns an array of 8 strings representing the chessboard ranks
*
* @internal
*/
export declare function getRanks(boardString: string): string[];
/**
* Splits a chessboard rank represented as a string into an array of 8 characters reprenting the pieces and empty squares
* @param rank - a string representing one of the chessboard ranks
* @returns an array of 8 characters reprenting the pieces and empty squares
*
* @internal
*/
export declare function getRankCells(rank: string): string[];
/**
* Converts a chessboard rank represented as a string possibly containing numbers to represent the number of consecutive empty squares
* into a rank containing points to represent each empty square
* @param rank - a string representing one of the chessboard ranks
* @returns a rank with dots to represent empty squares
*
* @internal
*/
export declare function convertNumbersToPoints(rank: string): string;