@dice-roller/rpg-dice-roller / modifiers / ModifierInput
Interface: ModifierInput<N> โ
Defined in: src/modifiers/types.ts:21
Context and modifier node supplied to a handler alongside its items.
Type Parameters โ
N โ
N extends ModifierNode = ModifierNode
Properties โ
ctx โ
readonlyctx:RollContext
Defined in: src/modifiers/types.ts:28
Roll mode, random generator, and safety limits for this evaluation.
die? โ
readonlyoptionaldie?:ResolvedDie
Defined in: src/modifiers/types.ts:35
The pool's die (pools only).
evaluateExpression? โ
readonlyoptionalevaluateExpression?: (node,bindings) =>Generator<EvaluationDrawRequest,ExpressionResult,number>
Defined in: src/modifiers/types.ts:30
Evaluates an expression in an immutable child scope of the current context.
Parameters โ
node โ
bindings โ
Readonly<Record<string, unknown>>
Returns โ
Generator<EvaluationDrawRequest, ExpressionResult, number>
modifier โ
readonlymodifier:N
Defined in: src/modifiers/types.ts:26
The modifier node from the AST for numeric quantities; computed Keep/Drop quantities arrive as a temporary numeric view while their original expressions remain on the source AST and result.
rollBatch? โ
readonlyoptionalrollBatch?: (count) =>Generator<EvaluationDrawRequest, readonlyDieResult[] |undefined,number>
Defined in: src/modifiers/types.ts:43
Rolls a complete batch atomically, or returns undefined without drawing if the remaining per-pool budget is insufficient.
Parameters โ
count โ
number
Returns โ
Generator<EvaluationDrawRequest, readonly DieResult[] | undefined, number>
rollDie? โ
readonlyoptionalrollDie?: () =>Generator<EvaluationDrawRequest,DieResult|undefined,number>
Defined in: src/modifiers/types.ts:37
Rolls one more die of the pool, or returns undefined when its per-pool budget is spent. Initial dice are excluded; repeating handlers must handle exhaustion and keep the results rolled so far.
Returns โ
Generator<EvaluationDrawRequest, DieResult | undefined, number>