-
Notifications
You must be signed in to change notification settings - Fork 61
/
index.d.ts
84 lines (78 loc) · 2.45 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import fecha from 'fecha';
import numbro from 'numbro';
interface DefaultMockdata {
titles: string[];
firstNames: string[];
lastNames: string[];
companies: string[];
tlds: string[];
streets: string[];
cities: string[];
countries: string[];
countryCodes: string[];
colors: string[];
lorem: string[];
}
interface DefaultHelpers {
repeat(min: number, max?: number, options?: any): string;
int(min: number, max: number, format?: string, options?: any): string;
float(min: number, max: number, format?: string, options?: any): string;
boolean(options?: any): string;
date(min: string, max: string, format?: string, options?: any): string;
time(min: string, max: string, format?: string, options?: any): string;
title(options?: any): string;
firstName(options?: any): string;
lastName(options?: any): string;
username(options?: any): string;
company(options?: any): string;
tld(options?: any): string;
domain(options?: any): string;
email(options?: any): string;
street(options?: any): string;
city(options?: any): string;
country(options?: any): string;
countryCode(options?: any): string;
zipcode(options?: any): string;
postcode(options?: any): string;
lat(options?: any): string;
long(options?: any): string;
phone(format?: string, options?: any): string;
guid(options?: any): string;
ipv4(options?: any): string;
ipv6(options?: any): string;
color(options?: any): string;
hexColor(options?: any): string;
char(charset: string, options?: any): string;
lorem(totalWords: number, options?: any): string;
random(...items: (string | number)[]): string;
lowercase(value: any): string;
uppercase(value: any): string;
add(a: number, b: number): string;
step(inc: number, options?: any): string;
}
interface Utils {
setRandomSeed(seed: string): void;
random(): number;
randomInt(min: number, max: number): number;
randomFloat(min: number, max: number): number;
randomBoolean(): boolean;
randomDate(min: number, max: number): Date;
randomArrayItem(array: any[]): any;
randomChar(chartset?: string): string;
}
export interface ParseOptions {
mockdata?: Record<string, any>;
helpers?: Record<string, any>;
partials?: Record<string, any>;
seed?: string;
}
declare const dummyjson: {
seed: string;
parse(string: string, options?: ParseOptions): string;
mockdata: DefaultMockdata;
helpers: DefaultHelpers;
utils: Utils;
fecha: typeof fecha;
numbro: typeof numbro;
};
export default dummyjson;