@whitesev/utils 2.3.0 → 2.3.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/index.amd.js +113 -61
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +113 -61
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +113 -61
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +113 -61
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +113 -61
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +113 -61
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Httpx.d.ts +1273 -1273
- package/dist/types/src/Log.d.ts +96 -96
- package/dist/types/src/Utils.d.ts +1761 -1752
- package/dist/types/src/VueObject.d.ts +110 -110
- package/package.json +1 -1
- package/src/Httpx.ts +114 -71
- package/src/Utils.ts +38 -10
package/dist/types/src/Log.d.ts
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
/** Utils.Log的初始化配置 */
|
|
2
|
-
declare interface UtilsLogOptions {
|
|
3
|
-
/** 是否输出Tag,false的话其它的颜色也不输出,默认为true */
|
|
4
|
-
tag: boolean;
|
|
5
|
-
/** log.success的颜色,默认#0000FF */
|
|
6
|
-
successColor: string;
|
|
7
|
-
/** log.warn的颜色,默认0 */
|
|
8
|
-
warnColor: string;
|
|
9
|
-
/** log.error的颜色,默认#FF0000 */
|
|
10
|
-
errorColor: string;
|
|
11
|
-
/** log.info的颜色,默认0 */
|
|
12
|
-
infoColor: string;
|
|
13
|
-
/** 是否开启debug模式,true会在控制台每次调用时输出调用函数的所在位置,false不会输出位置,默认false */
|
|
14
|
-
debug: boolean;
|
|
15
|
-
/** 当console输出超过logMaxCount数量自动清理控制台,默认false */
|
|
16
|
-
autoClearConsole: boolean;
|
|
17
|
-
/** console输出的最高数量,autoClearConsole开启则生效,默认999 */
|
|
18
|
-
logMaxCount: number;
|
|
19
|
-
}
|
|
20
|
-
declare class Log {
|
|
21
|
-
#private;
|
|
22
|
-
/** 前面的TAG标志 */
|
|
23
|
-
tag: string;
|
|
24
|
-
/**
|
|
25
|
-
* @param _GM_info_ 油猴管理器的API GM_info,或者是一个对象,如{"script":{name:"Utils.Log"}},或者直接是一个字符串
|
|
26
|
-
* @param console 可指定console对象为unsafeWindow下的console或者是油猴window下的console
|
|
27
|
-
*/
|
|
28
|
-
constructor(_GM_info_?: {
|
|
29
|
-
script: {
|
|
30
|
-
name: string;
|
|
31
|
-
};
|
|
32
|
-
} | string, console?: Console);
|
|
33
|
-
/**
|
|
34
|
-
* 解析Error的堆栈获取实际调用者的函数名及函数所在的位置
|
|
35
|
-
* @param stack
|
|
36
|
-
*/
|
|
37
|
-
private parseErrorStack;
|
|
38
|
-
/**
|
|
39
|
-
* 检测清理控制台
|
|
40
|
-
*/
|
|
41
|
-
private checkClearConsole;
|
|
42
|
-
/**
|
|
43
|
-
* 输出内容
|
|
44
|
-
* @param msg 需要输出的内容
|
|
45
|
-
* @param color 颜色
|
|
46
|
-
* @param otherStyle 其它CSS
|
|
47
|
-
*/
|
|
48
|
-
private printContent;
|
|
49
|
-
/**
|
|
50
|
-
* 控制台-普通输出
|
|
51
|
-
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
52
|
-
* @param color 输出的颜色
|
|
53
|
-
* @param otherStyle 其它CSS
|
|
54
|
-
*/
|
|
55
|
-
info(msg: any, color?: string, otherStyle?: string): void;
|
|
56
|
-
/**
|
|
57
|
-
* 控制台-警告输出
|
|
58
|
-
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
59
|
-
* @param color 输出的颜色
|
|
60
|
-
* @param otherStyle 其它CSS
|
|
61
|
-
*/
|
|
62
|
-
warn(msg: any, color?: string, otherStyle?: string): void;
|
|
63
|
-
/**
|
|
64
|
-
* 控制台-错误输出
|
|
65
|
-
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
66
|
-
* @param color 输出的颜色
|
|
67
|
-
* @param otherStyle 其它CSS
|
|
68
|
-
*/
|
|
69
|
-
error(msg: any, color?: string, otherStyle?: string): void;
|
|
70
|
-
/**
|
|
71
|
-
* 控制台-成功输出
|
|
72
|
-
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
73
|
-
* @param color 输出的颜色
|
|
74
|
-
* @param otherStyle 其它CSS
|
|
75
|
-
*/
|
|
76
|
-
success(msg: any, color?: string, otherStyle?: string): void;
|
|
77
|
-
/**
|
|
78
|
-
* 控制台-输出表格
|
|
79
|
-
* @param msg
|
|
80
|
-
* @param color 输出的颜色
|
|
81
|
-
* @param otherStyle 其它CSS
|
|
82
|
-
* @example
|
|
83
|
-
* log.table([{"名字":"example","值":"123"},{"名字":"example2","值":"345"}])
|
|
84
|
-
*/
|
|
85
|
-
table(msg: any[], color?: string, otherStyle?: string): void;
|
|
86
|
-
/**
|
|
87
|
-
* 配置Log对象的颜色
|
|
88
|
-
* @param paramDetails 配置信息
|
|
89
|
-
*/
|
|
90
|
-
config(paramDetails: Partial<UtilsLogOptions>): void;
|
|
91
|
-
/** 禁用输出 */
|
|
92
|
-
disable(): void;
|
|
93
|
-
/** 恢复输出 */
|
|
94
|
-
recovery(): void;
|
|
95
|
-
}
|
|
96
|
-
export { Log };
|
|
1
|
+
/** Utils.Log的初始化配置 */
|
|
2
|
+
declare interface UtilsLogOptions {
|
|
3
|
+
/** 是否输出Tag,false的话其它的颜色也不输出,默认为true */
|
|
4
|
+
tag: boolean;
|
|
5
|
+
/** log.success的颜色,默认#0000FF */
|
|
6
|
+
successColor: string;
|
|
7
|
+
/** log.warn的颜色,默认0 */
|
|
8
|
+
warnColor: string;
|
|
9
|
+
/** log.error的颜色,默认#FF0000 */
|
|
10
|
+
errorColor: string;
|
|
11
|
+
/** log.info的颜色,默认0 */
|
|
12
|
+
infoColor: string;
|
|
13
|
+
/** 是否开启debug模式,true会在控制台每次调用时输出调用函数的所在位置,false不会输出位置,默认false */
|
|
14
|
+
debug: boolean;
|
|
15
|
+
/** 当console输出超过logMaxCount数量自动清理控制台,默认false */
|
|
16
|
+
autoClearConsole: boolean;
|
|
17
|
+
/** console输出的最高数量,autoClearConsole开启则生效,默认999 */
|
|
18
|
+
logMaxCount: number;
|
|
19
|
+
}
|
|
20
|
+
declare class Log {
|
|
21
|
+
#private;
|
|
22
|
+
/** 前面的TAG标志 */
|
|
23
|
+
tag: string;
|
|
24
|
+
/**
|
|
25
|
+
* @param _GM_info_ 油猴管理器的API GM_info,或者是一个对象,如{"script":{name:"Utils.Log"}},或者直接是一个字符串
|
|
26
|
+
* @param console 可指定console对象为unsafeWindow下的console或者是油猴window下的console
|
|
27
|
+
*/
|
|
28
|
+
constructor(_GM_info_?: {
|
|
29
|
+
script: {
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
} | string, console?: Console);
|
|
33
|
+
/**
|
|
34
|
+
* 解析Error的堆栈获取实际调用者的函数名及函数所在的位置
|
|
35
|
+
* @param stack
|
|
36
|
+
*/
|
|
37
|
+
private parseErrorStack;
|
|
38
|
+
/**
|
|
39
|
+
* 检测清理控制台
|
|
40
|
+
*/
|
|
41
|
+
private checkClearConsole;
|
|
42
|
+
/**
|
|
43
|
+
* 输出内容
|
|
44
|
+
* @param msg 需要输出的内容
|
|
45
|
+
* @param color 颜色
|
|
46
|
+
* @param otherStyle 其它CSS
|
|
47
|
+
*/
|
|
48
|
+
private printContent;
|
|
49
|
+
/**
|
|
50
|
+
* 控制台-普通输出
|
|
51
|
+
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
52
|
+
* @param color 输出的颜色
|
|
53
|
+
* @param otherStyle 其它CSS
|
|
54
|
+
*/
|
|
55
|
+
info(msg: any, color?: string, otherStyle?: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* 控制台-警告输出
|
|
58
|
+
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
59
|
+
* @param color 输出的颜色
|
|
60
|
+
* @param otherStyle 其它CSS
|
|
61
|
+
*/
|
|
62
|
+
warn(msg: any, color?: string, otherStyle?: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* 控制台-错误输出
|
|
65
|
+
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
66
|
+
* @param color 输出的颜色
|
|
67
|
+
* @param otherStyle 其它CSS
|
|
68
|
+
*/
|
|
69
|
+
error(msg: any, color?: string, otherStyle?: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* 控制台-成功输出
|
|
72
|
+
* @param msg 需要输出的内容,如果想输出多个,修改成数组,且数组内的长度最大值为4个
|
|
73
|
+
* @param color 输出的颜色
|
|
74
|
+
* @param otherStyle 其它CSS
|
|
75
|
+
*/
|
|
76
|
+
success(msg: any, color?: string, otherStyle?: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* 控制台-输出表格
|
|
79
|
+
* @param msg
|
|
80
|
+
* @param color 输出的颜色
|
|
81
|
+
* @param otherStyle 其它CSS
|
|
82
|
+
* @example
|
|
83
|
+
* log.table([{"名字":"example","值":"123"},{"名字":"example2","值":"345"}])
|
|
84
|
+
*/
|
|
85
|
+
table(msg: any[], color?: string, otherStyle?: string): void;
|
|
86
|
+
/**
|
|
87
|
+
* 配置Log对象的颜色
|
|
88
|
+
* @param paramDetails 配置信息
|
|
89
|
+
*/
|
|
90
|
+
config(paramDetails: Partial<UtilsLogOptions>): void;
|
|
91
|
+
/** 禁用输出 */
|
|
92
|
+
disable(): void;
|
|
93
|
+
/** 恢复输出 */
|
|
94
|
+
recovery(): void;
|
|
95
|
+
}
|
|
96
|
+
export { Log };
|