@kizmann/pico-js 1.0.13 → 2.0.0

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 (125) hide show
  1. package/README.md +27 -7
  2. package/dist/pico-js.browser.js +2 -0
  3. package/dist/pico-js.browser.js.map +1 -0
  4. package/dist/pico-js.esm.js +2 -0
  5. package/dist/pico-js.esm.js.map +1 -0
  6. package/package.json +20 -7
  7. package/src/dom/DomAttribute.js +374 -0
  8. package/src/dom/DomBuilder.js +152 -0
  9. package/src/dom/DomEvent.js +253 -0
  10. package/src/dom/DomFinder.js +669 -0
  11. package/src/dom/DomForm.js +57 -0
  12. package/src/dom/DomGlobal.js +193 -0
  13. package/src/dom/DomInview.js +332 -0
  14. package/src/dom/DomMeta.js +66 -0
  15. package/src/dom/DomObserver.js +57 -0
  16. package/src/dom/DomRectangle.js +657 -0
  17. package/src/format/FormatFile.js +54 -0
  18. package/src/format/FormatOption.js +108 -0
  19. package/src/format/FormatParam.js +107 -0
  20. package/src/format/FormatParser.js +156 -0
  21. package/src/format/FormatUrl.js +75 -0
  22. package/src/index.browser.js +10 -0
  23. package/src/index.esm.js +138 -0
  24. package/src/now/NowDefault.js +533 -0
  25. package/src/now/NowFormat.js +196 -0
  26. package/src/now/NowGrid.js +251 -0
  27. package/src/now/NowHuman.js +118 -0
  28. package/src/now/NowMatch.js +175 -0
  29. package/src/now/NowRange.js +70 -0
  30. package/src/now/NowWalker.js +544 -0
  31. package/src/tool/scope.js +103 -0
  32. package/src/utils/Array.js +986 -0
  33. package/src/utils/Cookie.js +184 -0
  34. package/src/utils/Data.js +200 -0
  35. package/src/utils/Dom.js +208 -0
  36. package/src/utils/Event.js +140 -0
  37. package/src/utils/Format.js +62 -0
  38. package/src/utils/Hash.js +164 -0
  39. package/src/utils/Locale.js +229 -0
  40. package/src/utils/Mixed.js +887 -0
  41. package/src/utils/Now.js +234 -0
  42. package/src/utils/Number.js +238 -0
  43. package/src/utils/Object.js +655 -0
  44. package/src/utils/Route.js +67 -0
  45. package/src/utils/Runner.js +327 -0
  46. package/src/utils/String.js +618 -0
  47. package/src/{library/element.js → wip/Element.js} +90 -16
  48. package/src/{library/map.js → wip/Map.js} +256 -40
  49. package/types/dom/DomAttribute.d.ts +137 -0
  50. package/types/dom/DomBuilder.d.ts +67 -0
  51. package/types/dom/DomEvent.d.ts +103 -0
  52. package/types/dom/DomFinder.d.ts +321 -0
  53. package/types/dom/DomForm.d.ts +21 -0
  54. package/types/dom/DomGlobal.d.ts +79 -0
  55. package/types/dom/DomInview.d.ts +114 -0
  56. package/types/dom/DomMeta.d.ts +29 -0
  57. package/types/dom/DomObserver.d.ts +21 -0
  58. package/types/dom/DomRectangle.d.ts +270 -0
  59. package/types/format/FormatFile.d.ts +18 -0
  60. package/types/format/FormatOption.d.ts +40 -0
  61. package/types/format/FormatParam.d.ts +39 -0
  62. package/types/format/FormatParser.d.ts +46 -0
  63. package/types/format/FormatUrl.d.ts +17 -0
  64. package/types/index.browser.d.ts +1 -0
  65. package/types/index.esm.d.ts +52 -0
  66. package/types/now/NowDefault.d.ts +183 -0
  67. package/types/now/NowFormat.d.ts +70 -0
  68. package/types/now/NowGrid.d.ts +107 -0
  69. package/types/now/NowHuman.d.ts +37 -0
  70. package/types/now/NowMatch.d.ts +108 -0
  71. package/types/now/NowRange.d.ts +21 -0
  72. package/types/now/NowWalker.d.ts +301 -0
  73. package/types/tool/scope.d.ts +24 -0
  74. package/types/utils/Array.d.ts +480 -0
  75. package/types/utils/Cookie.d.ts +60 -0
  76. package/types/utils/Data.d.ts +91 -0
  77. package/types/utils/Dom.d.ts +138 -0
  78. package/types/utils/Event.d.ts +58 -0
  79. package/types/utils/Format.d.ts +37 -0
  80. package/types/utils/Hash.d.ts +81 -0
  81. package/types/utils/Locale.d.ts +115 -0
  82. package/types/utils/Mixed.d.ts +469 -0
  83. package/types/utils/Now.d.ts +125 -0
  84. package/types/utils/Number.d.ts +127 -0
  85. package/types/utils/Object.d.ts +255 -0
  86. package/types/utils/Route.d.ts +37 -0
  87. package/types/utils/Runner.d.ts +139 -0
  88. package/types/utils/String.d.ts +330 -0
  89. package/types/wip/Element.d.ts +119 -0
  90. package/types/wip/Map.d.ts +254 -0
  91. package/dist/.ignore.js +0 -0
  92. package/dist/pico-js.js +0 -2
  93. package/dist/pico-js.js.map +0 -1
  94. package/src/element/default.js +0 -46
  95. package/src/element/example.js +0 -58
  96. package/src/index.js +0 -90
  97. package/src/library/cookie.js +0 -123
  98. package/src/library/data.js +0 -111
  99. package/src/library/event.js +0 -91
  100. package/src/library/locale.js +0 -84
  101. package/src/library/queue.js +0 -64
  102. package/src/library/route.js +0 -28
  103. package/src/utility/any.js +0 -369
  104. package/src/utility/array.js +0 -410
  105. package/src/utility/dom.js +0 -1425
  106. package/src/utility/now.js +0 -544
  107. package/src/utility/number.js +0 -128
  108. package/src/utility/object.js +0 -429
  109. package/src/utility/string.js +0 -328
  110. package/types/index.d.ts +0 -77
  111. package/types/library/cookie.d.ts +0 -10
  112. package/types/library/data.d.ts +0 -15
  113. package/types/library/element.d.ts +0 -22
  114. package/types/library/event.d.ts +0 -13
  115. package/types/library/locale.d.ts +0 -14
  116. package/types/library/map.d.ts +0 -43
  117. package/types/library/queue.d.ts +0 -18
  118. package/types/library/route.d.ts +0 -11
  119. package/types/utility/any.d.ts +0 -35
  120. package/types/utility/array.d.ts +0 -46
  121. package/types/utility/dom.d.ts +0 -101
  122. package/types/utility/now.d.ts +0 -79
  123. package/types/utility/number.d.ts +0 -17
  124. package/types/utility/object.d.ts +0 -29
  125. package/types/utility/string.d.ts +0 -26
