UNPKG

@ironarachne/rng

Version:

A library for random number generation and various random ways of selecting items from arrays.

14 lines (13 loc) 301 B
/** * Represents an entry in a weighted list. */ export interface WeightedEntry<T> { /** * The weight of the entry. Higher values mean the entry is more likely to be selected. */ readonly commonality: number; /** * The value of the entry. */ readonly value: T; }