Skip to content

Character contract (C-min)

@franksauvag/rpg-commons/character exports the canonical pivot type DndCharacter and related interfaces for tabletop RPG apps.

Scope (2.0)

IncludedNot included (apps or later versions)
DndCharacter and nested typesZod schemas / validators
ABILITY_KEYS constantemptyCharacter, derived stats helpers
Index fields aligned with SRD typesDndMonster, 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, class index values reference SRD dataset indices.
  • alignmentIndex uses AlignmentIndex from the SRD module.
  • Apps load SRD data via createSrdRuntime, then read/write DndCharacter for persistence.

See Field guide and API reference.