UNPKG

svelte4-chess

Version:

Fully playable chess component for Svelte 4. Powered by Chess.js logic, Chessground chessboard and optionally Stockfish chess AI.

27 lines (26 loc) 714 B
import type { Color } from './api.js'; export interface EngineOptions { moveTime?: number; depth?: number; color?: Color | 'both' | 'none'; stockfishPath?: string; } export declare class Engine { private stockfish; private state; private moveTime; private depth; private color; private stockfishPath; private externalUciCallback; private onUciOk; private onBestMove; constructor(options?: EngineOptions); init(): Promise<void>; private _onUci; setUciCallback(callback: (uci: string) => void): void; getMove(fen: string): Promise<string>; getColor(): Color | "both" | "none"; isSearching(): boolean; stopSearch(): Promise<void>; }