npm.io
1.3.6 • Published 2 years ago

@types/node-uci

Licence
MIT
Version
1.3.6
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/node-uci

Summary

This package contains type definitions for node-uci (https://github.com/ebemunk/node-uci).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-uci.

index.d.ts

// Minimum TypeScript Version: 3.0
/// <reference types="node" />

import { EventEmitter } from "events";

export interface SearchOptions {
    searchmoves?: readonly string[] | undefined;
    ponder?: boolean | undefined;
    wtime?: number | undefined;
    btime?: number | undefined;
    winc?: number | undefined;
    binc?: number | undefined;
    movestogo?: number | undefined;
    depth?: number | undefined;
    nodes?: number | undefined;
    mate?: number | undefined;
    movetime?: number | undefined;
}

export interface SearchResult {
    bestmove: string;
    info: readonly string[];
}

export class Engine {
    constructor(enginePath: string);
    getBufferUntil(fn: (str: string) => boolean): Promise<readonly string[]>;
    write(cmd: string): void;
    chain(): EngineChain;
    init(): Promise<Engine>;
    quit(): Promise<Engine>;
    isready(): Promise<Engine>;
    sendCmd(cmd: string): Promise<Engine>;
    setoption(name: string, value?: string): Promise<Engine>;
    ucinewgame(): Promise<Engine>;
    ponderhit(): Promise<Engine>;
    position(fen: string, moves?: readonly string[]): Promise<Engine>;
    go(sp: SearchOptions): Promise<SearchResult>;
    goInfinite(sp: SearchOptions): EventEmitter;
    stop(): Promise<SearchResult>;
}

export class EngineChain {
    constructor(engine: Engine);
    init(): EngineChain;
    setoption(name: string, value?: string): EngineChain;
    isready(): EngineChain;
    ucinewgame(): EngineChain;
    quit(): EngineChain;
    position(fen: string, moves?: readonly string[]): EngineChain;
    go(sp: SearchOptions): Promise<SearchResult>;
    exec(): unknown;
}

Additional Details

  • Last updated: Mon, 20 Nov 2023 2324 GMT
  • Dependencies: @types/node

Credits

These definitions were written by .