return fen;
}
-window.ChessBoard = window.ChessBoard || function(containerElOrId, cfg) {
+/** @struct */
+var cfg;
+
+/** @constructor */
+window.ChessBoard = function(containerElOrId, cfg) {
'use strict';
cfg = cfg || {};
// Validation / Errors
//------------------------------------------------------------------------------
+/**
+ * @param {!number} code
+ * @param {!string} msg
+ * @param {Object=} obj
+ */
function error(code, msg, obj) {
// do nothing if showErrors is not set
if (cfg.hasOwnProperty('showErrors') !== true ||
return '';
}
+/**
+ * @param {!string} piece
+ * @param {boolean=} hidden
+ * @param {!string=} id
+ */
function buildPiece(piece, hidden, id) {
var html = '<img src="' + buildPieceImgSrc(piece) + '" ';
if (id && typeof id === 'string') {
error(5482, 'Invalid value passed to the orientation method.', arg);
};
+/**
+ * @param {!string|!Object} position
+ * @param {boolean=} useAnimation
+ */
widget.position = function(position, useAnimation) {
// no arguments, return the current position
if (arguments.length === 0) {