import type { DamageDistribution, OutcomeType } from "../common/types.js"; import { PMF } from "../pmf/pmf.js"; /** Internal bookkeeping attached to a {@link Dice} during parsing. */ export interface DicePrivateData { /** Marks a DC (saving-throw) check so outcomes are attributed correctly. */ isDCCheck?: boolean; /** The "other" distribution recorded by {@link Dice.combine}. */ except?: Dice | Record; /** Keep-highest/lowest selector applied when a die is multiplied out. */ keep?: (values: number[]) => number; /** Set on a freshly parsed flat `dN`/`hdN` atom: its own face count and whether it rerolls a * natural 1 once (Halfling Luck). Read by {@link parseExpression} in parser.ts to recover a * base check die's natural-max identity after it has been convolved with bonus to-hit dice * and modifiers, for a correct plain-`crit` probability. See parser.ts's "Track a flat ... * base check die" comment. */ checkDie?: { sides: number; rerollOne: boolean; }; /** Set on the result of a tracked AC gate (see parser.ts): the exact "natural max, any bonus * roll" sub-distribution, already isolated from the rest of the to-hit total. A plain `crit` * clause reads this directly instead of peeling the combined expression's single highest * face, which is wrong whenever bonus dice are present. */ natMaxCritSlice?: Dice; } /** * @internal */ export declare class Dice { private readonly faces; privateData: DicePrivateData; private outcomeData; private hasHitDistributionCalculated; identifier?: string; constructor(x?: number); getOutcomeDistribution(key: OutcomeType): DamageDistribution | undefined; getFullOutcomeDistribution(): Partial>; setOutcomeDistribution(key: OutcomeType, data: DamageDistribution | undefined): void; hasOutcomeData(key: OutcomeType): boolean; getOutcomeCount(key: OutcomeType, face: number): number; getAverage(key: OutcomeType): number; calculateHitDistribution(): DamageDistribution; private ensureHitDistribution; private binaryOp; private removeFaces; getFaceEntries(): [number, number][]; getFaceMap(): DamageDistribution; get(face: number): number; keys(): number[]; values(): number[]; total(): number; setFace(key: number, value: number): void; static scalar(value: number): Dice; maxFace(): number; minFace(): number; increment(face: number, count: number): void; normalize(scalar: number): Dice; add(other: Dice | number): Dice; subtract(other: Dice | number): Dice; conditionalApply(other: Dice | number): Dice; multiply(other: Dice | number): Dice; addNonZero(other: Dice | number): Dice; eq(other: Dice | number): Dice; max(other: Dice | number): Dice; min(other: Dice | number): Dice; advantage(): Dice; ge(other: Dice | number): Dice; divide(other: Dice | number): Dice; divideRoundUp(other: Dice | number): Dice; divideRoundDown(other: Dice | number): Dice; and(other: Dice | number): Dice; private checkTarget; dc(other: Dice | number): Dice; ac(other: Dice | number): Dice; deleteFace(face: number): Dice; reroll(toReroll: Dice | number): Dice; combine(other: Dice | number): Dice; combineInPlace(other: Dice): void; percent(): DamageDistribution; average(): number; toPMF(numEpsilon?: number): PMF; } export type _DiceInternal = never; //# sourceMappingURL=dice.d.ts.map