@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.
@@ -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;
@@ -0,0 +1,79 @@
1
+ // types/utility/now.d.ts
2
+
3
+ declare class Now {
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;
77
+ }
78
+
79
+ export default Now;
@@ -0,0 +1,17 @@
1
+ // types/utility/number.d.ts
2
+
3
+ declare class Num {
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;
15
+ }
16
+
17
+ export default Num;
@@ -0,0 +1,29 @@
1
+ // types/utility/object.d.ts
2
+
3
+ declare class Obj {
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;
27
+ }
28
+
29
+ export default Obj;
@@ -0,0 +1,26 @@
1
+ // types/utility/string.d.ts
2
+
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;
24
+ }
25
+
26
+ export default Str;