UNPKG

24.3 kBTypeScriptView Raw
1import { Moment } from 'moment';
2export * from './shared';
3import * as dom from './src/browser/dom';
4export * from './src/browser/dom';
5export { dom };
6/********************************************* EXPORT *********************************************/
7/**
8 * Top-level mad-utils namespace, containing all child namespaces
9 * Includes all contents of shared module plus browser-specific namespaces
10 */
11export declare const mUtils: {
12 dom: typeof dom;
13 array: typeof import("./src/array");
14 date: typeof import("./src/date");
15 commonDataTypes: typeof import("./src/types-data-generic");
16 dataTypes: typeof import("./src/types-data-generic");
17 enum: typeof import("./src/enum");
18 Enum: typeof import("./src/enum");
19 err: typeof import("./src/error");
20 error: typeof import("./src/error");
21 find: typeof import("./src/search");
22 func: typeof import("./src/function");
23 function: typeof import("./src/function");
24 functionUtils: typeof import("./src/function");
25 genericDataTypes: typeof import("./src/types-data-generic");
26 isNode: any;
27 locale: typeof import("./src/locale");
28 math: typeof import("./src/number");
29 num: typeof import("./src/number");
30 number: typeof import("./src/number");
31 numeric: typeof import("./src/number");
32 stream: typeof import("./src/stream");
33 object: typeof import("./src/object");
34 url: typeof import("./src/url");
35 search: typeof import("./src/search");
36 srch: typeof import("./src/search");
37 stacktrace: typeof import("./src/error");
38 str: typeof import("./src/string");
39 string: typeof import("./src/string");
40 type: {
41 biologicalSexes: Readonly<{
42 male: "male";
43 female: "female";
44 }>;
45 commonBiologicalSexes: Readonly<{
46 male: "male";
47 female: "female";
48 }>;
49 sexes: Readonly<{
50 male: "male";
51 female: "female";
52 }>;
53 commonSexes: Readonly<{
54 male: "male";
55 female: "female";
56 }>;
57 biologicalSexesWithBoth: Readonly<Readonly<{
58 male: "male";
59 female: "female";
60 }> & {
61 both: "both";
62 }>;
63 commonBiologicalSexesWithBoth: Readonly<Readonly<{
64 male: "male";
65 female: "female";
66 }> & {
67 both: "both";
68 }>;
69 sexesWithBoth: Readonly<Readonly<{
70 male: "male";
71 female: "female";
72 }> & {
73 both: "both";
74 }>;
75 commonSexesWithBoth: Readonly<Readonly<{
76 male: "male";
77 female: "female";
78 }> & {
79 both: "both";
80 }>;
81 sexWithBoth: Readonly<Readonly<{
82 male: "male";
83 female: "female";
84 }> & {
85 both: "both";
86 }>;
87 biologicalSexesWithOther: Readonly<Readonly<{
88 male: "male";
89 female: "female";
90 }> & {
91 other: "other";
92 }>;
93 sexesWithOther: Readonly<Readonly<{
94 male: "male";
95 female: "female";
96 }> & {
97 other: "other";
98 }>;
99 commonSexesWithOther: Readonly<Readonly<{
100 male: "male";
101 female: "female";
102 }> & {
103 other: "other";
104 }>;
105 commonBiologicalSexesWithOther: Readonly<Readonly<{
106 male: "male";
107 female: "female";
108 }> & {
109 other: "other";
110 }>;
111 gender: Readonly<Readonly<{
112 male: "male";
113 female: "female";
114 }> & {
115 other: "other";
116 }>;
117 genderCommon: Readonly<Readonly<{
118 male: "male";
119 female: "female";
120 }> & {
121 other: "other";
122 }>;
123 genderWithBoth: Readonly<Readonly<{
124 male: "male";
125 female: "female";
126 }> & {
127 both: "both";
128 }>;
129 genderCommonWithBoth: Readonly<Readonly<{
130 male: "male";
131 female: "female";
132 }> & {
133 both: "both";
134 }>;
135 genderFull: Readonly<Readonly<Readonly<{
136 male: "male";
137 female: "female";
138 }> & {
139 other: "other";
140 }> & {
141 transMale: "trans male";
142 transFemale: "trans female";
143 genderqueer: "genderqueer";
144 genderfluid: "genderfluid";
145 intersex: "intersex";
146 agender: "agender";
147 bigender: "bigender";
148 nonBinary: "nonBinary";
149 none: "none";
150 }>;
151 CANProvinces: Readonly<{
152 on: "Ontario";
153 qc: "Quebec";
154 nb: "New Brunswick";
155 ns: "Nova Scotia";
156 pe: "Prince Edward Island";
157 mb: "Manitoba";
158 sk: "Saskatchewan";
159 bc: "British Columbia";
160 nt: "Northwest Territories";
161 nu: "Nunavut";
162 yt: "Yukon Territory";
163 ab: "Alberta";
164 nl: "Newfoundland and Labrador";
165 }>;
166 CANProvincesOrNone: Readonly<Readonly<{
167 on: "Ontario";
168 qc: "Quebec";
169 nb: "New Brunswick";
170 ns: "Nova Scotia";
171 pe: "Prince Edward Island";
172 mb: "Manitoba";
173 sk: "Saskatchewan";
174 bc: "British Columbia";
175 nt: "Northwest Territories";
176 nu: "Nunavut";
177 yt: "Yukon Territory";
178 ab: "Alberta";
179 nl: "Newfoundland and Labrador";
180 }> & {
181 none: "none";
182 }>;
183 canadianProvinces: Readonly<{
184 on: "Ontario";
185 qc: "Quebec";
186 nb: "New Brunswick";
187 ns: "Nova Scotia";
188 pe: "Prince Edward Island";
189 mb: "Manitoba";
190 sk: "Saskatchewan";
191 bc: "British Columbia";
192 nt: "Northwest Territories";
193 nu: "Nunavut";
194 yt: "Yukon Territory";
195 ab: "Alberta";
196 nl: "Newfoundland and Labrador";
197 }>;
198 canadianProvincesOrNone: Readonly<Readonly<{
199 on: "Ontario";
200 qc: "Quebec";
201 nb: "New Brunswick";
202 ns: "Nova Scotia";
203 pe: "Prince Edward Island";
204 mb: "Manitoba";
205 sk: "Saskatchewan";
206 bc: "British Columbia";
207 nt: "Northwest Territories";
208 nu: "Nunavut";
209 yt: "Yukon Territory";
210 ab: "Alberta";
211 nl: "Newfoundland and Labrador";
212 }> & {
213 none: "none";
214 }>;
215 isUndefined: (value: any) => value is undefined;
216 isNullOrUndefined: (val: any) => val is null;
217 isVoidOrString: (val: any) => val is string;
218 isAlphabeticChar: <T extends string = string>(val: any, handleAccents?: boolean) => val is T;
219 isAlphaChar: <T extends string = string>(val: any, handleAccents?: boolean) => val is T;
220 isNumber: <T extends number | Number = number>(val: any) => val is T;
221 isNum: <T extends number | Number = number>(val: any) => val is T;
222 isNumberLike: <T extends string | number | String | Number = number>(val: any) => val is T;
223 isNumLike: <T extends string | number | String | Number = number>(val: any) => val is T;
224 isInteger: <T extends string | number | String | Number = number>(val: any) => val is T;
225 isInt: <T extends string | number | String | Number = number>(val: any) => val is T;
226 isIntegerLike: <T extends string | number | String | Number = number>(val: any) => val is T;
227 isIntLike: <T extends string | number | String | Number = number>(val: any) => val is T;
228 isString: <T extends string | String = string>(val: any) => val is T;
229 isStringOrNumber: (val: any) => val is string | number | String | Number;
230 isStringOrNum: (val: any) => val is string | number | String | Number;
231 isStrOrNum: (val: any) => val is string | number | String | Number;
232 isBoolean: <T extends boolean | Boolean = boolean>(val: any) => val is T;
233 isBool: <T extends boolean | Boolean = boolean>(val: any) => val is T;
234 isDateLike: <T extends string | boolean | Object | Moment>(val: any) => val is T;
235 isArray: <T = any>(val: any) => val is T[];
236 isObject: <T extends Object = Object>(val: any, trueForArrays?: boolean) => val is T;
237 isTrue: <T extends string | true | String = true>(val: any, include1CharVal?: boolean) => val is T;
238 isFalse: <T extends string | false | String = false>(val: any, include1CharVal?: boolean) => val is T;
239 isFunction: <T extends Function = (...args: any[]) => any>(val: any) => val is T;
240 singleton: <T extends import("./shared").ClassConstructor>(constructor: T) => import("./shared").SingletonInterface<any> & T;
241 boolStringToBool: (val: string | boolean, strict?: boolean) => boolean;
242 toBoolFromBoolString: (val: string | boolean, strict?: boolean) => boolean;
243 getType: (val: any, extraArrayDetectCb?: (val: any) => boolean) => import("./shared").DataTypesExpanded;
244 };
245 types: {
246 biologicalSexes: Readonly<{
247 male: "male";
248 female: "female";
249 }>;
250 commonBiologicalSexes: Readonly<{
251 male: "male";
252 female: "female";
253 }>;
254 sexes: Readonly<{
255 male: "male";
256 female: "female";
257 }>;
258 commonSexes: Readonly<{
259 male: "male";
260 female: "female";
261 }>;
262 biologicalSexesWithBoth: Readonly<Readonly<{
263 male: "male";
264 female: "female";
265 }> & {
266 both: "both";
267 }>;
268 commonBiologicalSexesWithBoth: Readonly<Readonly<{
269 male: "male";
270 female: "female";
271 }> & {
272 both: "both";
273 }>;
274 sexesWithBoth: Readonly<Readonly<{
275 male: "male";
276 female: "female";
277 }> & {
278 both: "both";
279 }>;
280 commonSexesWithBoth: Readonly<Readonly<{
281 male: "male";
282 female: "female";
283 }> & {
284 both: "both";
285 }>;
286 sexWithBoth: Readonly<Readonly<{
287 male: "male";
288 female: "female";
289 }> & {
290 both: "both";
291 }>;
292 biologicalSexesWithOther: Readonly<Readonly<{
293 male: "male";
294 female: "female";
295 }> & {
296 other: "other";
297 }>;
298 sexesWithOther: Readonly<Readonly<{
299 male: "male";
300 female: "female";
301 }> & {
302 other: "other";
303 }>;
304 commonSexesWithOther: Readonly<Readonly<{
305 male: "male";
306 female: "female";
307 }> & {
308 other: "other";
309 }>;
310 commonBiologicalSexesWithOther: Readonly<Readonly<{
311 male: "male";
312 female: "female";
313 }> & {
314 other: "other";
315 }>;
316 gender: Readonly<Readonly<{
317 male: "male";
318 female: "female";
319 }> & {
320 other: "other";
321 }>;
322 genderCommon: Readonly<Readonly<{
323 male: "male";
324 female: "female";
325 }> & {
326 other: "other";
327 }>;
328 genderWithBoth: Readonly<Readonly<{
329 male: "male";
330 female: "female";
331 }> & {
332 both: "both";
333 }>;
334 genderCommonWithBoth: Readonly<Readonly<{
335 male: "male";
336 female: "female";
337 }> & {
338 both: "both";
339 }>;
340 genderFull: Readonly<Readonly<Readonly<{
341 male: "male";
342 female: "female";
343 }> & {
344 other: "other";
345 }> & {
346 transMale: "trans male";
347 transFemale: "trans female";
348 genderqueer: "genderqueer";
349 genderfluid: "genderfluid";
350 intersex: "intersex";
351 agender: "agender";
352 bigender: "bigender";
353 nonBinary: "nonBinary";
354 none: "none";
355 }>;
356 CANProvinces: Readonly<{
357 on: "Ontario";
358 qc: "Quebec";
359 nb: "New Brunswick";
360 ns: "Nova Scotia";
361 pe: "Prince Edward Island";
362 mb: "Manitoba";
363 sk: "Saskatchewan";
364 bc: "British Columbia";
365 nt: "Northwest Territories";
366 nu: "Nunavut";
367 yt: "Yukon Territory";
368 ab: "Alberta";
369 nl: "Newfoundland and Labrador";
370 }>;
371 CANProvincesOrNone: Readonly<Readonly<{
372 on: "Ontario";
373 qc: "Quebec";
374 nb: "New Brunswick";
375 ns: "Nova Scotia";
376 pe: "Prince Edward Island";
377 mb: "Manitoba";
378 sk: "Saskatchewan";
379 bc: "British Columbia";
380 nt: "Northwest Territories";
381 nu: "Nunavut";
382 yt: "Yukon Territory";
383 ab: "Alberta";
384 nl: "Newfoundland and Labrador";
385 }> & {
386 none: "none";
387 }>;
388 canadianProvinces: Readonly<{
389 on: "Ontario";
390 qc: "Quebec";
391 nb: "New Brunswick";
392 ns: "Nova Scotia";
393 pe: "Prince Edward Island";
394 mb: "Manitoba";
395 sk: "Saskatchewan";
396 bc: "British Columbia";
397 nt: "Northwest Territories";
398 nu: "Nunavut";
399 yt: "Yukon Territory";
400 ab: "Alberta";
401 nl: "Newfoundland and Labrador";
402 }>;
403 canadianProvincesOrNone: Readonly<Readonly<{
404 on: "Ontario";
405 qc: "Quebec";
406 nb: "New Brunswick";
407 ns: "Nova Scotia";
408 pe: "Prince Edward Island";
409 mb: "Manitoba";
410 sk: "Saskatchewan";
411 bc: "British Columbia";
412 nt: "Northwest Territories";
413 nu: "Nunavut";
414 yt: "Yukon Territory";
415 ab: "Alberta";
416 nl: "Newfoundland and Labrador";
417 }> & {
418 none: "none";
419 }>;
420 isUndefined: (value: any) => value is undefined;
421 isNullOrUndefined: (val: any) => val is null;
422 isVoidOrString: (val: any) => val is string;
423 isAlphabeticChar: <T extends string = string>(val: any, handleAccents?: boolean) => val is T;
424 isAlphaChar: <T extends string = string>(val: any, handleAccents?: boolean) => val is T;
425 isNumber: <T extends number | Number = number>(val: any) => val is T;
426 isNum: <T extends number | Number = number>(val: any) => val is T;
427 isNumberLike: <T extends string | number | String | Number = number>(val: any) => val is T;
428 isNumLike: <T extends string | number | String | Number = number>(val: any) => val is T;
429 isInteger: <T extends string | number | String | Number = number>(val: any) => val is T;
430 isInt: <T extends string | number | String | Number = number>(val: any) => val is T;
431 isIntegerLike: <T extends string | number | String | Number = number>(val: any) => val is T;
432 isIntLike: <T extends string | number | String | Number = number>(val: any) => val is T;
433 isString: <T extends string | String = string>(val: any) => val is T;
434 isStringOrNumber: (val: any) => val is string | number | String | Number;
435 isStringOrNum: (val: any) => val is string | number | String | Number;
436 isStrOrNum: (val: any) => val is string | number | String | Number;
437 isBoolean: <T extends boolean | Boolean = boolean>(val: any) => val is T;
438 isBool: <T extends boolean | Boolean = boolean>(val: any) => val is T;
439 isDateLike: <T extends string | boolean | Object | Moment>(val: any) => val is T;
440 isArray: <T = any>(val: any) => val is T[];
441 isObject: <T extends Object = Object>(val: any, trueForArrays?: boolean) => val is T;
442 isTrue: <T extends string | true | String = true>(val: any, include1CharVal?: boolean) => val is T;
443 isFalse: <T extends string | false | String = false>(val: any, include1CharVal?: boolean) => val is T;
444 isFunction: <T extends Function = (...args: any[]) => any>(val: any) => val is T;
445 singleton: <T extends import("./shared").ClassConstructor>(constructor: T) => import("./shared").SingletonInterface<any> & T;
446 boolStringToBool: (val: string | boolean, strict?: boolean) => boolean;
447 toBoolFromBoolString: (val: string | boolean, strict?: boolean) => boolean;
448 getType: (val: any, extraArrayDetectCb?: (val: any) => boolean) => import("./shared").DataTypesExpanded;
449 };
450 typing: {
451 biologicalSexes: Readonly<{
452 male: "male";
453 female: "female";
454 }>;
455 commonBiologicalSexes: Readonly<{
456 male: "male";
457 female: "female";
458 }>;
459 sexes: Readonly<{
460 male: "male";
461 female: "female";
462 }>;
463 commonSexes: Readonly<{
464 male: "male";
465 female: "female";
466 }>;
467 biologicalSexesWithBoth: Readonly<Readonly<{
468 male: "male";
469 female: "female";
470 }> & {
471 both: "both";
472 }>;
473 commonBiologicalSexesWithBoth: Readonly<Readonly<{
474 male: "male";
475 female: "female";
476 }> & {
477 both: "both";
478 }>;
479 sexesWithBoth: Readonly<Readonly<{
480 male: "male";
481 female: "female";
482 }> & {
483 both: "both";
484 }>;
485 commonSexesWithBoth: Readonly<Readonly<{
486 male: "male";
487 female: "female";
488 }> & {
489 both: "both";
490 }>;
491 sexWithBoth: Readonly<Readonly<{
492 male: "male";
493 female: "female";
494 }> & {
495 both: "both";
496 }>;
497 biologicalSexesWithOther: Readonly<Readonly<{
498 male: "male";
499 female: "female";
500 }> & {
501 other: "other";
502 }>;
503 sexesWithOther: Readonly<Readonly<{
504 male: "male";
505 female: "female";
506 }> & {
507 other: "other";
508 }>;
509 commonSexesWithOther: Readonly<Readonly<{
510 male: "male";
511 female: "female";
512 }> & {
513 other: "other";
514 }>;
515 commonBiologicalSexesWithOther: Readonly<Readonly<{
516 male: "male";
517 female: "female";
518 }> & {
519 other: "other";
520 }>;
521 gender: Readonly<Readonly<{
522 male: "male";
523 female: "female";
524 }> & {
525 other: "other";
526 }>;
527 genderCommon: Readonly<Readonly<{
528 male: "male";
529 female: "female";
530 }> & {
531 other: "other";
532 }>;
533 genderWithBoth: Readonly<Readonly<{
534 male: "male";
535 female: "female";
536 }> & {
537 both: "both";
538 }>;
539 genderCommonWithBoth: Readonly<Readonly<{
540 male: "male";
541 female: "female";
542 }> & {
543 both: "both";
544 }>;
545 genderFull: Readonly<Readonly<Readonly<{
546 male: "male";
547 female: "female";
548 }> & {
549 other: "other";
550 }> & {
551 transMale: "trans male";
552 transFemale: "trans female";
553 genderqueer: "genderqueer";
554 genderfluid: "genderfluid";
555 intersex: "intersex";
556 agender: "agender";
557 bigender: "bigender";
558 nonBinary: "nonBinary";
559 none: "none";
560 }>;
561 CANProvinces: Readonly<{
562 on: "Ontario";
563 qc: "Quebec";
564 nb: "New Brunswick";
565 ns: "Nova Scotia";
566 pe: "Prince Edward Island";
567 mb: "Manitoba";
568 sk: "Saskatchewan";
569 bc: "British Columbia";
570 nt: "Northwest Territories";
571 nu: "Nunavut";
572 yt: "Yukon Territory";
573 ab: "Alberta";
574 nl: "Newfoundland and Labrador";
575 }>;
576 CANProvincesOrNone: Readonly<Readonly<{
577 on: "Ontario";
578 qc: "Quebec";
579 nb: "New Brunswick";
580 ns: "Nova Scotia";
581 pe: "Prince Edward Island";
582 mb: "Manitoba";
583 sk: "Saskatchewan";
584 bc: "British Columbia";
585 nt: "Northwest Territories";
586 nu: "Nunavut";
587 yt: "Yukon Territory";
588 ab: "Alberta";
589 nl: "Newfoundland and Labrador";
590 }> & {
591 none: "none";
592 }>;
593 canadianProvinces: Readonly<{
594 on: "Ontario";
595 qc: "Quebec";
596 nb: "New Brunswick";
597 ns: "Nova Scotia";
598 pe: "Prince Edward Island";
599 mb: "Manitoba";
600 sk: "Saskatchewan";
601 bc: "British Columbia";
602 nt: "Northwest Territories";
603 nu: "Nunavut";
604 yt: "Yukon Territory";
605 ab: "Alberta";
606 nl: "Newfoundland and Labrador";
607 }>;
608 canadianProvincesOrNone: Readonly<Readonly<{
609 on: "Ontario";
610 qc: "Quebec";
611 nb: "New Brunswick";
612 ns: "Nova Scotia";
613 pe: "Prince Edward Island";
614 mb: "Manitoba";
615 sk: "Saskatchewan";
616 bc: "British Columbia";
617 nt: "Northwest Territories";
618 nu: "Nunavut";
619 yt: "Yukon Territory";
620 ab: "Alberta";
621 nl: "Newfoundland and Labrador";
622 }> & {
623 none: "none";
624 }>;
625 isUndefined: (value: any) => value is undefined;
626 isNullOrUndefined: (val: any) => val is null;
627 isVoidOrString: (val: any) => val is string;
628 isAlphabeticChar: <T extends string = string>(val: any, handleAccents?: boolean) => val is T;
629 isAlphaChar: <T extends string = string>(val: any, handleAccents?: boolean) => val is T;
630 isNumber: <T extends number | Number = number>(val: any) => val is T;
631 isNum: <T extends number | Number = number>(val: any) => val is T;
632 isNumberLike: <T extends string | number | String | Number = number>(val: any) => val is T;
633 isNumLike: <T extends string | number | String | Number = number>(val: any) => val is T;
634 isInteger: <T extends string | number | String | Number = number>(val: any) => val is T;
635 isInt: <T extends string | number | String | Number = number>(val: any) => val is T;
636 isIntegerLike: <T extends string | number | String | Number = number>(val: any) => val is T;
637 isIntLike: <T extends string | number | String | Number = number>(val: any) => val is T;
638 isString: <T extends string | String = string>(val: any) => val is T;
639 isStringOrNumber: (val: any) => val is string | number | String | Number;
640 isStringOrNum: (val: any) => val is string | number | String | Number;
641 isStrOrNum: (val: any) => val is string | number | String | Number;
642 isBoolean: <T extends boolean | Boolean = boolean>(val: any) => val is T;
643 isBool: <T extends boolean | Boolean = boolean>(val: any) => val is T;
644 isDateLike: <T extends string | boolean | Object | Moment>(val: any) => val is T;
645 isArray: <T = any>(val: any) => val is T[];
646 isObject: <T extends Object = Object>(val: any, trueForArrays?: boolean) => val is T;
647 isTrue: <T extends string | true | String = true>(val: any, include1CharVal?: boolean) => val is T;
648 isFalse: <T extends string | false | String = false>(val: any, include1CharVal?: boolean) => val is T;
649 isFunction: <T extends Function = (...args: any[]) => any>(val: any) => val is T;
650 singleton: <T extends import("./shared").ClassConstructor>(constructor: T) => import("./shared").SingletonInterface<any> & T;
651 boolStringToBool: (val: string | boolean, strict?: boolean) => boolean;
652 toBoolFromBoolString: (val: string | boolean, strict?: boolean) => boolean;
653 getType: (val: any, extraArrayDetectCb?: (val: any) => boolean) => import("./shared").DataTypesExpanded;
654 };
655 validation: typeof import("./src/validation");
656};
657export { mUtils as __ };
658export { mUtils as m_ };
659export { mUtils as madUtils };