UNPKG

1.34 kBTypeScriptView 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 {@link lorem}
5 * @remarks Since 2.5.0
6 * @public
7 */
8export interface LoremConstraints {
9 /**
10 * Maximal number of entities:
11 * - maximal number of words in case mode is 'words'
12 * - maximal number of sentences in case mode is 'sentences'
13 *
14 * @defaultValue 0x7fffffff — _defaulting seen as "max non specified" when `defaultSizeToMaxWhenMaxSpecified=true`_
15 * @remarks Since 2.5.0
16 */
17 maxCount?: number;
18 /**
19 * Type of strings that should be produced by {@link lorem}:
20 * - words: multiple words
21 * - sentences: multiple sentences
22 *
23 * @defaultValue 'words'
24 * @remarks Since 2.5.0
25 */
26 mode?: 'words' | 'sentences';
27 /**
28 * Define how large the generated values should be (at max)
29 * @remarks Since 2.22.0
30 */
31 size?: SizeForArbitrary;
32}
33/**
34 * For lorem ipsum string of words or sentences with maximal number of words or sentences
35 *
36 * @param constraints - Constraints to be applied onto the generated value (since 2.5.0)
37 *
38 * @remarks Since 0.0.1
39 * @public
40 */
41export declare function lorem(constraints?: LoremConstraints): Arbitrary<string>;