UNPKG

902 BTypeScriptView Raw
1import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js';
2/**
3 * Constraints to be applied on {@link shuffledSubarray}
4 * @remarks Since 2.18.0
5 * @public
6 */
7export interface ShuffledSubarrayConstraints {
8 /**
9 * Lower bound of the generated subarray size (included)
10 * @defaultValue 0
11 * @remarks Since 2.4.0
12 */
13 minLength?: number;
14 /**
15 * Upper bound of the generated subarray size (included)
16 * @defaultValue The length of the original array itself
17 * @remarks Since 2.4.0
18 */
19 maxLength?: number;
20}
21/**
22 * For subarrays of `originalArray`
23 *
24 * @param originalArray - Original array
25 * @param constraints - Constraints to apply when building instances (since 2.4.0)
26 *
27 * @remarks Since 1.5.0
28 * @public
29 */
30export declare function shuffledSubarray<T>(originalArray: T[], constraints?: ShuffledSubarrayConstraints): Arbitrary<T[]>;