Skip to content

@dice-roller/rpg-dice-roller / RollOptions

Interface: RollOptions<T, Mode> โ€‹

Defined in: src/RollSettings.ts:35

How notation is parsed, rolled and presented. Every option is optional.

Type Parameters โ€‹

T โ€‹

T = string

the output type of the presenter

Mode โ€‹

Mode extends DrawMode = DrawMode

Properties โ€‹

data? โ€‹

optional data?: RollInputData

Defined in: src/RollSettings.ts:39

Default nested values available through $path; each roll snapshots these unless replaced by per-roll data.


dice? โ€‹

optional dice?: DieRegistry

Defined in: src/RollSettings.ts:43

Default: new DieRegistry() (the built-in dice).


drawDie? โ€‹

optional drawDie?: DrawDieOptionsForMode<Mode>

Defined in: src/RollSettings.ts:49

External dice source used instead of the random generator when configured.


engine? โ€‹

optional engine?: EngineOption

Defined in: src/RollSettings.ts:37

The source of randomness (default nativeMath); may be a name, engine instance, or definition.


engines? โ€‹

optional engines?: EngineRegistry

Defined in: src/RollSettings.ts:41

Engine factories used to resolve names (default: the built-in engines).


limits? โ€‹

optional limits?: Partial<RollLimits>

Defined in: src/RollSettings.ts:47

Safety limits: maxQty 999, maxIterations 1000 and maxGeneratedRolls 1,000,000 generated rolls per pool/evaluation; each must be a positive safe integer. The generated-roll limit excludes initial dice and truncates repeating modifiers without throwing.


modifiers? โ€‹

optional modifiers?: ModifierRegistry

Defined in: src/RollSettings.ts:45

Default: new ModifierRegistry() (the built-in modifiers).


presenter? โ€‹

optional presenter?: Presenter<T>

Defined in: src/RollSettings.ts:51

Used by Roll.present() and Roller.present() (default: the default TextPresenter).

MIT Licensed ยท Credits