chessground12
Version:
Extended lishuuro.org Chess UI
110 lines (109 loc) • 3.04 kB
TypeScript
import type { AnimCurrent } from './anim';
import type { DragCurrent } from './drag';
import type { Drawable } from './draw';
import { BoardDimensions, Color, Dests, Dom, DropDests, Elements, Exploding, Geometry, Key, KeyPair, MoveMetadata, Notation, Piece, Pieces, Plinths, PocketRoles, Pockets, Role, SetPremoveMetadata, Timer, Variant } from './types';
export interface HeadlessState {
pieces: Pieces;
plinths: Plinths;
plinthsPlaced: boolean;
orientation: Color;
turnColor: Color;
check?: Key;
lastMove?: Key[];
selected?: Key;
coordinates: boolean;
autoCastle: boolean;
viewOnly: boolean;
disableContextMenu: boolean;
addPieceZIndex: boolean;
addDimensionsCssVars: boolean;
blockTouchScroll: boolean;
pieceKey: boolean;
highlight: {
lastMove: boolean;
check: boolean;
};
animation: {
enabled: boolean;
duration: number;
current?: AnimCurrent;
};
movable: {
free: boolean;
color?: Color | 'both';
dests?: Dests;
showDests: boolean;
events: {
after?: (orig: Key, dest: Key, metadata: MoveMetadata) => void;
afterNewPiece?: (role: Role, key: Key, metadata: MoveMetadata) => void;
};
rookCastle: boolean;
};
premovable: {
enabled: boolean;
showDests: boolean;
castle: boolean;
dests?: Key[];
current?: KeyPair;
events: {
set?: (orig: Key, dest: Key, metadata?: SetPremoveMetadata) => void;
unset?: () => void;
};
};
predroppable: {
enabled: boolean;
showDropDests: boolean;
dropDests?: Key[];
current?: {
role: Role;
key: Key;
};
events: {
set?: (role: Role, key: Key) => void;
unset?: () => void;
};
};
draggable: {
enabled: boolean;
distance: number;
autoDistance: boolean;
showGhost: boolean;
deleteOnDropOff: boolean;
current?: DragCurrent;
};
dropmode: {
active: boolean;
showDropDests: boolean;
piece?: Piece;
dropDests?: DropDests;
};
selectable: {
enabled: boolean;
};
stats: {
dragged: boolean;
ctrlKey?: boolean;
};
events: {
change?: () => void;
move?: (orig: Key, dest: Key, capturedPiece?: Piece) => void;
dropNewPiece?: (piece: Piece, key: Key) => void;
select?: (key: Key) => void;
insert?: (elements: Elements) => void;
pocketSelect?: (piece: Piece) => void;
};
drawable: Drawable;
exploding?: Exploding;
hold: Timer;
dimensions: BoardDimensions;
geometry: Geometry;
variant: Variant;
chess960: boolean;
notation: Notation;
pockets?: Pockets;
pocketRoles?: PocketRoles;
}
export interface State extends HeadlessState {
dom: Dom;
}
export declare function defaults(): HeadlessState;