@pisell/pisellos 3.0.68 → 3.0.70

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.
Files changed (31) hide show
  1. package/dist/modules/Order/index.js +4 -2
  2. package/dist/modules/Order/types.d.ts +1 -0
  3. package/dist/plugins/request.d.ts +1 -0
  4. package/dist/solution/BookingByStep/index.d.ts +5 -1
  5. package/dist/solution/BookingByStep/index.js +31 -7
  6. package/dist/solution/RegisterAndLogin/config.d.ts +87 -0
  7. package/dist/solution/RegisterAndLogin/config.js +792 -0
  8. package/dist/solution/RegisterAndLogin/index.d.ts +189 -0
  9. package/dist/solution/RegisterAndLogin/index.js +2667 -0
  10. package/dist/solution/RegisterAndLogin/types.d.ts +444 -0
  11. package/dist/solution/RegisterAndLogin/types.js +231 -0
  12. package/dist/solution/RegisterAndLogin/utils.d.ts +95 -0
  13. package/dist/solution/RegisterAndLogin/utils.js +322 -0
  14. package/dist/solution/index.d.ts +1 -0
  15. package/dist/solution/index.js +2 -1
  16. package/lib/modules/Order/index.js +5 -2
  17. package/lib/modules/Order/types.d.ts +1 -0
  18. package/lib/plugins/request.d.ts +1 -0
  19. package/lib/solution/BookingByStep/index.d.ts +5 -1
  20. package/lib/solution/BookingByStep/index.js +9 -2
  21. package/lib/solution/RegisterAndLogin/config.d.ts +87 -0
  22. package/lib/solution/RegisterAndLogin/config.js +594 -0
  23. package/lib/solution/RegisterAndLogin/index.d.ts +189 -0
  24. package/lib/solution/RegisterAndLogin/index.js +1593 -0
  25. package/lib/solution/RegisterAndLogin/types.d.ts +444 -0
  26. package/lib/solution/RegisterAndLogin/types.js +78 -0
  27. package/lib/solution/RegisterAndLogin/utils.d.ts +95 -0
  28. package/lib/solution/RegisterAndLogin/utils.js +279 -0
  29. package/lib/solution/index.d.ts +1 -0
  30. package/lib/solution/index.js +3 -1
  31. package/package.json +1 -1
