trifle-bot-types
v1.0.7
Published
TypeScript type definitions for Trifle Bot game state and models
Maintainers
Readme
trifle-bot-types
TypeScript type definitions for Trifle Bot game state and models.
This package automatically extracts and publishes types from the main Trifle Bot repository, ensuring they stay in sync with the source code.
Installation
npm install trifle-bot-types
# or
yarn add trifle-bot-typesUsage
import { GameState, HexDirection, TeamId, VoteStatus } from 'trifle-bot-types';
// Use the types in your code
const gameState: GameState = {
snake: {
body: [],
currentDirection: 'n',
},
// ...
};Exported Types
Core Types
HexDirection- Hexagonal grid direction type ('n' | 'ne' | 'se' | 's' | 'sw' | 'nw')TeamId- Team identifier type ('A' | 'B' | 'C' | 'D' | 'E' | 'F')VoteStatus- Vote status type ('pending' | 'complete' | 'failed' | 'rejected')
Game State Types
GameState- Complete game state interfaceSnake- Snake game object interfaceHexPosition- Hexagonal grid position interfaceGameConfig- Game configuration interfaceTeamConfig- Team configuration interfaceVote,Votes- Voting system typesEatenFruit- Eaten fruit trackingDerivedConfig- Derived configuration valuesHexNotationDirection- Hex direction notation
See the source code for the complete list of exported types.
Development
To build the package locally:
cd packages/trifle-bot-types
npm install
npm run buildPublishing
To publish a new version:
cd packages/trifle-bot-types
npm version patch|minor|major
npm publishLicense
ISC
