UNPKG

lichess-pgn-viewer

Version:

PGN viewer widget, designed to be embedded in content pages.

35 lines (34 loc) 1.09 kB
import { Api as CgApi } from 'chessground/api'; import { GoTo, InitialOrMove, Opts, Translate } from './interfaces'; import { Config as CgConfig } from 'chessground/config'; import { Path } from './path'; import { AnyNode, Game } from './game'; export default class PgnViewer { readonly opts: Opts; readonly redraw: () => void; game: Game; path: Path; translate: Translate; ground?: CgApi; div?: HTMLElement; flipped: boolean; pane: string; autoScrollRequested: boolean; constructor(opts: Opts, redraw: () => void); curNode: () => AnyNode; curData: () => InitialOrMove; goTo: (to: GoTo, focus?: boolean) => void; canGoTo: (to: GoTo) => boolean; toPath: (path: Path, focus?: boolean) => void; focus: () => void | undefined; toggleMenu: () => void; togglePgn: () => void; orientation: () => "white" | "black"; flip: () => void; cgState: () => CgConfig; analysisUrl: () => string; practiceUrl: () => string; setGround: (cg: CgApi) => void; private redrawGround; private withGround; }