@cthunline/games
v3.5.0
Published
> TS types and [TypeBox](https://github.com/sinclairzx81/typebox) schemas for Cthunline games
Downloads
205
Readme
Cthunline Games
TS types and TypeBox schemas for Cthunline games
Using this package in other projects
Install
npm i @cthunline/games
Usage
import { callOfCthulhu, CoCCharacter } from '@cthunline/games';
import { Value } from '@sinclair/typebox/value';
// Check character data validity against schema
Value.Check(callOfCthulhu.schema, data);
// Use the default character object to initialise a new character
const newCharacter = { ...callOfCthulhu.default };
// Use TS types to type character objects
const character: CoCCharacter = {
// ...
};