UNPKG

random-pie

Version:

A lightweight TypeScript/JavaScript library providing Python-style random number generation and randomization utilities. This utility module implements the most common functions from Python's random module, making it intuitive for Python developers workin

21 lines (20 loc) 406 B
/** * Types for the random-pie package */ /** * Options for the choices function */ export interface ChoicesOptions { /** * An array of weights corresponding to each element in the population */ weights?: number[] | null; /** * An array of cumulative weights */ cumWeights?: number[] | null; /** * The number of elements to select */ k?: number; }