@kizmann/pico-js 1.0.1 → 1.0.3
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.
- package/dist/pico-js.js +1 -1
- package/dist/pico-js.js.map +1 -1
- package/package.json +4 -3
- package/src/element/example.js +2 -2
- package/src/index.js +9 -9
- package/src/library/data.js +1 -1
- package/src/library/locale.js +1 -1
- package/src/library/map.js +14 -14
- package/src/library/route.js +2 -2
- package/src/utility/dom.js +2 -2
- package/src/utility/now.js +4 -4
- package/src/utility/object.js +1 -1
- package/types/index.d.ts +77 -0
- package/types/library/cookie.d.ts +10 -0
- package/types/library/data.d.ts +15 -0
- package/types/library/element.d.ts +22 -0
- package/types/library/event.d.ts +13 -0
- package/types/library/locale.d.ts +14 -0
- package/types/library/map.d.ts +43 -0
- package/types/library/queue.d.ts +18 -0
- package/types/library/route.d.ts +11 -0
- package/types/utility/any.d.ts +35 -0
- package/types/utility/array.d.ts +46 -0
- package/types/utility/dom.d.ts +101 -0
- package/types/utility/now.d.ts +79 -0
- package/types/utility/number.d.ts +17 -0
- package/types/utility/object.d.ts +29 -0
- package/types/utility/string.d.ts +26 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kizmann/pico-js",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3",
|
4
4
|
"license": "MIT",
|
5
5
|
"type": "module",
|
6
6
|
"private": false,
|
@@ -12,6 +12,7 @@
|
|
12
12
|
"files": [
|
13
13
|
"dist/",
|
14
14
|
"src/",
|
15
|
+
"types/",
|
15
16
|
"package.json"
|
16
17
|
],
|
17
18
|
"scripts": {
|
@@ -42,7 +43,7 @@
|
|
42
43
|
},
|
43
44
|
"dependencies": {
|
44
45
|
"docsify": "^4.13.1",
|
45
|
-
"
|
46
|
-
"
|
46
|
+
"global": "^4.4.0",
|
47
|
+
"moment": "^2.30.1"
|
47
48
|
}
|
48
49
|
}
|
package/src/element/example.js
CHANGED
@@ -16,7 +16,7 @@ export default class Example extends DefaultElement
|
|
16
16
|
|
17
17
|
bind()
|
18
18
|
{
|
19
|
-
if (
|
19
|
+
if ( window.$ === undefined ) {
|
20
20
|
return console.error('Element ready function requires jquery.')
|
21
21
|
}
|
22
22
|
|
@@ -47,7 +47,7 @@ export default class Example extends DefaultElement
|
|
47
47
|
opacity: 1
|
48
48
|
});
|
49
49
|
|
50
|
-
|
50
|
+
window.$(this.el).animate({ opacity: 0 }, options);
|
51
51
|
}
|
52
52
|
|
53
53
|
getReadyClass()
|
package/src/index.js
CHANGED
@@ -70,23 +70,23 @@ export const Pico = {
|
|
70
70
|
}
|
71
71
|
|
72
72
|
/**
|
73
|
-
* @const
|
73
|
+
* @const window
|
74
74
|
*/
|
75
75
|
|
76
|
-
if ( typeof
|
77
|
-
|
76
|
+
if ( typeof window.IE === 'undefined' && window.navigator ) {
|
77
|
+
window.IE = !! window.navigator.userAgent.match(/Edge\/|Trident\/|MSIE /);
|
78
78
|
}
|
79
79
|
|
80
|
-
if ( typeof
|
81
|
-
|
80
|
+
if ( typeof window.WIN === 'undefined' && window.navigator ) {
|
81
|
+
window.WIN = !! window.navigator.userAgent.match(/Windows/);
|
82
82
|
}
|
83
83
|
|
84
|
-
if ( typeof
|
85
|
-
|
84
|
+
if ( typeof window.pi === 'undefined' && window.navigator ) {
|
85
|
+
window.pi = Pico;
|
86
86
|
}
|
87
87
|
|
88
|
-
if ( typeof
|
89
|
-
|
88
|
+
if ( typeof window.pi !== 'undefined' && window.document ) {
|
89
|
+
window.pi.Dom.ready(window.pi.Element.listen);
|
90
90
|
}
|
91
91
|
|
92
92
|
export default Pico;
|
package/src/library/data.js
CHANGED
package/src/library/locale.js
CHANGED
package/src/library/map.js
CHANGED
@@ -26,7 +26,7 @@ export default class Map
|
|
26
26
|
|
27
27
|
constructor(el, options = {})
|
28
28
|
{
|
29
|
-
if ( !
|
29
|
+
if ( ! window.google ) {
|
30
30
|
throw new Error('Google Maps is required for pi.Map');
|
31
31
|
}
|
32
32
|
|
@@ -39,7 +39,7 @@ export default class Map
|
|
39
39
|
options = Obj.assign({ gestureHandling: 'cooperative', scrollwheel: null, zoom: 12, center },
|
40
40
|
Obj.except(options, ['lat', 'lng']));
|
41
41
|
|
42
|
-
this.map = new
|
42
|
+
this.map = new window.google.maps.Map(Dom.find(el).get(0), options)
|
43
43
|
}
|
44
44
|
|
45
45
|
static setMapStyle(style = [])
|
@@ -51,7 +51,7 @@ export default class Map
|
|
51
51
|
|
52
52
|
static setMarkerStyle(key, style = {}, extra = {})
|
53
53
|
{
|
54
|
-
if ( !
|
54
|
+
if ( ! window.google ) {
|
55
55
|
throw new Error('Google Maps is required for pi.Map');
|
56
56
|
}
|
57
57
|
|
@@ -70,13 +70,13 @@ export default class Map
|
|
70
70
|
let final = {};
|
71
71
|
|
72
72
|
// Marker size
|
73
|
-
let size = new
|
73
|
+
let size = new window.google.maps.Size(style.width, style.height);
|
74
74
|
|
75
75
|
// Point position
|
76
|
-
let origin = new
|
76
|
+
let origin = new window.google.maps.Point(0, 0);
|
77
77
|
|
78
78
|
// Point position
|
79
|
-
let anchor = new
|
79
|
+
let anchor = new window.google.maps.Point(style.width / 2, style.height);
|
80
80
|
|
81
81
|
final.default = {
|
82
82
|
url: style.default, size: size, origin: origin, anchor: anchor, scaledSize: size
|
@@ -113,7 +113,7 @@ export default class Map
|
|
113
113
|
return;
|
114
114
|
}
|
115
115
|
|
116
|
-
if ( typeof
|
116
|
+
if ( typeof window.MarkerClusterer === "undefined" ) {
|
117
117
|
return console.error('Google Maps Cluster library not laoded!');
|
118
118
|
}
|
119
119
|
|
@@ -140,7 +140,7 @@ export default class Map
|
|
140
140
|
return visible && this.clusterFilter.call(this, item);
|
141
141
|
});
|
142
142
|
|
143
|
-
this.cluster = new
|
143
|
+
this.cluster = new window.MarkerClusterer(this.map, Arr.each(markers, (item) => item.marker),
|
144
144
|
this.clusterOptions = options);
|
145
145
|
}
|
146
146
|
|
@@ -383,7 +383,7 @@ export default class Map
|
|
383
383
|
item.style = options.style;
|
384
384
|
}
|
385
385
|
|
386
|
-
item.marker = new
|
386
|
+
item.marker = new window.google.maps.Marker(options);
|
387
387
|
|
388
388
|
if ( !options.visible ) {
|
389
389
|
item.marker.setVisible(false);
|
@@ -410,7 +410,7 @@ export default class Map
|
|
410
410
|
// Add marker default style
|
411
411
|
item.marker.addListener('mouseout', () => this.leaveMarker(key));
|
412
412
|
|
413
|
-
item.info = new
|
413
|
+
item.info = new window.google.maps.InfoWindow({
|
414
414
|
content: '<div class="gw-i-html">' + Obj.get(options, 'html') + '</div>'
|
415
415
|
});
|
416
416
|
|
@@ -445,7 +445,7 @@ export default class Map
|
|
445
445
|
|
446
446
|
getLocationByAddress(address, callback = null)
|
447
447
|
{
|
448
|
-
let geocoderService = new
|
448
|
+
let geocoderService = new window.google.maps.Geocoder();
|
449
449
|
|
450
450
|
let geocoderPromise = (resolve, reject) => {
|
451
451
|
|
@@ -495,7 +495,7 @@ export default class Map
|
|
495
495
|
markers = Obj.filter(this.markers, filter);
|
496
496
|
}
|
497
497
|
|
498
|
-
let boundry = new
|
498
|
+
let boundry = new window.google.maps.LatLngBounds();
|
499
499
|
|
500
500
|
Obj.each(markers, (item) => {
|
501
501
|
if ( item.marker.getVisible() ) {
|
@@ -526,10 +526,10 @@ export default class Map
|
|
526
526
|
renderDirections(options)
|
527
527
|
{
|
528
528
|
// Get directions service
|
529
|
-
let directionsService = new
|
529
|
+
let directionsService = new window.google.maps.DirectionsService();
|
530
530
|
|
531
531
|
// Get directions renderer
|
532
|
-
let directionsRenderer = new
|
532
|
+
let directionsRenderer = new window.google.maps.DirectionsRenderer();
|
533
533
|
|
534
534
|
if ( ! Obj.has(options, 'map') ) {
|
535
535
|
options.map = this.map;
|
package/src/library/route.js
CHANGED
@@ -2,7 +2,7 @@ import { Obj, Str, Any } from "../index.js";
|
|
2
2
|
|
3
3
|
export default class Route
|
4
4
|
{
|
5
|
-
static routes = Obj.get(
|
5
|
+
static routes = Obj.get(window, '_routes', {});
|
6
6
|
|
7
7
|
static set (key, value)
|
8
8
|
{
|
@@ -22,7 +22,7 @@ export default class Route
|
|
22
22
|
|
23
23
|
static goto (key, values = null, params = null)
|
24
24
|
{
|
25
|
-
|
25
|
+
window.location.href = this.get(key, values, params);
|
26
26
|
}
|
27
27
|
|
28
28
|
}
|
package/src/utility/dom.js
CHANGED
@@ -111,8 +111,8 @@ export class Dom
|
|
111
111
|
|
112
112
|
static title(text = null, glue = ' - ')
|
113
113
|
{
|
114
|
-
document.title =
|
115
|
-
text + glue +
|
114
|
+
document.title = window.baseTitle !== undefined ?
|
115
|
+
text + glue + window.baseTitle : text;
|
116
116
|
|
117
117
|
return this;
|
118
118
|
}
|
package/src/utility/now.js
CHANGED
@@ -7,7 +7,7 @@ export class Now
|
|
7
7
|
|
8
8
|
constructor(date = null, format = 'YYYY-MM-DD HH:mm:ss')
|
9
9
|
{
|
10
|
-
if ( !
|
10
|
+
if ( ! window.moment ) {
|
11
11
|
throw new Error('Moment.js is required for pi.Now');
|
12
12
|
}
|
13
13
|
|
@@ -18,14 +18,14 @@ export class Now
|
|
18
18
|
this.initialDate = date;
|
19
19
|
|
20
20
|
if ( ! Any.isString(date) ) {
|
21
|
-
this.moment =
|
21
|
+
this.moment = window.moment(date || new Date, format);
|
22
22
|
}
|
23
23
|
|
24
24
|
if ( this.moment !== null ) {
|
25
25
|
return this;
|
26
26
|
}
|
27
27
|
|
28
|
-
this.moment =
|
28
|
+
this.moment = window.moment(date.match(/^now/) ?
|
29
29
|
new Date : date, format);
|
30
30
|
|
31
31
|
let second = this.initialDate.match(/(\+|-)([0-9]+)seconds?/);
|
@@ -92,7 +92,7 @@ export class Now
|
|
92
92
|
valid()
|
93
93
|
{
|
94
94
|
return ! Any.isEmpty(this.initialDate) &&
|
95
|
-
|
95
|
+
window.moment(this.initialDate).isValid();
|
96
96
|
}
|
97
97
|
|
98
98
|
clone()
|
package/src/utility/object.js
CHANGED
package/types/index.d.ts
ADDED
@@ -0,0 +1,77 @@
|
|
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: Cookie;
|
24
|
+
const Data: Data;
|
25
|
+
const Element: Element;
|
26
|
+
const Event: Event;
|
27
|
+
const Locale: Locale;
|
28
|
+
const Map: Map;
|
29
|
+
const Queue: Queue;
|
30
|
+
const Route: Route;
|
31
|
+
|
32
|
+
const Dom: Dom;
|
33
|
+
const Arr: Arr;
|
34
|
+
const Obj: Obj;
|
35
|
+
const Any: Any;
|
36
|
+
const Str: Str;
|
37
|
+
const Num: Num;
|
38
|
+
const Now: 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
|
+
}
|
@@ -0,0 +1,10 @@
|
|
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;
|
@@ -0,0 +1,15 @@
|
|
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;
|
@@ -0,0 +1,22 @@
|
|
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;
|
@@ -0,0 +1,13 @@
|
|
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;
|
@@ -0,0 +1,14 @@
|
|
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;
|
@@ -0,0 +1,43 @@
|
|
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;
|
@@ -0,0 +1,18 @@
|
|
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;
|
@@ -0,0 +1,11 @@
|
|
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;
|
@@ -0,0 +1,35 @@
|
|
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;
|
@@ -0,0 +1,46 @@
|
|
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;
|