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