import type { Opening, OpeningCollection } from "../src/types.js"; /** * From/To transition index structure. * Maps position-only FEN to arrays of full FENs representing transitions. */ export interface FromToIndex { /** Maps position → array of next position FENs */ to: Record; /** Maps position → array of previous position FENs */ from: Record; } /** * Downloads and caches the pre-indexed from/to transition data from GitHub. * This file is generated by eco.json.tooling and maps position-only FENs to transition arrays. * * @returns Indexed transition data with to/from mappings * * @example * ```typescript * const index = await getFromToIndex(); * const position = "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR"; * const nextFens = index.to[position]; // FENs for e2-e4 position * ``` */ export declare function getFromToIndex(): Promise; /** * Gets the next and previous opening positions for a given FEN. * Returns full Opening objects (not just FEN strings) by looking up transitions * in the pre-indexed data and enriching with opening book information. * * Uses position-only FEN for lookup to handle transpositions. * * @param fen - The FEN string to look up transitions for * @param openings - Optional pre-loaded opening collection (will fetch if not provided) * @returns Object with next and from Opening arrays * * @example * ```typescript * // Get transitions for e2-e4 position * const { next, from } = await getFromTos( * "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1" * ); * * console.log(next[0].name); // "King's Pawn Opening: Sicilian Defense" * console.log(from[0].name); // "Starting Position" * ``` */ export declare function getFromTos(fen: string, openings?: OpeningCollection): Promise<{ next: Opening[]; from: Opening[]; }>; /** * Clears the cached fromToIndex, forcing a fresh download on next access. * Useful for testing or when data updates are expected. */ export declare function clearFromToCache(): void; //# sourceMappingURL=fromTo.d.ts.map