UNPKG

387 BTypeScriptView Raw
1/**
2 * Random generator for array objects.
3 *
4 * ### Example ###
5 *
6 * let value1 = RandomArray.pick([1, 2, 3, 4]); // Possible result: 3
7 */
8export declare class RandomArray {
9 /**
10 * Picks a random element from specified array.
11 *
12 * @param values an array of any type
13 * @returns a randomly picked item.
14 */
15 static pick<T>(values: T[]): T;
16}