Skip to content

@dice-roller/rpg-dice-roller / results

results โ€‹

Result types and helpers for inspecting evaluated expressions.

Interfaces โ€‹

InterfaceDescription
BinaryResultA binary operation and its evaluated operands.
ConditionalResultA check and its one evaluated branch.
DieResultA single die roll in a pool.
FunctionResultA maths function and its evaluated arguments.
GroupMemberResultOne expression of a roll group, with scoring separate from its nested expression result.
GroupResultA group of evaluated members after its modifiers have been applied.
ModifierArgumentResultAn evaluated expression used as a computed Keep/Drop quantity.
NumberResultThe result of a numeric literal.
ParenResultA parenthesised expression and its evaluated inner result.
PoolResultA pool's evaluated quantity, die arguments, die snapshot and modified rolls.
ReferenceResultA system or caller-data reference resolved to a numeric value.
ScoredItemA die roll or group member that modifier handlers can transform using the result helpers.
UnaryResultA unary operation and its evaluated operand.

Type Aliases โ€‹

Type AliasDescription
ExpressionResultTypeThe type of every expression result.
RESULT_FLAGSSemantic flags recording what happened to a die or group member.
ResultFlagA semantic marker on a scored die or group member, interpreted by presenters.

Functions โ€‹

FunctionDescription
createDieResultA fresh included die result with no flags: value, initialValue and calculationValue all equal value.
excludeFromTotalReturns a copy excluded from the total (useInTotal: false); does not add a drop flag.
withCalculationValueReturns a copy with a new calculationValue, keeping value.
withFlagsReturns a copy with flags deduplicated in first-occurrence order; does not change scoring.
withValueReturns a copy with a new value and calculationValue; preserves a die's initialValue.

References โ€‹

ComparisonResult โ€‹

Re-exports ComparisonResult


ExpressionResult โ€‹

Re-exports ExpressionResult

MIT Licensed ยท Credits