@@ -0,0 +1,444 @@
1
+ /**
2
+ * 注册登录解决方案类型定义
3
+ */
4
+ /**
5
+ * 注册登录流程 hooks
6
+ */
7
+ export declare enum RegisterAndLoginHooks {
8
+ onInited = "registerAndLogin:onInited",
9
+ onDestroy = "registerAndLogin:onDestroy",
10
+ onEmailVerificationSent = "registerAndLogin:onEmailVerificationSent",
11
+ onEmailVerificationVerified = "registerAndLogin:onEmailVerificationVerified",
12
+ onEmailVerificationFailed = "registerAndLogin:onEmailVerificationFailed",
13
+ onSmsVerificationSent = "registerAndLogin:onSmsVerificationSent",
14
+ onSmsVerificationVerified = "registerAndLogin:onSmsVerificationVerified",
15
+ onSmsVerificationFailed = "registerAndLogin:onSmsVerificationFailed",
16
+ onOAuthLoginStarted = "registerAndLogin:onOAuthLoginStarted",
17
+ onOAuthLoginSuccess = "registerAndLogin:onOAuthLoginSuccess",
18
+ onOAuthLoginFailed = "registerAndLogin:onOAuthLoginFailed",
19
+ onRegisterStarted = "registerAndLogin:onRegisterStarted",
20
+ onRegisterSuccess = "registerAndLogin:onRegisterSuccess",
21
+ onRegisterFailed = "registerAndLogin:onRegisterFailed",
22
+ onLoginStarted = "registerAndLogin:onLoginStarted",
23
+ onLoginSuccess = "registerAndLogin:onLoginSuccess",
24
+ onLoginFailed = "registerAndLogin:onLoginFailed",
25
+ onPasswordResetStarted = "registerAndLogin:onPasswordResetStarted",
26
+ onPasswordResetSuccess = "registerAndLogin:onPasswordResetSuccess",
27
+ onPasswordResetFailed = "registerAndLogin:onPasswordResetFailed"
28
+ }
29
+ /**
30
+ * OAuth 提供商类型
31
+ */
32
+ export declare enum OAuthProvider {
33
+ FACEBOOK = "facebook",
34
+ APPLE = "apple",
35
+ GOOGLE = "google",
36
+ WECHAT = "wechat",
37
+ GITHUB = "github"
38
+ }
39
+ /**
40
+ * 验证码类型
41
+ */
42
+ export declare enum VerificationCodeType {
43
+ EMAIL = "email",
44
+ SMS = "sms"
45
+ }
46
+ /**
47
+ * 验证码用途
48
+ */
49
+ export declare enum VerificationPurpose {
50
+ REGISTER = "register",
51
+ LOGIN = "login",
52
+ PASSWORD_RESET = "password_reset",
53
+ CHANGE_EMAIL = "change_email",
54
+ CHANGE_PHONE = "change_phone"
55
+ }
56
+ /**
57
+ * 用户信息接口
58
+ */
59
+ export interface UserInfo {
60
+ id: string;
61
+ email?: string;
62
+ phone?: string;
63
+ name?: string;
64
+ avatar?: string;
65
+ isEmailVerified: boolean;
66
+ isPhoneVerified: boolean;
67
+ createdAt: string;
68
+ updatedAt: string;
69
+ [key: string]: any;
70
+ }
71
+ /**
72
+ * 注册参数接口
73
+ */
74
+ export interface RegisterParams {
75
+ email?: string;
76
+ phone?: string;
77
+ password: string;
78
+ name?: string;
79
+ verificationCode?: string;
80
+ verificationCodeType?: VerificationCodeType;
81
+ [key: string]: any;
82
+ }
83
+ /**
84
+ * 登录参数接口
85
+ */
86
+ export interface LoginParams {
87
+ email?: string;
88
+ phone?: string;
89
+ password?: string;
90
+ verificationCode?: string;
91
+ verificationCodeType?: VerificationCodeType;
92
+ rememberMe?: boolean;
93
+ [key: string]: any;
94
+ }
95
+ /**
96
+ * OAuth 登录参数接口
97
+ */
98
+ export interface OAuthLoginParams {
99
+ provider: OAuthProvider;
100
+ code?: string;
101
+ accessToken?: string;
102
+ redirectUri?: string;
103
+ [key: string]: any;
104
+ }
105
+ /**
106
+ * 发送验证码参数接口
107
+ */
108
+ export interface SendVerificationCodeParams {
109
+ type: VerificationCodeType;
110
+ target: string;
111
+ purpose: VerificationPurpose;
112
+ [key: string]: any;
113
+ }
114
+ /**
115
+ * 验证验证码参数接口
116
+ */
117
+ export interface VerifyCodeParams {
118
+ type: VerificationCodeType;
119
+ target: string;
120
+ code: string;
121
+ purpose: VerificationPurpose;
122
+ [key: string]: any;
123
+ }
124
+ /**
125
+ * 密码重置参数接口
126
+ */
127
+ export interface PasswordResetParams {
128
+ type: 'email' | 'phone';
129
+ target: {
130
+ email?: string;
131
+ phone?: string;
132
+ country_calling_code?: string;
133
+ };
134
+ password: string;
135
+ code: string;
136
+ }
137
+ /**
138
+ * OAuth 配置接口
139
+ */
140
+ export interface OAuthConfig {
141
+ [OAuthProvider.FACEBOOK]?: {
142
+ appId: string;
143
+ appSecret?: string;
144
+ redirectUri?: string;
145
+ scope?: string[];
146
+ };
147
+ [OAuthProvider.APPLE]?: {
148
+ clientId: string;
149
+ teamId?: string;
150
+ keyId?: string;
151
+ privateKey?: string;
152
+ redirectUri?: string;
153
+ scope?: string[];
154
+ };
155
+ [OAuthProvider.GOOGLE]?: {
156
+ clientId: string;
157
+ clientSecret?: string;
158
+ redirectUri?: string;
159
+ scope?: string[];
160
+ };
161
+ [OAuthProvider.WECHAT]?: {
162
+ appId: string;
163
+ appSecret?: string;
164
+ redirectUri?: string;
165
+ scope?: string[];
166
+ };
167
+ [OAuthProvider.GITHUB]?: {
168
+ clientId: string;
169
+ clientSecret?: string;
170
+ redirectUri?: string;
171
+ scope?: string[];
172
+ };
173
+ }
174
+ /**
175
+ * 注册登录状态接口
176
+ */
177
+ export interface RegisterAndLoginState {
178
+ currentUser: UserInfo | null;
179
+ isLoggedIn: boolean;
180
+ isLoading: boolean;
181
+ verificationCodeSent: {
182
+ [key: string]: {
183
+ sent: boolean;
184
+ sentAt: number;
185
+ expiresAt: number;
186
+ };
187
+ };
188
+ emailRegisterLinkCode: string | null;
189
+ oauthConfig: OAuthConfig;
190
+ error: string | null;
191
+ [key: string]: any;
192
+ }
193
+ /**
194
+ * API 响应接口
195
+ */
196
+ export interface ApiResponse<T = any> {
197
+ status: boolean;
198
+ data?: T;
199
+ message?: string;
200
+ error?: string;
201
+ code?: number;
202
+ }
203
+ /**
204
+ * 登录响应接口
205
+ */
206
+ export interface LoginResponse {
207
+ user: UserInfo;
208
+ token: string;
209
+ refreshToken?: string;
210
+ expiresAt: number;
211
+ }
212
+ /**
213
+ * 注册响应接口
214
+ */
215
+ export interface RegisterResponse {
216
+ user: UserInfo;
217
+ token?: string;
218
+ refreshToken?: string;
219
+ expiresAt?: number;
220
+ needVerification?: boolean;
221
+ }
222
+ /**
223
+ * OAuth 登录响应接口
224
+ */
225
+ export interface OAuthLoginResponse {
226
+ user: UserInfo;
227
+ token: string;
228
+ refreshToken?: string;
229
+ expiresAt: number;
230
+ isNewUser: boolean;
231
+ }
232
+ /**
233
+ * 国家信息接口
234
+ */
235
+ export interface CountryInfo {
236
+ name: string;
237
+ code: string;
238
+ calling_code: string;
239
+ currency_code: string;
240
+ }
241
+ /**
242
+ * 获取国家区号响应接口
243
+ */
244
+ export interface GetCountriesResponse {
245
+ status: boolean;
246
+ code: number;
247
+ message: string;
248
+ data: CountryInfo[];
249
+ }
250
+ /**
251
+ * 发送手机号注册验证码参数接口
252
+ */
253
+ export interface SendSmsRegisterCodeParams {
254
+ phone: string;
255
+ country_calling_code: string;
256
+ }
257
+ /**
258
+ * 发送邮箱注册邀请链接参数接口
259
+ */
260
+ export interface SendEmailRegisterLinkParams {
261
+ email: string;
262
+ }
263
+ /**
264
+ * 验证邮箱注册链接参数接口
265
+ */
266
+ export interface VerifyEmailRegistrationLinkParams {
267
+ code: string;
268
+ password: string;
269
+ }
270
+ /**
271
+ * 邮箱密码登录参数接口
272
+ */
273
+ export interface EmailPasswordLoginParams {
274
+ email: string;
275
+ password: string;
276
+ }
277
+ /**
278
+ * 发送手机登录验证码参数接口
279
+ */
280
+ export interface SendSmsLoginCodeParams {
281
+ phone: string;
282
+ country_calling_code: string;
283
+ }
284
+ /**
285
+ * 手机号验证码登录参数接口
286
+ */
287
+ export interface PhoneCodeLoginParams {
288
+ phone: string;
289
+ country_calling_code: string;
290
+ code: string;
291
+ }
292
+ /**
293
+ * Guest 登录响应接口
294
+ */
295
+ export interface GuestLoginResponse {
296
+ user: UserInfo;
297
+ token: string;
298
+ refreshToken?: string;
299
+ customer: any;
300
+ }
301
+ /**
302
+ * 检查邮箱是否已注册参数接口
303
+ */
304
+ export interface CheckEmailExistsParams {
305
+ email: string;
306
+ shop_id: number;
307
+ }
308
+ /**
309
+ * 检查邮箱是否已注册响应接口
310
+ */
311
+ export interface CheckEmailExistsResponse {
312
+ exists: boolean;
313
+ }
314
+ /**
315
+ * 检查邮箱验证码是否有效参数接口
316
+ */
317
+ export interface CheckEmailCodeParams {
318
+ email: string;
319
+ shop_id: number;
320
+ code: string;
321
+ action: string;
322
+ }
323
+ /**
324
+ * 检查手机验证码是否有效参数接口
325
+ */
326
+ export interface CheckMobileCodeParams {
327
+ phone: string;
328
+ shop_id: number;
329
+ code: string;
330
+ country_calling_code: string;
331
+ }
332
+ /**
333
+ * 验证码有效性检查响应接口
334
+ */
335
+ export interface CheckCodeValidResponse {
336
+ valid: boolean;
337
+ }
338
+ /**
339
+ * 手机号密码登录参数接口
340
+ */
341
+ export interface PhonePasswordLoginParams {
342
+ phone: string;
343
+ password: string;
344
+ country_calling_code: string;
345
+ }
346
+ /**
347
+ * 发送密码重置邮箱验证码参数接口
348
+ */
349
+ export interface SendPasswordResetEmailParams {
350
+ email: string;
351
+ }
352
+ /**
353
+ * 发送重置密码手机号验证码参数接口
354
+ */
355
+ export interface SendPasswordResetSmsParams {
356
+ phone: string;
357
+ country_calling_code: string;
358
+ }
359
+ /**
360
+ * 发送重置密码邮箱链接参数接口
361
+ */
362
+ export interface SendResetPasswordLinkParams {
363
+ email: string;
364
+ }
365
+ /**
366
+ * 检测重置密码链接code有效性参数接口
367
+ */
368
+ export interface CheckResetPasswordCodeParams {
369
+ code: string;
370
+ }
371
+ /**
372
+ * 通过code重置密码参数接口
373
+ */
374
+ export interface ResetPasswordByCodeParams {
375
+ code: string;
376
+ password: string;
377
+ }
378
+ /**
379
+ * 邮箱验证码注册参数接口
380
+ */
381
+ export interface EmailCodeRegisterParams {
382
+ email: string;
383
+ code: string;
384
+ password: string;
385
+ }
386
+ /**
387
+ * 手机验证码注册参数接口
388
+ */
389
+ export interface PhoneCodeRegisterParams {
390
+ phone: string;
391
+ password: string;
392
+ code: string;
393
+ country_calling_code: string;
394
+ }
395
+ /**
396
+ * 重新发送邮箱注册链接参数接口
397
+ */
398
+ export interface ResendEmailRegisterLinkParams {
399
+ code: string;
400
+ }
401
+ /**
402
+ * 校验邮件链接 code 有效性参数接口
403
+ */
404
+ export interface CheckEmailLinkCodeParams {
405
+ code: string;
406
+ }
407
+ /**
408
+ * 校验邮件链接 code 有效性响应接口
409
+ */
410
+ export interface CheckEmailLinkCodeResponse {
411
+ valid: boolean;
412
+ }
413
+ /**
414
+ * Apple 登录参数
415
+ */
416
+ export interface AppleLoginParams {
417
+ token: string;
418
+ }
419
+ /**
420
+ * Apple 登录响应
421
+ */
422
+ export interface AppleLoginResponse {
423
+ user: UserInfo;
424
+ token: string;
425
+ refreshToken?: string;
426
+ expiresAt: number;
427
+ isNewUser: boolean;
428
+ }
429
+ /**
430
+ * Facebook 登录参数
431
+ */
432
+ export interface FacebookLoginParams {
433
+ token: string;
434
+ }
435
+ /**
436
+ * Facebook 登录响应
437
+ */
438
+ export interface FacebookLoginResponse {
439
+ user: UserInfo;
440
+ token: string;
441
+ refreshToken?: string;
442
+ expiresAt: number;
443
+ isNewUser: boolean;
444
+ }
@@ -0,0 +1,78 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/solution/RegisterAndLogin/types.ts
20
+ var types_exports = {};
21
+ __export(types_exports, {
22
+ OAuthProvider: () => OAuthProvider,
23
+ RegisterAndLoginHooks: () => RegisterAndLoginHooks,
24
+ VerificationCodeType: () => VerificationCodeType,
25
+ VerificationPurpose: () => VerificationPurpose
26
+ });
27
+ module.exports = __toCommonJS(types_exports);
28
+ var RegisterAndLoginHooks = /* @__PURE__ */ ((RegisterAndLoginHooks2) => {
29
+ RegisterAndLoginHooks2["onInited"] = "registerAndLogin:onInited";
30
+ RegisterAndLoginHooks2["onDestroy"] = "registerAndLogin:onDestroy";
31
+ RegisterAndLoginHooks2["onEmailVerificationSent"] = "registerAndLogin:onEmailVerificationSent";
32
+ RegisterAndLoginHooks2["onEmailVerificationVerified"] = "registerAndLogin:onEmailVerificationVerified";
33
+ RegisterAndLoginHooks2["onEmailVerificationFailed"] = "registerAndLogin:onEmailVerificationFailed";
34
+ RegisterAndLoginHooks2["onSmsVerificationSent"] = "registerAndLogin:onSmsVerificationSent";
35
+ RegisterAndLoginHooks2["onSmsVerificationVerified"] = "registerAndLogin:onSmsVerificationVerified";
36
+ RegisterAndLoginHooks2["onSmsVerificationFailed"] = "registerAndLogin:onSmsVerificationFailed";
37
+ RegisterAndLoginHooks2["onOAuthLoginStarted"] = "registerAndLogin:onOAuthLoginStarted";
38
+ RegisterAndLoginHooks2["onOAuthLoginSuccess"] = "registerAndLogin:onOAuthLoginSuccess";
39
+ RegisterAndLoginHooks2["onOAuthLoginFailed"] = "registerAndLogin:onOAuthLoginFailed";
40
+ RegisterAndLoginHooks2["onRegisterStarted"] = "registerAndLogin:onRegisterStarted";
41
+ RegisterAndLoginHooks2["onRegisterSuccess"] = "registerAndLogin:onRegisterSuccess";
42
+ RegisterAndLoginHooks2["onRegisterFailed"] = "registerAndLogin:onRegisterFailed";
43
+ RegisterAndLoginHooks2["onLoginStarted"] = "registerAndLogin:onLoginStarted";
44
+ RegisterAndLoginHooks2["onLoginSuccess"] = "registerAndLogin:onLoginSuccess";
45
+ RegisterAndLoginHooks2["onLoginFailed"] = "registerAndLogin:onLoginFailed";
46
+ RegisterAndLoginHooks2["onPasswordResetStarted"] = "registerAndLogin:onPasswordResetStarted";
47
+ RegisterAndLoginHooks2["onPasswordResetSuccess"] = "registerAndLogin:onPasswordResetSuccess";
48
+ RegisterAndLoginHooks2["onPasswordResetFailed"] = "registerAndLogin:onPasswordResetFailed";
49
+ return RegisterAndLoginHooks2;
50
+ })(RegisterAndLoginHooks || {});
51
+ var OAuthProvider = /* @__PURE__ */ ((OAuthProvider2) => {
52
+ OAuthProvider2["FACEBOOK"] = "facebook";
53
+ OAuthProvider2["APPLE"] = "apple";
54
+ OAuthProvider2["GOOGLE"] = "google";
55
+ OAuthProvider2["WECHAT"] = "wechat";
56
+ OAuthProvider2["GITHUB"] = "github";
57
+ return OAuthProvider2;
58
+ })(OAuthProvider || {});
59
+ var VerificationCodeType = /* @__PURE__ */ ((VerificationCodeType2) => {
60
+ VerificationCodeType2["EMAIL"] = "email";
61
+ VerificationCodeType2["SMS"] = "sms";
62
+ return VerificationCodeType2;
63
+ })(VerificationCodeType || {});
64
+ var VerificationPurpose = /* @__PURE__ */ ((VerificationPurpose2) => {
65
+ VerificationPurpose2["REGISTER"] = "register";
66
+ VerificationPurpose2["LOGIN"] = "login";
67
+ VerificationPurpose2["PASSWORD_RESET"] = "password_reset";
68
+ VerificationPurpose2["CHANGE_EMAIL"] = "change_email";
69
+ VerificationPurpose2["CHANGE_PHONE"] = "change_phone";
70
+ return VerificationPurpose2;
71
+ })(VerificationPurpose || {});
72
+ // Annotate the CommonJS export names for ESM import in node:
73
+ 0 && (module.exports = {
74
+ OAuthProvider,
75
+ RegisterAndLoginHooks,
76
+ VerificationCodeType,
77
+ VerificationPurpose
78
+ });
@@ -0,0 +1,95 @@
1
+ /**
2
+ * 注册登录工具函数
3
+ */
4
+ import { VerificationCodeType, OAuthProvider } from './types';
5
+ /**
6
+ * 验证邮箱格式
7
+ */
8
+ export declare function validateEmail(email: string): boolean;
9
+ /**
10
+ * 验证手机号格式(支持多种国际格式)
11
+ */
12
+ export declare function validatePhone(phone: string): boolean;
13
+ /**
14
+ * 验证密码强度
15
+ */
16
+ export declare function validatePassword(password: string): {
17
+ isValid: boolean;
18
+ errors: string[];
19
+ };
20
+ /**
21
+ * 验证验证码格式
22
+ */
23
+ export declare function validateVerificationCode(code: string, type: VerificationCodeType): boolean;
24
+ /**
25
+ * 格式化手机号显示
26
+ */
27
+ export declare function formatPhoneDisplay(phone: string): string;
28
+ /**
29
+ * 格式化邮箱显示(隐藏部分字符)
30
+ */
31
+ export declare function formatEmailDisplay(email: string, maskLength?: number): string;
32
+ /**
33
+ * 生成随机字符串(用于状态参数等)
34
+ */
35
+ export declare function generateRandomString(length?: number): string;
36
+ /**
37
+ * 获取 OAuth 提供商的显示名称
38
+ */
39
+ export declare function getOAuthProviderDisplayName(provider: OAuthProvider): string;
40
+ /**
41
+ * 获取 OAuth 提供商的图标 URL
42
+ */
43
+ export declare function getOAuthProviderIconUrl(provider: OAuthProvider): string;
44
+ /**
45
+ * 检查是否在移动设备上
46
+ */
47
+ export declare function isMobileDevice(): boolean;
48
+ /**
49
+ * 检查是否支持 WebAuthn
50
+ */
51
+ export declare function isWebAuthnSupported(): boolean;
52
+ /**
53
+ * 检查是否在 iOS 设备上
54
+ */
55
+ export declare function isIOSDevice(): boolean;
56
+ /**
57
+ * 检查是否在 Android 设备上
58
+ */
59
+ export declare function isAndroidDevice(): boolean;
60
+ /**
61
+ * 获取设备类型
62
+ */
63
+ export declare function getDeviceType(): 'desktop' | 'mobile' | 'tablet';
64
+ /**
65
+ * 防抖函数
66
+ */
67
+ export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
68
+ /**
69
+ * 节流函数
70
+ */
71
+ export declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
72
+ /**
73
+ * 深拷贝对象
74
+ */
75
+ export declare function deepClone<T>(obj: T): T;
76
+ /**
77
+ * 安全的 JSON 解析
78
+ */
79
+ export declare function safeJsonParse<T = any>(jsonString: string, defaultValue: T): T;
80
+ /**
81
+ * 安全的 JSON 字符串化
82
+ */
83
+ export declare function safeJsonStringify(obj: any, defaultValue?: string): string;
84
+ /**
85
+ * 格式化时间戳为可读时间
86
+ */
87
+ export declare function formatTimestamp(timestamp: number, format?: string): string;
88
+ /**
89
+ * 计算两个时间戳之间的差值(秒)
90
+ */
91
+ export declare function getTimeDifference(timestamp1: number, timestamp2: number): number;
92
+ /**
93
+ * 检查时间戳是否过期
94
+ */
95
+ export declare function isTimestampExpired(timestamp: number, expirationTime?: number): boolean;