/** A branch in the conditional move tree, consists of the response move and * the sub-tree of the next possible moves */ export type ConditionalMoveResponse = [ ( /** response_move */ string | null), /** next move tree */ ConditionalMoveResponseTree ]; export interface ConditionalMoveResponseTree { [move: string]: ConditionalMoveResponse; } export declare class ConditionalMoveTree { children: { [move: string]: ConditionalMoveTree; }; parent?: ConditionalMoveTree; move: string | null; constructor(move: string | null, parent?: ConditionalMoveTree); encode(): ConditionalMoveResponse; static decode(data: ConditionalMoveResponse): ConditionalMoveTree; getChild(mv: string): ConditionalMoveTree; duplicate(): ConditionalMoveTree; /** * Merge another conditional move tree into this one. The other tree's * branches override this tree's where they conflict — see * {@link mergeResponseTrees} for the per-branch rule. */ merge(other: ConditionalMoveTree): ConditionalMoveTree; /** * Build a conditional move tree from a flat sequence of moves that * alternate "opponent move, our planned response". The string is taken * pair-by-pair (each move is two characters) starting from the most * recent and working back to the root, so the resulting tree describes: * "if opponent plays move N, respond with move N+1; if then opponent * plays move N+2, respond with move N+3; …" * * Required shape: `moves.length % 2 === 0`. The first move in the string * is the opponent's. A trailing unpaired opponent move with no planned * response is allowed (the deepest node has `move = null`). */ static fromMoveDiff(moves: string): ConditionalMoveTree; }