Interface definition needed
Hello eidogo developers,
I'm writing a tsumego solving js library and found that eidogo can simplify my debugging experience: eidogo can render the search tree and help me understand where the algorithm chose a wrong way. Essentially I need from eidogo a few things:
- Render SGF.
- Move to the "current" node in the SGF.
- Play a move.
- Make a pass.
- Undo the move.
It's clear how to render SGF from the samples, but it doesn't seem so clear how to do the rest. Since I couldn't find an interface definition of eidogo, I had to see in debugger how the UI achieves what I need: I put a breakpoint in player.js, click on the board and see what happens. So far I've figured out that in order to play a move it does .playMove, .board.commit and .board.render: this seems to add the move, but doesn't update the game tree.
It would be nice to have the eidogo's interface in form of a TypeScript's .d.ts file:
declare module eidogo {
interface Player {
/** move = "ca", color = -1 (white) */
playMove(move: string, color: number);
board: {
commit(): void;
render(): void;
}
}
}
Thanks.