UNPKG

616 BTypeScriptView Raw
1import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
2/**
3 * Generate non-contiguous ranges of values
4 * by mapping integer values to constant
5 *
6 * @param options - Builders to be called to generate the values
7 *
8 * @example
9 * ```
10 * // generate alphanumeric values (a-z0-9)
11 * mapToConstant(
12 * { num: 26, build: v => String.fromCharCode(v + 0x61) },
13 * { num: 10, build: v => String.fromCharCode(v + 0x30) },
14 * )
15 * ```
16 *
17 * @remarks Since 1.14.0
18 * @public
19 */
20export declare function mapToConstant<T>(...entries: {
21 num: number;
22 build: (idInGroup: number) => T;
23}[]): Arbitrary<T>;