import {RNGFunction} from './types'; type WeightedChoiceOptions = { rng: RNGFunction; getWeight: (item: T, index?: number) => number; }; type WeightedChoiceFunction = (array: Array) => T; type CachedWeightedChoiceFunction = () => T; declare const weightedChoice: { (array: Array): T; createWeightedChoice(rng: RNGFunction): WeightedChoiceFunction; createWeightedChoice( options: WeightedChoiceOptions ): WeightedChoiceFunction; createCachedWeightedChoice( rng: RNGFunction, array: Array ): CachedWeightedChoiceFunction; createCachedWeightedChoice( options: WeightedChoiceOptions, array: Array ): CachedWeightedChoiceFunction; }; export function createWeightedChoice( rng: RNGFunction ): WeightedChoiceFunction; export function createWeightedChoice( options: WeightedChoiceFunction ): WeightedChoiceFunction; export function createCachedWeightedChoice( rng: RNGFunction, array: Array ): CachedWeightedChoiceFunction; export function createCachedWeightedChoice( options: WeightedChoiceOptions, array: Array ): CachedWeightedChoiceFunction; export default weightedChoice;