pgn-viewer
pgn-viewer copied to clipboard
Definition of a useful external API
Currently the PgnViewerJS can be used as it is, but there is no programmatic interface to it. If #174 is solved, there should be defined a useful (implicit) API, that can be used by others, that want to integrate the PgnViewerJS into their own applications, and drive it by using an external API.
See the wiki page API and Callbacks with the development of the API.
So if anyone is interested in having a function as external API, this would be the place to name it ...
Ideas for the API
- view / edit / print mode
- make moves programmatically: by giving the SAN, the move number, the FEN. If giving the SAN the interpretation will depend on the mode:
- view: search for it in the notation
- edit: make a new move in the current position
- change pgn: gives the viewer a new PGN, optional start at move
- change the configuration: orientation, theme, pieceStyle, ...
- ...
- make moves programmatically: by giving the SAN, the move number, the FEN. If giving the SAN the interpretation will depend on the mode:
- board mode
- ... (any?)
Now everything is in place, so I should be able now to add useful functions to the API. I have to check what could be useful (beside the already existing UI functionality, that may be exposed by the API as well).
- interface to hide/show/set-value of evaluation sidebar
- interface to hide/show/set-value of evaluation sidebar
Which does not exist at the moment. Why should we provide an API for something that has no implementation?