@bedard/hexchess-engine
Version:
A game engine for Gliński's hexagonal chess
27 lines (26 loc) • 920 B
TypeScript
export interface EvaluateOptions {
depth: number;
position: string;
}
export interface EvaluateResponse {
depth: number;
evaluations: number;
sans: {
san: string;
score: number;
}[];
}
export interface PingResponse {
now: number;
}
export interface ExecuteResponse<T extends Record<string, any> = {}> {
command: string;
options: Record<string, unknown>;
response: T;
}
/** execute a command with the engine worker */
export declare function execute<T extends Record<string, any> = {}>(worker: Worker, command: string, options?: Record<string, any>): Promise<ExecuteResponse<T>>;
/** evaluate a position */
export declare function evaluate(worker: Worker, options: EvaluateOptions): Promise<ExecuteResponse<EvaluateResponse>>;
/** test for a connection with the engine worker */
export declare function ping(worker: Worker): Promise<ExecuteResponse<PingResponse>>;