UNPKG

shogiground

Version:
48 lines 1.46 kB
import type { State } from './state.js'; import type * as sg from './types.js'; export interface DrawShape { orig: sg.Key | sg.Piece; dest: sg.Key | sg.Piece; piece?: DrawShapePiece; customSvg?: string; description?: string; brush: string; } export interface SquareHighlight { key: sg.Key; className: string; } export interface DrawShapePiece { role: sg.RoleString; color: sg.Color; scale?: number; } export interface Drawable { enabled: boolean; visible: boolean; forced: boolean; eraseOnClick: boolean; onChange?: (shapes: DrawShape[]) => void; shapes: DrawShape[]; autoShapes: DrawShape[]; squares: SquareHighlight[]; current?: DrawCurrent; prevSvgHash: string; piece?: sg.Piece; } export interface DrawCurrent { orig: sg.Key | sg.Piece; dest?: sg.Key | sg.Piece; arrow?: SVGElement; piece?: sg.Piece; pos: sg.NumberPair; brush: string; } export declare function start(state: State, e: sg.MouchEvent): void; export declare function startFromHand(state: State, piece: sg.Piece, e: sg.MouchEvent): void; export declare function move(state: State, e: sg.MouchEvent): void; export declare function end(state: State, _: sg.MouchEvent): void; export declare function cancel(state: State): void; export declare function clear(state: State): void; export declare function setDrawPiece(state: State, piece: sg.Piece): void; //# sourceMappingURL=draw.d.ts.map