Skip to content

@vttforge/types / RollLike

Interface: RollLike ​

foundry.dice.Roll.

Properties ​

data ​

readonly data: Record<string, unknown>


dice ​

readonly dice: DieTermLike[]


formula ​

readonly formula: string


isDeterministic ​

readonly isDeterministic: boolean


options ​

options: Record<string, unknown>


result ​

readonly result: string


terms ​

readonly terms: RollTermLike[]


total ​

readonly total: number | undefined

Undefined until the roll is evaluated.

Methods ​

alter() ​

alter(multiply, add, options?): this

Parameters ​

multiply ​

number

add ​

number

options? ​
multiplyNumeric? ​

boolean

Returns ​

this


clone() ​

clone(): this

Returns ​

this


evaluate() ​

evaluate(options?): Promise<RollLike>

Always await this. Nothing reads total before it resolves.

Parameters ​

options? ​

RollEvaluateOptions

Returns ​

Promise<RollLike>


evaluateSync() ​

evaluateSync(options?): this

Only for a deterministic roll: pass minimize or maximize.

Parameters ​

options? ​

RollEvaluateOptions & object

Returns ​

this


getTooltip() ​

getTooltip(): Promise<string>

Returns ​

Promise<string>


render() ​

render(options?): Promise<string>

Parameters ​

options? ​
flavor? ​

string

isPrivate? ​

boolean

template? ​

string

Returns ​

Promise<string>


reroll() ​

reroll(options?): Promise<RollLike>

Parameters ​

options? ​

RollEvaluateOptions

Returns ​

Promise<RollLike>


resetFormula() ​

resetFormula(): string

Returns ​

string


roll() ​

roll(options?): Promise<RollLike>

An async alias of evaluate.

Parameters ​

options? ​

RollEvaluateOptions

Returns ​

Promise<RollLike>


toAnchor() ​

toAnchor(options?): HTMLAnchorElement

Parameters ​

options? ​
attrs? ​

Record<string, string>

classes? ​

readonly string[]

dataset? ​

Record<string, string>

icon? ​

string

label? ​

string

Returns ​

HTMLAnchorElement


toJSON() ​

toJSON(): Record<string, unknown>

Returns ​

Record<string, unknown>


toMessage() ​

toMessage(messageData?, options?): Promise<unknown>

Parameters ​

messageData? ​

Record<string, unknown>

options? ​

ToMessageOptions

Returns ​

Promise<unknown>

MIT licensed.