@dice-roller/rpg-dice-roller / results
results
Result types and helpers for inspecting evaluated expressions.
Interfaces
| Interface | Description |
|---|---|
| BinaryResult | A binary operation and its evaluated operands. |
| DieResult | A single die roll in a pool. |
| FunctionResult | A maths function and its evaluated arguments. |
| GroupMemberResult | One expression of a roll group, with scoring separate from its nested expression result. |
| GroupResult | A group of evaluated members after its modifiers have been applied. |
| NumberResult | The result of a numeric literal. |
| ParenResult | A parenthesised expression and its evaluated inner result. |
| PoolResult | A pool's evaluated quantity, die arguments, die snapshot and modified rolls. |
| ScoredItem | A die roll or group member that modifier handlers can transform using the result helpers. |
| UnaryResult | A unary operation and its evaluated operand. |
Type Aliases
| Type Alias | Description |
|---|---|
| ExpressionResultType | The type of every expression result. |
| RESULT_FLAGS | Semantic flags recording what happened to a die or group member. |
| ResultFlag | A semantic marker on a scored die or group member, interpreted by presenters. |
Functions
| Function | Description |
|---|---|
| createDieResult | A fresh included die result with no flags: value, initialValue and calculationValue all equal value. |
| excludeFromTotal | Returns a copy excluded from the total (useInTotal: false); does not add a drop flag. |
| withCalculationValue | Returns a copy with a new calculationValue, keeping value. |
| withFlags | Returns a copy with flags deduplicated in first-occurrence order; does not change scoring. |
| withValue | Returns a copy with a new value and calculationValue; preserves a die's initialValue. |
References
ExpressionResult
Re-exports ExpressionResult