UNPKG

shogiground

Version:
33 lines 1.44 kB
import type { Config } from './config.js'; import type { State } from './state.js'; import type { DrawShape, SquareHighlight } from './draw.js'; import type * as sg from './types.js'; export interface Api { attach(wrapElements: sg.WrapElements): void; detach(wrapElementsBoolean: sg.WrapElementsBoolean): void; set(config: Config, skipAnimation?: boolean): void; state: State; getBoardSfen(): sg.BoardSfen; getHandsSfen(): sg.HandsSfen; toggleOrientation(): void; move(orig: sg.Key, dest: sg.Key, prom?: boolean): void; drop(piece: sg.Piece, key: sg.Key, prom?: boolean, spare?: boolean): void; setPieces(pieces: sg.PiecesDiff): void; addToHand(piece: sg.Piece, count?: number): void; removeFromHand(piece: sg.Piece, count?: number): void; selectSquare(key: sg.Key | null, prom?: boolean, force?: boolean): void; selectPiece(piece: sg.Piece | null, spare?: boolean, force?: boolean): void; playPremove(): boolean; cancelPremove(): void; playPredrop(): boolean; cancelPredrop(): void; cancelMoveOrDrop(): void; stop(): void; setShapes(shapes: DrawShape[]): void; setAutoShapes(shapes: DrawShape[]): void; setSquareHighlights(squares: SquareHighlight[]): void; dragNewPiece(piece: sg.Piece, event: sg.MouchEvent, spare?: boolean): void; destroy: sg.Unbind; } export declare function start(state: State): Api; //# sourceMappingURL=api.d.ts.map