UNPKG

chessground

Version:
21 lines (20 loc) 1.4 kB
import * as cg from './types.js'; export declare const invRanks: readonly cg.Rank[]; export declare const allKeys: readonly cg.Key[]; export declare const pos2key: (pos: cg.Pos) => cg.Key; export declare const key2pos: (k: cg.Key) => cg.Pos; export declare const uciToMove: (uci: string | undefined) => cg.Key[] | undefined; export declare const allPos: readonly cg.Pos[]; export declare function memo<A>(f: () => A): cg.Memo<A>; export declare const timer: () => cg.Timer; export declare const opposite: (c: cg.Color) => cg.Color; export declare const distanceSq: (pos1: cg.Pos, pos2: cg.Pos) => number; export declare const samePiece: (p1: cg.Piece, p2: cg.Piece) => boolean; export declare const posToTranslate: (bounds: DOMRectReadOnly) => (pos: cg.Pos, asWhite: boolean) => cg.NumberPair; export declare const translate: (el: HTMLElement, pos: cg.NumberPair) => void; export declare const translateAndScale: (el: HTMLElement, pos: cg.NumberPair, scale?: number) => void; export declare const setVisible: (el: HTMLElement, v: boolean) => void; export declare const eventPosition: (e: cg.MouchEvent) => cg.NumberPair | undefined; export declare const isRightButton: (e: cg.MouchEvent) => boolean; export declare const createEl: (tagName: string, className?: string) => HTMLElement; export declare function computeSquareCenter(key: cg.Key, asWhite: boolean, bounds: DOMRectReadOnly): cg.NumberPair;