roll-parser - v3.0.0-beta.0
    Preparing search index...

    Type Alias RollResult

    Complete roll result with all metadata.

    type RollResult = {
        degree?: DegreeOfSuccess;
        expression: string;
        failures?: number;
        natural?: number;
        notation: string;
        parts: RollPart;
        rendered: string;
        rolls: DieResult[];
        successes?: number;
        total: number;
    }
    Index

    PF2e Degree of Success. Present only when the expression used the vs operator at the top level (e.g. 1d20+10 vs 25).

    expression: string

    Normalized expression

    failures?: number

    Number of dice tagged as failure across the whole expression. Present only when a success-counting modifier with a fail threshold was used.

    natural?: number

    Natural d20 value used for PF2e upgrade/downgrade — present only when exactly one kept d20 was rolled on the roll side of a vs expression.

    notation: string

    Original input notation

    parts: RollPart

    Structured breakdown of the evaluated expression, mirroring the AST 1:1.

    rendered: string

    Rendered result with individual rolls shown

    rolls: DieResult[]

    All individual die results

    successes?: number

    Number of dice tagged as success across the whole expression. Present only when a success-counting modifier was used. Independent of total — arithmetic on top of a success count (e.g. 5d6>=5 * 2) affects total but not successes.

    total: number

    Final computed total