import { type IndexNumber } from '../value/index'; /** * A callable factory that returns a random value from its pre-configured values array on each invocation. */ export type RandomPickFactory = (() => T) & { /** * Array of all pickable values within this factory. */ readonly _values: T[]; }; /** * Creates a {@link RandomPickFactory} from the input values. * * @param values - Array of values to randomly pick from. * @returns A callable factory that returns a random value from the array on each invocation. * @throws {Error} If the input array is empty. * * @dbxUtil * @dbxUtilCategory array * @dbxUtilKind factory * @dbxUtilTags array, random, pick, sample, choose, factory * @dbxUtilRelated pick-one-randomly, random-array-index * * @__NO_SIDE_EFFECTS__ */ export declare function randomPickFactory(values: T[]): RandomPickFactory; /** * Returns a random index from the input array. Returns 0 if the array is empty. * * @param values - Array to generate a random index for. * @returns A random valid index within the array, or 0 if the array is empty. * * @dbxUtil * @dbxUtilCategory array * @dbxUtilTags array, random, index, position * @dbxUtilRelated pick-one-randomly, random-pick-factory */ export declare function randomArrayIndex(values: T[]): IndexNumber; /** * Picks a single item randomly from the input array. * * @param values - Array to pick a random item from. * @returns A randomly selected item from the array. * @throws {Error} If the input array is empty. * * @dbxUtil * @dbxUtilCategory array * @dbxUtilTags array, random, pick, sample, choose * @dbxUtilRelated random-pick-factory, random-array-index */ export declare function pickOneRandomly(values: T[]): T;