UNPKG

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