UNPKG

kokopu

Version:

A JavaScript/TypeScript library implementing the chess game rules and providing tools to read/write the standard chess file formats.

85 lines 3.03 kB
"use strict"; /*! * -------------------------------------------------------------------------- * * * * Kokopu - A JavaScript/TypeScript chess library. * * <https://www.npmjs.com/package/kokopu> * * Copyright (C) 2018-2025 Yoann Le Montagner <yo35 -at- melix.net> * * * * Kokopu is free software: you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * * as published by the Free Software Foundation, either version 3 of * * the License, or (at your option) any later version. * * * * Kokopu is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General * * Public License along with this program. If not, see * * <http://www.gnu.org/licenses/>. * * * * -------------------------------------------------------------------------- */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Variation = exports.Node = exports.AbstractNode = void 0; /** * Base class for {@link Node} and {@link Variation}. */ class AbstractNode { /** * @ignore */ constructor() { } } exports.AbstractNode = AbstractNode; /** * Represent one move in the tree structure formed by a chess game with multiple variations. */ class Node extends AbstractNode { /** * @ignore */ constructor() { super(); } /** * @deprecated Use `obj instanceof Variation` instead. */ isVariation() { return false; } /** * @ignore */ toString() { return `${this.id()}[${this.notation()}]`; } } exports.Node = Node; /** * Represent one variation in the tree structure formed by a chess game, meaning a starting chess position and * a list of moves played consecutively from this position. */ class Variation extends AbstractNode { /** * @ignore */ constructor() { super(); } /** * @deprecated Use `obj instanceof Variation` instead. */ isVariation() { return true; } /** * @ignore */ toString() { return this.id(); } } exports.Variation = Variation; //# sourceMappingURL=node_variation.js.map