UNPKG

829 BTypeScriptView Raw
1import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js';
2import type { SizeForArbitrary } from './_internals/helpers/MaxLengthFromMinLength.js';
3/**
4 * Constraints to be applied on the arbitrary {@link stringMatching}
5 * @remarks Since 3.10.0
6 * @public
7 */
8export type StringMatchingConstraints = {
9 /**
10 * Define how large the generated values should be (at max)
11 * @remarks Since 3.10.0
12 */
13 size?: SizeForArbitrary;
14};
15/**
16 * For strings matching the provided regex
17 *
18 * @param regex - Arbitrary able to generate random strings (possibly multiple characters)
19 * @param constraints - Constraints to apply when building instances
20 *
21 * @remarks Since 3.10.0
22 * @public
23 */
24export declare function stringMatching(regex: RegExp, constraints?: StringMatchingConstraints): Arbitrary<string>;