utils-lib-js 2.0.0 → 2.0.1
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.en.md +1 -1
- package/README.md +1 -1
- package/package.json +13 -12
- package/rollup.config.js +1 -0
- package/dist/bundle/animate.d.ts +0 -25
- package/dist/bundle/array.d.ts +0 -10
- package/dist/bundle/base.d.ts +0 -15
- package/dist/bundle/element.d.ts +0 -6
- package/dist/bundle/event.d.ts +0 -14
- package/dist/bundle/function.d.ts +0 -12
- package/dist/bundle/index.d.ts +0 -64
- package/dist/bundle/index.js +0 -1
- package/dist/bundle/log.d.ts +0 -8
- package/dist/bundle/object.d.ts +0 -32
- package/dist/bundle/static.d.ts +0 -16
- package/dist/bundle/storage.d.ts +0 -9
- package/dist/bundle/types.d.ts +0 -68
- package/dist/cjs/animate.d.ts +0 -25
- package/dist/cjs/array.d.ts +0 -10
- package/dist/cjs/base.d.ts +0 -15
- package/dist/cjs/element.d.ts +0 -6
- package/dist/cjs/event.d.ts +0 -14
- package/dist/cjs/function.d.ts +0 -12
- package/dist/cjs/index.d.ts +0 -64
- package/dist/cjs/index.js +0 -917
- package/dist/cjs/log.d.ts +0 -8
- package/dist/cjs/object.d.ts +0 -32
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/static.d.ts +0 -16
- package/dist/cjs/storage.d.ts +0 -9
- package/dist/cjs/types.d.ts +0 -68
- package/dist/esm/animate.d.ts +0 -25
- package/dist/esm/array.d.ts +0 -10
- package/dist/esm/base.d.ts +0 -15
- package/dist/esm/element.d.ts +0 -6
- package/dist/esm/event.d.ts +0 -14
- package/dist/esm/function.d.ts +0 -12
- package/dist/esm/index.d.ts +0 -64
- package/dist/esm/index.js +0 -865
- package/dist/esm/log.d.ts +0 -8
- package/dist/esm/object.d.ts +0 -32
- package/dist/esm/static.d.ts +0 -16
- package/dist/esm/storage.d.ts +0 -9
- package/dist/esm/types.d.ts +0 -68
- package/dist/umd/animate.d.ts +0 -25
- package/dist/umd/array.d.ts +0 -10
- package/dist/umd/base.d.ts +0 -15
- package/dist/umd/element.d.ts +0 -6
- package/dist/umd/event.d.ts +0 -14
- package/dist/umd/function.d.ts +0 -12
- package/dist/umd/index.d.ts +0 -64
- package/dist/umd/index.js +0 -923
- package/dist/umd/log.d.ts +0 -8
- package/dist/umd/object.d.ts +0 -32
- package/dist/umd/static.d.ts +0 -16
- package/dist/umd/storage.d.ts +0 -9
- package/dist/umd/types.d.ts +0 -68
package/README.en.md
CHANGED
|
@@ -330,7 +330,7 @@ timer? : number
|
|
|
330
330
|
export type ILogLoop = (opts? : ILogLoopParams) => ILogLoopParams | void
|
|
331
331
|
|
|
332
332
|
##### request module
|
|
333
|
-
###### https://gitee.com/DieHunter/js-request
|
|
333
|
+
###### https://gitee.com/DieHunter/js-request-lib
|
|
334
334
|
export type IRequestParams<T> = T | IObject<any> | null
|
|
335
335
|
|
|
336
336
|
// Request path
|
package/README.md
CHANGED
|
@@ -329,7 +329,7 @@ export type ILogLoopParams = {
|
|
|
329
329
|
export type ILogLoop = (opts?: ILogLoopParams) => ILogLoopParams | void
|
|
330
330
|
|
|
331
331
|
##### request 模块
|
|
332
|
-
###### https://gitee.com/DieHunter/js-request
|
|
332
|
+
###### https://gitee.com/DieHunter/js-request-lib
|
|
333
333
|
export type IRequestParams<T> = T | IObject<any> | null
|
|
334
334
|
|
|
335
335
|
// 请求路径
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "utils-lib-js",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "JavaScript工具函数,封装的一些常用的js函数",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
"import": "./dist/esm/index.js",
|
|
11
11
|
"require": "./dist/cjs/index.js"
|
|
12
12
|
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"debug": "start cmd /k pnpm run build:hot & pnpm run node:hot",
|
|
15
|
+
"node:hot": "nodemon example.js --watch example.js",
|
|
16
|
+
"build:hot": "pnpm rollup -c --watch",
|
|
17
|
+
"build": "pnpm run rollup:build && pnpm run commonjs",
|
|
18
|
+
"rollup:build": "rm -fr dist && pnpm rollup -c",
|
|
19
|
+
"build:publish": "pnpm run build && pnpm publish",
|
|
20
|
+
"commonjs": "cp ./commonjs.json dist/cjs/package.json"
|
|
21
|
+
},
|
|
13
22
|
"repository": {
|
|
14
23
|
"type": "git",
|
|
15
24
|
"url": "https://gitee.com/DieHunter/utils-lib-js.git"
|
|
@@ -33,16 +42,8 @@
|
|
|
33
42
|
},
|
|
34
43
|
"dependencies": {
|
|
35
44
|
"event-message-center": "^1.3.2",
|
|
45
|
+
"js-request-lib": "^1.0.2",
|
|
36
46
|
"task-queue-lib": "^1.2.0"
|
|
37
47
|
},
|
|
38
|
-
"umdModuleName": "UtilsLib"
|
|
39
|
-
|
|
40
|
-
"debug": "start cmd /k pnpm run build:hot & pnpm run node:hot",
|
|
41
|
-
"node:hot": "nodemon example.js --watch example.js",
|
|
42
|
-
"build:hot": "pnpm rollup -c --watch",
|
|
43
|
-
"build": "pnpm run rollup:build && pnpm run commonjs",
|
|
44
|
-
"rollup:build": "rm -fr dist && pnpm rollup -c",
|
|
45
|
-
"build:publish": "pnpm run build && pnpm publish",
|
|
46
|
-
"commonjs": "cp ./commonjs.json dist/cjs/package.json"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
48
|
+
"umdModuleName": "UtilsLib"
|
|
49
|
+
}
|
package/rollup.config.js
CHANGED
package/dist/bundle/animate.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { IAnimateFrame } from "./types";
|
|
2
|
-
export declare class AnimateFrame implements IAnimateFrame {
|
|
3
|
-
fn: any;
|
|
4
|
-
id: any;
|
|
5
|
-
duration: number;
|
|
6
|
-
isActive: boolean;
|
|
7
|
-
constructor(fn: any);
|
|
8
|
-
start(duration: any): void;
|
|
9
|
-
stop(): void;
|
|
10
|
-
animate(timer?: number): void;
|
|
11
|
-
}
|
|
12
|
-
export declare function quadraticBezier(_x: number, _y: number, t: number): number[];
|
|
13
|
-
export declare function cubicBezier(_x1: number, _y1: number, _x2: number, _y2: number, t: number): number[];
|
|
14
|
-
export declare function factorial(n: number): any;
|
|
15
|
-
export declare function combination(n: number, k: number): number;
|
|
16
|
-
export declare function NBezier(points: number[][], t: number): number[];
|
|
17
|
-
declare const _default: {
|
|
18
|
-
AnimateFrame: typeof AnimateFrame;
|
|
19
|
-
quadraticBezier: typeof quadraticBezier;
|
|
20
|
-
cubicBezier: typeof cubicBezier;
|
|
21
|
-
factorial: typeof factorial;
|
|
22
|
-
combination: typeof combination;
|
|
23
|
-
NBezier: typeof NBezier;
|
|
24
|
-
};
|
|
25
|
-
export default _default;
|
package/dist/bundle/array.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IArrayRandom, IArrayUniq, IArrayDemote, IDemoteArray } from "./types";
|
|
2
|
-
export declare const arrayRandom: IArrayRandom<any[]>;
|
|
3
|
-
export declare const arrayUniq: IArrayUniq<any[]>;
|
|
4
|
-
export declare const arrayDemote: IArrayDemote<IDemoteArray<any>>;
|
|
5
|
-
declare const _default: {
|
|
6
|
-
arrayRandom: IArrayRandom<any[]>;
|
|
7
|
-
arrayUniq: IArrayUniq<any[]>;
|
|
8
|
-
arrayDemote: IArrayDemote<IDemoteArray<any>>;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
package/dist/bundle/base.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IRandomNum, IUrlSplit, IUrlJoin, IGetType, IGetTypeByList } from "./types";
|
|
2
|
-
import { types } from "./static";
|
|
3
|
-
export declare const randomNum: IRandomNum;
|
|
4
|
-
export declare const urlSplit: IUrlSplit;
|
|
5
|
-
export declare const urlJoin: IUrlJoin;
|
|
6
|
-
export declare const getType: IGetType<types>;
|
|
7
|
-
export declare const getTypeByList: IGetTypeByList;
|
|
8
|
-
declare const _default: {
|
|
9
|
-
randomNum: IRandomNum;
|
|
10
|
-
urlSplit: IUrlSplit;
|
|
11
|
-
urlJoin: IUrlJoin;
|
|
12
|
-
getType: IGetType<types>;
|
|
13
|
-
getTypeByList: IGetTypeByList;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
package/dist/bundle/element.d.ts
DELETED
package/dist/bundle/event.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IAddHandler, IStopBubble, IStopDefault, IRemoveHandler, IDispatchEvent } from "./types";
|
|
2
|
-
export declare const addHandler: IAddHandler;
|
|
3
|
-
export declare const stopBubble: IStopBubble;
|
|
4
|
-
export declare const stopDefault: IStopDefault;
|
|
5
|
-
export declare const removeHandler: IRemoveHandler;
|
|
6
|
-
export declare const dispatchEvent: IDispatchEvent;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
addHandler: IAddHandler;
|
|
9
|
-
stopBubble: IStopBubble;
|
|
10
|
-
stopDefault: IStopDefault;
|
|
11
|
-
removeHandler: IRemoveHandler;
|
|
12
|
-
dispatchEvent: IDispatchEvent;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ICatchAwait, IThrottle, IDebounce, IDefer } from "./types";
|
|
2
|
-
export declare const throttle: IThrottle;
|
|
3
|
-
export declare const debounce: IDebounce;
|
|
4
|
-
export declare const defer: IDefer;
|
|
5
|
-
export declare const catchAwait: ICatchAwait<Promise<any>>;
|
|
6
|
-
declare const _default: {
|
|
7
|
-
throttle: IThrottle;
|
|
8
|
-
debounce: IDebounce;
|
|
9
|
-
defer: IDefer;
|
|
10
|
-
catchAwait: ICatchAwait<Promise<any>>;
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
package/dist/bundle/index.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export * from "./object";
|
|
2
|
-
export * from "./base";
|
|
3
|
-
export * from "./array";
|
|
4
|
-
export * from "./function";
|
|
5
|
-
export * from "./element";
|
|
6
|
-
export * from "./static";
|
|
7
|
-
export * from "./types";
|
|
8
|
-
export * from "./event";
|
|
9
|
-
export * from "./storage";
|
|
10
|
-
export * from "./log";
|
|
11
|
-
export * from "./animate";
|
|
12
|
-
export * from "event-message-center";
|
|
13
|
-
export * from "task-queue-lib";
|
|
14
|
-
import eventMessageCenter from "event-message-center";
|
|
15
|
-
import taskQueueLib from "task-queue-lib";
|
|
16
|
-
declare const _default: {
|
|
17
|
-
eventMessageCenter: typeof eventMessageCenter;
|
|
18
|
-
taskQueueLib: typeof taskQueueLib;
|
|
19
|
-
AnimateFrame: typeof import("./animate").AnimateFrame;
|
|
20
|
-
quadraticBezier: typeof import("./animate").quadraticBezier;
|
|
21
|
-
cubicBezier: typeof import("./animate").cubicBezier;
|
|
22
|
-
factorial: typeof import("./animate").factorial;
|
|
23
|
-
combination: typeof import("./animate").combination;
|
|
24
|
-
NBezier: typeof import("./animate").NBezier;
|
|
25
|
-
logOneLine: import("./types").ILogOneLine;
|
|
26
|
-
logLoop: import("./types").ILogLoop;
|
|
27
|
-
setStorage: (key: string, val: any) => void;
|
|
28
|
-
getStorage: (key: string) => any;
|
|
29
|
-
clearStorage: (key: string) => void;
|
|
30
|
-
addHandler: import("./types").IAddHandler;
|
|
31
|
-
stopBubble: import("./types").IStopBubble;
|
|
32
|
-
stopDefault: import("./types").IStopDefault;
|
|
33
|
-
removeHandler: import("./types").IRemoveHandler;
|
|
34
|
-
dispatchEvent: import("./types").IDispatchEvent;
|
|
35
|
-
types: typeof import("./static").types;
|
|
36
|
-
createElement: import("./types").ICreateElement<HTMLElement>;
|
|
37
|
-
throttle: import("./types").IThrottle;
|
|
38
|
-
debounce: import("./types").IDebounce;
|
|
39
|
-
defer: import("./types").IDefer;
|
|
40
|
-
catchAwait: import("./types").ICatchAwait<Promise<any>>;
|
|
41
|
-
arrayRandom: import("./types").IArrayRandom<any[]>;
|
|
42
|
-
arrayUniq: import("./types").IArrayUniq<any[]>;
|
|
43
|
-
arrayDemote: import("./types").IArrayDemote<import("./types").IDemoteArray<any>>;
|
|
44
|
-
randomNum: import("./types").IRandomNum;
|
|
45
|
-
urlSplit: import("./types").IUrlSplit;
|
|
46
|
-
urlJoin: import("./types").IUrlJoin;
|
|
47
|
-
getType: import("./types").IGetType<import("./static").types>;
|
|
48
|
-
getTypeByList: import("./types").IGetTypeByList;
|
|
49
|
-
getValue: import("./types").IGetValue;
|
|
50
|
-
setValue: import("./types").ISetValue;
|
|
51
|
-
mixIn: import("./types").IMixIn;
|
|
52
|
-
enumInversion: import("./types").IEnumInversion;
|
|
53
|
-
isNotObject: (source: any, type: any) => boolean;
|
|
54
|
-
cloneDeep: import("./types").ICloneDeep;
|
|
55
|
-
createObjectVariable: import("./types").ICreateObjectVariable;
|
|
56
|
-
createObject: import("./types").ICreateObject;
|
|
57
|
-
inherit: import("./types").IInherit;
|
|
58
|
-
getInstance: import("./types").IGetInstance;
|
|
59
|
-
classDecorator: import("./types").IClassDecorator;
|
|
60
|
-
stringToJson: import("./types").IStringToJson;
|
|
61
|
-
jsonToString: import("./types").IJsonToString;
|
|
62
|
-
isWindow: (win: any) => boolean;
|
|
63
|
-
};
|
|
64
|
-
export default _default;
|
package/dist/bundle/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var UtilsLib=function(e){"use strict";var t,n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}e.types=void 0,(t=e.types||(e.types={}))["[object Array]"]="array",t["[object Object]"]="object",t["[object Function]"]="function",t["[object Set]"]="set",t["[object Map]"]="map",t["[object WeakMap]"]="weakMap",t["[object WeakSet]"]="weakSet",t["[object Date]"]="date",t["[object RegExp]"]="regExp",t["[object Math]"]="math";var o={types:e.types},i=function(e,t,n){return void 0===n&&(n=!1),Math.floor(Math.random()*(t-e+(n?1:0))+e)},u=function(e){var t={};return e.includes("?")?(e.split("?")[1].split("&").forEach((function(e){var n=e.split("=")[0];t[n]=e.split("=")[1]})),t):t},a=function(e,t){void 0===t&&(t={});var n=Object.keys(t);if(0===n.length)return e;var r=n.map((function(e){return"".concat(e,"=").concat(t[e])}));return"".concat(e).concat(e.includes("?")?"&":"?").concat(r.join("&"))},c=function(t){var n=typeof t;if(null===t)return"null";if("object"===n){var r=Object.prototype.toString.call(t);return e.types[r]}return n},s=function(e,t){void 0===t&&(t=[]);var n=c(e);return t.indexOf(n)>0},l={randomNum:i,urlSplit:u,urlJoin:a,getType:c,getTypeByList:s},f=function(e,t,n){void 0===n&&(n="");for(var r=0,o=t.split(".");r<o.length;r++){if(void 0===(e=e[o[r]]))return n}return e},p=function(e,t,n){void 0===n&&(n={});for(var r=t.split("."),o=r[r.length-1],i=e,u=0,a=r;u<a.length;u++){var c=a[u];if("object"!=typeof i&&void 0!==i)return e;!i&&(i={}),!i[c]&&(i[c]={}),o===c&&(i[o]=n),i=i[c]}return e},h=function(e,t,n){var r;for(var o in void 0===t&&(t={}),void 0===n&&(n=!1),t)for(var i in t[o]){var u=null!==(r=e.prototype)&&void 0!==r?r:e;(void 0===e[i]||n)&&(u[i]=t[o][i])}return e},d=function(e){for(var t in e){var n=e[t];"string"!=typeof n||e[n]||(e[n]=t)}return e},v=function(e,t){return"object"!=typeof e||"null"===t},y=function(e){var t=c(e);if(v(e,t))return e;var n=g(t,e);return"map"===t?e.forEach((function(e,t){n.set(t,y(e))})):"set"===t?e.forEach((function(e){n.add(y(e))})):Reflect.ownKeys(e).forEach((function(t){var r=e[t];n[t]=y(r)})),n},g=function(e,t){switch(void 0===t&&(t={}),e){case"array":return[];case"function":return t;case"set":return new Set;case"map":return new Map;case"date":return new Date(t);case"regExp":return new RegExp(t);case"math":return Math;default:return{}}},m=function(e){function t(){}return t.prototype=e,new t},b=function(e,t){return void 0===t&&(t=function(){}),t.prototype=m(e.prototype),t.prototype.super=e,t.prototype.constructor=t,t},w=function(e,t){void 0===t&&(t=!1);for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];return e._instance&&!t||(e._instance=new(e.bind.apply(e,r([void 0],n,!1)))),e._instance},j=function(e){return function(t){for(var n in e)Reflect.has(t.prototype,n)||(t.prototype[n]=e[n])}},E=function(e){if("string"!==c(e))return null;try{return JSON.parse(e)}catch(e){return null}},S=function(e){if(!s(e,["array","object","set","map"]))return"";try{return JSON.stringify(e)}catch(e){return""}},O=function(e){return e&&e===e.window},x={getValue:f,setValue:p,mixIn:h,enumInversion:d,isNotObject:v,cloneDeep:y,createObjectVariable:g,createObject:m,inherit:b,getInstance:w,classDecorator:j,stringToJson:E,jsonToString:S,isWindow:O},k=function(e){return e.sort((function(){return Math.random()-.5}))},P=function(e){return Array.from(new Set(e))},T=function(e,t){return void 0===t&&(t=[]),e.forEach((function(e){return"array"===c(e)?T(e,t):t.push(e)})),t},H={arrayRandom:k,arrayUniq:P,arrayDemote:T},q=void 0,L=function(e,t){var n=null;return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n||(n=setTimeout((function(){e.call.apply(e,r([q],o,!1)),n=null}),t))}},M=function(e,t){var n=null;return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n&&(clearTimeout(n),n=null),n=setTimeout((function(){e.call.apply(e,r([q],o,!1))}),t)}},C=function(e){var t,n;return void 0===e&&(e=0),e>0&&setTimeout(n,e),{promise:new Promise((function(e,r){t=e,n=r})),resolve:t,reject:n}},A=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},R={throttle:L,debounce:M,defer:C,catchAwait:A},D=function(e){var t,n,r=e.ele,o=e.style,i=e.attr,u=e.parent,a=r instanceof HTMLElement?r:document.createElement(null!=r?r:"div");return o&&(null===(t=Object.keys(o))||void 0===t||t.forEach((function(e){return a.style[e]=o[e]}))),i&&(null===(n=Object.keys(i))||void 0===n||n.forEach((function(e){return a[e]=i[e]}))),u&&u.appendChild(a),a},B={createElement:D},I=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e["on"+t]=n},N=function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!1},J=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1},_=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e["on"+t]=null},V=function(e,t){var n=new Event(t);e.dispatchEvent(n)},z={addHandler:I,stopBubble:N,stopDefault:J,removeHandler:_,dispatchEvent:V},F=function(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},Q=function(e){try{var t=localStorage.getItem(e);return null==t?null:JSON.parse(t)}catch(e){return console.error(e),null}},W=function(e){try{e&&localStorage.removeItem(e),!e&&localStorage.clear()}catch(e){console.error(e)}},U={setStorage:F,getStorage:Q,clearStorage:W},G=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),t&&(process.stdout.clearLine(0),process.stdout.cursorTo(0)),process.stdout.write(e),n&&process.stdout.write("\n")},K=function(e){return G(e,!0,!1)},$=["\\","|","/","—","—"],X=function(e){var t;void 0===e&&(e={});var n=e.loopList,r=void 0===n?$:n,o=e.isStop,i=void 0!==o&&o,u=e.timer,a=void 0===u?100:u,c=e.index,s=void 0===c?0:c,l=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(!l)return e;if(i)return K("\n");s>=l-1&&(s=0);var f=r[s++];return K(f),setTimeout((function(){e.index=s,X(e)}),a),e},Y={logOneLine:G,logLoop:X},Z=function(){function e(e){this.fn=e,this.id=null,this.duration=1/0,this.isActive=!1}return e.prototype.start=function(e){this.isActive||(this.duration=null!=e?e:1/0,this.isActive=!0,this.animate())},e.prototype.stop=function(){this.isActive=!1,cancelAnimationFrame(this.id)},e.prototype.animate=function(e){void 0===e&&(e=0),this.isActive&&this.duration-- >0&&(this.fn(e),this.id=requestAnimationFrame(this.animate.bind(this)))},e}();function ee(e,t,n){var r=1-n,o=n*n;return[2*r*n*e+o,2*r*n*t+o]}function te(e,t,n,r,o){var i=3*e,u=3*t,a=3*(n-e)-i,c=3*(r-t)-u,s=1-u-c;return[(1-i-a)*Math.pow(o,3)+a*Math.pow(o,2)+i*o,s*Math.pow(o,3)+c*Math.pow(o,2)+u*o]}function ne(e){return 0===e||1===e?1:e*ne(e-1)}function re(e,t){return ne(e)/(ne(t)*ne(e-t))}function oe(e,t){for(var n=e.length-1,r=[0,0],o=0;o<=n;o++){var i=re(n,o)*Math.pow(1-t,n-o)*Math.pow(t,o);r[0]+=i*e[o][0],r[1]+=i*e[o][1]}return r}var ie={AnimateFrame:Z,quadraticBezier:ee,cubicBezier:te,factorial:ne,combination:re,NBezier:oe},ue=function(){function e(e){void 0===e&&(e={}),this.options=e,this.events={}}return e.prototype.on=function(e,t){return this.checkHandler(e,t),this.getHandler(e,[]).push(t),this},e.prototype.emit=function(e,t){return this.has(e)&&this.runHandler(e,t),this},e.prototype.un=function(e,t){return this.unHandler(e,t),this},e.prototype.once=function(e,t){var n=this;this.checkHandler(e,t);var r=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.un(e,r),t.apply(void 0,o)};return this.on(e,r),this},e.prototype.clear=function(){return this.events={},this},e.prototype.has=function(e){return!!this.getHandler(e)},e.prototype.getHandler=function(e,t){var n;return"object"==typeof t&&(this.events[e]=null!==(n=this.events[e])&&void 0!==n?n:t),this.events[e]},e.prototype.handlerLength=function(e){var t,n;return null!==(n=null===(t=this.getHandler(e))||void 0===t?void 0:t.length)&&void 0!==n?n:0},e.prototype.watch=function(e,t){var n=this;this.checkHandler(e,t);return this.on(e,(function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.emit(n.prefixStr(e),t.apply(void 0,r))})),this},e.prototype.invoke=function(e,t){var n=this;return new Promise((function(r){n.once(n.prefixStr(e),r),n.emit(e,t)}))},e.prototype.runHandler=function(e,t){for(var n=0,r=this.getHandler(e);n<r.length;n++){var o=r[n];o&&o(t)}},e.prototype.unHandler=function(e,t){var n=this.getHandler(e);!t&&(this.events[e]=[]),t&&this.checkHandler(e,t);for(var r=0;r<n.length;r++)n&&n[r]===t&&(n[r]=null)},e.prototype.prefixStr=function(e){return"@".concat(e)},e.prototype.checkHandler=function(e,t){var n=this.options,r=n.blackList,o=void 0===r?[]:r,i=n.maxLen,u=void 0===i?1/0:i,a=this.handlerLength(e);if(0===(null==e?void 0:e.length))throw new Error("type.length can not be 0");if(!t||!e)throw new ReferenceError("type or handler is not defined");if("function"!=typeof t||"string"!=typeof e)throw new TypeError("".concat(t," is not a function or ").concat(e," is not a string"));if(o.includes(e))throw new Error("".concat(e," is not allow"));if(u<=a)throw new Error("the number of ".concat(e," must be less than ").concat(u))},e.Instance=function(e){return e._instance||Object.defineProperty(e,"_instance",{value:new e}),e._instance},e}(),ae=ue.Instance(ue),ce=function(e){return e.prototype.messageCenter||(e.prototype.messageCenter=new ue),e},se=function(){return se=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},se.apply(this,arguments)},le=function(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u},fe=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},pe=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))},he=function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},de=function(){function e(e){var t=this;this.fix="@~&$",this.init=function(){t.messageCenter.on("push:handler",t.run),t.messageCenter.on("run:success:handler",t.run),t.messageCenter.on("run:success:handler",t.finish),t.messageCenter.on("run:error:handler",t.run),t.messageCenter.on("run:error:handler",t.finish)},this.defineProps=function(e,n){Object.defineProperty(t,n,{value:e})},this.push=function(e){var n;t.checkHandler(e);var r=(n=t.defer()).resolve,o=n.reject,i=n.promise,u=t.fixStr(e.name);return t.queues=t.queues.concat(e.children.map((function(e){return{defer:e,name:u}}))),t.queueTemp[u]=se(se({},e),{result:[]}),t.messageCenter.emit("push:handler",o),t.messageCenter.on(u,r),i},this.unshift=function(e){return t.queues.splice(0,e)},this.run=function(e){var n=e.reject;return pe(t,void 0,void 0,(function(){var e,t,r,o,i;return he(this,(function(u){switch(u.label){case 0:if("pending"===this.stateProxy())return[2,void 0];if(0===this.queues.length)return[2,this.stateProxy("idle")];this.stateProxy("pending"),e=this.unshift(null!==(i=null===(o=this.props)||void 0===o?void 0:o.maxLen)&&void 0!==i?i:10),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,Promise.all(e.map((function(e,t){return e.defer().catch((function(e){return e}))})))];case 2:return t=u.sent(),[2,this.handlerSuccess({res:t,queues:e})];case 3:return r=u.sent(),[2,this.handlerError({reject:n,error:r,queues:e})];case 4:return[2]}}))}))},this.clear=function(){t.queues=[],t.queueTemp={},t.props=null,t.stateProxy("idle"),t.messageCenter.clear()},this.finish=function(e){var n=e.res,r=void 0===n?[]:n,o=e.queues,i=e.error,u=void 0===i?"err":i,a=t.queueTemp;o.forEach((function(e,n){var o,i,c,s=a[e.name];null==s||s.result.push(null!==(o=r[n])&&void 0!==o?o:u),(null===(i=null==s?void 0:s.result)||void 0===i?void 0:i.length)===(null===(c=null==s?void 0:s.children)||void 0===c?void 0:c.length)&&(t.messageCenter.emit(e.name,null==s?void 0:s.result),a[e.name]=null)}))},this.handlerSuccess=function(e){return t.stateProxy("fulfilled"),t.messageCenter.emit("run:success:handler",e)},this.handlerError=function(e){var n=e.reject,r=e.error;return t.stateProxy("rejected"),n&&"function"==typeof n&&n(r),t.messageCenter.emit("run:error:handler",e)},this.stateProxy=function(e){return e&&(t.state=e),t.state},this.defer=function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),resolve:e,reject:t}},this.clear(),e&&this.defineProps(e,"props"),this.init()}return e.prototype.checkHandler=function(e){var t,n;if(!e)throw new ReferenceError("queue is not defined");if(!(e.children instanceof Array)||"object"!=typeof e)throw new TypeError("queue should be an object and queue.children should be an array");if(0===(null===(t=e.children)||void 0===t?void 0:t.length))throw new Error("queue.children.length can not be 0");if(null===(n=e.children)||void 0===n?void 0:n.find((function(e){return function(e){return!e||"function"!=typeof e}(e)})))throw new Error("queueList should have defer")},e.prototype.fixStr=function(e){return"".concat(this.fix).concat(e)},e=le([ce,fe("design:paramtypes",[Object])],e)}(),ve=n(n(n(n(n(n(n(n(n(n(n({},x),l),H),R),B),o),z),U),Y),ie),{eventMessageCenter:ue,taskQueueLib:de});return e.AnimateFrame=Z,e.MessageCenter=ue,e.NBezier=oe,e.TaskQueue=de,e.addHandler=I,e.arrayDemote=T,e.arrayRandom=k,e.arrayUniq=P,e.catchAwait=A,e.classDecorator=j,e.clearStorage=W,e.cloneDeep=y,e.combination=re,e.createElement=D,e.createObject=m,e.createObjectVariable=g,e.cubicBezier=te,e.debounce=M,e.decoratorMessageCenter=ce,e.decoratorTaskQueue=function(e){return function(t){t.prototype.taskQueue||(t.prototype.taskQueue=new de(e))}},e.default=ve,e.defer=C,e.dispatchEvent=V,e.enumInversion=d,e.factorial=ne,e.getInstance=w,e.getStorage=Q,e.getType=c,e.getTypeByList=s,e.getValue=f,e.inherit=b,e.isNotObject=v,e.isWindow=O,e.jsonToString=S,e.logLoop=X,e.logOneLine=G,e.messageCenter=ae,e.mixIn=h,e.quadraticBezier=ee,e.randomNum=i,e.removeHandler=_,e.setStorage=F,e.setValue=p,e.stopBubble=N,e.stopDefault=J,e.stringToJson=E,e.throttle=L,e.urlJoin=a,e.urlSplit=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
package/dist/bundle/log.d.ts
DELETED
package/dist/bundle/object.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { IGetValue, ISetValue, IMixIn, ICloneDeep, ICreateObjectVariable, IEnumInversion, IInherit, ICreateObject, IGetInstance, IClassDecorator, IStringToJson, IJsonToString } from "./types";
|
|
2
|
-
export declare const getValue: IGetValue;
|
|
3
|
-
export declare const setValue: ISetValue;
|
|
4
|
-
export declare const mixIn: IMixIn;
|
|
5
|
-
export declare const enumInversion: IEnumInversion;
|
|
6
|
-
export declare const isNotObject: (source: any, type: any) => boolean;
|
|
7
|
-
export declare const cloneDeep: ICloneDeep;
|
|
8
|
-
export declare const createObjectVariable: ICreateObjectVariable;
|
|
9
|
-
export declare const createObject: ICreateObject;
|
|
10
|
-
export declare const inherit: IInherit;
|
|
11
|
-
export declare const getInstance: IGetInstance;
|
|
12
|
-
export declare const classDecorator: IClassDecorator;
|
|
13
|
-
export declare const stringToJson: IStringToJson;
|
|
14
|
-
export declare const jsonToString: IJsonToString;
|
|
15
|
-
export declare const isWindow: (win: any) => boolean;
|
|
16
|
-
declare const _default: {
|
|
17
|
-
getValue: IGetValue;
|
|
18
|
-
setValue: ISetValue;
|
|
19
|
-
mixIn: IMixIn;
|
|
20
|
-
enumInversion: IEnumInversion;
|
|
21
|
-
isNotObject: (source: any, type: any) => boolean;
|
|
22
|
-
cloneDeep: ICloneDeep;
|
|
23
|
-
createObjectVariable: ICreateObjectVariable;
|
|
24
|
-
createObject: ICreateObject;
|
|
25
|
-
inherit: IInherit;
|
|
26
|
-
getInstance: IGetInstance;
|
|
27
|
-
classDecorator: IClassDecorator;
|
|
28
|
-
stringToJson: IStringToJson;
|
|
29
|
-
jsonToString: IJsonToString;
|
|
30
|
-
isWindow: (win: any) => boolean;
|
|
31
|
-
};
|
|
32
|
-
export default _default;
|
package/dist/bundle/static.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare enum types {
|
|
2
|
-
"[object Array]" = "array",
|
|
3
|
-
"[object Object]" = "object",
|
|
4
|
-
"[object Function]" = "function",
|
|
5
|
-
"[object Set]" = "set",
|
|
6
|
-
"[object Map]" = "map",
|
|
7
|
-
"[object WeakMap]" = "weakMap",
|
|
8
|
-
"[object WeakSet]" = "weakSet",
|
|
9
|
-
"[object Date]" = "date",
|
|
10
|
-
"[object RegExp]" = "regExp",
|
|
11
|
-
"[object Math]" = "math"
|
|
12
|
-
}
|
|
13
|
-
declare const _default: {
|
|
14
|
-
types: typeof types;
|
|
15
|
-
};
|
|
16
|
-
export default _default;
|
package/dist/bundle/storage.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const setStorage: (key: string, val: any) => void;
|
|
2
|
-
export declare const getStorage: (key: string) => any;
|
|
3
|
-
export declare const clearStorage: (key: string) => void;
|
|
4
|
-
declare const _default: {
|
|
5
|
-
setStorage: (key: string, val: any) => void;
|
|
6
|
-
getStorage: (key: string) => any;
|
|
7
|
-
clearStorage: (key: string) => void;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
package/dist/bundle/types.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export type IKey = string | symbol | number;
|
|
2
|
-
export interface IObject<T> {
|
|
3
|
-
[key: IKey]: T | IObject<any>;
|
|
4
|
-
}
|
|
5
|
-
export interface IPromise extends IObject<any> {
|
|
6
|
-
promise: Promise<void>;
|
|
7
|
-
resolve: (res: any) => unknown;
|
|
8
|
-
reject: (err: any) => unknown;
|
|
9
|
-
}
|
|
10
|
-
export type IInstance<T> = {
|
|
11
|
-
_instance: Function;
|
|
12
|
-
} & T;
|
|
13
|
-
export type IDemoteArray<T> = Array<IDemoteArray<T> | T>;
|
|
14
|
-
export type IRandomNum = (min: number, max: number, bool?: boolean) => number;
|
|
15
|
-
export type IUrlSplit = (url: string) => IObject<any>;
|
|
16
|
-
export type IUrlJoin = (url: string, query: object) => string;
|
|
17
|
-
export type IGetType<T> = (data: any) => typeof data | T[keyof T] | "null";
|
|
18
|
-
export type IGetTypeByList = (data: any, whiteList: string[]) => boolean;
|
|
19
|
-
export type IGetValue = <T, U = IObject<T> | IObject<T>[IKey]>(object: U, key: string, defaultValue?: any) => U;
|
|
20
|
-
export type ISetValue = <T>(object: IObject<T>, key: string, value?: any) => IObject<T>;
|
|
21
|
-
export type IMixIn = <U extends IObject<any>>(target?: U, source?: IObject<any>, overwrite?: boolean) => U;
|
|
22
|
-
export type IEnumInversion = (target: IObject<string>) => IObject<string>;
|
|
23
|
-
export type ICloneDeep = (target?: any) => any;
|
|
24
|
-
export type ICreateObjectVariable = (type: string, source?: any) => any;
|
|
25
|
-
export type ICreateObject = <T, U extends T>(source: T) => U;
|
|
26
|
-
export type IInherit = <T extends Function>(source: T, target?: Function) => Function;
|
|
27
|
-
export type IGetInstance = (classProto: IInstance<FunctionConstructor>, overwrite?: boolean, ...params: any[]) => Function;
|
|
28
|
-
export type IClassDecorator = (params: IObject<any>) => <TFunction extends Function>(target: TFunction) => void;
|
|
29
|
-
export type IStringToJson = (target: string) => IObject<any> | null;
|
|
30
|
-
export type IJsonToString = (target: IObject<any>) => string;
|
|
31
|
-
export type IThrottle = (fn: Function, time: number) => (...args: any[]) => void;
|
|
32
|
-
export type IDebounce = (fn: Function, time: number) => (...args: any[]) => void;
|
|
33
|
-
export type IDefer = (timer?: number) => IPromise;
|
|
34
|
-
export type ICatchAwait<T extends Promise<any>> = (defer: T) => T;
|
|
35
|
-
export type IArrayRandom<T extends any[]> = (arr: T) => T;
|
|
36
|
-
export type IArrayUniq<T extends any[]> = (arr: T) => T;
|
|
37
|
-
export type IArrayDemote<T extends IDemoteArray<any>> = (arr: T, result?: T) => T;
|
|
38
|
-
type TagAttributes = Partial<Record<string, string | boolean>>;
|
|
39
|
-
interface IElementParams<T> {
|
|
40
|
-
ele: T | string;
|
|
41
|
-
style?: Partial<CSSStyleDeclaration>;
|
|
42
|
-
attr?: TagAttributes;
|
|
43
|
-
parent?: T;
|
|
44
|
-
}
|
|
45
|
-
export type ICreateElement<T = HTMLElement> = (params: IElementParams<T>) => T;
|
|
46
|
-
export type IAddHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
|
|
47
|
-
export type IStopBubble = (e: Event) => void;
|
|
48
|
-
export type IStopDefault = (e: Event) => void;
|
|
49
|
-
export type IRemoveHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
|
|
50
|
-
export type IDispatchEvent = <T extends Document>(ele: T, data: any) => void;
|
|
51
|
-
export type ILogOneLine = (str: string, overwrite?: boolean, warp?: boolean) => void;
|
|
52
|
-
export type ILogLoopParams = {
|
|
53
|
-
loopList?: string[];
|
|
54
|
-
index?: number;
|
|
55
|
-
isStop?: boolean;
|
|
56
|
-
timer?: number;
|
|
57
|
-
};
|
|
58
|
-
export type ILogLoop = (opts?: ILogLoopParams) => ILogLoopParams | void;
|
|
59
|
-
export type IAnimateFrame = {
|
|
60
|
-
id: number | null;
|
|
61
|
-
duration: number;
|
|
62
|
-
isActive: boolean;
|
|
63
|
-
fn(timer: number): void;
|
|
64
|
-
start(duration: number): void;
|
|
65
|
-
stop(): void;
|
|
66
|
-
animate(timer: number): void;
|
|
67
|
-
};
|
|
68
|
-
export {};
|
package/dist/cjs/animate.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { IAnimateFrame } from "./types";
|
|
2
|
-
export declare class AnimateFrame implements IAnimateFrame {
|
|
3
|
-
fn: any;
|
|
4
|
-
id: any;
|
|
5
|
-
duration: number;
|
|
6
|
-
isActive: boolean;
|
|
7
|
-
constructor(fn: any);
|
|
8
|
-
start(duration: any): void;
|
|
9
|
-
stop(): void;
|
|
10
|
-
animate(timer?: number): void;
|
|
11
|
-
}
|
|
12
|
-
export declare function quadraticBezier(_x: number, _y: number, t: number): number[];
|
|
13
|
-
export declare function cubicBezier(_x1: number, _y1: number, _x2: number, _y2: number, t: number): number[];
|
|
14
|
-
export declare function factorial(n: number): any;
|
|
15
|
-
export declare function combination(n: number, k: number): number;
|
|
16
|
-
export declare function NBezier(points: number[][], t: number): number[];
|
|
17
|
-
declare const _default: {
|
|
18
|
-
AnimateFrame: typeof AnimateFrame;
|
|
19
|
-
quadraticBezier: typeof quadraticBezier;
|
|
20
|
-
cubicBezier: typeof cubicBezier;
|
|
21
|
-
factorial: typeof factorial;
|
|
22
|
-
combination: typeof combination;
|
|
23
|
-
NBezier: typeof NBezier;
|
|
24
|
-
};
|
|
25
|
-
export default _default;
|
package/dist/cjs/array.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IArrayRandom, IArrayUniq, IArrayDemote, IDemoteArray } from "./types";
|
|
2
|
-
export declare const arrayRandom: IArrayRandom<any[]>;
|
|
3
|
-
export declare const arrayUniq: IArrayUniq<any[]>;
|
|
4
|
-
export declare const arrayDemote: IArrayDemote<IDemoteArray<any>>;
|
|
5
|
-
declare const _default: {
|
|
6
|
-
arrayRandom: IArrayRandom<any[]>;
|
|
7
|
-
arrayUniq: IArrayUniq<any[]>;
|
|
8
|
-
arrayDemote: IArrayDemote<IDemoteArray<any>>;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
package/dist/cjs/base.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IRandomNum, IUrlSplit, IUrlJoin, IGetType, IGetTypeByList } from "./types";
|
|
2
|
-
import { types } from "./static";
|
|
3
|
-
export declare const randomNum: IRandomNum;
|
|
4
|
-
export declare const urlSplit: IUrlSplit;
|
|
5
|
-
export declare const urlJoin: IUrlJoin;
|
|
6
|
-
export declare const getType: IGetType<types>;
|
|
7
|
-
export declare const getTypeByList: IGetTypeByList;
|
|
8
|
-
declare const _default: {
|
|
9
|
-
randomNum: IRandomNum;
|
|
10
|
-
urlSplit: IUrlSplit;
|
|
11
|
-
urlJoin: IUrlJoin;
|
|
12
|
-
getType: IGetType<types>;
|
|
13
|
-
getTypeByList: IGetTypeByList;
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
package/dist/cjs/element.d.ts
DELETED
package/dist/cjs/event.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IAddHandler, IStopBubble, IStopDefault, IRemoveHandler, IDispatchEvent } from "./types";
|
|
2
|
-
export declare const addHandler: IAddHandler;
|
|
3
|
-
export declare const stopBubble: IStopBubble;
|
|
4
|
-
export declare const stopDefault: IStopDefault;
|
|
5
|
-
export declare const removeHandler: IRemoveHandler;
|
|
6
|
-
export declare const dispatchEvent: IDispatchEvent;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
addHandler: IAddHandler;
|
|
9
|
-
stopBubble: IStopBubble;
|
|
10
|
-
stopDefault: IStopDefault;
|
|
11
|
-
removeHandler: IRemoveHandler;
|
|
12
|
-
dispatchEvent: IDispatchEvent;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
package/dist/cjs/function.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ICatchAwait, IThrottle, IDebounce, IDefer } from "./types";
|
|
2
|
-
export declare const throttle: IThrottle;
|
|
3
|
-
export declare const debounce: IDebounce;
|
|
4
|
-
export declare const defer: IDefer;
|
|
5
|
-
export declare const catchAwait: ICatchAwait<Promise<any>>;
|
|
6
|
-
declare const _default: {
|
|
7
|
-
throttle: IThrottle;
|
|
8
|
-
debounce: IDebounce;
|
|
9
|
-
defer: IDefer;
|
|
10
|
-
catchAwait: ICatchAwait<Promise<any>>;
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export * from "./object";
|
|
2
|
-
export * from "./base";
|
|
3
|
-
export * from "./array";
|
|
4
|
-
export * from "./function";
|
|
5
|
-
export * from "./element";
|
|
6
|
-
export * from "./static";
|
|
7
|
-
export * from "./types";
|
|
8
|
-
export * from "./event";
|
|
9
|
-
export * from "./storage";
|
|
10
|
-
export * from "./log";
|
|
11
|
-
export * from "./animate";
|
|
12
|
-
export * from "event-message-center";
|
|
13
|
-
export * from "task-queue-lib";
|
|
14
|
-
import eventMessageCenter from "event-message-center";
|
|
15
|
-
import taskQueueLib from "task-queue-lib";
|
|
16
|
-
declare const _default: {
|
|
17
|
-
eventMessageCenter: typeof eventMessageCenter;
|
|
18
|
-
taskQueueLib: typeof taskQueueLib;
|
|
19
|
-
AnimateFrame: typeof import("./animate").AnimateFrame;
|
|
20
|
-
quadraticBezier: typeof import("./animate").quadraticBezier;
|
|
21
|
-
cubicBezier: typeof import("./animate").cubicBezier;
|
|
22
|
-
factorial: typeof import("./animate").factorial;
|
|
23
|
-
combination: typeof import("./animate").combination;
|
|
24
|
-
NBezier: typeof import("./animate").NBezier;
|
|
25
|
-
logOneLine: import("./types").ILogOneLine;
|
|
26
|
-
logLoop: import("./types").ILogLoop;
|
|
27
|
-
setStorage: (key: string, val: any) => void;
|
|
28
|
-
getStorage: (key: string) => any;
|
|
29
|
-
clearStorage: (key: string) => void;
|
|
30
|
-
addHandler: import("./types").IAddHandler;
|
|
31
|
-
stopBubble: import("./types").IStopBubble;
|
|
32
|
-
stopDefault: import("./types").IStopDefault;
|
|
33
|
-
removeHandler: import("./types").IRemoveHandler;
|
|
34
|
-
dispatchEvent: import("./types").IDispatchEvent;
|
|
35
|
-
types: typeof import("./static").types;
|
|
36
|
-
createElement: import("./types").ICreateElement<HTMLElement>;
|
|
37
|
-
throttle: import("./types").IThrottle;
|
|
38
|
-
debounce: import("./types").IDebounce;
|
|
39
|
-
defer: import("./types").IDefer;
|
|
40
|
-
catchAwait: import("./types").ICatchAwait<Promise<any>>;
|
|
41
|
-
arrayRandom: import("./types").IArrayRandom<any[]>;
|
|
42
|
-
arrayUniq: import("./types").IArrayUniq<any[]>;
|
|
43
|
-
arrayDemote: import("./types").IArrayDemote<import("./types").IDemoteArray<any>>;
|
|
44
|
-
randomNum: import("./types").IRandomNum;
|
|
45
|
-
urlSplit: import("./types").IUrlSplit;
|
|
46
|
-
urlJoin: import("./types").IUrlJoin;
|
|
47
|
-
getType: import("./types").IGetType<import("./static").types>;
|
|
48
|
-
getTypeByList: import("./types").IGetTypeByList;
|
|
49
|
-
getValue: import("./types").IGetValue;
|
|
50
|
-
setValue: import("./types").ISetValue;
|
|
51
|
-
mixIn: import("./types").IMixIn;
|
|
52
|
-
enumInversion: import("./types").IEnumInversion;
|
|
53
|
-
isNotObject: (source: any, type: any) => boolean;
|
|
54
|
-
cloneDeep: import("./types").ICloneDeep;
|
|
55
|
-
createObjectVariable: import("./types").ICreateObjectVariable;
|
|
56
|
-
createObject: import("./types").ICreateObject;
|
|
57
|
-
inherit: import("./types").IInherit;
|
|
58
|
-
getInstance: import("./types").IGetInstance;
|
|
59
|
-
classDecorator: import("./types").IClassDecorator;
|
|
60
|
-
stringToJson: import("./types").IStringToJson;
|
|
61
|
-
jsonToString: import("./types").IJsonToString;
|
|
62
|
-
isWindow: (win: any) => boolean;
|
|
63
|
-
};
|
|
64
|
-
export default _default;
|