react-chess-analysis-board
Version:
React component for a fully featured, stylable chess analysis board.
36 lines (35 loc) • 933 B
TypeScript
/// <reference types="react" />
import { Chess, Move } from 'chess.js';
interface TChessNodes {
edgeNodeIndex: number;
node: Chess;
nodeId: number;
parentNodeId: number;
historyArray?: string | Move[];
}
interface TBoardPosition {
nodeId: number;
moveIndex: number;
}
interface TPositionTree {
boardPosition: TBoardPosition;
setBoardPosition: Function;
fen?: string;
chessRootNode?: Chess;
chessNodes?: TChessNodes[];
handleRightClick: Function;
handleLeftClick: Function;
setChessNodes: Function;
setFen: Function;
getPosition?: Function;
setPosition: Function;
}
export interface TPositionTreeSetter {
pgnString: string;
boardPosition: TBoardPosition;
fen?: string;
chessNodes: TChessNodes[];
}
export declare const PositionContextProvider: (props: any) => JSX.Element;
export declare const usePositionContext: () => TPositionTree;
export {};