UNPKG

shogiground

Version:
20 lines 1.2 kB
import type { State } from './state.js'; import type { DrawShape } from './draw.js'; import type * as sg from './types.js'; export declare function createSVGElement(tagName: string): SVGElement; interface Shape { shape: DrawShape; hash: Hash; current?: boolean; } type Hash = string; export declare function renderShapes(state: State, svg: SVGElement, customSvg: SVGElement, freePieces: HTMLElement): void; export declare function syncShapes(shapes: Shape[], root: HTMLElement | SVGElement, renderShape: (shape: Shape) => HTMLElement | SVGElement | undefined, outsideArrow?: boolean): void; export declare function renderPiece(state: State, { shape }: Shape): sg.PieceNode | undefined; export declare function setAttributes(el: SVGElement, attrs: Record<string, any>): SVGElement; export declare function pos2user(pos: sg.Pos, color: sg.Color, dims: sg.Dimensions, ratio: sg.NumberPair): sg.NumberPair; export declare function isPiece(x: sg.Key | sg.Piece): x is sg.Piece; export declare function samePieceOrKey(kp1: sg.Key | sg.Piece, kp2: sg.Key | sg.Piece): boolean; export declare function usesBounds(shapes: DrawShape[]): boolean; export {}; //# sourceMappingURL=shapes.d.ts.map