devix 0.0.22 → 0.0.23-beta.10
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 +25 -25
- package/dist/index.js +306 -0
- package/dist/index.mjs +292 -0
- package/index.d.ts +53 -0
- package/lib/cache/index.d.ts +24 -0
- package/lib/cache/index.js +38 -0
- package/lib/cache/index.mjs +35 -0
- package/package.json +44 -38
- package/dist/index.cjs.js +0 -157
- package/dist/index.d.ts +0 -96
- package/dist/index.esm.js +0 -157
- package/dist/index.umd.js +0 -157
package/dist/index.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
//! format types
|
|
2
|
-
interface ITimerObj {
|
|
3
|
-
year: string
|
|
4
|
-
month: string
|
|
5
|
-
day: string
|
|
6
|
-
hours: string
|
|
7
|
-
minutes: string
|
|
8
|
-
seconds: string
|
|
9
|
-
week: string
|
|
10
|
-
weekNum: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type TFormatTimer = (
|
|
14
|
-
cellValue: string | number | Date,
|
|
15
|
-
formatType?: string
|
|
16
|
-
) => string | ITimerObj
|
|
17
|
-
|
|
18
|
-
//! retalimit types
|
|
19
|
-
type ThrottleOptions = {
|
|
20
|
-
leading?: boolean
|
|
21
|
-
trailing?: boolean
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface TestServerOption {
|
|
25
|
-
url: string
|
|
26
|
-
method: string
|
|
27
|
-
handler: (ctx: any, next: any) => any
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface ITestServerOptions {
|
|
31
|
-
routes?: Array<TestServerOption>
|
|
32
|
-
}
|
|
33
|
-
type TIsType = (type: string, target: any) => boolean
|
|
34
|
-
|
|
35
|
-
//! other types
|
|
36
|
-
type Tcase = 'upper' | 'lower'
|
|
37
|
-
type TCases = [Tcase, Tcase]
|
|
38
|
-
type TTransGetParams = (params: IDataObject) => string
|
|
39
|
-
interface IDataObject {
|
|
40
|
-
[key: string]: any
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
declare function currying(fn: Function): (this: any, ...args: any[]) => any;
|
|
44
|
-
declare function compose(...fns: Function[]): ((this: any, ...args: any[]) => any) | undefined;
|
|
45
|
-
declare function insertStr(soure: string, start: number, newStr: string): string;
|
|
46
|
-
declare function stringCase(soure: string, separa?: string[], cases?: TCases): string;
|
|
47
|
-
declare const transformGetParams: TTransGetParams;
|
|
48
|
-
|
|
49
|
-
declare const isType: TIsType;
|
|
50
|
-
|
|
51
|
-
declare enum CacheType {
|
|
52
|
-
Local = 0,
|
|
53
|
-
Session = 1
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Encapsulate storage cache class
|
|
57
|
-
*
|
|
58
|
-
* @class StorageCache
|
|
59
|
-
* @template T
|
|
60
|
-
*/
|
|
61
|
-
declare class StorageCache<T = any> {
|
|
62
|
-
private storage;
|
|
63
|
-
constructor(type: CacheType);
|
|
64
|
-
getCache(key: string): T;
|
|
65
|
-
setCache(key: string, value: T): void;
|
|
66
|
-
updateCache(key: string, property: string, value: T): void;
|
|
67
|
-
deleteCache(key: string): void;
|
|
68
|
-
clearCache(): void;
|
|
69
|
-
}
|
|
70
|
-
declare const localCache: StorageCache<any>;
|
|
71
|
-
declare const sessionCache: StorageCache<any>;
|
|
72
|
-
|
|
73
|
-
declare function debounce<T extends (...args: any[]) => any>(callback: T, delay?: number, immediate?: boolean): ((...args: Parameters<T>) => Promise<ReturnType<T>>) & {
|
|
74
|
-
cancel: () => void;
|
|
75
|
-
};
|
|
76
|
-
declare function throttle<T extends (...args: any[]) => any>(callback: T, interval: number, options?: ThrottleOptions): ((...args: Parameters<T>) => Promise<ReturnType<T>>) & {
|
|
77
|
-
cancel: () => void;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
declare function shallowClone<T = any>(source: T): T;
|
|
81
|
-
declare function deepClone(source: any, hash?: WeakMap<object, any>): any;
|
|
82
|
-
|
|
83
|
-
declare enum SortType {
|
|
84
|
-
ASC = "ASC",
|
|
85
|
-
DESC = "DESC"
|
|
86
|
-
}
|
|
87
|
-
declare function bubblingSort<T>(array: T[], type?: string, key?: keyof T): T[];
|
|
88
|
-
|
|
89
|
-
declare const formatTimer: TFormatTimer;
|
|
90
|
-
declare function setTimer(execute: (...args: any[]) => any, delay?: number, immediate?: boolean): Promise<{
|
|
91
|
-
cancel: () => void;
|
|
92
|
-
}>;
|
|
93
|
-
|
|
94
|
-
declare const createTestServer: (options?: ITestServerOptions) => any;
|
|
95
|
-
|
|
96
|
-
export { SortType, bubblingSort, compose, createTestServer, currying, debounce, deepClone, formatTimer, insertStr, isType, localCache, sessionCache, setTimer, shallowClone, stringCase, throttle, transformGetParams };
|