import { Squares, Colors } from '../types/Types'; import { GameResult } from './GameResult'; import { Position } from './Position'; import { Move } from './Move'; import { SimpleMove } from './SimpleMove'; import { IGameData, IMovePart, ITreePart, IChessPlayer, IChessOpening, IGameAnalysis } from '../types/Interfaces'; export declare enum ChessRatingType { None = 0, Elo = 1, Internal = 2, Rapid = 3, Iccf = 4 } export declare class ChessTags { private owner; private tags; /** * constructor */ constructor(owner: Chess); clear(): void; add(name: string, value: any): void; } export declare class ChessGameState { InCheckMate: boolean; InStaleMate: boolean; IsNoMaterialWhite: boolean; IsNoMaterialBlack: boolean; IsPosRepeation: boolean; Is50MovesRule: boolean; } export declare class Chess { private data; private savedMove; private savedPos; private savedPlyCount; private pgnLastMovePos; private pgnNextMovePos; private varDepth; private supressEvents; private moveList; private currentMove; private curPos; private startPos; private startFen; Altered: boolean; InPromotion: boolean; Fen?: string; NoQueenPromotion: boolean; Tags: ChessTags; GameId?: number | string; White?: IChessPlayer; Black?: IChessPlayer; Event?: string; Site?: string; GameDate?: string; EventDate?: string; Round?: string; WhiteElo?: number; WhiteRatingType?: ChessRatingType; BlackElo?: number; BlackRatingType?: ChessRatingType; Eco?: IChessOpening; Result: GameResult.Color; get RawData(): Readonly; get ToMove(): Colors.BW; get CurrentPlyCount(): number; get StartPlyCount(): number; get CurrentMove(): Move; get CurrentPos(): Position; set StartFen(value: string); get NonStandardStart(): boolean; Analysis: IGameAnalysis; /** * @constructor */ constructor(data?: IGameData); private clear; private clearStandardTags; private clearExtraTags; private clearMoves; init(): void; private assignPlayer; private isInstanceOfTreePart; decodeMove(mv: IMovePart | ITreePart): void; private decodeMoves; private positionChanged; checkGameState(): ChessGameState; makeMove(fr: Squares.Square, to: Squares.Square, promote?: string): SimpleMove | undefined; /** * Add a move at current position and do it. The parameter 'san' can be NULL. If it is provided, it is stored with the move to speed up PGN printing. * @param sm SimpleMove * @param san String */ addMove(sm: SimpleMove, san?: string, fen?: string): Move; moveToKey(key: string): void; /** * Move to begin game */ moveBegin(): void; /** * Move to first move */ moveFirst(): void; /** * Move to last move */ moveLast(): void; /** * Move to end position */ moveEnd(): void; /** * Переместить текущую позицию на 1 вперед * @returns Boolean */ moveForward(): boolean; /** * Move to 1 turn back * @returns Boolean */ moveBackward(): boolean; /** * Переместиться на указанную позицию в главной линии партии * @param hmNumber */ moveToPly(hmNumber: number): void; findNextMistake(color: Colors.BW, ply: number, type: "blunder" | "mistake" | "inaccuracy"): number | undefined; getResultName(mode: 'char' | 'short' | 'long' | 'html'): string; static plyToTurn(ply: number): number; static plyToColor(ply: number): Colors.BW; static turnToPly(turn: number, color?: Colors.BW): number; }