1 | import IntegerOptions = Chance.IntegerOptions;
|
2 | import SentenceOptions = Chance.SentenceOptions;
|
3 | import WordOptions = Chance.WordOptions;
|
4 | import StringOptions = Chance.StringOptions;
|
5 | import UrlOptions = Chance.UrlOptions;
|
6 | import EmailOptions = Chance.EmailOptions;
|
7 |
|
8 | declare interface Any {
|
9 | simpleObject(): Record<string, string>;
|
10 |
|
11 | objectWithKeys<T extends string, F, R = string>(
|
12 | keys: T[],
|
13 | options?: { factory?: F }
|
14 | ): Record<T, F extends (...args: any) => any ? ReturnType<F> : R>;
|
15 |
|
16 | fromList<T extends unknown>(list: T[]): T;
|
17 |
|
18 | subList<T extends unknown>(list: T[], options?: { size: number }): T[];
|
19 |
|
20 | listOf<F extends (...args: any) => any, T = ReturnType<F>>(
|
21 | factory: F,
|
22 | options?: { size?: number; uniqueOn?: string } & Parameters<typeof Any['integer']>[0]
|
23 | ): T[];
|
24 |
|
25 | string(options?: Partial<StringOptions>): string;
|
26 |
|
27 | word(options?: Partial<WordOptions>): string;
|
28 |
|
29 | sentence(options?: Partial<SentenceOptions>): string;
|
30 |
|
31 | paragraph(options?: { sentences?: number }): string;
|
32 |
|
33 | integer(options?: Partial<IntegerOptions>): number;
|
34 |
|
35 | float(options?: Partial<IntegerOptions> & { fixed?: number }): number;
|
36 |
|
37 | boolean(options?: { likelihood?: number }): boolean;
|
38 |
|
39 | url(options?: Partial<UrlOptions>): string;
|
40 |
|
41 | email(options?: Partial<EmailOptions>): string;
|
42 |
|
43 | date(): string;
|
44 | }
|
45 | declare const Any: Any;
|
46 |
|
47 | export default Any;
|