@kizmann/pico-js 2.0.8 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/pico-js.browser.js +1 -1
  2. package/dist/pico-js.browser.js.map +1 -1
  3. package/dist/pico-js.esm.js +1 -1
  4. package/dist/pico-js.esm.js.map +1 -1
  5. package/package.json +4 -6
  6. package/src/dom/{DomAttribute.js → DomAttribute.ts} +40 -63
  7. package/src/dom/{DomBuilder.js → DomBuilder.ts} +27 -44
  8. package/src/dom/{DomEvent.js → DomEvent.ts} +74 -78
  9. package/src/dom/{DomFinder.js → DomFinder.ts} +89 -129
  10. package/src/dom/DomForm.ts +38 -0
  11. package/src/dom/{DomGlobal.js → DomGlobal.ts} +34 -51
  12. package/src/dom/{DomInview.js → DomInview.ts} +37 -57
  13. package/src/dom/DomMeta.ts +48 -0
  14. package/src/dom/DomObserver.ts +17 -0
  15. package/src/dom/{DomPopover.js → DomPopover.ts} +20 -39
  16. package/src/dom/{DomRectangle.js → DomRectangle.ts} +67 -88
  17. package/src/format/{FormatFile.js → FormatFile.ts} +12 -23
  18. package/src/format/{FormatOption.js → FormatOption.ts} +15 -24
  19. package/src/format/{FormatParam.js → FormatParam.ts} +14 -25
  20. package/src/format/{FormatParser.js → FormatParser.ts} +29 -39
  21. package/src/format/{FormatUrl.js → FormatUrl.ts} +9 -21
  22. package/src/index.browser.ts +32 -0
  23. package/src/index.esm.ts +64 -0
  24. package/src/now/{NowDefault.js → NowDefault.ts} +86 -121
  25. package/src/now/{NowFormat.js → NowFormat.ts} +23 -28
  26. package/src/now/{NowGrid.js → NowGrid.ts} +41 -58
  27. package/src/now/{NowHuman.js → NowHuman.ts} +18 -27
  28. package/src/now/{NowMatch.js → NowMatch.ts} +22 -28
  29. package/src/now/{NowRange.js → NowRange.ts} +13 -22
  30. package/src/now/{NowWalker.js → NowWalker.ts} +65 -71
  31. package/src/tool/{scope.js → scope.ts} +41 -11
  32. package/src/utils/{Array.js → Array.ts} +146 -160
  33. package/src/utils/{Cookie.js → Cookie.ts} +15 -12
  34. package/src/utils/{Data.js → Data.ts} +17 -17
  35. package/src/utils/Dom.ts +204 -0
  36. package/src/utils/Format.ts +48 -0
  37. package/src/utils/{Hash.js → Hash.ts} +20 -20
  38. package/src/utils/{Locale.js → Locale.ts} +22 -22
  39. package/src/utils/{Mixed.js → Mixed.ts} +70 -58
  40. package/src/utils/{Now.js → Now.ts} +68 -69
  41. package/src/utils/{Number.js → Number.ts} +34 -36
  42. package/src/utils/{Object.js → Object.ts} +68 -122
  43. package/src/utils/{Route.js → Route.ts} +11 -9
  44. package/src/utils/{Runner.js → Runner.ts} +65 -47
  45. package/src/utils/{Signal.js → Signal.ts} +35 -22
  46. package/src/utils/{String.js → String.ts} +79 -69
  47. package/src/wip/{Element.js → Element.ts} +2 -2
  48. package/src/wip/{Map.js → Map.ts} +131 -101
  49. package/types/dom/DomAttribute.d.ts +16 -27
  50. package/types/dom/DomBuilder.d.ts +6 -9
  51. package/types/dom/DomEvent.d.ts +19 -25
  52. package/types/dom/DomFinder.d.ts +35 -58
  53. package/types/dom/DomForm.d.ts +7 -10
  54. package/types/dom/DomGlobal.d.ts +8 -15
  55. package/types/dom/DomInview.d.ts +9 -19
  56. package/types/dom/DomMeta.d.ts +9 -16
  57. package/types/dom/DomObserver.d.ts +4 -8
  58. package/types/dom/DomPopover.d.ts +8 -11
  59. package/types/dom/DomRectangle.d.ts +21 -40
  60. package/types/format/FormatFile.d.ts +5 -8
  61. package/types/format/FormatOption.d.ts +6 -8
  62. package/types/format/FormatParam.d.ts +6 -9
  63. package/types/format/FormatParser.d.ts +10 -18
  64. package/types/format/FormatUrl.d.ts +5 -8
  65. package/types/index.esm.d.ts +25 -37
  66. package/types/now/NowDefault.d.ts +30 -99
  67. package/types/now/NowFormat.d.ts +8 -21
  68. package/types/now/NowGrid.d.ts +24 -46
  69. package/types/now/NowHuman.d.ts +10 -11
  70. package/types/now/NowMatch.d.ts +6 -4
  71. package/types/now/NowRange.d.ts +5 -8
  72. package/types/now/NowWalker.d.ts +6 -4
  73. package/types/tool/scope.d.ts +11 -3
  74. package/types/utils/Array.d.ts +83 -104
  75. package/types/utils/Cookie.d.ts +11 -8
  76. package/types/utils/Data.d.ts +7 -7
  77. package/types/utils/Dom.d.ts +63 -96
  78. package/types/utils/Format.d.ts +15 -28
  79. package/types/utils/Hash.d.ts +21 -21
  80. package/types/utils/Locale.d.ts +10 -10
  81. package/types/utils/Mixed.d.ts +18 -32
  82. package/types/utils/Now.d.ts +51 -56
  83. package/types/utils/Number.d.ts +9 -20
  84. package/types/utils/Object.d.ts +21 -36
  85. package/types/utils/Route.d.ts +5 -2
  86. package/types/utils/Runner.d.ts +41 -24
  87. package/types/utils/Signal.d.ts +16 -16
  88. package/types/utils/String.d.ts +40 -76
  89. package/src/dom/DomForm.js +0 -59
  90. package/src/dom/DomMeta.js +0 -68
  91. package/src/dom/DomObserver.js +0 -38
  92. package/src/index.browser.js +0 -36
  93. package/src/index.esm.js +0 -80
  94. package/src/utils/Dom.js +0 -214
  95. package/src/utils/Format.js +0 -62
  96. package/types/wip/Element.d.ts +0 -119
  97. package/types/wip/Map.d.ts +0 -254
