utils-lib-js 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/array.d.ts +10 -10
- package/dist/bundle/base.d.ts +14 -14
- package/dist/bundle/element.d.ts +6 -6
- package/dist/bundle/event.d.ts +14 -14
- package/dist/bundle/function.d.ts +12 -12
- package/dist/bundle/index.d.ts +55 -55
- package/dist/bundle/object.d.ts +30 -30
- package/dist/bundle/request.d.ts +60 -60
- package/dist/bundle/static.d.ts +16 -16
- package/dist/bundle/storage.d.ts +9 -9
- package/dist/bundle/types.d.ts +103 -103
- package/dist/cjs/array.d.ts +10 -10
- package/dist/cjs/base.d.ts +14 -14
- package/dist/cjs/element.d.ts +6 -6
- package/dist/cjs/event.d.ts +14 -14
- package/dist/cjs/function.d.ts +12 -12
- package/dist/cjs/index.d.ts +55 -55
- package/dist/cjs/index.js +567 -567
- package/dist/cjs/object.d.ts +30 -30
- package/dist/cjs/request.d.ts +60 -60
- package/dist/cjs/static.d.ts +16 -16
- package/dist/cjs/storage.d.ts +9 -9
- package/dist/cjs/types.d.ts +103 -103
- package/dist/esm/array.d.ts +10 -10
- package/dist/esm/base.d.ts +14 -14
- package/dist/esm/element.d.ts +6 -6
- package/dist/esm/event.d.ts +14 -14
- package/dist/esm/function.d.ts +12 -12
- package/dist/esm/index.d.ts +55 -55
- package/dist/esm/index.js +567 -567
- package/dist/esm/object.d.ts +30 -30
- package/dist/esm/request.d.ts +60 -60
- package/dist/esm/static.d.ts +16 -16
- package/dist/esm/storage.d.ts +9 -9
- package/dist/esm/types.d.ts +103 -103
- package/dist/umd/array.d.ts +10 -10
- package/dist/umd/base.d.ts +14 -14
- package/dist/umd/element.d.ts +6 -6
- package/dist/umd/event.d.ts +14 -14
- package/dist/umd/function.d.ts +12 -12
- package/dist/umd/index.d.ts +55 -55
- package/dist/umd/index.js +567 -567
- package/dist/umd/object.d.ts +30 -30
- package/dist/umd/request.d.ts +60 -60
- package/dist/umd/static.d.ts +16 -16
- package/dist/umd/storage.d.ts +9 -9
- package/dist/umd/types.d.ts +103 -103
- package/example.js +2 -0
- package/package.json +49 -54
- package/pnpm-lock.yaml +11 -116
- package/rollup.config.js +2 -5
package/dist/bundle/types.d.ts
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
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 = () => 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
|
-
interface IElementParams<T> {
|
|
39
|
-
ele: T | string;
|
|
40
|
-
style: CSSStyleDeclaration;
|
|
41
|
-
attr: Attr;
|
|
42
|
-
parent: T;
|
|
43
|
-
}
|
|
44
|
-
export type ICreateElement<T = HTMLElement> = (params: IElementParams<T>) => T;
|
|
45
|
-
export type IAddHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
|
|
46
|
-
export type IStopBubble = (e: Event) => void;
|
|
47
|
-
export type IStopDefault = (e: Event) => void;
|
|
48
|
-
export type IRemoveHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
|
|
49
|
-
export type IDispatchEvent = <T extends Document>(ele: T, data: any) => void;
|
|
50
|
-
export type IRequestParams<T> = T | IObject<any> | null;
|
|
51
|
-
export type IUrl = string;
|
|
52
|
-
export type IEnv = 'Window' | 'Node';
|
|
53
|
-
export type IDataType = "text" | "json" | "blob" | "formData" | "arrayBuffer";
|
|
54
|
-
export type IRequestMethods = "GET" | "POST" | "DELETE" | "PUT" | "OPTION" | "HEAD" | "PATCH";
|
|
55
|
-
export type IRequestBody = IRequestParams<BodyInit>;
|
|
56
|
-
export type IRequestHeaders = IRequestParams<HeadersInit>;
|
|
57
|
-
export type IRequestBaseFn = (url: IUrl, opts: IRequestOptions) => Promise<any>;
|
|
58
|
-
export type IRequestFn = (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => Promise<any>;
|
|
59
|
-
export type IRequestOptions = {
|
|
60
|
-
method?: IRequestMethods;
|
|
61
|
-
query?: IRequestParams<IObject<any>>;
|
|
62
|
-
body?: IRequestBody;
|
|
63
|
-
headers?: IRequestHeaders;
|
|
64
|
-
controller?: AbortController;
|
|
65
|
-
timeout?: number;
|
|
66
|
-
timer?: number | unknown | null;
|
|
67
|
-
[key: string]: any;
|
|
68
|
-
};
|
|
69
|
-
export type IInterceptors = {
|
|
70
|
-
use(type: "request" | "response" | "error", fn: Function): IInterceptors;
|
|
71
|
-
get reqFn(): Function;
|
|
72
|
-
get resFn(): Function;
|
|
73
|
-
get errFn(): Function;
|
|
74
|
-
};
|
|
75
|
-
export type IRequestBase = {
|
|
76
|
-
readonly origin: string;
|
|
77
|
-
chackUrl: (url: IUrl) => boolean;
|
|
78
|
-
envDesc: () => IEnv;
|
|
79
|
-
errorFn: <Err = any, R = Function>(reject: R) => (err: Err) => R;
|
|
80
|
-
clearTimer: (opts: IRequestOptions) => void;
|
|
81
|
-
initAbort: (opts: IRequestOptions) => IRequestOptions;
|
|
82
|
-
requestType: () => IRequestBaseFn;
|
|
83
|
-
fixOrigin: (fixStr: string) => string;
|
|
84
|
-
fetch: IRequestBaseFn;
|
|
85
|
-
http: IRequestBaseFn;
|
|
86
|
-
getDataByType: (type: IDataType, response: Response) => Promise<any>;
|
|
87
|
-
formatBodyString: (bodyString: string) => IObject<Function>;
|
|
88
|
-
};
|
|
89
|
-
export type IRequestInit = {
|
|
90
|
-
initDefaultParams: (url: IUrl, opts: IRequestOptions) => any;
|
|
91
|
-
initFetchParams: (url: IUrl, opts: IRequestOptions) => any;
|
|
92
|
-
initHttpParams: (url: IUrl, opts: IRequestOptions) => any;
|
|
93
|
-
};
|
|
94
|
-
export type IRequest = {
|
|
95
|
-
GET: IRequestFn;
|
|
96
|
-
POST: IRequestFn;
|
|
97
|
-
DELETE: IRequestFn;
|
|
98
|
-
PUT: IRequestFn;
|
|
99
|
-
OPTIONS: IRequestFn;
|
|
100
|
-
HEAD: IRequestFn;
|
|
101
|
-
PATCH: IRequestFn;
|
|
102
|
-
} & IRequestBase;
|
|
103
|
-
export {};
|
|
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 = () => 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
|
+
interface IElementParams<T> {
|
|
39
|
+
ele: T | string;
|
|
40
|
+
style: CSSStyleDeclaration;
|
|
41
|
+
attr: Attr;
|
|
42
|
+
parent: T;
|
|
43
|
+
}
|
|
44
|
+
export type ICreateElement<T = HTMLElement> = (params: IElementParams<T>) => T;
|
|
45
|
+
export type IAddHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
|
|
46
|
+
export type IStopBubble = (e: Event) => void;
|
|
47
|
+
export type IStopDefault = (e: Event) => void;
|
|
48
|
+
export type IRemoveHandler = <T extends Document>(ele: T, type: string, handler: (e: Event) => void) => void;
|
|
49
|
+
export type IDispatchEvent = <T extends Document>(ele: T, data: any) => void;
|
|
50
|
+
export type IRequestParams<T> = T | IObject<any> | null;
|
|
51
|
+
export type IUrl = string;
|
|
52
|
+
export type IEnv = 'Window' | 'Node';
|
|
53
|
+
export type IDataType = "text" | "json" | "blob" | "formData" | "arrayBuffer";
|
|
54
|
+
export type IRequestMethods = "GET" | "POST" | "DELETE" | "PUT" | "OPTION" | "HEAD" | "PATCH";
|
|
55
|
+
export type IRequestBody = IRequestParams<BodyInit>;
|
|
56
|
+
export type IRequestHeaders = IRequestParams<HeadersInit>;
|
|
57
|
+
export type IRequestBaseFn = (url: IUrl, opts: IRequestOptions) => Promise<any>;
|
|
58
|
+
export type IRequestFn = (url?: IUrl, query?: IObject<any>, body?: IRequestBody, opts?: IRequestOptions) => Promise<any>;
|
|
59
|
+
export type IRequestOptions = {
|
|
60
|
+
method?: IRequestMethods;
|
|
61
|
+
query?: IRequestParams<IObject<any>>;
|
|
62
|
+
body?: IRequestBody;
|
|
63
|
+
headers?: IRequestHeaders;
|
|
64
|
+
controller?: AbortController;
|
|
65
|
+
timeout?: number;
|
|
66
|
+
timer?: number | unknown | null;
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
};
|
|
69
|
+
export type IInterceptors = {
|
|
70
|
+
use(type: "request" | "response" | "error", fn: Function): IInterceptors;
|
|
71
|
+
get reqFn(): Function;
|
|
72
|
+
get resFn(): Function;
|
|
73
|
+
get errFn(): Function;
|
|
74
|
+
};
|
|
75
|
+
export type IRequestBase = {
|
|
76
|
+
readonly origin: string;
|
|
77
|
+
chackUrl: (url: IUrl) => boolean;
|
|
78
|
+
envDesc: () => IEnv;
|
|
79
|
+
errorFn: <Err = any, R = Function>(reject: R) => (err: Err) => R;
|
|
80
|
+
clearTimer: (opts: IRequestOptions) => void;
|
|
81
|
+
initAbort: (opts: IRequestOptions) => IRequestOptions;
|
|
82
|
+
requestType: () => IRequestBaseFn;
|
|
83
|
+
fixOrigin: (fixStr: string) => string;
|
|
84
|
+
fetch: IRequestBaseFn;
|
|
85
|
+
http: IRequestBaseFn;
|
|
86
|
+
getDataByType: (type: IDataType, response: Response) => Promise<any>;
|
|
87
|
+
formatBodyString: (bodyString: string) => IObject<Function>;
|
|
88
|
+
};
|
|
89
|
+
export type IRequestInit = {
|
|
90
|
+
initDefaultParams: (url: IUrl, opts: IRequestOptions) => any;
|
|
91
|
+
initFetchParams: (url: IUrl, opts: IRequestOptions) => any;
|
|
92
|
+
initHttpParams: (url: IUrl, opts: IRequestOptions) => any;
|
|
93
|
+
};
|
|
94
|
+
export type IRequest = {
|
|
95
|
+
GET: IRequestFn;
|
|
96
|
+
POST: IRequestFn;
|
|
97
|
+
DELETE: IRequestFn;
|
|
98
|
+
PUT: IRequestFn;
|
|
99
|
+
OPTIONS: IRequestFn;
|
|
100
|
+
HEAD: IRequestFn;
|
|
101
|
+
PATCH: IRequestFn;
|
|
102
|
+
} & IRequestBase;
|
|
103
|
+
export {};
|
package/dist/cjs/array.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IArrayRandom, IArrayUniq, IArrayDemote, IDemoteArray } from "./index";
|
|
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;
|
|
1
|
+
import { IArrayRandom, IArrayUniq, IArrayDemote, IDemoteArray } from "./index";
|
|
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
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IRandomNum, IUrlSplit, IUrlJoin, IGetType, IGetTypeByList, types } from "./index";
|
|
2
|
-
export declare const randomNum: IRandomNum;
|
|
3
|
-
export declare const urlSplit: IUrlSplit;
|
|
4
|
-
export declare const urlJoin: IUrlJoin;
|
|
5
|
-
export declare const getType: IGetType<types>;
|
|
6
|
-
export declare const getTypeByList: IGetTypeByList;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
randomNum: IRandomNum;
|
|
9
|
-
urlSplit: IUrlSplit;
|
|
10
|
-
urlJoin: IUrlJoin;
|
|
11
|
-
getType: IGetType<types>;
|
|
12
|
-
getTypeByList: IGetTypeByList;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
1
|
+
import { IRandomNum, IUrlSplit, IUrlJoin, IGetType, IGetTypeByList, types } from "./index";
|
|
2
|
+
export declare const randomNum: IRandomNum;
|
|
3
|
+
export declare const urlSplit: IUrlSplit;
|
|
4
|
+
export declare const urlJoin: IUrlJoin;
|
|
5
|
+
export declare const getType: IGetType<types>;
|
|
6
|
+
export declare const getTypeByList: IGetTypeByList;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
randomNum: IRandomNum;
|
|
9
|
+
urlSplit: IUrlSplit;
|
|
10
|
+
urlJoin: IUrlJoin;
|
|
11
|
+
getType: IGetType<types>;
|
|
12
|
+
getTypeByList: IGetTypeByList;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
package/dist/cjs/element.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ICreateElement } from "./index";
|
|
2
|
-
export declare const createElement: ICreateElement;
|
|
3
|
-
declare const _default: {
|
|
4
|
-
createElement: ICreateElement
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
import { ICreateElement } from "./index";
|
|
2
|
+
export declare const createElement: ICreateElement;
|
|
3
|
+
declare const _default: {
|
|
4
|
+
createElement: ICreateElement<HTMLElement>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
package/dist/cjs/event.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IAddHandler, IStopBubble, IStopDefault, IRemoveHandler, IDispatchEvent } from "./index";
|
|
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
|
+
import { IAddHandler, IStopBubble, IStopDefault, IRemoveHandler, IDispatchEvent } from "./index";
|
|
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
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ICatchAwait, IThrottle, IDebounce, IDefer } from "./index";
|
|
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;
|
|
1
|
+
import { ICatchAwait, IThrottle, IDebounce, IDefer } from "./index";
|
|
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
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
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 "./request";
|
|
9
|
-
export * from "./event";
|
|
10
|
-
export * from "./storage";
|
|
11
|
-
export * from "event-message-center";
|
|
12
|
-
export * from "task-queue-lib";
|
|
13
|
-
import eventMessageCenter from "event-message-center";
|
|
14
|
-
import taskQueueLib from "task-queue-lib";
|
|
15
|
-
declare const _default: {
|
|
16
|
-
eventMessageCenter: typeof eventMessageCenter;
|
|
17
|
-
taskQueueLib: typeof taskQueueLib;
|
|
18
|
-
setStorage: (key: string, val: any) => void;
|
|
19
|
-
getStorage: (key: string) => any;
|
|
20
|
-
clearStorage: (key: string) => void;
|
|
21
|
-
addHandler: import("./types").IAddHandler;
|
|
22
|
-
stopBubble: import("./types").IStopBubble;
|
|
23
|
-
stopDefault: import("./types").IStopDefault;
|
|
24
|
-
removeHandler: import("./types").IRemoveHandler;
|
|
25
|
-
dispatchEvent: import("./types").IDispatchEvent;
|
|
26
|
-
Request: typeof import("./request").Request;
|
|
27
|
-
types: typeof import("./static").types;
|
|
28
|
-
createElement: import("./types").ICreateElement
|
|
29
|
-
throttle: import("./types").IThrottle;
|
|
30
|
-
debounce: import("./types").IDebounce;
|
|
31
|
-
defer: import("./types").IDefer;
|
|
32
|
-
catchAwait: import("./types").ICatchAwait<Promise<any>>;
|
|
33
|
-
arrayRandom: import("./types").IArrayRandom<any[]>;
|
|
34
|
-
arrayUniq: import("./types").IArrayUniq<any[]>;
|
|
35
|
-
arrayDemote: import("./types").IArrayDemote<import("./types").IDemoteArray<any>>;
|
|
36
|
-
randomNum: import("./types").IRandomNum;
|
|
37
|
-
urlSplit: import("./types").IUrlSplit;
|
|
38
|
-
urlJoin: import("./types").IUrlJoin;
|
|
39
|
-
getType: import("./types").IGetType<import("./static").types>;
|
|
40
|
-
getTypeByList: import("./types").IGetTypeByList;
|
|
41
|
-
getValue: import("./types").IGetValue;
|
|
42
|
-
setValue: import("./types").ISetValue;
|
|
43
|
-
mixIn: import("./types").IMixIn;
|
|
44
|
-
enumInversion: import("./types").IEnumInversion;
|
|
45
|
-
isNotObject: (source: any, type: any) => boolean;
|
|
46
|
-
cloneDeep: import("./types").ICloneDeep;
|
|
47
|
-
createObjectVariable: import("./types").ICreateObjectVariable;
|
|
48
|
-
createObject: import("./types").ICreateObject;
|
|
49
|
-
inherit: import("./types").IInherit;
|
|
50
|
-
getInstance: import("./types").IGetInstance;
|
|
51
|
-
classDecorator: import("./types").IClassDecorator;
|
|
52
|
-
stringToJson: import("./types").IStringToJson;
|
|
53
|
-
jsonToString: import("./types").IJsonToString;
|
|
54
|
-
};
|
|
55
|
-
export default _default;
|
|
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 "./request";
|
|
9
|
+
export * from "./event";
|
|
10
|
+
export * from "./storage";
|
|
11
|
+
export * from "event-message-center";
|
|
12
|
+
export * from "task-queue-lib";
|
|
13
|
+
import eventMessageCenter from "event-message-center";
|
|
14
|
+
import taskQueueLib from "task-queue-lib";
|
|
15
|
+
declare const _default: {
|
|
16
|
+
eventMessageCenter: typeof eventMessageCenter;
|
|
17
|
+
taskQueueLib: typeof taskQueueLib;
|
|
18
|
+
setStorage: (key: string, val: any) => void;
|
|
19
|
+
getStorage: (key: string) => any;
|
|
20
|
+
clearStorage: (key: string) => void;
|
|
21
|
+
addHandler: import("./types").IAddHandler;
|
|
22
|
+
stopBubble: import("./types").IStopBubble;
|
|
23
|
+
stopDefault: import("./types").IStopDefault;
|
|
24
|
+
removeHandler: import("./types").IRemoveHandler;
|
|
25
|
+
dispatchEvent: import("./types").IDispatchEvent;
|
|
26
|
+
Request: typeof import("./request").Request;
|
|
27
|
+
types: typeof import("./static").types;
|
|
28
|
+
createElement: import("./types").ICreateElement<HTMLElement>;
|
|
29
|
+
throttle: import("./types").IThrottle;
|
|
30
|
+
debounce: import("./types").IDebounce;
|
|
31
|
+
defer: import("./types").IDefer;
|
|
32
|
+
catchAwait: import("./types").ICatchAwait<Promise<any>>;
|
|
33
|
+
arrayRandom: import("./types").IArrayRandom<any[]>;
|
|
34
|
+
arrayUniq: import("./types").IArrayUniq<any[]>;
|
|
35
|
+
arrayDemote: import("./types").IArrayDemote<import("./types").IDemoteArray<any>>;
|
|
36
|
+
randomNum: import("./types").IRandomNum;
|
|
37
|
+
urlSplit: import("./types").IUrlSplit;
|
|
38
|
+
urlJoin: import("./types").IUrlJoin;
|
|
39
|
+
getType: import("./types").IGetType<import("./static").types>;
|
|
40
|
+
getTypeByList: import("./types").IGetTypeByList;
|
|
41
|
+
getValue: import("./types").IGetValue;
|
|
42
|
+
setValue: import("./types").ISetValue;
|
|
43
|
+
mixIn: import("./types").IMixIn;
|
|
44
|
+
enumInversion: import("./types").IEnumInversion;
|
|
45
|
+
isNotObject: (source: any, type: any) => boolean;
|
|
46
|
+
cloneDeep: import("./types").ICloneDeep;
|
|
47
|
+
createObjectVariable: import("./types").ICreateObjectVariable;
|
|
48
|
+
createObject: import("./types").ICreateObject;
|
|
49
|
+
inherit: import("./types").IInherit;
|
|
50
|
+
getInstance: import("./types").IGetInstance;
|
|
51
|
+
classDecorator: import("./types").IClassDecorator;
|
|
52
|
+
stringToJson: import("./types").IStringToJson;
|
|
53
|
+
jsonToString: import("./types").IJsonToString;
|
|
54
|
+
};
|
|
55
|
+
export default _default;
|