Files
18xchat/assets/Scripts/Main/Channel/core/IAnalyticsSDK.ts
T
2025-09-26 17:34:07 +08:00

31 lines
910 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 分析统计 SDK 接口
*
* - 分析/统计 SDK 的通用接口
* - 用于事件上报(例如:友盟、Google Analytics、Mixpanel
* - 所有分析 SDK 都应该实现这些方法
*/
import { ISDK } from "./ISDK";
export interface IAnalyticsSDK extends ISDK {
/**
* 判断统计功能是否可用
* @returns {boolean} true 表示启用,false 表示禁用
*
* - 不同环境下可能有不同表现(如 Test 环境默认关闭)
* - SDK 初始化失败时也可能返回 false
*/
isAnalyticsEnabled(): boolean;
/**
* 上报事件
* @param eventName 事件名称
* @param value 事件参数(可选)
*
* - 常用于埋点上报,例如:关卡完成、按钮点击
* - 不同 SDK 内部实现方式可能不同(友盟、Firebase、GA)
*/
trackEvent(eventName: string, value?: any): void;
}