@@ -1,328 +0,0 @@
1
- import Arr from "./array.js";
2
- import Obj from "./object.js";
3
- import Num from "./number.js";
4
- import Any from "./any.js";
5
-
6
- export class Str
7
- {
8
- static regexEscape(val)
9
- {
10
- return String(val).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
11
- }
12
-
13
- static upper(val)
14
- {
15
- return String(val).toUpperCase();
16
- }
17
-
18
- static lower(val)
19
- {
20
- return String(val).toLowerCase();
21
- }
22
-
23
- static camelcase(val)
24
- {
25
- let slug = Str.slugify(val);
26
-
27
- let slugSplits = Arr.each(slug.split('-'), (split, index) => {
28
-
29
- if ( index === 0 ) {
30
- return split;
31
- }
32
-
33
- return Str.ucfirst(split);
34
- });
35
-
36
- return slugSplits.join('');
37
- }
38
-
39
- static humancase(val)
40
- {
41
- let slug = Str.slugify(val);
42
-
43
- let slugSplits = Arr.each(slug.split('-'), (split) => {
44
- return Str.ucfirst(split);
45
- });
46
-
47
- return slugSplits.join(' ');
48
- }
49
-
50
- static slugify(val)
51
- {
52
- val = String(val).replace(/^\s+|\s+$/g, '')
53
- .toLowerCase();
54
-
55
- let sources = [
56
- 'à', 'á', 'â', 'è', 'é', 'ê', 'ì', 'í', 'ï', 'î', 'ò', 'ó', 'ô',
57
- 'ù', 'ú', 'û', 'ñ', 'ç', '·', '/', '_', ',', ':', ';', 'ä', 'ö', 'ü'
58
- ];
59
-
60
- let targets = [
61
- 'a', 'a', 'a', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'o', 'o', 'o',
62
- 'u', 'u', 'u', 'n', 'c', '-', '-', '-', '-', '-', '-', 'ae', 'oe', 'ue'
63
- ];
64
-
65
- Arr.each(sources, (source, index) => {
66
- val = val.replace(new RegExp(source.charAt(source), 'g'), targets[index]);
67
- });
68
-
69
- return val.replace(/[^a-z0-9 -]/g, '')
70
- .replace(/\s+/g, '-').replace(/-+/g, '-');
71
- }
72
-
73
- static ucfirst(val)
74
- {
75
- return val.charAt(0).toUpperCase() + val.slice(1);
76
- }
77
-
78
- static lcfirst(val)
79
- {
80
- return val.charAt(0).toLowerCase() + val.slice(1);
81
- }
82
-
83
- static has(val, search)
84
- {
85
- return this.lower(val).indexOf(this.lower(search)) !== -1;
86
- }
87
-
88
- static filesize(val, decimals = 1)
89
- {
90
- let size = null;
91
-
92
- let units = [
93
- 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'
94
- ];
95
-
96
- Arr.each(units, (unit, count) => {
97
-
98
- let limit = Math.pow(1000, Any.integer(count));
99
-
100
- if ( val <= limit) {
101
- return;
102
- }
103
-
104
- size = Num.fixed(val / limit, decimals) + ' ' + unit;
105
- });
106
-
107
- return size;
108
- }
109
-
110
- static array(value, fallback = [])
111
- {
112
- value = value.replace(/^@\[(.*?)?\]$/, '$1');
113
-
114
- if ( Any.isEmpty(value) ) {
115
- return fallback;
116
- }
117
-
118
- return Arr.each(value.split(','), (val) => {
119
- return Str.real(val.replace(/(^"|^'|"$|'$)/g, ''));
120
- });
121
- }
122
-
123
- static real(value)
124
- {
125
- if ( typeof value === 'string' && value.match(/^@\[.*?\]$/) ) {
126
- value = Str.array(value);
127
- }
128
-
129
- if ( typeof value === 'string' && value.match(/^(null|undefined)$/i) ) {
130
- value = null;
131
- }
132
-
133
- if ( typeof value === 'string' && value.match(/^(true|false)$/i) ) {
134
- value = Any.bool(value);
135
- }
136
-
137
- if ( typeof value === 'string' && value.match(/^[0-9]+$/) ) {
138
- value = Num.int(value);
139
- }
140
-
141
- if ( typeof value === 'string' && value.match(/^[0-9]+\\.[0-9]+$/) ) {
142
- value = Num.float(value);
143
- }
144
-
145
- return value;
146
- }
147
-
148
- /**
149
- * Parse param string to object
150
- */
151
- static objectify(value, mode = 'options', isArray = false)
152
- {
153
- if ( Any.isObject(value) ) {
154
- return value;
155
- }
156
-
157
- if ( mode === 'params' ) {
158
- return Str.fromParams(value, isArray);
159
- }
160
-
161
- if ( mode === 'options' ) {
162
- return Str.fromOptions(value, isArray);
163
- }
164
-
165
- return JSON.parse(value);
166
- }
167
-
168
- /**
169
- * Parse param object to string
170
- */
171
- static stringify(value, mode = 'options')
172
- {
173
- if ( Any.isString(value) ) {
174
- return value;
175
- }
176
- if ( mode === 'params' ) {
177
- return Str.params(value);
178
- }
179
-
180
- if ( mode === 'options' ) {
181
- return Str.options(value);
182
- }
183
-
184
- return JSON.stringify(value);
185
- }
186
-
187
- /**
188
- * Parse object to string (e.g. foo:bar;test:lorem).
189
- */
190
- static options(params, quota = null)
191
- {
192
- if ( Any.isEmpty(params) ) {
193
- return '';
194
- }
195
-
196
- let result = [];
197
-
198
- Obj.each(params, (value, key) => {
199
-
200
- if ( quota !== null ) {
201
- key = quota + '.' + key;
202
- }
203
-
204
- if ( Any.isObject(value) ) {
205
- return result.push(Str.options(value, key).replace(/;$/, ''));
206
- }
207
-
208
- result.push(String(key) + ':' + String(value));
209
- });
210
-
211
- return result.join(';') + ';';
212
- }
213
-
214
- /**
215
- * Parse string to object (e.g. foo:bar;test:lorem).
216
- */
217
- static fromOptions(value, isArray = false)
218
- {
219
- if ( Any.isEmpty(value) ) {
220
- return {};
221
- }
222
-
223
- let regex = '(^|;)(\\s*(.*?)\\s*:\\s*' +
224
- '(".*?"|\'.*?\'|.*?)\\s*)(?=;|$)';
225
-
226
- let matches = value.match(new RegExp(regex, 'g'));
227
-
228
- let result = Arr.reduce(matches || [],
229
- this.convertFromOptions, {});
230
-
231
- if ( isArray ) {
232
- return Any.vals(result);
233
- }
234
-
235
- return result;
236
- }
237
-
238
- static convertFromOptions(result, match)
239
- {
240
- // Get key and value from match
241
- let attr = match.match(/^;?\s*(.*?)\s*:\s*(".*?"|'.*?'|.*?)\s*$/);
242
-
243
- // Skip if length does not match
244
- if ( attr.length !== 3 ) {
245
- return result;
246
- }
247
-
248
- let val = Str.real(attr[2].replace(/(^["']*|["']*$)/g, ''));
249
-
250
- Obj.set(result, attr[1], val);
251
-
252
- return result;
253
- }
254
-
255
- /**
256
- * Parse object to string (e.g. foo=bar&test=lorem).
257
- */
258
- static params(params, quota = null)
259
- {
260
- if ( Any.isEmpty(params) ) {
261
- return '';
262
- }
263
-
264
- let result = [];
265
-
266
- Obj.each(params, (value, key) => {
267
-
268
- if ( quota !== null ) {
269
- key = quota + '[' + key + ']';
270
- }
271
-
272
- if ( Any.isObject(value) ) {
273
- return result.push(Str.params(value, key));
274
- }
275
-
276
- result.push(String(key) + '=' + String(value));
277
- });
278
-
279
- return result.join('&');
280
- }
281
-
282
- /**
283
- * Parse string to object (e.g. foo=bar&test=lorem).
284
- */
285
- static fromParams(value, isArray = false)
286
- {
287
- if ( Any.isEmpty(value) ) {
288
- return {};
289
- }
290
-
291
- let regex = '(^|&)(\\s*(.*?)\\s*=\\s*' +
292
- '(".*?"|\'.*?\'|.*?)\\s*)(?=&|$)';
293
-
294
- let matches = value.match(new RegExp(regex, 'g'));
295
-
296
- let result = Arr.reduce(matches || [],
297
- this.convertFromParams, {});
298
-
299
- if ( isArray ) {
300
- return Any.vals(result);
301
- }
302
-
303
- return result
304
- }
305
-
306
- static convertFromParams(result, match) {
307
-
308
- // Get key and value from match
309
- let attr = match.match(/^&?\s*(.*?)\s*=\s*(".*?"|'.*?'|.*?)\s*$/);
310
-
311
- // Skip if length does not match
312
- if ( attr.length !== 3 ) {
313
- return result;
314
- }
315
-
316
- let key = attr[1].replace(/(\]\[|\[|\])/g, '.')
317
- .replace(/\.$/, '');
318
-
319
- let val = Str.real(attr[2].replace(/(^["']*|["']*$)/g, ''));
320
-
321
- Obj.set(result, key, val);
322
-
323
- return result;
324
- }
325
-
326
- }
327
-
328
- export default Str;
package/types/index.d.ts DELETED
@@ -1,77 +0,0 @@
1
- // types/index.d.ts
2
- import Cookie from "./library/cookie";
3
- import Data from "./library/data";
4
- import Element from "./library/element";
5
- import Event from "./library/event";
6
- import Locale from "./library/locale";
7
- import Map from "./library/map";
8
- import Queue from "./library/queue";
9
- import Route from "./library/route";
10
-
11
- import Dom from "./utility/dom";
12
- import Arr from "./utility/array";
13
- import Obj from "./utility/object";
14
- import Any from "./utility/any";
15
- import Num from "./utility/number";
16
- import Str from "./utility/string";
17
- import Now from "./utility/now";
18
-
19
- export declare module "@kizmann/pico-js" {
20
-
21
- function UUID(): string;
22
-
23
- const Cookie: typeof Cookie;
24
- const Data: typeof Data;
25
- const Element: typeof Element;
26
- const Event: typeof Event;
27
- const Locale: typeof Locale;
28
- const Map: typeof Map;
29
- const Queue: typeof Queue;
30
- const Route: typeof Route;
31
-
32
- const Dom: typeof Dom;
33
- const Arr: typeof Arr;
34
- const Obj: typeof Obj;
35
- const Any: typeof Any;
36
- const Str: typeof Str;
37
- const Num: typeof Num;
38
- const Now: typeof Now;
39
-
40
- export {
41
- UUID,
42
- Cookie,
43
- Data,
44
- Element,
45
- Event,
46
- Locale,
47
- Map,
48
- Queue,
49
- Route,
50
- Dom,
51
- Arr,
52
- Obj,
53
- Any,
54
- Str,
55
- Num,
56
- Now,
57
- };
58
-
59
- export default {
60
- UUID,
61
- Cookie,
62
- Data,
63
- Element,
64
- Event,
65
- Locale,
66
- Map,
67
- Queue,
68
- Route,
69
- Dom,
70
- Arr,
71
- Obj,
72
- Any,
73
- Str,
74
- Num,
75
- Now
76
- };
77
- }
@@ -1,10 +0,0 @@
1
- // types/utility/cookie.d.ts
2
-
3
- declare class Cookie {
4
- static pattern: string;
5
- static get(key: string, fallback?: any, decode?: 'string' | 'boolean' | 'float' | 'integer' | 'object' | 'array'): any;
6
- static set(key: string, value: any, expire?: number | null, options?: object): void;
7
- static forget(key: string, options?: object): void;
8
- }
9
-
10
- export default Cookie;
@@ -1,15 +0,0 @@
1
- // types/utility/data.d.ts
2
-
3
- declare class Data {
4
- static data: any;
5
- static has(input: any): boolean;
6
- static set(input: any, value: any): void;
7
- static unset(input: any): void;
8
- static get(input: any, fallback?: any, forceSet?: boolean): any;
9
- static find(input: any, value: any, fallback?: any): any;
10
- static replace(input: any, value: any): void;
11
- static add(input: any, ...args: any[]): void;
12
- static remove(input: any, ...args: any[]): void;
13
- }
14
-
15
- export default Data;
@@ -1,22 +0,0 @@
1
- // types/utility/element.d.ts
2
-
3
- declare class Element {
4
- static prefix: string;
5
- static mount: string;
6
- static inis: object;
7
- static runs: any[];
8
- static invi: any[];
9
-
10
- static listen(): void;
11
- static scroll(): void;
12
- static alias(key: string, instance: any): typeof Element;
13
- static bind(key: string, selector: any, options?: object): typeof Element;
14
- static unbind(key: string, selector: any, options?: object): typeof Element;
15
- static observe(key: string, plain?: boolean): typeof Element;
16
- static bindInview(el: any, cb: Function): void;
17
- static unbindInview(el: any, cb: Function): void;
18
- static getPrefix(key: string): string;
19
- static setPrefix(prefix: string): void;
20
- }
21
-
22
- export default Element;
@@ -1,13 +0,0 @@
1
- // types/utility/event.d.ts
2
-
3
- declare class Event {
4
- static events: any[];
5
-
6
- static bind(name: string | string[], callback: Function, options?: any, paused?: boolean): typeof Event;
7
- static unbind(name: string | string[], options?: any): typeof Event;
8
- static fire(name: string, ...args: any[]): typeof Event;
9
- static pause(name: string | string[], options?: any): typeof Event;
10
- static unpause(name: string | string[], options?: any): typeof Event;
11
- }
12
-
13
- export default Event;
@@ -1,14 +0,0 @@
1
- // types/utility/locale.d.ts
2
-
3
- declare class Locale {
4
- static locales: object;
5
-
6
- static pickByCount(splits: string[], count: number): string;
7
- static has(key: string): boolean;
8
- static get(key: string, fallback?: string | null): string;
9
- static set(key: string, value: string): typeof Locale;
10
- static trans(key: string, values?: object): string;
11
- static choice(key: string, count?: number, values?: object): string;
12
- }
13
-
14
- export default Locale;
@@ -1,43 +0,0 @@
1
- // types/utility/map.d.ts
2
-
3
- declare class Map {
4
- map: any;
5
- static mapStyle: any[];
6
- markers: object;
7
- static markerStyles: object;
8
- cluster: any;
9
- clusterFilter: Function | null;
10
- clusterOptions: object;
11
- static hideMarkers: boolean;
12
- static closeInfoWindows: boolean;
13
-
14
- constructor(el: any, options?: object);
15
-
16
- static setMapStyle(style?: any[]): typeof Map;
17
- static setMarkerStyle(key: string, style?: object, extra?: object): typeof Map;
18
-
19
- clusterMarkers(options?: object, filter?: Function | null, allowCreate?: boolean): void;
20
- styleMarker(key: string, type?: string | null): void;
21
- getMarker(key: string): any;
22
- getMarkerVisibility(key: string, fallback?: boolean): boolean;
23
- getMarkerPositon(key: string, fallback?: any): any;
24
- toggleMarker(key: string): boolean;
25
- showMarker(key: string): boolean;
26
- hideMarker(key: string): boolean;
27
- enterMarker(key: string): this;
28
- leaveMarker(key: string): this;
29
- getInfoVisibility(key: string, fallback?: boolean): boolean;
30
- toggleInfo(key: string): boolean;
31
- openInfo(key: string): boolean;
32
- closeInfo(key: string): boolean;
33
- createMarker(key?: string | null, options?: object): any;
34
- setMarkerPosition(key: string, options?: object): void;
35
- setMarkerByAddress(key: string, address: string): Promise<any>;
36
- getLocationByAddress(address: string, callback?: Function | null): Promise<any>;
37
- showMarkers(filter?: any): this;
38
- getMarkerBoundry(filter?: any): any;
39
- focusMarkers(filter?: any, maxZoom?: number, boundSpace?: number): this;
40
- renderDirections(options: object): Promise<any>;
41
- }
42
-
43
- export default Map;
@@ -1,18 +0,0 @@
1
- // types/utility/queue.d.ts
2
-
3
- declare class Queue {
4
- queue: Function[];
5
- stopQueue: boolean;
6
- activeQueue: boolean;
7
-
8
- constructor(queue?: Function[]);
9
-
10
- handler(queue: Function[], index: number): Function;
11
- stop(): this;
12
- clear(): this;
13
- add(cb: Function): this;
14
- run(): Queue;
15
- active(): boolean;
16
- }
17
-
18
- export default Queue;
@@ -1,11 +0,0 @@
1
- // types/utility/route.d.ts
2
-
3
- declare class Route {
4
- static routes: object;
5
-
6
- static set(key: string, value: string): void;
7
- static get(key: string, values?: object | null, params?: object | null): string;
8
- static goto(key: string, values?: object | null, params?: object | null): void;
9
- }
10
-
11
- export default Route;
@@ -1,35 +0,0 @@
1
- // types/utility/any.d.ts
2
-
3
- declare class Any {
4
- static isEmpty(val: any): boolean;
5
- static isNull(val: any): boolean;
6
- static isEqual(obj: any, val: any): boolean;
7
- static isString(val: any): boolean;
8
- static isNumber(val: any): boolean;
9
- static isBool(val: any): boolean;
10
- static isFunction(val: any): boolean;
11
- static isObject(val: any): boolean;
12
- static isPlain(val: any): boolean;
13
- static isArray(val: any): boolean;
14
- static isDate(val: any): boolean;
15
- static string(val: any): string;
16
- static convertString(val: any, empty?: string): string;
17
- static number(val: any, fallback?: number): number;
18
- static integer(val: any): number;
19
- static float(val: any): number;
20
- static bool(val: any): boolean;
21
- static boolean(val: any): boolean;
22
- static convertBool(val: any, yes?: string, no?: string): string;
23
- static convertBoolean(val: any, yes?: string, no?: string): string;
24
- static convertDatetime(val: any, format?: string, empty?: string): string;
25
- static vals(obj: any): any[];
26
- static keys(obj: any): string[];
27
- static async(callback: Function, ...args: any[]): typeof Any;
28
- static delay(callback: Function, delay?: number, ...args: any[]): typeof Any;
29
- static debounce(callback: Function, delay?: number, ref?: any): Function;
30
- static throttle(callback: Function, delay?: number, ref?: any): Function;
31
- static framerate(callback: Function, rate?: number, ref?: any): Function;
32
- static form(obj: any): FormData;
33
- }
34
-
35
- export default Any;
@@ -1,46 +0,0 @@
1
- // types/utility/array.d.ts
2
-
3
- declare class Arr {
4
- static make(count: number): number[];
5
- static all(arr: any): any[];
6
- static get(arr: any[], index: number, fallback?: any): any;
7
- static set(arr: any[], index: number, value: any): any;
8
- static first(arr: any[], fallback?: any): any;
9
- static second(arr: any[], fallback?: any): any;
10
- static third(arr: any[], fallback?: any): any;
11
- static last(arr: any[], fallback?: any): any;
12
- static prepend(arr: any[], val: any): any[];
13
- static append(arr: any[], val: any): any[];
14
- static sort(obj: any, key: any): any[];
15
- static sortString(obj: any, key: any): any[];
16
- static filter(arr: any[], filter: any): any[];
17
- static filterIndex(arr: any[], filter: any): any[];
18
- static find(arr: any[], val: any, fallback?: any): any;
19
- static findIndex(arr: any[], val: any, fallback?: number): number;
20
- static has(arr: any[], val: any): boolean;
21
- static add(arr: any[], val: any, finder?: any): any[];
22
- static replace(arr: any[], val: any, finder?: any): any[];
23
- static remove(arr: any[], val: any): any[];
24
- static toggle(arr: any[], val: any): any[];
25
- static removeIndex(arr: any[], val: number): any[];
26
- static insert(arr: any[], key: number, val: any): any[];
27
- static slice(arr: any[], key: number, count?: number): any[];
28
- static splice(arr: any[], key: number, count?: number): any[];
29
- static equal(arr1: any[], arr2: any[]): boolean;
30
- static includes(arr: any[], val: any): boolean;
31
- static contains(arr: any[], val: any): boolean;
32
- static concat(arr: any[], ...args: any[]): any[];
33
- static clone(arr: any): any;
34
- static merge(arr: any[], ...args: any[]): any[];
35
- static push(arr: any[], ...args: any[]): any[];
36
- static diff(arr: any[], val: any[]): any[];
37
- static intersect(...args: any[][]): any[];
38
- static chunk(arr: any[], chunk?: number): any[][];
39
- static reduce(arr: any[], callback: Function, accumulator: any): any;
40
- static extract(arr: any[], path: string): any[];
41
- static each(arr: any[], callback: Function): any[];
42
- static map(arr: any[], callback: Function): any[];
43
- static recursive(arr: any, key: string, callback: Function, cascade?: any[]): any;
44
- }
45
-
46
- export default Arr;