forked from Klowner/casual-browserify
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
300 lines (246 loc) · 12.7 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
declare module "casual" {
interface generators {
// EMBEDDED GENERATORS
_country(): string; // 'United Kingdom'
_city(): string; // 'New Ortiz chester'
_street(): string; // 'Jadyn Islands'
_address(): string; // '6390 Tremblay Pines Suite 784'
_address1(): string; // '8417 Veda Circles'
_address2(): string; // 'Suite 648'
_state(): string; // 'Michigan'
_state_abbr(): string; // 'CO'
_latitude(): string; // 90.0610
_longitude(): string; // 180.0778
_building_number(): string; // 2413
// Text
_sentence(): string; // 'Laborum eius porro consequatur.'
_title(): string; // 'Systematic nobis'
_text(): string; // 'Nemo tempore natus non accusamus eos placeat nesciunt. et fugit ut odio nisi dolore non ... (long text)'
_description(): string; // 'Vel et rerum nostrum quia. Dolorum fuga nobis sit natus consequatur.'
_short_description(): string; // 'Qui iste similique iusto.'
_string(): string; // 'saepe quia molestias voluptates et'
_word(): string; // 'voluptatem'
_letter(): string; // 'k'
// Internet
_ip(): string; // '21.44.122.149'
_domain(): string; // 'darrion.us'
_url(): string; // 'germaine.net'
_email(): string; // '[email protected]'
_user_agent(): string; // 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv():34.0) Gecko/20100101 Firefox/34.0'
// Person
_name(): string; // 'Alberto'
_username(): string; // 'Darryl'
_first_name(): string; // 'Derek'
_last_name(): string; // 'Considine'
_full_name(): string; // 'Kadin Torphy'
_password(): string; // '(205)580-1350Schumm'
_name_prefix(): string; // 'Miss'
_name_suffix(): string; // 'Jr.'
_company_name(): string; // 'Cole, Wuckert and Strosin'
_company_suffix(): string; // 'Inc'
_catch_phrase(): string; // 'Synchronised optimal concept'
_phone(): string; // '982-790-2592'
// numbers
_random(): number; // 0.7171590146608651 (core generator)
_coin_flip(): Boolean; // true
// Date
_unix_time(): number; // 659897901
_moment(): any; // moment.js object see http://momentjs.com/docs/
_century(): string; // 'IV'
_am_pm(): string; // 'am'
_day_of_year(): number; // 323
_day_of_month(): number; // 9
_day_of_week(): number; // 4
_month_number(): number; // 9
_month_name(): string; // 'March'
_year(): number; // 1990
_timezone(): string; // 'America/Miquelon'
// Payments
_card_type(): string; // 'American Express'
_card_exp(): string; // '03/04'
_card_data(): { type: string, number: string, exp: string, holder_name: string }; // { type: 'MasterCard', number: '5307558778577046', exp: '04/88', holder_name: 'Jaron Gibson' }
// Misc
_country_code(): string; // 'ES'
_language_code(): string; // 'ru'
_locale(): string; // 'hi_IN'
_mime_type(): string; // 'audio/mpeg'
_file_extension(): string; // 'rtf'
// Colors
_color_name(): string; // 'DarkOliveGreen'
_safe_color_name(): string; // 'maroon'
_rgb_hex(): string; // '#2e4e1f'
_rgb_array(): Array<number> // [ 194, 193, 166 ]
}
interface functions {
// EMBEDDED GENERATORS
country(): string; // 'United Kingdom'
city(): string; // 'New Ortiz chester'
street(): string; // 'Jadyn Islands'
address(): string; // '6390 Tremblay Pines Suite 784'
address1(): string; // '8417 Veda Circles'
address2(): string; // 'Suite 648'
state(): string; // 'Michigan'
state_abbr(): string; // 'CO'
latitude(): string; // 90.0610
longitude(): string; // 180.0778
building_number(): string; // 2413
// Text
sentence(): string; // 'Laborum eius porro consequatur.'
title(): string; // 'Systematic nobis'
text(): string; // 'Nemo tempore natus non accusamus eos placeat esciunt. et fugit ut odio nisi dolore non ... (long text)'
description(): string; // 'Vel et rerum nostrum quia. Dolorum fuga nobis sit atus consequatur.'
short_description(): string; // 'Qui iste similique iusto.'
string(): string; // 'saepe quia molestias voluptates et'
word(): string; // 'voluptatem'
letter(): string; // 'k'
// Internet
ip(): string; // '21.44.122.149'
domain(): string; // 'darrion.us'
url(): string; // 'germaine.net'
email(): string; // '[email protected]'
user_agent(): string; // 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv():34.0) Gecko/20100101 Firefox/34.0'
// Person
name(): string; // 'Alberto'
username(): string; // 'Darryl'
first_name(): string; // 'Derek'
last_name(): string; // 'Considine'
full_name(): string; // 'Kadin Torphy'
password(): string; // '(205)580-1350Schumm'
name_prefix(): string; // 'Miss'
name_suffix(): string; // 'Jr.'
company_name(): string; // 'Cole, Wuckert and Strosin'
company_suffix(): string; // 'Inc'
catch_phrase(): string; // 'Synchronised optimal concept'
phone(): string; // '982-790-2592'
// numbers
random(): number; // 0.7171590146608651 (core generator)
coin_flip(): Boolean; // true
// Date
unix_time(): number; // 659897901
moment(): any; // moment.js object see http://momentjs.com/docs/
century(): string; // 'IV'
am_pm(): string; // 'am'
day_of_year(): number; // 323
day_of_month(): number; // 9
day_of_week(): number; // 4
month_number(): number; // 9
month_name(): string; // 'March'
year(): number; // 1990
timezone(): string; // 'America/Miquelon'
// Payments
card_type(): string; // 'American Express'
card_exp(): string; // '03/04'
card_data(): { type: string, number: string, exp: string, holder_name: string }; // { type: 'MasterCard', number: '5307558778577046', exp: '04/88', holder_name: 'Jaron Gibson' }
// Misc
country_code(): string; // 'ES'
language_code(): string; // 'ru'
locale(): string; // 'hi_IN'
mime_type(): string; // 'audio/mpeg'
file_extension(): string; // 'rtf'
// Colors
color_name(): string; // 'DarkOliveGreen'
safe_color_name(): string; // 'maroon'
rgb_hex(): string; // '#2e4e1f'
rgb_array(): Array<number> // [ 194, 193, 166 ]
}
interface casual {
// EMBEDDED GENERATORS
country: string; // 'United Kingdom'
city: string; // 'New Ortiz chester'
zip(digits: Object): string; // '26995-7979' (if no digits specified then random selection between ZIP and ZIP+4)
street: string; // 'Jadyn Islands'
address: string; // '6390 Tremblay Pines Suite 784'
address1: string; // '8417 Veda Circles'
address2: string; // 'Suite 648'
state: string; // 'Michigan'
state_abbr: string; // 'CO'
latitude: string; // 90.0610
longitude: string; // 180.0778
building_number: string; // 2413
// Text
sentence: string; // 'Laborum eius porro consequatur.'
sentences(n?: number): string; // 'Dolorum fuga nobis sit natus consequatur. Laboriosam sapiente. Natus quos ut.'
title: string; // 'Systematic nobis'
text: string; // 'Nemo tempore natus non accusamus eos placeat nesciunt. et fugit ut odio nisi dolore non ... (long text)'
description: string; // 'Vel et rerum nostrum quia. Dolorum fuga nobis sit natus consequatur.'
short_description: string; // 'Qui iste similique iusto.'
string: string; // 'saepe quia molestias voluptates et'
word: string; // 'voluptatem'
words(n?: number): string; // 'sed quis ut beatae id adipisci aut'
array_of_words(n?: number): Array<string>; // [ 'voluptas', 'atque', 'vitae', 'vel', 'dolor', 'saepe', 'ut' ]
letter: string; // 'k'
// Internet
ip: string; // '21.44.122.149'
domain: string; // 'darrion.us'
url: string; // 'germaine.net'
email: string; // '[email protected]'
user_agent: string; // 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0'
// Person
name: string; // 'Alberto'
username: string; // 'Darryl'
first_name: string; // 'Derek'
last_name: string; // 'Considine'
full_name: string; // 'Kadin Torphy'
password: string; // '(205)580-1350Schumm'
name_prefix: string; // 'Miss'
name_suffix: string; // 'Jr.'
company_name: string; // 'Cole, Wuckert and Strosin'
company_suffix: string; // 'Inc'
catch_phrase: string; // 'Synchronised optimal concept'
phone: string; // '982-790-2592'
// numbers
random: number; // 0.7171590146608651 (core generator)
integer(from?: number, to?: number): number // 632
double(from?: number, to?: number): number // -234.12987444
array_of_digits(n?: number): Array<number>; // [ 4, 8, 3, 1, 7, 6, 6 ]
array_of_integers(n?: number): Array<number>; // [ -105, -7, -532, -596, -430, -957, -234 ]
array_of_doubles(n?: number): Array<number>; // [ -866.3755785673857, -166.62194719538093, ...]
coin_flip: Boolean; // true
// Date
unix_time: number; // 659897901
moment: any; // moment.js object see http://momentjs.com/docs/
date(format?: string): string; // '2001-07-06' (see available formatters http://momentjs.com/docs/#/parsing/string-format/)
time(format?: string): string; // '03:08:02' (see available formatters http://momentjs.com/docs/#/parsing/string-format/)
century: string; // 'IV'
am_pm: string; // 'am'
day_of_year: number; // 323
day_of_month: number; // 9
day_of_week: number; // 4
month_number: number; // 9
month_name: string; // 'March'
year: number; // 1990
timezone: string; // 'America/Miquelon'
// Payments
card_type: string; // 'American Express'
card_number(vendor?: string): string; // '4716506247152101' (if no vendor specified then random)
card_exp: string; // '03/04'
card_data: { type: string, number: string, exp: string, holder_name: string }; // { type: 'MasterCard', number: '5307558778577046', exp: '04/88', holder_name: 'Jaron Gibson' }
// Misc
country_code: string; // 'ES'
language_code: string; // 'ru'
locale: string; // 'hi_IN'
mime_type: string; // 'audio/mpeg'
file_extension: string; // 'rtf'
// Colors
color_name: string; // 'DarkOliveGreen'
safe_color_name: string; // 'maroon'
rgb_hex: string; // '#2e4e1f'
rgb_array: Array<number> // [ 194, 193, 166 ]
// CUSTOM GENERATORS
define(type: string, cb: () => any): void;
// HELPERS
random_element(elements: Array<any>): any;
random_value(obj: Object): any;
random_key(obj: Object): any;
populate(str: string): string;
populate_one_of(arr: Array<string>): string;
numerify(format: string): string;
register_provider(provider: Object): void;
// SEEDING
seed(n: number): any;
// GENERATORS functions
functions(): functions;
}
const casual: generators & casual;
export = casual;
}