@webalternatif/js-core 1.6.3 → 1.6.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/README.md +3 -3
- package/dist/cjs/Mouse.js +6 -1
- package/dist/cjs/Translator.js +7 -1
- package/dist/cjs/array.js +5 -35
- package/dist/cjs/dom.js +817 -208
- package/dist/cjs/eventDispatcher.js +6 -1
- package/dist/cjs/index.js +6 -13
- package/dist/cjs/is.js +44 -1
- package/dist/cjs/math.js +56 -31
- package/dist/cjs/traversal.js +1 -2
- package/dist/cjs/utils.js +155 -38
- package/dist/esm/Mouse.js +7 -1
- package/dist/esm/Translator.js +7 -1
- package/dist/esm/array.js +4 -35
- package/dist/esm/dom.js +816 -206
- package/dist/esm/eventDispatcher.js +7 -1
- package/dist/esm/index.js +7 -8
- package/dist/esm/is.js +43 -0
- package/dist/esm/math.js +58 -32
- package/dist/esm/traversal.js +1 -2
- package/dist/esm/utils.js +156 -39
- package/dist/umd/Translator.umd.js +1 -0
- package/dist/umd/dom.umd.js +1 -0
- package/dist/umd/eventDispatcher.umd.js +1 -0
- package/dist/umd/mouse.umd.js +1 -0
- package/dist/umd/webf.umd.js +1 -0
- package/docs/array.md +41 -8
- package/docs/dom.md +1063 -269
- package/docs/is.md +244 -0
- package/docs/math.md +87 -7
- package/docs/mouse.md +43 -0
- package/docs/translator.md +14 -14
- package/docs/traversal.md +16 -16
- package/docs/utils.md +173 -20
- package/package.json +10 -4
- package/src/Mouse.js +73 -0
- package/src/Translator.js +148 -0
- package/src/array.js +136 -0
- package/src/dom.js +1553 -0
- package/src/eventDispatcher.js +118 -0
- package/src/index.js +106 -0
- package/src/is.js +201 -0
- package/src/math.js +113 -0
- package/src/onOff.js +313 -0
- package/src/random.js +38 -0
- package/src/string.js +662 -0
- package/src/stringPrototype.js +16 -0
- package/src/traversal.js +236 -0
- package/src/utils.js +242 -0
- package/types/Translator.d.ts +6 -5
- package/types/array.d.ts +0 -1
- package/types/dom.d.ts +763 -204
- package/types/index.d.ts +22 -21
- package/types/is.d.ts +3 -0
- package/types/math.d.ts +6 -5
- package/types/utils.d.ts +4 -4
- package/types/i18n.d.ts +0 -4
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export default webf;
|
|
2
|
+
export type Collection = import("./traversal.js").Collection<any>;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('./traversal.js').Collection<any>} Collection
|
|
5
|
+
*/
|
|
2
6
|
/**
|
|
3
7
|
* Main entry point of js-core.
|
|
4
8
|
*
|
|
@@ -8,24 +12,20 @@ export default webf;
|
|
|
8
12
|
* @module webf
|
|
9
13
|
*/
|
|
10
14
|
declare const webf: {
|
|
11
|
-
equals: (
|
|
15
|
+
equals: (...values: any[]) => boolean;
|
|
12
16
|
noop: () => void;
|
|
13
|
-
sizeOf: (
|
|
17
|
+
sizeOf: (v: Object | any[] | string) => number;
|
|
14
18
|
flatten: (o: Object | any[]) => any[];
|
|
15
19
|
strParseFloat: (val: any) => number;
|
|
16
|
-
throttle: (func:
|
|
17
|
-
debounce: (func: Function, wait: number, immediate?: boolean, context?:
|
|
18
|
-
round: (val:
|
|
19
|
-
floorTo: (
|
|
20
|
-
plancher: (
|
|
21
|
-
min: (list:
|
|
22
|
-
max: (list:
|
|
20
|
+
throttle: (func: Function, wait: number, leading?: boolean, trailing?: boolean, context?: any) => Function;
|
|
21
|
+
debounce: (func: Function, wait: number, immediate?: boolean, context?: any) => Function;
|
|
22
|
+
round: (val: number, precision?: number) => number;
|
|
23
|
+
floorTo: (val: number, precision: number) => number;
|
|
24
|
+
plancher: (val: number, precision: number) => number;
|
|
25
|
+
min: <T>(list: Iterable<T> | Record<string, T>, cmp_func?: (a: T, b: T) => number) => T | undefined;
|
|
26
|
+
max: <T>(list: math.Collection<T>, cmp_func?: (a: T, b: T) => number) => T | undefined;
|
|
23
27
|
dec2hex: (n: number) => string;
|
|
24
28
|
hex2dec: (hex: string) => number;
|
|
25
|
-
isWindow: (o: any) => boolean;
|
|
26
|
-
isDocument: (o: any) => boolean;
|
|
27
|
-
isDomElement: (o: any) => boolean;
|
|
28
|
-
getStyle: (el: Element, cssRule: string) => string;
|
|
29
29
|
randAlpha: (n: any) => string;
|
|
30
30
|
randAlphaCs: (n: any) => string;
|
|
31
31
|
randAlphaNum: (n: any) => string;
|
|
@@ -50,17 +50,19 @@ declare const webf: {
|
|
|
50
50
|
isScalar: (v: any) => boolean;
|
|
51
51
|
isEventSupported: (eventName: any) => boolean;
|
|
52
52
|
isTouchDevice: () => boolean;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
isWindow: (o: any) => boolean;
|
|
54
|
+
isDocument: (o: any) => boolean;
|
|
55
|
+
isDomElement: (o: any) => boolean;
|
|
56
|
+
each: <T>(o: traversal.Collection<T>, callback: (key: number | string, value: T, o: traversal.Collection<T>, index: number) => (void | boolean), context?: any) => typeof o;
|
|
57
|
+
foreach: <T>(o: traversal.Collection<T>, callback: (value: T, key: number | string, o: traversal.Collection<T>, index: number) => (void | boolean), context?: any) => typeof o;
|
|
58
|
+
map: <T, R>(o: traversal.Collection<T>, callback: (key: number | string, value: T, o: traversal.Collection<T>, index: number) => (R | null | false), context?: any) => Array<R>;
|
|
59
|
+
reduce: <T, R>(o: traversal.Collection<T>, callback: (accumulator: R | T, value: T, key: any, index: number, o: traversal.Collection<T>) => R, initialValue?: R) => R;
|
|
57
60
|
extend: <T>(...args: (boolean | T)[]) => T;
|
|
58
61
|
clone: <T>(o: T) => T;
|
|
59
|
-
merge: <T>(first: Collection<T>, second?: Collection<T>, ...args: Collection<T>[]) => Array<T>;
|
|
62
|
+
merge: <T>(first: traversal.Collection<T>, second?: traversal.Collection<T>, ...args: traversal.Collection<T>[]) => Array<T>;
|
|
60
63
|
inArray: (value: any, arr: Object | any[], index?: number, strict?: boolean) => boolean;
|
|
61
64
|
indexOf: (arr: Array<any> | string, elt: any, from?: number) => number;
|
|
62
65
|
lastIndexOf: (arr: Array<any> | string, elt: any, from?: number) => number;
|
|
63
|
-
compareArray: (a1: any[], a2: any[]) => boolean;
|
|
64
66
|
arrayUnique: (arr: any) => any;
|
|
65
67
|
array_unique: (arr: any) => any;
|
|
66
68
|
arrayDiff: (array1: any, array2: any, strict?: boolean) => any;
|
|
@@ -109,11 +111,10 @@ import * as arrayFunctions from './array.js';
|
|
|
109
111
|
import * as traversal from './traversal.js';
|
|
110
112
|
import * as is from './is.js';
|
|
111
113
|
import * as random from './random.js';
|
|
112
|
-
import { getStyle } from './dom.js';
|
|
113
114
|
import dom from './dom.js';
|
|
114
115
|
import * as math from './math.js';
|
|
115
116
|
import * as utils from './utils.js';
|
|
116
117
|
import eventDispatcher from './eventDispatcher.js';
|
|
117
118
|
import Mouse from './Mouse.js';
|
|
118
119
|
import Translator from './Translator.js';
|
|
119
|
-
export { stringFunctions, arrayFunctions, traversal, is, random,
|
|
120
|
+
export { stringFunctions, arrayFunctions, traversal, is, random, dom, math, utils, eventDispatcher, Mouse, Translator };
|
package/types/is.d.ts
CHANGED
|
@@ -15,3 +15,6 @@ export function isFloat(n: any): boolean;
|
|
|
15
15
|
export function isScalar(v: any): boolean;
|
|
16
16
|
export function isEventSupported(eventName: any): boolean;
|
|
17
17
|
export function isTouchDevice(): boolean;
|
|
18
|
+
export function isWindow(o: any): boolean;
|
|
19
|
+
export function isDocument(o: any): boolean;
|
|
20
|
+
export function isDomElement(o: any): boolean;
|
package/types/math.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function round(val:
|
|
2
|
-
export function floorTo(
|
|
3
|
-
export function plancher(
|
|
4
|
-
export function min(list:
|
|
5
|
-
export function max(list:
|
|
1
|
+
export function round(val: number, precision?: number): number;
|
|
2
|
+
export function floorTo(val: number, precision: number): number;
|
|
3
|
+
export function plancher(val: number, precision: number): number;
|
|
4
|
+
export function min<T>(list: Iterable<T> | Record<string, T>, cmp_func?: (a: T, b: T) => number): T | undefined;
|
|
5
|
+
export function max<T>(list: Collection<T>, cmp_func?: (a: T, b: T) => number): T | undefined;
|
|
6
6
|
export function dec2hex(n: number): string;
|
|
7
7
|
export function hex2dec(hex: string): number;
|
|
8
|
+
export type Collection = any;
|
package/types/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function equals(
|
|
1
|
+
export function equals(...values: any[]): boolean;
|
|
2
2
|
export function noop(): void;
|
|
3
|
-
export function sizeOf(
|
|
3
|
+
export function sizeOf(v: Object | any[] | string): number;
|
|
4
4
|
export function flatten(o: Object | any[]): any[];
|
|
5
5
|
export function strParseFloat(val: any): number;
|
|
6
|
-
export function throttle(func:
|
|
7
|
-
export function debounce(func: Function, wait: number, immediate?: boolean, context?:
|
|
6
|
+
export function throttle(func: Function, wait: number, leading?: boolean, trailing?: boolean, context?: any): Function;
|
|
7
|
+
export function debounce(func: Function, wait: number, immediate?: boolean, context?: any): Function;
|
package/types/i18n.d.ts
DELETED