@kizmann/pico-js 1.0.2 → 1.0.4
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/package.json +3 -3
- package/types/index.d.ts +66 -14
- 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 +29 -60
- package/types/utility/array.d.ts +38 -38
- package/types/utility/dom.d.ts +101 -0
- package/types/utility/now.d.ts +73 -142
- package/types/utility/number.d.ts +11 -25
- package/types/utility/object.d.ts +23 -48
- package/types/utility/string.d.ts +23 -30
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kizmann/pico-js",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.4",
|
4
4
|
"license": "MIT",
|
5
5
|
"type": "module",
|
6
6
|
"private": false,
|
@@ -43,7 +43,7 @@
|
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
45
|
"docsify": "^4.13.1",
|
46
|
-
"
|
47
|
-
"
|
46
|
+
"global": "^4.4.0",
|
47
|
+
"moment": "^2.30.1"
|
48
48
|
}
|
49
49
|
}
|
package/types/index.d.ts
CHANGED
@@ -1,25 +1,77 @@
|
|
1
1
|
// types/index.d.ts
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
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";
|
8
18
|
|
9
19
|
export declare module "@kizmann/pico-js" {
|
10
20
|
|
11
|
-
|
12
|
-
|
13
|
-
const
|
14
|
-
const
|
15
|
-
const
|
16
|
-
const
|
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;
|
17
39
|
|
18
40
|
export {
|
19
|
-
|
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,
|
20
57
|
};
|
21
58
|
|
22
59
|
export default {
|
23
|
-
|
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
|
24
76
|
};
|
25
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;
|
package/types/utility/any.d.ts
CHANGED
@@ -1,66 +1,35 @@
|
|
1
1
|
// types/utility/any.d.ts
|
2
2
|
|
3
|
-
|
4
|
-
import { Arr } from "./array";
|
5
|
-
import { Obj } from "./object";
|
6
|
-
import { Now } from "./now";
|
7
|
-
|
8
3
|
declare class Any {
|
9
|
-
static isEmpty(val
|
10
|
-
|
11
|
-
static
|
12
|
-
|
13
|
-
static
|
14
|
-
|
15
|
-
static
|
16
|
-
|
17
|
-
static
|
18
|
-
|
19
|
-
static
|
20
|
-
|
21
|
-
static
|
22
|
-
|
23
|
-
static
|
24
|
-
|
25
|
-
static
|
26
|
-
|
27
|
-
static
|
28
|
-
|
29
|
-
static
|
30
|
-
|
31
|
-
static
|
32
|
-
|
33
|
-
static
|
34
|
-
|
35
|
-
static
|
36
|
-
|
37
|
-
static
|
38
|
-
|
39
|
-
static bool(val : any) : boolean;
|
40
|
-
|
41
|
-
static boolean(val : any) : boolean;
|
42
|
-
|
43
|
-
static convertBool(val : any, yes? : string, no? : string) : string;
|
44
|
-
|
45
|
-
static convertBoolean(val : any, yes? : string, no? : string) : string;
|
46
|
-
|
47
|
-
static convertDatetime(val : any, format? : string, empty? : string) : string;
|
48
|
-
|
49
|
-
static vals(obj : any) : any[];
|
50
|
-
|
51
|
-
static keys(obj : any) : string[];
|
52
|
-
|
53
|
-
static async(callback : (...args : any[]) => void, ...args : any[]) : Any;
|
54
|
-
|
55
|
-
static delay(callback : (...args : any[]) => void, delay? : number, ...args : any[]) : Any;
|
56
|
-
|
57
|
-
static debounce(callback : (...args : any[]) => void, delay? : number, ref? : any) : (...args : any[]) => void;
|
58
|
-
|
59
|
-
static throttle(callback : (...args : any[]) => void, delay? : number, ref? : any) : (...args : any[]) => void;
|
60
|
-
|
61
|
-
static framerate(callback : (...args : any[]) => void, rate? : number, ref? : any) : (...args : any[]) => void;
|
62
|
-
|
63
|
-
static form(obj : any) : FormData;
|
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;
|
64
33
|
}
|
65
34
|
|
66
35
|
export default Any;
|
package/types/utility/array.d.ts
CHANGED
@@ -2,45 +2,45 @@
|
|
2
2
|
|
3
3
|
declare class Arr {
|
4
4
|
static make(count: number): number[];
|
5
|
-
static all
|
6
|
-
static get
|
7
|
-
static set
|
8
|
-
static first
|
9
|
-
static second
|
10
|
-
static third
|
11
|
-
static last
|
12
|
-
static prepend
|
13
|
-
static append
|
14
|
-
static sort
|
15
|
-
static sortString
|
16
|
-
static filter
|
17
|
-
static filterIndex(arr: any[], filter: any):
|
18
|
-
static find
|
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
19
|
static findIndex(arr: any[], val: any, fallback?: number): number;
|
20
|
-
static has
|
21
|
-
static add
|
22
|
-
static replace
|
23
|
-
static remove
|
24
|
-
static toggle
|
25
|
-
static removeIndex
|
26
|
-
static insert
|
27
|
-
static slice
|
28
|
-
static splice
|
29
|
-
static equal
|
30
|
-
static includes
|
31
|
-
static contains
|
32
|
-
static concat
|
33
|
-
static clone
|
34
|
-
static merge
|
35
|
-
static push
|
36
|
-
static diff
|
37
|
-
static intersect
|
38
|
-
static chunk
|
39
|
-
static reduce
|
40
|
-
static extract
|
41
|
-
static each
|
42
|
-
static map
|
43
|
-
static recursive
|
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
44
|
}
|
45
45
|
|
46
46
|
export default Arr;
|
@@ -0,0 +1,101 @@
|
|
1
|
+
// types/utility/dom.d.ts
|
2
|
+
|
3
|
+
declare class Dom {
|
4
|
+
el: any;
|
5
|
+
static events: any[];
|
6
|
+
static datas: any[];
|
7
|
+
|
8
|
+
constructor(el: any);
|
9
|
+
|
10
|
+
static ready(callback: Function, delay?: number, count?: number): typeof Dom;
|
11
|
+
static complete(callback: Function, delay?: number, count?: number): typeof Dom;
|
12
|
+
static required(callback: Function, globals?: string[], timer?: number): typeof Dom;
|
13
|
+
static find(element: any): Dom;
|
14
|
+
static make(element: any, options?: any): Dom;
|
15
|
+
static location(posx: number, posy: number): Dom;
|
16
|
+
static title(text?: string, glue?: string): typeof Dom;
|
17
|
+
|
18
|
+
length(): number;
|
19
|
+
empty(): boolean;
|
20
|
+
visible(): boolean;
|
21
|
+
inviewX(ratio?: number): boolean;
|
22
|
+
inviewY(ratio?: number): boolean;
|
23
|
+
is(selector: string): boolean;
|
24
|
+
isParent(selector: any): boolean;
|
25
|
+
first(offset?: number): any;
|
26
|
+
last(offset?: number): any;
|
27
|
+
get(index?: number): any;
|
28
|
+
getNot(el: any): Dom | null;
|
29
|
+
each(callback: Function): any;
|
30
|
+
matches(selector: string): boolean;
|
31
|
+
closest(selector: any): any;
|
32
|
+
closestScrollable(fallback?: any): any;
|
33
|
+
contains(selector: any): boolean;
|
34
|
+
inside(selector: any): boolean;
|
35
|
+
parent(): Dom;
|
36
|
+
child(selector: any): Dom;
|
37
|
+
childs(selector?: any, filter?: boolean): Dom;
|
38
|
+
find(selector: string): Dom;
|
39
|
+
where(selector: string): Dom;
|
40
|
+
not(selector: string): Dom;
|
41
|
+
prepend(val: any): this;
|
42
|
+
prependTo(el: any): this;
|
43
|
+
append(val: any): this;
|
44
|
+
appendTo(el: any): this;
|
45
|
+
replace(el: any): this;
|
46
|
+
previous(): Dom;
|
47
|
+
next(): Dom;
|
48
|
+
loaded(callback: Function): this;
|
49
|
+
bind(event: string, callback: Function): this;
|
50
|
+
unbind(event: string): void;
|
51
|
+
on(event: string | string[], callback: Function, options?: any, paused?: boolean): this;
|
52
|
+
live(event: string | string[], selector: string, callback: Function, options?: any, paused?: boolean): this;
|
53
|
+
one(event: string, callback: Function, options?: any): this;
|
54
|
+
fire(event: string): this;
|
55
|
+
delayed(event: string, callback: Function, delay?: number, options?: any): this;
|
56
|
+
off(event: string | string[], selector?: string, options?: any): this;
|
57
|
+
unpause(event: string | string[], selector?: string, options?: any): this;
|
58
|
+
pause(event: string | string[], selector?: string, options?: any): this;
|
59
|
+
observer(callback: Function, initial?: boolean): Function;
|
60
|
+
observerResize(callback: Function, initial?: boolean): Function;
|
61
|
+
data(key?: any, val?: any, fallback?: any): any;
|
62
|
+
value(val?: any): any;
|
63
|
+
html(html: string): this;
|
64
|
+
computed(key?: string, fallback?: any): any;
|
65
|
+
css(vals?: any): any;
|
66
|
+
class(vals: string | string[]): void;
|
67
|
+
hasClass(vals: string | string[]): boolean;
|
68
|
+
addClass(vals: string | string[]): this | void;
|
69
|
+
removeClass(vals: string | string[]): this | void;
|
70
|
+
toggleClass(vals: string | string[]): this;
|
71
|
+
attr(attr: any, val?: any): any;
|
72
|
+
actual(callback: Function, val?: any): any;
|
73
|
+
loopParent(callback: Function, target?: any): boolean;
|
74
|
+
loopOffsetParent(callback: Function, target?: any): boolean;
|
75
|
+
offset(key?: string, boundry?: any): any;
|
76
|
+
offsetTop(boundry?: any): number;
|
77
|
+
offsetBottom(boundry?: any): number;
|
78
|
+
offsetLeft(boundry?: any): number;
|
79
|
+
offsetRight(boundry?: any): number;
|
80
|
+
scroll(key?: string, boundry?: any): any;
|
81
|
+
scrollTop(val?: number, boundry?: any): number | this;
|
82
|
+
scrollTopGlobal(): number;
|
83
|
+
scrollLeft(val?: number, boundry?: any): number | this;
|
84
|
+
scrollLeftGlobal(): number;
|
85
|
+
margin(key?: string): any;
|
86
|
+
padding(key?: string): any;
|
87
|
+
height(): number;
|
88
|
+
clientHeight(): number;
|
89
|
+
scrollHeight(): number;
|
90
|
+
innerHeight(): number;
|
91
|
+
realHeight(styles?: any): number | string;
|
92
|
+
evaluateHeight(target?: any, auto?: boolean): number | string;
|
93
|
+
width(): number;
|
94
|
+
clientWidth(): number;
|
95
|
+
scrollWidth(): number;
|
96
|
+
innerWidth(): number;
|
97
|
+
realWidth(styles?: any): number;
|
98
|
+
evaluateWidth(target?: any, auto?: boolean): number | string;
|
99
|
+
}
|
100
|
+
|
101
|
+
export default Dom;
|
package/types/utility/now.d.ts
CHANGED
@@ -1,148 +1,79 @@
|
|
1
1
|
// types/utility/now.d.ts
|
2
2
|
|
3
|
-
import { Num } from "./number";
|
4
|
-
import { Arr } from "./array";
|
5
|
-
import { Any } from "./any";
|
6
|
-
|
7
3
|
declare class Now {
|
8
|
-
initialDate
|
9
|
-
moment
|
10
|
-
|
11
|
-
constructor(date
|
12
|
-
|
13
|
-
static make(date
|
14
|
-
|
15
|
-
get()
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
prevDate() : Now;
|
82
|
-
|
83
|
-
nextDate() : Now;
|
84
|
-
|
85
|
-
lastDate() : number;
|
86
|
-
|
87
|
-
day(day? : number | null) : number | Now;
|
88
|
-
|
89
|
-
hour(hour? : number | null) : number | Now;
|
90
|
-
|
91
|
-
addHour(count? : number) : Now;
|
92
|
-
|
93
|
-
subHour(count? : number) : Now;
|
94
|
-
|
95
|
-
prevHour() : Now;
|
96
|
-
|
97
|
-
nextHour() : Now;
|
98
|
-
|
99
|
-
minute(minute? : number | null) : number | Now;
|
100
|
-
|
101
|
-
addMinute(count? : number) : Now;
|
102
|
-
|
103
|
-
subMinute(count? : number) : Now;
|
104
|
-
|
105
|
-
prevMinute() : Now;
|
106
|
-
|
107
|
-
nextMinute() : Now;
|
108
|
-
|
109
|
-
second(second? : number | null) : number | Now;
|
110
|
-
|
111
|
-
addSecond(count? : number) : Now;
|
112
|
-
|
113
|
-
subSecond(count? : number) : Now;
|
114
|
-
|
115
|
-
prevSecond() : Now;
|
116
|
-
|
117
|
-
nextSecond() : Now;
|
118
|
-
|
119
|
-
humanDay() : number;
|
120
|
-
|
121
|
-
humanMonth() : number;
|
122
|
-
|
123
|
-
getMonths() : Now[];
|
124
|
-
|
125
|
-
getYears() : Now[];
|
126
|
-
|
127
|
-
getYearsGrid(size? : number) : Now[];
|
128
|
-
|
129
|
-
getDates() : Now[];
|
130
|
-
|
131
|
-
getDatesRange(target? : any) : Now[];
|
132
|
-
|
133
|
-
getDatesGrid(start? : number, end? : number) : Now[];
|
134
|
-
|
135
|
-
getHours(interval? : number) : Now[];
|
136
|
-
|
137
|
-
getMinutes(interval? : number) : Now[];
|
138
|
-
|
139
|
-
getSeconds(interval? : number) : Now[];
|
140
|
-
|
141
|
-
resetTime() : Now;
|
142
|
-
|
143
|
-
applyDate(now : any, format? : string) : void;
|
144
|
-
|
145
|
-
applyTime(now : any, format? : string) : void;
|
4
|
+
initialDate: any;
|
5
|
+
moment: any;
|
6
|
+
|
7
|
+
constructor(date?: any, format?: string);
|
8
|
+
|
9
|
+
static make(date?: any, format?: string): Now;
|
10
|
+
|
11
|
+
get(): any;
|
12
|
+
valid(): boolean;
|
13
|
+
clone(): Now;
|
14
|
+
code(format?: string): number;
|
15
|
+
format(format?: string, force?: boolean): string;
|
16
|
+
before(before?: any): boolean;
|
17
|
+
beforeDate(before?: any): boolean;
|
18
|
+
beforeTime(before?: any): boolean;
|
19
|
+
after(after?: any): boolean;
|
20
|
+
afterDate(after?: any): boolean;
|
21
|
+
afterTime(after?: any): boolean;
|
22
|
+
equal(equal?: any, format?: string): boolean;
|
23
|
+
equalDate(equal?: any, format?: string): boolean;
|
24
|
+
equalTime(equal?: any, format?: string): boolean;
|
25
|
+
between(fromDate?: any, toDate?: any, format?: string): boolean;
|
26
|
+
decade(): number;
|
27
|
+
prevDecade(): Now;
|
28
|
+
nextDecade(): Now;
|
29
|
+
addDecades(count?: number): Now;
|
30
|
+
subDecades(count?: number): Now;
|
31
|
+
year(year?: number): number | Now;
|
32
|
+
prevYear(): Now;
|
33
|
+
nextYear(): Now;
|
34
|
+
addYears(count?: number): Now;
|
35
|
+
subYears(count?: number): Now;
|
36
|
+
month(month?: number): number | Now;
|
37
|
+
addMonths(count?: number): Now;
|
38
|
+
subMonths(count?: number): Now;
|
39
|
+
prevMonth(): Now;
|
40
|
+
nextMonth(): Now;
|
41
|
+
date(date?: number): number | Now;
|
42
|
+
addDates(count?: number): Now;
|
43
|
+
subDates(count?: number): Now;
|
44
|
+
prevDate(): Now;
|
45
|
+
nextDate(): Now;
|
46
|
+
lastDate(): number;
|
47
|
+
day(day?: number): number | Now;
|
48
|
+
hour(hour?: number): number | Now;
|
49
|
+
addHour(count?: number): Now;
|
50
|
+
subHour(count?: number): Now;
|
51
|
+
prevHour(): Now;
|
52
|
+
nextHour(): Now;
|
53
|
+
minute(minute?: number): number | Now;
|
54
|
+
addMinute(count?: number): Now;
|
55
|
+
subMinute(count?: number): Now;
|
56
|
+
prevMinute(): Now;
|
57
|
+
nextMinute(): Now;
|
58
|
+
second(second?: number): number | Now;
|
59
|
+
addSecond(count?: number): Now;
|
60
|
+
subSecond(count?: number): Now;
|
61
|
+
prevSecond(): Now;
|
62
|
+
nextSecond(): Now;
|
63
|
+
humanDay(): number;
|
64
|
+
humanMonth(): number;
|
65
|
+
getMonths(): Now[];
|
66
|
+
getYears(): Now[];
|
67
|
+
getYearsGrid(size?: number): Now[];
|
68
|
+
getDates(): Now[];
|
69
|
+
getDatesRange(target?: any): Now[];
|
70
|
+
getDatesGrid(start?: number, end?: number): Now[];
|
71
|
+
getHours(interval?: number): Now[];
|
72
|
+
getMinutes(interval?: number): Now[];
|
73
|
+
getSeconds(interval?: number): Now[];
|
74
|
+
resetTime(): Now;
|
75
|
+
applyDate(now: any, format?: string): void;
|
76
|
+
applyTime(now: any, format?: string): void;
|
146
77
|
}
|
147
78
|
|
148
79
|
export default Now;
|
@@ -1,31 +1,17 @@
|
|
1
1
|
// types/utility/number.d.ts
|
2
2
|
|
3
|
-
import { Any } from "./any";
|
4
|
-
import { Arr } from "./array";
|
5
|
-
import { Obj } from "./object";
|
6
|
-
|
7
3
|
declare class Num {
|
8
|
-
static int(num
|
9
|
-
|
10
|
-
static
|
11
|
-
|
12
|
-
static
|
13
|
-
|
14
|
-
static
|
15
|
-
|
16
|
-
static
|
17
|
-
|
18
|
-
static
|
19
|
-
|
20
|
-
static random(start? : number, end? : number) : number;
|
21
|
-
|
22
|
-
static matrix(num : number, limit? : number, base? : number[]) : number[];
|
23
|
-
|
24
|
-
static combine(arr : number[]) : number;
|
25
|
-
|
26
|
-
static distance(cord1 : { lat : number; lng : number }, cord2 : { lat : number; lng : number }, miles? : boolean) : number;
|
27
|
-
|
28
|
-
static format(num : number | null, decimal? : string, thousand? : string, fixed? : number | null) : string | null;
|
4
|
+
static int(num: any): number;
|
5
|
+
static float(num: any): number;
|
6
|
+
static ceil(num: number): number;
|
7
|
+
static round(num: number): number;
|
8
|
+
static floor(num: number): number;
|
9
|
+
static fixed(num: any, fixed?: number): string;
|
10
|
+
static random(start?: number, end?: number): number;
|
11
|
+
static matrix(num: number, limit?: number, base?: number[]): number[];
|
12
|
+
static combine(arr: number[]): number;
|
13
|
+
static distance(cord1: any, cord2: any, miles?: boolean): number;
|
14
|
+
static format(num: number, decimal?: string, thousand?: string, fixed?: number): string | null;
|
29
15
|
}
|
30
16
|
|
31
17
|
export default Num;
|
@@ -1,54 +1,29 @@
|
|
1
1
|
// types/utility/object.d.ts
|
2
2
|
|
3
|
-
import { Arr } from "./array";
|
4
|
-
import { Any } from "./any";
|
5
|
-
|
6
3
|
declare class Obj {
|
7
|
-
static has(obj
|
8
|
-
|
9
|
-
static
|
10
|
-
|
11
|
-
static
|
12
|
-
|
13
|
-
static
|
14
|
-
|
15
|
-
static
|
16
|
-
|
17
|
-
static
|
18
|
-
|
19
|
-
static
|
20
|
-
|
21
|
-
static
|
22
|
-
|
23
|
-
static
|
24
|
-
|
25
|
-
static
|
26
|
-
|
27
|
-
static
|
28
|
-
|
29
|
-
static
|
30
|
-
|
31
|
-
static filter(obj : any, filter : any) : any[];
|
32
|
-
|
33
|
-
static filterIndex(obj : any, filter : any) : string[];
|
34
|
-
|
35
|
-
static find(arr : any[], obj : any, fallback? : any) : any;
|
36
|
-
|
37
|
-
static findIndex(arr : any[], obj : any, fallback? : number) : number;
|
38
|
-
|
39
|
-
static clone(obj : any) : any;
|
40
|
-
|
41
|
-
static assign(...args : any[]) : any;
|
42
|
-
|
43
|
-
static remove(obj : any, keys : string[]) : any;
|
44
|
-
|
45
|
-
static each(obj : any, callback : (value : any, key : string) => void) : any;
|
46
|
-
|
47
|
-
static map(obj : any, callback : (value : any, key : string) => any) : any;
|
48
|
-
|
49
|
-
static values(obj : any) : any[];
|
50
|
-
|
51
|
-
static flatten(obj : any) : any;
|
4
|
+
static has(obj: any, keys: any): boolean;
|
5
|
+
static empty(obj: any, key: string): boolean;
|
6
|
+
static get(obj: any, keys: any, fallback?: any): any;
|
7
|
+
static set(obj: any, keys: any, val: any): any;
|
8
|
+
static unset(obj: any, keys: any): any;
|
9
|
+
static pluck(obj: any, keys: any, fallback?: any): any;
|
10
|
+
static only(obj: any, keys: any, assign?: any): any;
|
11
|
+
static except(obj: any, keys: any, assign?: any): any;
|
12
|
+
static includes(obj: any, val: any): boolean;
|
13
|
+
static matches(obj: any, val: any): boolean;
|
14
|
+
static sort(obj: any, key: any): any[];
|
15
|
+
static sortString(obj: any, key: any): any[];
|
16
|
+
static filter(obj: any, filter: any): any;
|
17
|
+
static filterIndex(obj: any, filter: any): any[];
|
18
|
+
static find(arr: any, obj: any, fallback?: any): any;
|
19
|
+
static findIndex(arr: any, obj: any, fallback?: number): any;
|
20
|
+
static clone(obj: any): any;
|
21
|
+
static assign(...args: any[]): any;
|
22
|
+
static remove(obj: any, keys: any[]): any;
|
23
|
+
static each(obj: any, callback: Function): any;
|
24
|
+
static map(obj: any, callback: Function): any;
|
25
|
+
static values(obj: any): any[];
|
26
|
+
static flatten(obj: any): any;
|
52
27
|
}
|
53
28
|
|
54
29
|
export default Obj;
|
@@ -1,33 +1,26 @@
|
|
1
1
|
// types/utility/string.d.ts
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
static options(params: any, quota?: string | null): string;
|
25
|
-
static fromOptions(value: string, isArray?: boolean): any;
|
26
|
-
private static convertFromOptions(result: any, match: string): any;
|
27
|
-
static params(params: any, quota?: string | null): string;
|
28
|
-
static fromParams(value: string, isArray?: boolean): any;
|
29
|
-
private static convertFromParams(result: any, match: string): any;
|
30
|
-
}
|
31
|
-
|
32
|
-
export default Str;
|
3
|
+
export class Str {
|
4
|
+
static regexEscape(val: any): string;
|
5
|
+
static upper(val: any): string;
|
6
|
+
static lower(val: any): string;
|
7
|
+
static camelcase(val: any): string;
|
8
|
+
static humancase(val: any): string;
|
9
|
+
static slugify(val: any): string;
|
10
|
+
static ucfirst(val: string): string;
|
11
|
+
static lcfirst(val: string): string;
|
12
|
+
static has(val: string, search: string): boolean;
|
13
|
+
static filesize(val: number, decimals?: number): string | null;
|
14
|
+
static array(value: string, fallback?: any[]): any[];
|
15
|
+
static real(value: any): any;
|
16
|
+
static objectify(value: any, mode?: string, isArray?: boolean): any;
|
17
|
+
static stringify(value: any, mode?: string): string;
|
18
|
+
static options(params: any, quota?: string | null): string;
|
19
|
+
static fromOptions(value: string, isArray?: boolean): any;
|
20
|
+
static convertFromOptions(result: any, match: string): any;
|
21
|
+
static params(params: any, quota?: string | null): string;
|
22
|
+
static fromParams(value: string, isArray?: boolean): any;
|
23
|
+
static convertFromParams(result: any, match: string): any;
|
33
24
|
}
|
25
|
+
|
26
|
+
export default Str;
|