lyb-js 1.0.1 → 1.0.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.d.ts +1 -395
- package/dist/index.js +1 -405
- package/dist/lib.d.ts +395 -39
- package/dist/lib.js +405 -39
- package/package.json +1 -1
package/dist/lib.d.ts
CHANGED
|
@@ -1,39 +1,395 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
/** @description 基础方法 */
|
|
2
|
+
export declare const Base: {
|
|
3
|
+
/**
|
|
4
|
+
* @description 返回数据类型
|
|
5
|
+
* @param v 需要判断类型的数据
|
|
6
|
+
* @example
|
|
7
|
+
* libGetDataType(123); // "number"
|
|
8
|
+
* libGetDataType("hello"); // "string"
|
|
9
|
+
* libGetDataType([1, 2, 3]); // "array"
|
|
10
|
+
*/
|
|
11
|
+
libGetDataType: (v: any) => import("./Base/LibGetDataType").LibGetDataTypeReturnType;
|
|
12
|
+
/**
|
|
13
|
+
* @description 延时执行,切换到其他页面会暂停
|
|
14
|
+
* @param delay 延时毫秒数
|
|
15
|
+
* @param fn 延时执行函数
|
|
16
|
+
* @example
|
|
17
|
+
* libPromiseTimeout(3000, () => {
|
|
18
|
+
* console.log("执行延时函数");
|
|
19
|
+
* });
|
|
20
|
+
*/
|
|
21
|
+
libPromiseTimeout: (delay?: number, fn?: () => void) => Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
/** @description 浏览器相关方法 */
|
|
24
|
+
export declare const Browser: {
|
|
25
|
+
/** @description console颜色打印
|
|
26
|
+
* @param title 标题
|
|
27
|
+
* @param color 颜色
|
|
28
|
+
* @param logs 信息
|
|
29
|
+
* @example
|
|
30
|
+
* // 使用红色打印日志
|
|
31
|
+
* libColorConsole("错误提示", "red", [{ label: "错误代码", value: 500 }]);
|
|
32
|
+
*
|
|
33
|
+
* // 使用蓝色打印简单日志
|
|
34
|
+
* libColorConsole("信息", "blue", "操作成功");
|
|
35
|
+
*/
|
|
36
|
+
libColorConsole: (title: string, color: "red" | "orange" | "yellow" | "green" | "blue" | "purple", logs?: {
|
|
37
|
+
label: string;
|
|
38
|
+
value: any;
|
|
39
|
+
}[] | any) => void;
|
|
40
|
+
/** @description 判断是否为移动设备
|
|
41
|
+
* @example
|
|
42
|
+
* const isMobile = libIsMobile();
|
|
43
|
+
* console.log(isMobile); // true 或 false
|
|
44
|
+
*/
|
|
45
|
+
libIsMobile: () => boolean;
|
|
46
|
+
/** @description 判断是否为平板
|
|
47
|
+
* @example
|
|
48
|
+
* const isPad = libIsPad();
|
|
49
|
+
* console.log(isPad); // true 或 false
|
|
50
|
+
*/
|
|
51
|
+
libIsPad: () => boolean;
|
|
52
|
+
/** @description 获取浏览器地址栏参数
|
|
53
|
+
* @example
|
|
54
|
+
* const params = libPathParams();
|
|
55
|
+
* console.log(params); // { param1: "value1", param2: "value2" }
|
|
56
|
+
*/
|
|
57
|
+
libPathParams: () => Record<string, string>;
|
|
58
|
+
/** @description 动态设置网站标题及图标
|
|
59
|
+
* @param title 网站标题
|
|
60
|
+
* @param url 网站图标地址
|
|
61
|
+
* @example
|
|
62
|
+
* libSetTitleIcon("我的网站", "https://example.com/favicon.ico");
|
|
63
|
+
*/
|
|
64
|
+
libSetTitleIcon: (title: string, url: string) => void;
|
|
65
|
+
/** @description 网站标题交互,当从当前网页切换到其他网页,网站标题自动切换
|
|
66
|
+
* @param backTitle 从其他网页返回时显示的标题
|
|
67
|
+
* @param leaveTitle 从当前网页离开时显示的标题
|
|
68
|
+
* * @example
|
|
69
|
+
* libTagTitleTip("欢迎回来", "来和妲己玩耍吧!");
|
|
70
|
+
*/
|
|
71
|
+
libTagTitleTip: (backTitle: string, leaveTitle: string) => void;
|
|
72
|
+
};
|
|
73
|
+
/** @description 数据相关方法 */
|
|
74
|
+
export declare const Data: {
|
|
75
|
+
/**
|
|
76
|
+
* @description 将数组拆分成指定数组元素数量的多个数组
|
|
77
|
+
* @param arr 需要拆分的数组
|
|
78
|
+
* @param chunkSize 每个数组的元素数量
|
|
79
|
+
* @example
|
|
80
|
+
* const chunks = libChunkArray([1, 2, 3, 4, 5, 6], 2);
|
|
81
|
+
* console.log(chunks); // [[1, 2], [3, 4], [5, 6]]
|
|
82
|
+
*/
|
|
83
|
+
libChunkArray: <T>(arr: T[], chunkSize: number) => T[][];
|
|
84
|
+
/** @description 递归将JSON字符串深度解析为对象
|
|
85
|
+
* @example
|
|
86
|
+
* const obj = libDeepJSONParse('{"a": 1, "b": "{\"c\": 2}"}');
|
|
87
|
+
* console.log(obj); // { a: 1, b: { c: 2 } }
|
|
88
|
+
*/
|
|
89
|
+
libDeepJSONParse: <T>(data: any) => T;
|
|
90
|
+
/**
|
|
91
|
+
* @description 分类汇总,将数组对象按照指定键值整理成一个以键值为键名的对象
|
|
92
|
+
* @param arr 要分组的数组。
|
|
93
|
+
* @param key 分组的键。
|
|
94
|
+
* @returns 分组后的对象。
|
|
95
|
+
* @example
|
|
96
|
+
* const grouped = libGroupArrayByKey([{ id: 1, name: 'A' }, { id: 2, name: 'B' }, { id: 1, name: 'C' }], 'id');
|
|
97
|
+
* console.log(grouped); // { 1: [{ id: 1, name: 'A' }, { id: 1, name: 'C' }], 2: [{ id: 2, name: 'B' }] }
|
|
98
|
+
*/
|
|
99
|
+
libGroupArrayByKey: (arr: any[] | undefined, key: string) => any;
|
|
100
|
+
/**
|
|
101
|
+
* @description 匹配电子邮件,可用于实时输入时,自动补全常用邮箱后缀
|
|
102
|
+
* @param str 要匹配的字符串
|
|
103
|
+
* @param emailList 电子邮件后缀列表
|
|
104
|
+
* @returns 匹配结果数组
|
|
105
|
+
* @example
|
|
106
|
+
* const emails = libMatchEmail("user", ["@gmail.com", "@yahoo.com"]);
|
|
107
|
+
* console.log(emails); // ["user@gmail.com", "user@yahoo.com"]
|
|
108
|
+
*/
|
|
109
|
+
libMatchEmail: (str: string, emailList: string[]) => string[];
|
|
110
|
+
/** @description 数组乱序
|
|
111
|
+
* @param arr 需要乱序的数组
|
|
112
|
+
* @example
|
|
113
|
+
* const shuffled = libShuffleArray([1, 2, 3, 4, 5]);
|
|
114
|
+
* console.log(shuffled); // [3, 5, 2, 1, 4] (结果每次不同)
|
|
115
|
+
*/
|
|
116
|
+
libShuffleArray: <T>(arr: T[]) => T[];
|
|
117
|
+
/** @description 数组元素整体步数移动
|
|
118
|
+
* @param arr 移动的数组
|
|
119
|
+
* @param step 负数为向后移动,正数为向前移动
|
|
120
|
+
* @example
|
|
121
|
+
* const moved = libStepArray([1, 2, 3, 4, 5], 2);
|
|
122
|
+
* console.log(moved); // [4, 5, 1, 2, 3]
|
|
123
|
+
*/
|
|
124
|
+
libStepArray: <T>(arr: T[], step: number) => T[];
|
|
125
|
+
};
|
|
126
|
+
/** @description 文件相关方法 */
|
|
127
|
+
export declare const File: {
|
|
128
|
+
/** @description 下载图片链接
|
|
129
|
+
* @param link 图片链接
|
|
130
|
+
* @param name 图片名称
|
|
131
|
+
* @example
|
|
132
|
+
* libDownloadImageLink("https://example.com/image.jpg", "downloaded-image.jpg");
|
|
133
|
+
*/
|
|
134
|
+
libDownloadImageLink: (link: string, name: string) => void;
|
|
135
|
+
/** @description 图片压缩
|
|
136
|
+
* @param obj 压缩参数
|
|
137
|
+
* @example
|
|
138
|
+
* // 图片压缩使用示例
|
|
139
|
+
* libImageOptimizerOptionsParams({
|
|
140
|
+
* file: myFile,
|
|
141
|
+
* ratio: 0.8,
|
|
142
|
+
* width: 800,
|
|
143
|
+
* maxSize: 1024,
|
|
144
|
+
* success: (data, file, url) => {
|
|
145
|
+
* console.log('压缩成功', data, file, url);
|
|
146
|
+
* },
|
|
147
|
+
* fail: (error) => {
|
|
148
|
+
* console.error('压缩失败', error);
|
|
149
|
+
* }
|
|
150
|
+
* });
|
|
151
|
+
*/
|
|
152
|
+
libImageOptimizer: (obj: import("./File/LibImageOptimizer").LibImageOptimizerOptionsParams) => void;
|
|
153
|
+
/**
|
|
154
|
+
* @description 保存文件到本地
|
|
155
|
+
* @param data 要保存的数据
|
|
156
|
+
* @param name 文件名
|
|
157
|
+
* @example
|
|
158
|
+
* libSaveJson(JSON.stringify({ key: "value" }), "example.json");
|
|
159
|
+
*/
|
|
160
|
+
libSaveJson: (data: BlobPart, name: string) => void;
|
|
161
|
+
};
|
|
162
|
+
/** @description 格式化相关方法 */
|
|
163
|
+
export declare const Formatter: {
|
|
164
|
+
/**
|
|
165
|
+
* @description 格式化字节大小
|
|
166
|
+
* @param bytes 字节数
|
|
167
|
+
* @returns ['大小', '单位', '大小及单位']
|
|
168
|
+
* @example
|
|
169
|
+
* const [size, unit, formatted] = libFormatterByte(2048);
|
|
170
|
+
* console.log(size, unit, formatted); // 2.00 KB 2.00 KB
|
|
171
|
+
*/
|
|
172
|
+
libFormatterByte: (bytes: number) => (string | number)[];
|
|
173
|
+
/**
|
|
174
|
+
* @description 隐藏手机号码中间的四位数字。
|
|
175
|
+
* @param mobile 需要处理的手机号码。
|
|
176
|
+
* @example
|
|
177
|
+
* const masked = libMaskPhoneNumber("13812345678");
|
|
178
|
+
* console.log(masked); // 138****5678
|
|
179
|
+
*/
|
|
180
|
+
libMaskPhoneNumber: (mobile: number | string) => string;
|
|
181
|
+
/**
|
|
182
|
+
* @description 数字每三位添加逗号
|
|
183
|
+
* @param num 需要格式化的数字
|
|
184
|
+
* @param reserve 保留小数位数
|
|
185
|
+
* @example
|
|
186
|
+
* const formatted = libNumComma(1234567.89);
|
|
187
|
+
* console.log(formatted); // 1,234,567.89
|
|
188
|
+
*/
|
|
189
|
+
libNumComma: (num: number, reserve?: number) => string;
|
|
190
|
+
/** @description 将大于1000的数字使用k为单位
|
|
191
|
+
* @param num 数字
|
|
192
|
+
* @param units 单位组,key为单位,value为格式化阈值
|
|
193
|
+
* @returns [数字, 单位]
|
|
194
|
+
* @example
|
|
195
|
+
* const [value, unit] = libNumberUnit(1500, { K: 1000, M: 1000000 });
|
|
196
|
+
* console.log(value, unit); // 1.50 K
|
|
197
|
+
*/
|
|
198
|
+
libNumberUnit: (num: number, units: import("./Formatter/LibNumberUnit").LibNumberUnitParams) => string[];
|
|
199
|
+
};
|
|
200
|
+
/** @description 数学相关方法 */
|
|
201
|
+
export declare const Math: {
|
|
202
|
+
/** @description 计算表达式字符串
|
|
203
|
+
* @param expression 表达式字符串
|
|
204
|
+
* @param point 小数点精度
|
|
205
|
+
* @returns 计算结果
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* const result = libCalculateExpression("(1+2)-(3*4)/5");
|
|
209
|
+
* console.log(result); // 0.6
|
|
210
|
+
*/
|
|
211
|
+
libCalculateExpression: (expression: string, point?: number) => number;
|
|
212
|
+
/**
|
|
213
|
+
* @description 角度和弧度互相转换
|
|
214
|
+
* @param value 角度值或弧度值
|
|
215
|
+
* @param type 角度类型或弧度类型
|
|
216
|
+
* @example
|
|
217
|
+
* // 角度转弧度
|
|
218
|
+
* libConvertAngle(90, "rad"); // 返回 1.5708... (π/2)
|
|
219
|
+
*
|
|
220
|
+
* // 弧度转角度
|
|
221
|
+
* libConvertAngle(Math.PI, "deg"); // 返回 180
|
|
222
|
+
*/
|
|
223
|
+
libConvertAngle: (value: number, type: "rad" | "deg") => number;
|
|
224
|
+
/** @description 计算两点角度
|
|
225
|
+
* @param coord1 起点坐标
|
|
226
|
+
* @param coord2 终点坐标
|
|
227
|
+
* @example
|
|
228
|
+
* libCoordsAngle({ x: 0, y: 0 }, { x: 1, y: 0 }); // 0
|
|
229
|
+
* libCoordsAngle({ x: 0, y: 0 }, { x: 1, y: 1 }); // 45
|
|
230
|
+
* libCoordsAngle({ x: 0, y: 0 }, { x: 0, y: 1 }); // 90
|
|
231
|
+
*/
|
|
232
|
+
libCoordsAngle: (coord1: {
|
|
233
|
+
x: number;
|
|
234
|
+
y: number;
|
|
235
|
+
}, coord2: {
|
|
236
|
+
x: number;
|
|
237
|
+
y: number;
|
|
238
|
+
}) => number;
|
|
239
|
+
/** @description 计算两点距离
|
|
240
|
+
* @param coord1 起点坐标
|
|
241
|
+
* @param coord2 终点坐标
|
|
242
|
+
* @example
|
|
243
|
+
* libCoordsDistance({ x: 0, y: 0 }, { x: 3, y: 4 }); // 5
|
|
244
|
+
* libCoordsDistance({ x: 1, y: 1 }, { x: 4, y: 5 }); // 5
|
|
245
|
+
* libCoordsDistance({ x: 0, y: 0 }, { x: 0, y: 0 }); // 0
|
|
246
|
+
*/
|
|
247
|
+
libCoordsDistance: (coord1: {
|
|
248
|
+
x: number;
|
|
249
|
+
y: number;
|
|
250
|
+
}, coord2: {
|
|
251
|
+
x: number;
|
|
252
|
+
y: number;
|
|
253
|
+
}) => number;
|
|
254
|
+
/** @description 计算两个数的运算结果,并保留指定位数的小数
|
|
255
|
+
* @param num1 第一个数
|
|
256
|
+
* @param num2 第二个数
|
|
257
|
+
* @param operator 运算符,支持加减乘除
|
|
258
|
+
* @example
|
|
259
|
+
* // 示例用法
|
|
260
|
+
* libDecimal(10, 3, "+"); // 13
|
|
261
|
+
* libDecimal(10, 3, "-"); // 7
|
|
262
|
+
* libDecimal(10, 3, "/", 2); // 3.33
|
|
263
|
+
*/
|
|
264
|
+
libDecimal: (num1: number, num2: number, operator: "+" | "-" | "*" | "/", point?: number) => number;
|
|
265
|
+
};
|
|
266
|
+
/** @description 杂项相关方法 */
|
|
267
|
+
export declare const Misc: {
|
|
268
|
+
/**
|
|
269
|
+
* @description 表单验证函数。
|
|
270
|
+
* @param form 表单数据对象。
|
|
271
|
+
* @param rules 验证规则数组。
|
|
272
|
+
* @returns 验证结果数组,包含未通过验证的项。
|
|
273
|
+
* @example
|
|
274
|
+
* const form = { username: "john", email: "john@example.com" };
|
|
275
|
+
* const rules = [
|
|
276
|
+
* { key: "username", verify: /^[a-zA-Z0-9]{3,}$/, msg: "用户名不合法", name: "用户名" },
|
|
277
|
+
* { key: "email", verify: /^\S+@\S+\.\S+$/, msg: "邮箱格式不正确", name: "邮箱" },
|
|
278
|
+
* ];
|
|
279
|
+
* libRegFormValidate(form, rules);
|
|
280
|
+
* // 返回结果: []
|
|
281
|
+
*
|
|
282
|
+
* const invalidForm = { username: "jo", email: "invalid-email" };
|
|
283
|
+
* libRegFormValidate(invalidForm, rules);
|
|
284
|
+
* // 返回结果: [
|
|
285
|
+
* // { key: "username", msg: "用户名不合法", name: "用户名" },
|
|
286
|
+
* // { key: "email", msg: "邮箱格式不正确", name: "邮箱" }
|
|
287
|
+
* // ]
|
|
288
|
+
*/
|
|
289
|
+
libRegFormValidate: (form: Record<string, any>, rules: Array<{
|
|
290
|
+
key: string;
|
|
291
|
+
verify: RegExp | ((value: any) => boolean);
|
|
292
|
+
msg: string;
|
|
293
|
+
name: string;
|
|
294
|
+
}>) => import("./Misc/LibRegFormValidate").ValidationResult[];
|
|
295
|
+
/** @description 请求失败重连
|
|
296
|
+
* @param promiseFn 请求函数
|
|
297
|
+
* @param maxRetries 最大重试次数
|
|
298
|
+
* @param retryDelay 重试间隔时间
|
|
299
|
+
* @param params 请求参数
|
|
300
|
+
* @example
|
|
301
|
+
* const requestFn = (params: { url: string }) => fetch(params.url).then(res => res.json());
|
|
302
|
+
* const params = { url: "https://api.example.com/data" };
|
|
303
|
+
* libRetryRequest({
|
|
304
|
+
* promiseFn: requestFn,
|
|
305
|
+
* params,
|
|
306
|
+
* maxRetries: 5,
|
|
307
|
+
* retryDelay: 1000
|
|
308
|
+
* })
|
|
309
|
+
* .then(data => console.log(data))
|
|
310
|
+
* .catch(err => console.error(err));
|
|
311
|
+
*/
|
|
312
|
+
libRetryRequest: <T>({ promiseFn, maxRetries, retryDelay, params, }: {
|
|
313
|
+
promiseFn: (params?: any) => Promise<T>;
|
|
314
|
+
params?: any;
|
|
315
|
+
maxRetries?: number;
|
|
316
|
+
retryDelay?: number;
|
|
317
|
+
onRetry?: () => void;
|
|
318
|
+
}) => Promise<T>;
|
|
319
|
+
};
|
|
320
|
+
/** @description 随机相关方法 */
|
|
321
|
+
export declare const Random: {
|
|
322
|
+
/** @description 百分比概率结果
|
|
323
|
+
* @param probability 触发概率,百分比,0-100
|
|
324
|
+
* @example
|
|
325
|
+
* libProbabilityResult(50); // 50% 概率为 true
|
|
326
|
+
* libProbabilityResult(80); // 80% 概率为 true
|
|
327
|
+
* libProbabilityResult(100); // 100% 概率为 true
|
|
328
|
+
*/
|
|
329
|
+
libProbabilityResult: (probability: number) => boolean;
|
|
330
|
+
/** @description 随机数
|
|
331
|
+
* @param min 最小值
|
|
332
|
+
* @param max 最大值
|
|
333
|
+
* @param num 保留小数位数
|
|
334
|
+
* @example
|
|
335
|
+
* libRandom(1, 10); // 1 到 10 之间的随机整数
|
|
336
|
+
* libRandom(1, 10, 2); // 1 到 10 之间保留两位小数的随机数
|
|
337
|
+
* libRandom(5, 5, 3); // 返回 5.000
|
|
338
|
+
*/
|
|
339
|
+
libRandom: (min: number, max: number, num?: number) => number;
|
|
340
|
+
/** @description 随机 RGBA 颜色
|
|
341
|
+
* @param alpha 透明度
|
|
342
|
+
* @example
|
|
343
|
+
* libRandomColor(); // 生成随机的 RGBA 颜色,默认透明度 1
|
|
344
|
+
* libRandomColor(0.5); // 生成随机的 RGBA 颜色,透明度为 0.5
|
|
345
|
+
*/
|
|
346
|
+
libRandomColor: (alpha?: number) => string;
|
|
347
|
+
/** @description 随机生成n个指定范围的随机数数组
|
|
348
|
+
* @param min 最小值
|
|
349
|
+
* @param max 最大值
|
|
350
|
+
* @param count 数组长度
|
|
351
|
+
* @example
|
|
352
|
+
* libUniqueRandomNumbers(1, 10, 5); // 从 1 到 10 中随机生成 5 个唯一数字
|
|
353
|
+
* libUniqueRandomNumbers(1, 100, 10); // 从 1 到 100 中随机生成 10 个唯一数字
|
|
354
|
+
*/
|
|
355
|
+
libUniqueRandomNumbers: (min: number, max: number, count: number) => number[];
|
|
356
|
+
};
|
|
357
|
+
/** @description 时间相关方法 */
|
|
358
|
+
export declare const Time: {
|
|
359
|
+
/**
|
|
360
|
+
* @description 传入时间戳与当前时间判断是否为同一天或同一周
|
|
361
|
+
* @param timestamp 毫秒时间戳
|
|
362
|
+
* @param unit 判断单位
|
|
363
|
+
* @returns 0-同一单位时间 1-新单位时间 -1时间戳大于当前时间
|
|
364
|
+
*/
|
|
365
|
+
libSameTimeCheck: (timestamp: number, unit: import("dayjs").OpUnitType) => 0 | 1 | -1;
|
|
366
|
+
/**
|
|
367
|
+
* @description 将秒数格式化为中文时间描述,支持扩展到年和月。
|
|
368
|
+
* @param seconds 秒数
|
|
369
|
+
* @returns 格式化后的中文时间
|
|
370
|
+
* @example
|
|
371
|
+
* libSecondsFormatterChinese(100000); // "1天3小时46分40秒"
|
|
372
|
+
* libSecondsFormatterChinese(31536000); // "1年"
|
|
373
|
+
* libSecondsFormatterChinese(3600); // "1小时"
|
|
374
|
+
* libSecondsFormatterChinese(90); // "1分30秒"
|
|
375
|
+
*/
|
|
376
|
+
libSecondsFormatterChinese: (seconds: number) => string;
|
|
377
|
+
/** @description 时间差计算
|
|
378
|
+
* @param timestamp 毫秒时间戳
|
|
379
|
+
* @example
|
|
380
|
+
* libTimeAgotamp(Date.now() - 3600000); // "1 小时前"
|
|
381
|
+
* libTimeAgotamp(Date.now() - 86400000); // "1 天前"
|
|
382
|
+
* libTimeAgotamp(Date.now() - 31536000000); // "1 年前"
|
|
383
|
+
* libTimeAgotamp(Date.now() - 10000); // "刚刚"
|
|
384
|
+
*/
|
|
385
|
+
libTimeAgo: (timestamp: number) => string;
|
|
386
|
+
/**
|
|
387
|
+
* @description 根据当前时间返回问候语。
|
|
388
|
+
* @param greet 自定义问候语对象。
|
|
389
|
+
* @example
|
|
390
|
+
* libTimeGreeting(); // 根据当前时间返回默认问候语
|
|
391
|
+
* libTimeGreeting({ morning: "早安" }); // 自定义早上问候语
|
|
392
|
+
* libTimeGreeting({ afternoon: "午后好" }); // 自定义下午问候语
|
|
393
|
+
*/
|
|
394
|
+
libTimeGreeting: (greet?: import("./Time/LibTimeGreeting").LibTimeGreetingParams) => string;
|
|
395
|
+
};
|