Monte Carlo equity
Card lists accept CardInput (string[] or packed Uint8Array) — see Packed card input.
simulateHandOutcome— single-threaded estimate vs random villain(s)simulateHandOutcomeAsync— same, non-blocking; optionalAbortSignalparallelHandSimulation— chunked workers with distinct seedsparallelHandSimulationAsync— non-blocking parallel MC; optional cancellationsimulateHandOutcomeBatch— many spots →Float64ArrayexactHuEquityVsRandomHand— exact enumeration (preflop or board 3–5 cards)simulateHandOutcomeDetailed— equity with SE and Wilson CI in one callsimulateEquityVsRange— MC vs a weighted villain rangeexactHuEquityVsKnownHand— exact HU when villain holes are knownexactHuEquityVsRange— exact HU vs a weighted range (see Range equity (exact))
See Batch equity for packed batch layouts.
Cancellation
All six *Async exports in this area (and decideActionAsync, benchmarkEvaluatorThroughputAsync) accept an optional trailing AsyncOptions object with signal?: AbortSignal. Aborting rejects the Promise with AbortError and stops cooperative work in the native layer.
const ac = new AbortController();
const pending = poker.simulateHandOutcomeAsync(hole, board, 2_000_000, 42, 1, {
signal: ac.signal,
});
await new Promise((r) => setImmediate(r));
ac.abort();
Use a fixed seed for reproducible research; increase numSimulations until monteCarloStandardError is acceptable.