Character contract (C-min)
@franksauvag/rpg-commons/character exports the canonical pivot type DndCharacter and related interfaces for tabletop RPG apps.
Scope (2.0)
| Included | Not included (apps or later versions) |
|---|---|
DndCharacter and nested types | Zod schemas / validators |
ABILITY_KEYS constant | emptyCharacter, derived stats helpers |
| Index fields aligned with SRD types | DndMonster, combat types |
Import
ts
import type { DndCharacter, AbilityScores } from "@franksauvag/rpg-commons/character";AbilityKey is an alias of AbilityIndex from @franksauvag/rpg-commons/srd.
Relation to SRD
speciesIndex,backgroundIndex, classindexvalues reference SRD dataset indices.alignmentIndexusesAlignmentIndexfrom the SRD module.- Apps load SRD data via
createSrdRuntime, then read/writeDndCharacterfor persistence.
See Field guide and API reference.