@@ -1,27 +1,27 @@
1
- import { Mix, Obj, Locale } from "../index.esm.js";
1
+ import { Mix, Obj, Locale } from "../index.esm.ts";
2
2
 
3
3
  export class PicoLocale
4
4
  {
5
5
  /**
6
6
  * Translation dictionary
7
7
  *
8
- * @type {Record<any, any>}
8
+ * @type {any}
9
9
  */
10
- static $text = {};
10
+ static $text : any = {};
11
11
 
12
12
  /**
13
13
  * Cached collator instance
14
14
  *
15
- * @type {Intl.Collator|null}
15
+ * @type {Intl.Collator}
16
16
  */
17
- static $sort = null;
17
+ static $sort : Intl.Collator = null;
18
18
 
19
19
  /**
20
20
  * Active locale code
21
21
  *
22
22
  * @type {string}
23
23
  */
24
- static $code = 'en';
24
+ static $code : string = 'en';
25
25
 
26
26
  /**
27
27
  * Check if translation key exists
@@ -32,13 +32,13 @@ export class PicoLocale
32
32
  * @param {any} [key] Translation key
33
33
  * @returns {boolean} True if exists
34
34
  */
35
- static has(key = undefined)
35
+ static has(key : any = undefined) : boolean
36
36
  {
37
37
  if ( key === undefined ) {
38
38
  return true;
39
39
  }
40
40
 
41
- return Mix.has(PicoLocale.$text, key);
41
+ return Obj.has(PicoLocale.$text, key);
42
42
  }
43
43
 
44
44
  /**
@@ -51,7 +51,7 @@ export class PicoLocale
51
51
  * @param {any} [fallback] Fallback value
52
52
  * @returns {any} Translation value
53
53
  */
54
- static get(key = undefined, fallback = null)
54
+ static get(key : any = undefined, fallback : any = null) : any
55
55
  {
56
56
  if ( key === undefined ) {
57
57
  return PicoLocale.$text;
@@ -70,7 +70,7 @@ export class PicoLocale
70
70
  * @param {any} [value] Value to set
71
71
  * @returns {any} Updated map
72
72
  */
73
- static set(key = undefined, value = undefined)
73
+ static set(key : any = undefined, value : any = undefined) : any
74
74
  {
75
75
  if ( value === undefined ) {
76
76
  return PicoLocale.$text = key;
@@ -85,16 +85,16 @@ export class PicoLocale
85
85
  * @example Locale.code() // => "en"
86
86
  * @example Locale.code("de") // => "de"
87
87
  *
88
- * @param {string|null} [code] Locale code
88
+ * @param {string} [code] Locale code
89
89
  * @returns {string} Active code
90
90
  */
91
- static code(code = null)
91
+ static code(code : string = null) : string
92
92
  {
93
- if ( ! Mix.isNull(code) ) {
93
+ if ( !Mix.isNull(code) ) {
94
94
  return Locale.$code = code;
95
95
  }
96
96
 
97
- if ( ! Mix.isNull(Locale.$code) ) {
97
+ if ( !Mix.isNull(Locale.$code) ) {
98
98
  return Locale.$code;
99
99
  }
100
100
 
@@ -111,9 +111,9 @@ export class PicoLocale
111
111
  *
112
112
  * @returns {Intl.Collator} Collator instance
113
113
  */
114
- static collator()
114
+ static collator() : Intl.Collator
115
115
  {
116
- if ( ! Mix.isNull(Locale.$sort) ) {
116
+ if ( Locale.$sort != null ) {
117
117
  return Locale.$sort;
118
118
  }
119
119
 
@@ -134,13 +134,13 @@ export class PicoLocale
134
134
  * @param {any} [replace] Replace map
135
135
  * @returns {string} Replaced text
136
136
  */
137
- static replace(text, replace = null)
137
+ static replace(text : string, replace : any = null) : string
138
138
  {
139
139
  if ( replace == null ) {
140
140
  return text;
141
141
  }
142
142
 
143
- Obj.each(replace, (val, key) => {
143
+ Obj.each(replace, (val : any, key : any) => {
144
144
  text = text.replace(new RegExp(':' + key, 'g'), val);
145
145
  });
146
146
 
@@ -157,7 +157,7 @@ export class PicoLocale
157
157
  * @param {any} [replace] Replace map
158
158
  * @returns {string} Translated text
159
159
  */
160
- static trans(text, replace = null)
160
+ static trans(text : string, replace : any = null) : string
161
161
  {
162
162
  text = Obj.get(PicoLocale.$text, text, text);
163
163
 
@@ -175,7 +175,7 @@ export class PicoLocale
175
175
  * @param {any} [replace] Replace map
176
176
  * @returns {string} Chosen text
177
177
  */
178
- static choice(text, count = 0, replace = {})
178
+ static choice(text : string, count : number = 0, replace : any = {}) : string
179
179
  {
180
180
  text = Obj.get(PicoLocale.$text, text, text);
181
181
 
@@ -193,11 +193,11 @@ export class PicoLocale
193
193
  *
194
194
  * @example Locale.countpick(["a","b"], 2) // => "b"
195
195
  *
196
- * @param {Array<string>} splits Variant list
196
+ * @param {string[]} splits Variant list
197
197
  * @param {number} count Choice count
198
198
  * @returns {string} Picked text
199
199
  */
200
- static countpick(splits, count)
200
+ static countpick(splits : string[], count : number = 0) : string
201
201
  {
202
202
  let length = splits.length;
203
203
 
@@ -1,4 +1,4 @@
1
- import { go, Arr, Mix, Run, Now, Locale, Str, Obj } from "../index.esm.js";
1
+ import { go, Arr, Mix, Run, Locale, Str, Obj } from "../index.esm.ts";
2
2
 
3
3
  export const MIX_REGEX = {
4
4
  'iso': /^\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,
@@ -18,7 +18,7 @@ export class PicoMixed
18
18
  * @param {any} value The value to test
19
19
  * @returns {boolean} Returns true if value is not empty
20
20
  */
21
- static isEmpty(value)
21
+ static isEmpty(value : any) : boolean
22
22
  {
23
23
  if ( value == null ) {
24
24
  return true;
@@ -54,7 +54,7 @@ export class PicoMixed
54
54
  * @param {any} value The value to test
55
55
  * @returns {boolean} Return true if null
56
56
  */
57
- static isNull(value)
57
+ static isNull(value : any) : boolean
58
58
  {
59
59
  return value === null;
60
60
  }
@@ -70,7 +70,7 @@ export class PicoMixed
70
70
  * @param {any} value The value to test
71
71
  * @returns {boolean} Return true if undefined
72
72
  */
73
- static isUndef(value)
73
+ static isUndef(value : any) : boolean
74
74
  {
75
75
  return value === undefined;
76
76
  }
@@ -86,7 +86,7 @@ export class PicoMixed
86
86
  * @param {any} value The value to test
87
87
  * @returns {boolean} Return true if null or undefined
88
88
  */
89
- static isNix(value)
89
+ static isNix(value : any) : boolean
90
90
  {
91
91
  return value === undefined || value === null;
92
92
  }
@@ -102,7 +102,7 @@ export class PicoMixed
102
102
  * @param {any} value The value to test
103
103
  * @returns {boolean} Return true if typeof string or number
104
104
  */
105
- static isPrim(value)
105
+ static isPrim(value : any) : boolean
106
106
  {
107
107
  return typeof value === 'string' || typeof value === 'number';
108
108
  }
@@ -121,7 +121,7 @@ export class PicoMixed
121
121
  * @param {any} value The value to test
122
122
  * @returns {boolean} Return true if is string
123
123
  */
124
- static isStr(value)
124
+ static isStr(value : any) : boolean
125
125
  {
126
126
  return typeof value === 'string';
127
127
  }
@@ -141,7 +141,7 @@ export class PicoMixed
141
141
  * @param {any} value The value to test
142
142
  * @returns {boolean} Return true if is number
143
143
  */
144
- static isNum(value)
144
+ static isNum(value : any) : boolean
145
145
  {
146
146
  if ( typeof value === 'number' ) {
147
147
  return true;
@@ -170,7 +170,7 @@ export class PicoMixed
170
170
  * @param {any} value The value to test
171
171
  * @returns {boolean} Return true if is integer
172
172
  */
173
- static isInt(value)
173
+ static isInt(value : any) : boolean
174
174
  {
175
175
  if ( !this.isNum(value) ) {
176
176
  return false;
@@ -199,7 +199,7 @@ export class PicoMixed
199
199
  * @param {any} value The value to test
200
200
  * @returns {boolean} Return true if is boolean
201
201
  */
202
- static isBool(value)
202
+ static isBool(value : any) : boolean
203
203
  {
204
204
  if ( typeof value === 'boolean' ) {
205
205
  return true;
@@ -228,7 +228,7 @@ export class PicoMixed
228
228
  * @param {any} value The value to test
229
229
  * @returns {boolean} Return true if is function
230
230
  */
231
- static isFunc(value)
231
+ static isFunc(value : any) : boolean
232
232
  {
233
233
  return typeof value === 'function';
234
234
  }
@@ -250,7 +250,7 @@ export class PicoMixed
250
250
  * @param {any} value The value to test
251
251
  * @returns {boolean} Returns true if is an object
252
252
  */
253
- static isRef(value)
253
+ static isRef(value : any) : boolean
254
254
  {
255
255
  if ( value == null ) {
256
256
  return false;
@@ -273,7 +273,7 @@ export class PicoMixed
273
273
  * @param {any} value The value to test
274
274
  * @returns {boolean} Returns true if is plain object
275
275
  */
276
- static isObj(value)
276
+ static isObj(value : any) : boolean
277
277
  {
278
278
  if ( value == null ) {
279
279
  return false;
@@ -296,7 +296,7 @@ export class PicoMixed
296
296
  * @param {any} value The Value to test
297
297
  * @returns {boolean} Returns true if is array object
298
298
  */
299
- static isArr(value)
299
+ static isArr(value : any) : boolean
300
300
  {
301
301
  if ( value == null ) {
302
302
  return false;
@@ -319,7 +319,7 @@ export class PicoMixed
319
319
  * @param {any} value The Value to test
320
320
  * @returns {boolean} Returns true if is iterable object
321
321
  */
322
- static isIter(value)
322
+ static isIter(value : any) : boolean
323
323
  {
324
324
  if ( this.isArr(value) ) {
325
325
  return false;
@@ -347,7 +347,7 @@ export class PicoMixed
347
347
  * @param {any} value The Value to test
348
348
  * @returns {boolean} Returns true if is iso date
349
349
  */
350
- static isIsoDate(value)
350
+ static isIsoDate(value : any) : boolean
351
351
  {
352
352
  if ( value instanceof Date ) {
353
353
  return true;
@@ -366,7 +366,7 @@ export class PicoMixed
366
366
  * @param {any} value The Value to test
367
367
  * @returns {boolean} Returns true if is valid date
368
368
  */
369
- static isDate(value)
369
+ static isDate(value : any) : boolean
370
370
  {
371
371
  if ( value instanceof Date ) {
372
372
  return true;
@@ -385,7 +385,7 @@ export class PicoMixed
385
385
  * @param {any} value The Value to test
386
386
  * @returns {boolean} Returns true if is valid time
387
387
  */
388
- static isTime(value)
388
+ static isTime(value : any) : boolean
389
389
  {
390
390
  if ( value instanceof Date ) {
391
391
  return true;
@@ -403,7 +403,7 @@ export class PicoMixed
403
403
  * @param {any} val Compare value
404
404
  * @returns {boolean} True if equal
405
405
  */
406
- static isEqual(obj, val)
406
+ static isEqual(obj : any, val : any) : boolean
407
407
  {
408
408
  if ( obj instanceof Node ) {
409
409
  return obj.isEqualNode(val);
@@ -424,7 +424,7 @@ export class PicoMixed
424
424
  * @param {any} value Value to convert
425
425
  * @returns {Record<string, any>} Converted object
426
426
  */
427
- static iter(value)
427
+ static iter(value : any) : Record<string, any>
428
428
  {
429
429
  if ( value == null ) {
430
430
  return {};
@@ -448,7 +448,7 @@ export class PicoMixed
448
448
  * @param {any} value Object to iterate
449
449
  * @returns {Array<any>} Returns array with keys
450
450
  */
451
- static keys(value)
451
+ static keys(value : any) : Array<any>
452
452
  {
453
453
  if ( value == null ) {
454
454
  return [];
@@ -474,7 +474,7 @@ export class PicoMixed
474
474
  * @param {any} value Object to iterate
475
475
  * @returns {Array<any>} Returns array with values
476
476
  */
477
- static vals(value)
477
+ static vals(value : any) : Array<any>
478
478
  {
479
479
  if ( value == null ) {
480
480
  return [];
@@ -494,7 +494,7 @@ export class PicoMixed
494
494
 
495
495
  let keys = this.keys(value);
496
496
 
497
- for ( let i = 0; i < keys.length; i ++ ) {
497
+ for ( let i = 0; i < keys.length; i++ ) {
498
498
  keys[i] = value[keys[i]];
499
499
  }
500
500
 
@@ -509,7 +509,7 @@ export class PicoMixed
509
509
  * @param {any} value Source value
510
510
  * @returns {Array<any>} Array result
511
511
  */
512
- static nodes(value)
512
+ static nodes(value : any) : Array<any>
513
513
  {
514
514
  return Array.prototype.slice.call(value);
515
515
  }
@@ -520,10 +520,10 @@ export class PicoMixed
520
520
  * @example Mix.props(Math, ["PI"]) // => {}
521
521
  *
522
522
  * @param {any} value Source object
523
- * @param {Array<any>} [exclude] Exclude keys
523
+ * @param {string[]} [exclude] Exclude keys
524
524
  * @returns {Record<string, any>} Props map
525
525
  */
526
- static props(value, exclude = [])
526
+ static props(value : any, exclude : string[] = []) : Record<string, any>
527
527
  {
528
528
  let result = {};
529
529
 
@@ -536,7 +536,7 @@ export class PicoMixed
536
536
  return result;
537
537
  }
538
538
 
539
- static extend(target, value, exclude = ['constructor'])
539
+ static extend(target : any, value : any, exclude : string[] = ['constructor'])
540
540
  {
541
541
  if ( value == null ) {
542
542
  return {};
@@ -574,10 +574,10 @@ export class PicoMixed
574
574
  * @example Mix.class(MyClass) // => {}
575
575
  *
576
576
  * @param {any} value Source class
577
- * @param {Array<any>} [exclude] Exclude keys
577
+ * @param {string[any]} [exclude] Exclude keys
578
578
  * @returns {Record<string, any>} Props map
579
579
  */
580
- static class(value, exclude = [])
580
+ static class(value : any, exclude : string[] = []) : Record<string, any>
581
581
  {
582
582
  exclude = Arr.merge(exclude, [
583
583
  'length', 'name', 'prototype', 'constructor'
@@ -592,10 +592,10 @@ export class PicoMixed
592
592
  * @example Mix.proto(MyClass) // => {}
593
593
  *
594
594
  * @param {any} value Source class
595
- * @param {Array<any>} [exclude] Exclude keys
595
+ * @param {string[]} [exclude] Exclude keys
596
596
  * @returns {Record<string, any>} Props map
597
597
  */
598
- static proto(value, exclude = [])
598
+ static proto(value : any, exclude : string[] = []) : Record<string, any>
599
599
  {
600
600
  exclude = Arr.merge(exclude, [
601
601
  'constructor'
@@ -612,11 +612,11 @@ export class PicoMixed
612
612
  * @param {any} value Source object
613
613
  * @returns {FormData} Form instance
614
614
  */
615
- static form(value)
615
+ static form(value : any) : FormData
616
616
  {
617
617
  let form = new FormData();
618
618
 
619
- Obj.each(Obj.flattenForm(value), (val, key) => {
619
+ Obj.each(Obj.flattenForm(value), (val : any, key : any) => {
620
620
  form.append(key, val);
621
621
  });
622
622
 
@@ -630,10 +630,10 @@ export class PicoMixed
630
630
  * @example Mix.vals(NodeList, (val, key) => null) // => Mix
631
631
  *
632
632
  * @param {any} value Value to loop
633
- * @param {function} cb Callback for each loop
633
+ * @param {Function} cb Callback for each loop
634
634
  * @returns {PicoMixed} Returns Mix instance
635
635
  */
636
- static each(value, cb)
636
+ static each(value : any, cb : Function) : PicoMixed
637
637
  {
638
638
  if ( !this.isRef(value) ) {
639
639
  throw new Error('Iterate non object');
@@ -657,7 +657,7 @@ export class PicoMixed
657
657
  * @param {any} value The value to count
658
658
  * @returns {number} Returns length of value
659
659
  */
660
- static len(value)
660
+ static len(value : any) : number
661
661
  {
662
662
  if ( this.isArr(value) ) {
663
663
  return value.length;
@@ -682,7 +682,7 @@ export class PicoMixed
682
682
  * @param {any} compare Second compare value
683
683
  * @returns {number} Returns sort position
684
684
  */
685
- static compare(value, compare)
685
+ static compare(value : any, compare : any) : number
686
686
  {
687
687
  return Locale.collator().compare(value, compare);
688
688
  }
@@ -696,7 +696,7 @@ export class PicoMixed
696
696
  * @param {any} [fallback] Fallback value
697
697
  * @returns {any} Null or fallback
698
698
  */
699
- static null(value, fallback = null)
699
+ static null(value : any, fallback : any = null) : any
700
700
  {
701
701
  if ( value === 'null' ) {
702
702
  return null;
@@ -717,7 +717,7 @@ export class PicoMixed
717
717
  * @param {any} value Source value
718
718
  * @returns {Array<any>} Array result
719
719
  */
720
- static arr(value)
720
+ static arr(value : any) : Array<any>
721
721
  {
722
722
  if ( this.isArr(value) ) {
723
723
  return value;
@@ -751,7 +751,7 @@ export class PicoMixed
751
751
  * @param {any} value The value to convert
752
752
  * @returns {string} Return value as string
753
753
  */
754
- static str(value)
754
+ static str(value : any) : string
755
755
  {
756
756
  if ( this.isNix(value) ) {
757
757
  return String(value);
@@ -779,9 +779,9 @@ export class PicoMixed
779
779
  *
780
780
  * @param {any} value The value to convert
781
781
  * @param {any} fallback Fallback incase it is not primitive
782
- * @returns {number|any} Return value as number
782
+ * @returns {number} Return value as number
783
783
  */
784
- static num(value, fallback = NaN)
784
+ static num(value : any, fallback : number = NaN) : number
785
785
  {
786
786
  if ( !this.isPrim(value) ) {
787
787
  return fallback;
@@ -808,10 +808,10 @@ export class PicoMixed
808
808
  * @example Mix.int(true) // => NaN
809
809
  *
810
810
  * @param {any} value The value to convert
811
- * @param {any} fallback Fallback incase it is not primitive
812
- * @returns {number|any} Return value as integer
811
+ * @param {number} fallback Fallback incase it is not primitive
812
+ * @returns {number} Return value as integer
813
813
  */
814
- static int(value, fallback = NaN)
814
+ static int(value : any, fallback : number = NaN) : number
815
815
  {
816
816
  if ( !this.isPrim(value) ) {
817
817
  return fallback;
@@ -843,7 +843,7 @@ export class PicoMixed
843
843
  * @param {any} value The value to convert
844
844
  * @returns {boolean} Return value as boolean
845
845
  */
846
- static bool(value)
846
+ static bool(value : any) : boolean
847
847
  {
848
848
  if ( this.isRef(value) ) {
849
849
  return !!this.vals(value).length;
@@ -862,62 +862,74 @@ export class PicoMixed
862
862
  static boolean = PicoMixed.bool;
863
863
  }
864
864
 
865
- PicoMixed.global = function (...args) {
865
+ // @ts-ignore
866
+ PicoMixed.global = function (...args : Parameters<typeof go>) {
866
867
  console.warn('Mix.global() is deprecated, use go() instead.');
867
868
  return go(...args);
868
869
  };
869
870
 
870
- PicoMixed.isPlain = function (...args) {
871
+ // @ts-ignore
872
+ PicoMixed.isPlain = function (...args : Parameters<typeof Mix.isObj>) {
871
873
  console.warn('Mix.isPlain() is deprecated, use Mix.isObj() instead.');
872
874
  return Mix.isObj(...args);
873
875
  };
874
876
 
875
- PicoMixed.float = function (...args) {
877
+ // @ts-ignore
878
+ PicoMixed.float = function (...args : Parameters<typeof Mix.num>) {
876
879
  console.warn('Mix.float() is deprecated, use Mix.num() instead.');
877
880
  return Mix.num(...args);
878
881
  };
879
882
 
880
- PicoMixed.delay = function (...args) {
883
+ // @ts-ignore
884
+ PicoMixed.delay = function (...args : Parameters<typeof Run.delay>) {
881
885
  console.warn('Mix.delay() is deprecated, use Run.delay() instead.');
882
886
  return Run.delay(...args);
883
887
  };
884
888
 
885
- PicoMixed.async = function (...args) {
889
+ // @ts-ignore
890
+ PicoMixed.async = function (...args : Parameters<typeof Run.async>) {
886
891
  console.warn('Mix.async() is deprecated, use Run.async() instead.');
887
892
  return Run.async(...args);
888
893
  };
889
894
 
890
- PicoMixed.debounce = function (...args) {
895
+ // @ts-ignore
896
+ PicoMixed.debounce = function (...args : Parameters<typeof Run.debounce>) {
891
897
  console.warn('Mix.debounce() is deprecated, use Run.debounce() instead.');
892
898
  return Run.debounce(...args);
893
899
  };
894
900
 
895
- PicoMixed.throttle = function (...args) {
901
+ // @ts-ignore
902
+ PicoMixed.throttle = function (...args : Parameters<typeof Run.throttle>) {
896
903
  console.warn('Mix.throttle() is deprecated, use Run.throttle() instead.');
897
904
  return Run.throttle(...args);
898
905
  };
899
906
 
900
- PicoMixed.framerate = function (...args) {
907
+ // @ts-ignore
908
+ PicoMixed.framerate = function (...args : Parameters<typeof Run.framerate>) {
901
909
  console.warn('Mix.framerate() is deprecated, use Run.framerate() instead.');
902
910
  return Run.framerate(...args);
903
911
  };
904
912
 
905
- PicoMixed.convertString = function (...args) {
913
+ // @ts-ignore
914
+ PicoMixed.convertString = function (...args : Parameters<typeof Str.string>) {
906
915
  console.warn('Mix.convertString() is deprecated, use Str.string() instead.');
907
916
  return Str.string(...args);
908
917
  };
909
918
 
910
- PicoMixed.convertDatetime = function (...args) {
919
+ // @ts-ignore
920
+ PicoMixed.convertDatetime = function (...args : Parameters<typeof Str.date>) {
911
921
  console.warn('Mix.convertDatetime() is deprecated, use Str.date() instead.');
912
922
  return Str.date(...args);
913
923
  };
914
924
 
915
- PicoMixed.convertBool = function (...args) {
925
+ // @ts-ignore
926
+ PicoMixed.convertBool = function (...args : Parameters<typeof Str.boolean>) {
916
927
  console.warn('Mix.convertBool() is deprecated, use Str.boolean() instead.');
917
928
  return Str.boolean(...args);
918
929
  };
919
930
 
920
- PicoMixed.convertBoolean = function (...args) {
931
+ // @ts-ignore
932
+ PicoMixed.convertBoolean = function (...args : Parameters<typeof Str.boolean>) {
921
933
  console.warn('Mix.convertBoolean() is deprecated, use Str.boolean() instead.');
922
934
  return Str.boolean(...args);
923
935
  };