@qhr123/sa2kit 0.2.0 → 0.3.1

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.
@@ -0,0 +1,741 @@
1
+ /**
2
+ * 埋点系统类型定义
3
+ * Analytics System Type Definitions
4
+ */
5
+ /**
6
+ * 事件类型枚举
7
+ */
8
+ declare enum EventType {
9
+ PAGE_VIEW = "page_view",
10
+ PAGE_LEAVE = "page_leave",
11
+ CLICK = "click",
12
+ SCROLL = "scroll",
13
+ INPUT = "input",
14
+ SUBMIT = "submit",
15
+ LOGIN = "login",
16
+ LOGOUT = "logout",
17
+ REGISTER = "register",
18
+ SEARCH = "search",
19
+ SHARE = "share",
20
+ PERFORMANCE = "performance",
21
+ ERROR = "error",
22
+ API_CALL = "api_call",
23
+ CUSTOM = "custom"
24
+ }
25
+ /**
26
+ * 事件优先级
27
+ */
28
+ declare enum EventPriority {
29
+ LOW = 0,// 低优先级,可延迟上报
30
+ NORMAL = 1,// 普通优先级,批量上报
31
+ HIGH = 2,// 高优先级,实时上报
32
+ CRITICAL = 3
33
+ }
34
+ /**
35
+ * 基础事件数据接口
36
+ */
37
+ interface BaseEvent {
38
+ event_id: string;
39
+ event_type: EventType;
40
+ event_name: string;
41
+ timestamp: number;
42
+ priority: EventPriority;
43
+ user_id?: string;
44
+ session_id: string;
45
+ device_id: string;
46
+ page_url?: string;
47
+ page_title?: string;
48
+ referrer?: string;
49
+ properties?: Record<string, any>;
50
+ platform: string;
51
+ app_version: string;
52
+ sdk_version: string;
53
+ }
54
+ /**
55
+ * 页面浏览事件
56
+ */
57
+ interface PageViewEvent extends BaseEvent {
58
+ event_type: EventType.PAGE_VIEW;
59
+ page_url: string;
60
+ page_title: string;
61
+ duration?: number;
62
+ }
63
+ /**
64
+ * 点击事件
65
+ */
66
+ interface ClickEvent extends BaseEvent {
67
+ event_type: EventType.CLICK;
68
+ element_id?: string;
69
+ element_class?: string;
70
+ element_text?: string;
71
+ element_type?: string;
72
+ position?: {
73
+ x: number;
74
+ y: number;
75
+ };
76
+ }
77
+ /**
78
+ * 错误事件
79
+ */
80
+ interface ErrorEvent extends BaseEvent {
81
+ event_type: EventType.ERROR;
82
+ error_message: string;
83
+ error_stack?: string;
84
+ error_type?: string;
85
+ error_level?: 'warning' | 'error' | 'fatal';
86
+ }
87
+ /**
88
+ * 性能事件
89
+ */
90
+ interface PerformanceEvent extends BaseEvent {
91
+ event_type: EventType.PERFORMANCE;
92
+ metric_name: string;
93
+ metric_value: number;
94
+ metric_unit?: string;
95
+ }
96
+ /**
97
+ * API调用事件
98
+ */
99
+ interface ApiCallEvent extends BaseEvent {
100
+ event_type: EventType.API_CALL;
101
+ api_url: string;
102
+ api_method: string;
103
+ api_status?: number;
104
+ duration?: number;
105
+ success: boolean;
106
+ }
107
+ /**
108
+ * 所有事件类型联合
109
+ */
110
+ type AnalyticsEvent = BaseEvent | PageViewEvent | ClickEvent | ErrorEvent | PerformanceEvent | ApiCallEvent;
111
+ /**
112
+ * 事件上报配置
113
+ */
114
+ interface AnalyticsConfig {
115
+ appId: string;
116
+ appVersion: string;
117
+ endpoint: string;
118
+ platform?: string;
119
+ debug?: boolean;
120
+ batchSize?: number;
121
+ batchInterval?: number;
122
+ maxQueueSize?: number;
123
+ retryTimes?: number;
124
+ retryInterval?: number;
125
+ enableAutoPageView?: boolean;
126
+ enableAutoClick?: boolean;
127
+ enableAutoError?: boolean;
128
+ enableAutoPerformance?: boolean;
129
+ ignoreUrls?: string[];
130
+ ignoreErrors?: string[];
131
+ beforeSend?: (event: AnalyticsEvent) => AnalyticsEvent | null;
132
+ userId?: string;
133
+ customProperties?: Record<string, any>;
134
+ }
135
+ /**
136
+ * 设备信息接口
137
+ */
138
+ interface DeviceInfo {
139
+ device_id: string;
140
+ device_model?: string;
141
+ device_brand?: string;
142
+ os_name: string;
143
+ os_version: string;
144
+ screen_width: number;
145
+ screen_height: number;
146
+ language: string;
147
+ timezone: string;
148
+ network_type?: string;
149
+ carrier?: string;
150
+ }
151
+ /**
152
+ * 上报响应接口
153
+ */
154
+ interface UploadResponse {
155
+ success: boolean;
156
+ message?: string;
157
+ code?: number;
158
+ }
159
+ /**
160
+ * 存储适配器接口
161
+ */
162
+ interface AnalyticsStorageAdapter {
163
+ /**
164
+ * 保存事件到本地存储
165
+ */
166
+ saveEvents(events: AnalyticsEvent[]): Promise<void>;
167
+ /**
168
+ * 获取本地存储的事件
169
+ */
170
+ getEvents(): Promise<AnalyticsEvent[]>;
171
+ /**
172
+ * 清除本地存储的事件
173
+ */
174
+ clearEvents(): Promise<void>;
175
+ /**
176
+ * 保存设备信息
177
+ */
178
+ saveDeviceInfo(info: DeviceInfo): Promise<void>;
179
+ /**
180
+ * 获取设备信息
181
+ */
182
+ getDeviceInfo(): Promise<DeviceInfo | null>;
183
+ /**
184
+ * 保存会话ID
185
+ */
186
+ saveSessionId(sessionId: string): Promise<void>;
187
+ /**
188
+ * 获取会话ID
189
+ */
190
+ getSessionId(): Promise<string | null>;
191
+ }
192
+ /**
193
+ * 网络适配器接口
194
+ */
195
+ interface AnalyticsNetworkAdapter {
196
+ /**
197
+ * 上传事件数据
198
+ */
199
+ upload(url: string, events: AnalyticsEvent[]): Promise<UploadResponse>;
200
+ /**
201
+ * 检查网络连接状态
202
+ */
203
+ isOnline(): Promise<boolean>;
204
+ }
205
+ /**
206
+ * 设备信息适配器接口
207
+ */
208
+ interface AnalyticsDeviceAdapter {
209
+ /**
210
+ * 获取设备信息
211
+ */
212
+ getDeviceInfo(): Promise<DeviceInfo>;
213
+ /**
214
+ * 生成设备唯一ID
215
+ */
216
+ generateDeviceId(): Promise<string>;
217
+ }
218
+
219
+ /**
220
+ * 埋点系统核心类
221
+ * Analytics Core SDK
222
+ */
223
+
224
+ declare class Analytics {
225
+ private config;
226
+ private eventQueue;
227
+ private uploader;
228
+ private storageAdapter;
229
+ private networkAdapter;
230
+ private deviceAdapter;
231
+ private sessionId;
232
+ private deviceId;
233
+ private deviceInfo;
234
+ private initialized;
235
+ private batchTimer;
236
+ constructor(config: Omit<AnalyticsConfig, 'endpoint'> & {
237
+ adapter?: {
238
+ storage: AnalyticsStorageAdapter;
239
+ network: AnalyticsNetworkAdapter;
240
+ device: AnalyticsDeviceAdapter;
241
+ };
242
+ platform?: string;
243
+ serverUrl?: string;
244
+ endpoint?: string;
245
+ }, storageAdapter?: AnalyticsStorageAdapter, networkAdapter?: AnalyticsNetworkAdapter, deviceAdapter?: AnalyticsDeviceAdapter);
246
+ /**
247
+ * 初始化
248
+ */
249
+ init(): Promise<void>;
250
+ /**
251
+ * 追踪事件(简化版本,支持两种调用方式)
252
+ */
253
+ track(eventNameOrType: string | EventType, propertiesOrName?: Record<string, any> | string, maybeProperties?: Record<string, any>, priority?: EventPriority): void;
254
+ /**
255
+ * 追踪页面浏览
256
+ */
257
+ trackPageView(pageUrl: string, pageTitle: string, properties?: Record<string, any>): void;
258
+ /**
259
+ * 追踪点击事件
260
+ */
261
+ trackClick(elementInfo: {
262
+ elementId?: string;
263
+ elementClass?: string;
264
+ elementText?: string;
265
+ elementType?: string;
266
+ position?: {
267
+ x: number;
268
+ y: number;
269
+ };
270
+ }, properties?: Record<string, any>): void;
271
+ /**
272
+ * 追踪错误
273
+ */
274
+ trackError(errorMessage: string, errorStack?: string, errorType?: string, properties?: Record<string, any>): void;
275
+ /**
276
+ * 追踪性能指标
277
+ */
278
+ trackPerformance(metricName: string, metricValue: number, metricUnit?: string, properties?: Record<string, any>): void;
279
+ /**
280
+ * 追踪 API 调用
281
+ */
282
+ trackApiCall(apiUrl: string, apiMethod: string, apiStatus: number, duration: number, success: boolean, properties?: Record<string, any>): void;
283
+ /**
284
+ * 设置用户ID
285
+ */
286
+ setUserId(userId: string): void;
287
+ /**
288
+ * 设置用户信息(包括用户ID和其他属性)
289
+ */
290
+ setUser(userInfo: {
291
+ userId: string;
292
+ [key: string]: any;
293
+ }): void;
294
+ /**
295
+ * 设置自定义属性
296
+ */
297
+ setCustomProperties(properties: Record<string, any>): void;
298
+ /**
299
+ * 立即上传所有事件
300
+ */
301
+ flush(): Promise<void>;
302
+ /**
303
+ * 立即上传高优先级事件
304
+ */
305
+ private flushHighPriority;
306
+ /**
307
+ * 销毁实例
308
+ */
309
+ destroy(): Promise<void>;
310
+ /**
311
+ * 创建事件对象
312
+ */
313
+ private createEvent;
314
+ /**
315
+ * 初始化设备信息
316
+ */
317
+ private initDeviceInfo;
318
+ /**
319
+ * 初始化会话
320
+ */
321
+ private initSession;
322
+ /**
323
+ * 启动批量上传定时器
324
+ */
325
+ private startBatchTimer;
326
+ /**
327
+ * 上传成功回调
328
+ */
329
+ private onUploadSuccess;
330
+ /**
331
+ * 上传失败回调
332
+ */
333
+ private onUploadError;
334
+ /**
335
+ * 生成事件ID
336
+ */
337
+ private generateEventId;
338
+ /**
339
+ * 生成会话ID
340
+ */
341
+ private generateSessionId;
342
+ /**
343
+ * 获取平台标识
344
+ */
345
+ private getPlatform;
346
+ /**
347
+ * 日志输出
348
+ */
349
+ private log;
350
+ /**
351
+ * 获取队列状态
352
+ */
353
+ getQueueStatus(): {
354
+ size: number;
355
+ isFull: boolean;
356
+ isEmpty: boolean;
357
+ };
358
+ /**
359
+ * 获取初始化状态
360
+ */
361
+ isInitialized(): boolean;
362
+ }
363
+
364
+ /**
365
+ * 事件队列管理器
366
+ * Event Queue Manager
367
+ */
368
+
369
+ declare class EventQueue {
370
+ private queue;
371
+ private maxSize;
372
+ constructor(maxSize?: number);
373
+ /**
374
+ * 添加事件到队列
375
+ */
376
+ enqueue(event: AnalyticsEvent): void;
377
+ /**
378
+ * 批量添加事件
379
+ */
380
+ enqueueBatch(events: AnalyticsEvent[]): void;
381
+ /**
382
+ * 获取指定数量的事件
383
+ */
384
+ dequeue(count: number): AnalyticsEvent[];
385
+ /**
386
+ * 获取所有事件
387
+ */
388
+ dequeueAll(): AnalyticsEvent[];
389
+ /**
390
+ * 获取高优先级事件
391
+ */
392
+ getHighPriorityEvents(): AnalyticsEvent[];
393
+ /**
394
+ * 查看队列长度
395
+ */
396
+ size(): number;
397
+ /**
398
+ * 队列是否为空
399
+ */
400
+ isEmpty(): boolean;
401
+ /**
402
+ * 队列是否已满
403
+ */
404
+ isFull(): boolean;
405
+ /**
406
+ * 清空队列
407
+ */
408
+ clear(): void;
409
+ /**
410
+ * 移除最低优先级的事件
411
+ */
412
+ private removeLowestPriorityEvent;
413
+ /**
414
+ * 获取队列快照(不移除事件)
415
+ */
416
+ snapshot(): AnalyticsEvent[];
417
+ }
418
+
419
+ /**
420
+ * 事件上传器
421
+ * Event Uploader
422
+ */
423
+
424
+ interface UploaderConfig {
425
+ endpoint: string;
426
+ batchSize: number;
427
+ retryTimes: number;
428
+ retryInterval: number;
429
+ networkAdapter: AnalyticsNetworkAdapter;
430
+ storageAdapter: AnalyticsStorageAdapter;
431
+ onSuccess?: (events: AnalyticsEvent[]) => void;
432
+ onError?: (error: Error, events: AnalyticsEvent[]) => void;
433
+ }
434
+ declare class Uploader {
435
+ private config;
436
+ private uploading;
437
+ private retryQueue;
438
+ constructor(config: UploaderConfig);
439
+ /**
440
+ * 上传事件
441
+ */
442
+ upload(events: AnalyticsEvent[]): Promise<boolean>;
443
+ /**
444
+ * 批量上传
445
+ */
446
+ uploadBatch(events: AnalyticsEvent[]): Promise<boolean>;
447
+ /**
448
+ * 重试失败的上传
449
+ */
450
+ retryFailedUploads(): Promise<void>;
451
+ /**
452
+ * 上传本地缓存的事件
453
+ */
454
+ uploadCachedEvents(): Promise<void>;
455
+ /**
456
+ * 保存事件到本地存储
457
+ */
458
+ private saveToLocal;
459
+ /**
460
+ * 添加到重试队列
461
+ */
462
+ private addToRetryQueue;
463
+ /**
464
+ * 分割成批次
465
+ */
466
+ private splitIntoBatches;
467
+ /**
468
+ * 延迟函数
469
+ */
470
+ private delay;
471
+ /**
472
+ * 是否正在上传
473
+ */
474
+ isUploading(): boolean;
475
+ /**
476
+ * 获取重试队列大小
477
+ */
478
+ getRetryQueueSize(): number;
479
+ /**
480
+ * 清空重试队列
481
+ */
482
+ clearRetryQueue(): void;
483
+ }
484
+
485
+ /**
486
+ * Analytics 预设配置
487
+ * Analytics Preset Configurations
488
+ *
489
+ * 提供常见场景的配置模板(不包含平台适配器)
490
+ * 使用时需要提供具体的 adapter 实现
491
+ */
492
+
493
+ /**
494
+ * Web 应用基础配置模板
495
+ */
496
+ declare function createWebConfig(appId: string, options?: {
497
+ endpoint?: string;
498
+ debug?: boolean;
499
+ enableAutoPageView?: boolean;
500
+ appVersion?: string;
501
+ }): Partial<AnalyticsConfig>;
502
+ /**
503
+ * 移动应用基础配置模板
504
+ */
505
+ declare function createMobileConfig(appId: string, options?: {
506
+ endpoint?: string;
507
+ debug?: boolean;
508
+ appVersion?: string;
509
+ }): Partial<AnalyticsConfig>;
510
+ /**
511
+ * 小程序基础配置模板
512
+ */
513
+ declare function createMiniappConfig(appId: string, options?: {
514
+ endpoint?: string;
515
+ debug?: boolean;
516
+ appVersion?: string;
517
+ }): Partial<AnalyticsConfig>;
518
+ /**
519
+ * 桌面应用基础配置模板
520
+ */
521
+ declare function createDesktopConfig(appId: string, options?: {
522
+ endpoint?: string;
523
+ debug?: boolean;
524
+ appVersion?: string;
525
+ }): Partial<AnalyticsConfig>;
526
+
527
+ /**
528
+ * Analytics 单例管理器
529
+ * Analytics Singleton Manager
530
+ *
531
+ * 提供统一的单例创建和管理功能,支持多个独立实例
532
+ */
533
+
534
+ /**
535
+ * 创建或获取 Analytics 实例
536
+ * @param instanceKey 实例唯一标识
537
+ * @param config Analytics 配置
538
+ * @returns Analytics 实例
539
+ */
540
+ declare function createAnalytics(instanceKey: string, config: AnalyticsConfig): Analytics;
541
+ /**
542
+ * 获取已存在的 Analytics 实例
543
+ * @param instanceKey 实例唯一标识
544
+ * @returns Analytics 实例或 null
545
+ */
546
+ declare function getAnalyticsInstance(instanceKey: string): Analytics | null;
547
+ /**
548
+ * 重置指定实例
549
+ * @param instanceKey 实例唯一标识
550
+ */
551
+ declare function resetAnalytics(instanceKey: string): void;
552
+ /**
553
+ * 重置所有实例
554
+ */
555
+ declare function resetAllAnalytics(): void;
556
+ /**
557
+ * 检查实例是否已初始化
558
+ * @param instanceKey 实例唯一标识
559
+ */
560
+ declare function isAnalyticsInitialized(instanceKey: string): boolean;
561
+ /**
562
+ * 获取所有已创建的实例键名
563
+ */
564
+ declare function getAllInstanceKeys(): string[];
565
+
566
+ /**
567
+ * 埋点工具函数
568
+ * Analytics Helper Functions
569
+ */
570
+
571
+ /**
572
+ * 节流函数
573
+ */
574
+ declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
575
+ /**
576
+ * 防抖函数
577
+ */
578
+ declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
579
+ /**
580
+ * 格式化事件数据
581
+ */
582
+ declare function formatEvent(event: AnalyticsEvent): string;
583
+ /**
584
+ * 验证事件数据
585
+ */
586
+ declare function validateEvent(event: AnalyticsEvent): boolean;
587
+ /**
588
+ * 批量验证事件
589
+ */
590
+ declare function validateEvents(events: AnalyticsEvent[]): {
591
+ valid: AnalyticsEvent[];
592
+ invalid: AnalyticsEvent[];
593
+ };
594
+ /**
595
+ * 计算事件大小(字节)
596
+ */
597
+ declare function getEventSize(event: AnalyticsEvent): number;
598
+ /**
599
+ * 计算批量事件大小
600
+ */
601
+ declare function getBatchSize(events: AnalyticsEvent[]): number;
602
+ /**
603
+ * 过滤敏感信息
604
+ */
605
+ declare function sanitizeEvent(event: AnalyticsEvent, sensitiveKeys?: string[]): AnalyticsEvent;
606
+ /**
607
+ * 合并事件属性
608
+ */
609
+ declare function mergeEventProperties(baseProperties: Record<string, any>, ...additionalProperties: Record<string, any>[]): Record<string, any>;
610
+ /**
611
+ * 生成唯一ID
612
+ */
613
+ declare function generateUniqueId(prefix?: string): string;
614
+ /**
615
+ * 判断是否为移动设备
616
+ */
617
+ declare function isMobile(): boolean;
618
+ /**
619
+ * 判断是否为开发环境
620
+ */
621
+ declare function isDevelopment(): boolean;
622
+ /**
623
+ * 格式化时间戳
624
+ */
625
+ declare function formatTimestamp(timestamp: number, format?: 'date' | 'datetime' | 'time'): string;
626
+ /**
627
+ * 深拷贝对象
628
+ */
629
+ declare function deepClone<T>(obj: T): T;
630
+ /**
631
+ * 安全的 JSON.stringify
632
+ */
633
+ declare function safeStringify(obj: any, fallback?: string): string;
634
+ /**
635
+ * 安全的 JSON.parse
636
+ */
637
+ declare function safeParse<T>(json: string, fallback: T): T;
638
+ /**
639
+ * 获取页面停留时长
640
+ */
641
+ declare function getPageDuration(startTime: number): number;
642
+ /**
643
+ * 获取当前页面 URL
644
+ */
645
+ declare function getCurrentPageUrl(): string;
646
+ /**
647
+ * 获取当前页面标题
648
+ */
649
+ declare function getCurrentPageTitle(): string;
650
+ /**
651
+ * 获取来源页面
652
+ */
653
+ declare function getReferrer(): string;
654
+
655
+ /**
656
+ * 埋点装饰器
657
+ * Analytics Decorators
658
+ */
659
+
660
+ /**
661
+ * 追踪方法执行
662
+ * @param eventName 事件名称
663
+ * @param priority 事件优先级
664
+ */
665
+ declare function Track(eventName?: string, priority?: EventPriority): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
666
+ /**
667
+ * 追踪点击事件
668
+ */
669
+ declare function TrackClick(eventName?: string): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
670
+ /**
671
+ * 追踪性能
672
+ */
673
+ declare function TrackPerformance(metricName?: string): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
674
+ /**
675
+ * 自动捕获错误
676
+ */
677
+ declare function CatchError(_eventName?: string): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
678
+ /**
679
+ * 设置全局 Analytics 实例
680
+ */
681
+ declare function setGlobalAnalytics(analytics: Analytics): void;
682
+ /**
683
+ * 获取全局 Analytics 实例
684
+ */
685
+ declare function getGlobalAnalytics(): Analytics | null;
686
+
687
+ /**
688
+ * 使用埋点实例
689
+ */
690
+ declare function useAnalytics(analytics: Analytics | null): Analytics | null;
691
+ /**
692
+ * 追踪页面浏览
693
+ */
694
+ declare function usePageView(analytics: Analytics | null, pageUrl?: string, pageTitle?: string): void;
695
+ /**
696
+ * 追踪事件(返回追踪函数)
697
+ */
698
+ declare function useTrackEvent(analytics: Analytics | null): (eventType: EventType, eventName: string, properties?: Record<string, any>, priority?: EventPriority) => void;
699
+ /**
700
+ * 追踪点击事件
701
+ */
702
+ declare function useTrackClick(analytics: Analytics | null): (elementInfo: {
703
+ elementId?: string;
704
+ elementClass?: string;
705
+ elementText?: string;
706
+ elementType?: string;
707
+ }) => void;
708
+ /**
709
+ * 追踪页面停留时长
710
+ */
711
+ declare function usePageDuration(analytics: Analytics | null): void;
712
+ /**
713
+ * 追踪性能指标
714
+ */
715
+ declare function usePerformanceTracking(analytics: Analytics | null): void;
716
+ /**
717
+ * 追踪错误
718
+ */
719
+ declare function useErrorTracking(analytics: Analytics | null): void;
720
+ /**
721
+ * 自动追踪用户行为(综合 Hook)
722
+ */
723
+ declare function useAutoTracking(analytics: Analytics | null, options?: {
724
+ trackPageView?: boolean;
725
+ trackPageDuration?: boolean;
726
+ trackPerformance?: boolean;
727
+ trackErrors?: boolean;
728
+ }): void;
729
+
730
+ /**
731
+ * Analytics 埋点分析模块
732
+ *
733
+ * 提供完整的事件追踪、用户行为分析、数据上报等功能
734
+ *
735
+ * 注意:此模块不包含平台特定的适配器(web/mobile/desktop/miniapp)
736
+ * 如需使用平台适配器,请在项目中自行实现
737
+ */
738
+
739
+ declare const ANALYTICS_VERSION = "1.0.0";
740
+
741
+ export { ANALYTICS_VERSION, Analytics, type AnalyticsConfig, type AnalyticsDeviceAdapter, type AnalyticsEvent, type AnalyticsNetworkAdapter, type AnalyticsStorageAdapter, type ApiCallEvent, type BaseEvent, CatchError, type ClickEvent, type DeviceInfo, type ErrorEvent, EventPriority, EventQueue, EventType, type PageViewEvent, type PerformanceEvent, Track, TrackClick, TrackPerformance, type UploadResponse, Uploader, createAnalytics, createDesktopConfig, createMiniappConfig, createMobileConfig, createWebConfig, debounce, deepClone, formatEvent, formatTimestamp, generateUniqueId, getAllInstanceKeys, getAnalyticsInstance, getBatchSize, getCurrentPageTitle, getCurrentPageUrl, getEventSize, getGlobalAnalytics, getPageDuration, getReferrer, isAnalyticsInitialized, isDevelopment, isMobile, mergeEventProperties, resetAllAnalytics, resetAnalytics, safeParse, safeStringify, sanitizeEvent, setGlobalAnalytics, throttle, useAnalytics, useAutoTracking, useErrorTracking, usePageDuration, usePageView, usePerformanceTracking, useTrackClick, useTrackEvent, validateEvent, validateEvents };