@gobstones/gobstones-gbb-parser
Version:
A Parser/Stringifier for GBB (Gobstones Board) file format
23 lines • 1.2 kB
TypeScript
import { Board } from '@gobstones/gobstones-core';
import { GBBStringifyingOptions } from './models';
/**
* Convert the given JS Object representing a Board into a String representing a GBB board.
*
* @param board - The `Board` to convert to a GBB board string.
* @param options - The options on how to produce the final string
* @returns A String with a GBB Board format representation of the given board.
*
* @throws
* `GBBUnparsingErrors.InvalidSizeDefinition` -
* If the board has cero or negative size in any width or height.
* `GBBUnparsingErrors.HeadBoundaryExceeded` -
* If the head position is negative or exceeds the board size in any of it's coordinates.
* `GBBUnparsingErrors.InvalidBoardDefinition` -
* If the board array has incorrect size (not matching the board defined size)
* in the main array or any of it's elements.
* `GBBUnparsingErrors.InvalidCellDefinition` -
* If any cell of the board array includes more than 4 keys or is missing any of
* 'a', 'n', 'r' or 'v' keys.
*/
export declare const stringify: (board: Board, options?: Partial<GBBStringifyingOptions>) => string;
//# sourceMappingURL=stringifier.d.ts.map