A set of utility types, interfaces and classes that are used through all the Gobstones Platform repositories.
Install with npm by using
npm install @gobstones/gobstones-core
Unless you are developing a library for the Gobstones Platform you probably won't need to use this library directly, as many of the elements in this library are re-exported by other tools. If you are however interesting in using this library directly or you are effectively developing things in the Gobstones Platform, there are several ways how you can use this library.
The main module is @gobstones/gobstones-core
and contains useful classes and abstraction to
most code usage in Gobstones. Currently some of the exported utilities are:
- Board related classes and interfaces (Board, Cell, Color, Direction)
- Expectations (The
expect
function and all it's associated matchers) - Translator (Mainly the translator class and it's associated behavior)
- SourceReader (A class to solve the problem of locating characters in source input)
- helper tools (Such as a tool for creating matrices, a deepEqual comparison, and tools to flatten/unflatten an object)
Just import then from the main module the tools you want. Check the API for more information on what is exported and how it works.
import { Board } from '@gobstones/gobstones-core';
import { expect } from '@gobstones/gobstones-core';
import { SourceInput, SourceReader } from '@gobstones/gobstones-core';
The CLI module provides tools for constructing a CLI application. It resides on the /cli
submodule. It exports mainly the cli
type and function. Import it as follows:
import { cli } from '@gobstones/gobstones-core/cli';
See our Contributions Guidelines to contribute.