UNPKG

2.3 kBTypeScriptView Raw
1import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
2/**
3 * Constraints to be applied on {@link lorem}
4 * @remarks Since 2.5.0
5 * @public
6 */
7export interface LoremConstraints {
8 /**
9 * Maximal number of entities:
10 * - maximal number of words in case mode is 'words'
11 * - maximal number of sentences in case mode is 'sentences'
12 *
13 * @defaultValue 5
14 *
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 *
25 * @remarks Since 2.5.0
26 */
27 mode?: 'words' | 'sentences';
28}
29/**
30 * For lorem ipsum strings of words
31 * @remarks Since 0.0.1
32 * @public
33 */
34declare function lorem(): Arbitrary<string>;
35/**
36 * For lorem ipsum string of words with maximal number of words
37 *
38 * @param maxWordsCount - Upper bound of the number of words allowed
39 *
40 * @deprecated
41 * Superceded by `fc.lorem({maxCount})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
42 * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
43 *
44 * @remarks Since 0.0.1
45 * @public
46 */
47declare function lorem(maxWordsCount: number): Arbitrary<string>;
48/**
49 * For lorem ipsum string of words or sentences with maximal number of words or sentences
50 *
51 * @param maxWordsCount - Upper bound of the number of words/sentences allowed
52 * @param sentencesMode - If enabled, multiple sentences might be generated
53 *
54 * @deprecated
55 * Superceded by `fc.lorem({maxCount, mode})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
56 * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
57 *
58 * @remarks Since 0.0.1
59 * @public
60 */
61declare function lorem(maxWordsCount: number, sentencesMode: boolean): Arbitrary<string>;
62/**
63 * For lorem ipsum string of words or sentences with maximal number of words or sentences
64 *
65 * @param constraints - Constraints to be applied onto the generated value
66 *
67 * @remarks Since 2.5.0
68 * @public
69 */
70declare function lorem(constraints: LoremConstraints): Arbitrary<string>;
71export { lorem };