@dice-roller/rpg-dice-roller / dice
dice
Die definitions, presets, and registries for extending dice notation.
Classes
| Class | Description |
|---|---|
| DieRegistry | Die factories by name. |
Interfaces
| Interface | Description |
|---|---|
| DieBehaviour | Optional behaviour a die can provide, instead of the default helpers. |
| DieOptions | Optional settings for a preset die. |
| DieSnapshot | The JSON-safe values of a die, stored in results. |
| FacesDieDefinition | A die with a non-empty list of finite faces, e.g. dF ([-1, 0, 1]). Repeats act as weights. |
| RangeDieDefinition | A die defined by its inclusive bounds, e.g. d6 or d%. |
| ResolvedDie | A die with every value resolved to a plain number, and a roll() that always exists. |
Type Aliases
| Type Alias | Description |
|---|---|
| DieDefinition | The minimum data that defines a die. |
| DieFactory | Creates a die from the evaluated arguments of a DieNode, e.g. standard(6) for d6. |
| FudgeNonBlanks | The conventional number of faces each non-blank symbol (-, +) covers on a fudge die. |
| NumberOrGetter | A number, or a function that returns one. |
Variables
| Variable | Description |
|---|---|
| percentileDie | d%: a 100-sided die, displayed as d%. Registered in the DieRegistry as percentile. |
Functions
| Function | Description |
|---|---|
| faceDie | A die with a list of faces, e.g. faceDie([1, 1, 2, 3, 5, 8]). |
| fudgeDie | A fudge / fate die. Registered in the DieRegistry as fudge. |
| rangeDie | A die with every integer from min to max, e.g. rangeDie(-2, 3). |
| standardDie | A die numbered from 1 to sides, e.g. standardDie(6) for d6. |
References
DieLike
Re-exports DieLike