import { PMF } from "../.js"; import type { DieNode, ExpressionNode } from "./nodes.js"; import type { RollBuilder } from "./roll.js"; import type { RollConfig, RollType } from "./types.js"; export declare function dieNodeFromConfig(cfg: RollConfig): DieNode; export declare function astFromRollConfigs(configs: readonly RollConfig[]): ExpressionNode | undefined; export declare function resolve(node: ExpressionNode, eps?: number): PMF; export declare function pmfFromRollBuilder(rb: RollBuilder, eps?: number): PMF; /** * Resolve a d20-shaped die (honoring reroll/minimum/explode via {@link resolveSingleDie}) then * lift it into advantage/disadvantage/elven accuracy. Each of the 2 or 3 rolls compared is an * independent draw from that SAME resolved marginal — so a Halfling Lucky reroll or a * Trance-of-Order floor applies per-die, matching RAW (you reroll/floor each d20 you roll, not * just a single "representative" one). This generalizes {@link d20RollPMF}, which only ever * modeled the plain-uniform-plus-reroll-1 case; callers that resolve a die with no minimum/ * explode/deeper reroll get bit-identical results to `d20RollPMF` (verified: the reroll-only * formula below reduces to the same closed form). * * Deliberately ignores any caller-facing output-precision `eps` (matching `d20RollPMF`'s own * contract): this builds the FOUNDATIONAL check-die distribution, where every face carries real * probability mass (e.g. 1/20 per face on a flat d20) — pruning it against an output-rounding * epsilon (some callers request eps as coarse as 0.1 purely to round the FINAL hit/miss/crit * mixture) would silently delete real faces instead of real noise. Always resolves at the * library's near-zero {@link defaultEps} internally; only the mixture built on top of this * result should be pruned against the caller's requested eps. */ export declare function resolveD20Roll(die: DieNode, rollType: RollType | undefined): PMF; /** * Resolve a check builder's root die (the to-hit/save d20, or whatever die it wraps), honoring * that die's reroll/minimum/explode, then lift by its `rollType`. The single entry point every * attack/save check builder ({@link ACBuilder}, {@link AttackBuilder}, {@link AlwaysHitBuilder}, * {@link AlwaysCritBuilder}, `DCBuilder`, save `resolveProbabilities`) should use instead of * reaching for `d20RollPMF(rollType, baseReroll > 0)` directly — that 2-argument summary silently * drops `minimum`/`explode` on the root config. */ export declare function resolveRootD20(check: RollBuilder): PMF; export declare function resolveSingleDie(die: DieNode, eps?: number): PMF; export declare function getASTSignature(node: ExpressionNode): string; //# sourceMappingURL=ast.d.ts.map