28 lines
695 B
TypeScript
28 lines
695 B
TypeScript
/**
|
|
* IMetricsRepository 接口
|
|
*
|
|
* 对齐 Dart 端 `MetricsRepository` 抽象(lib/data/repositories/metrics_repository.dart):
|
|
* - 纯远程 fire-and-forget 上报,无本地状态
|
|
*
|
|
*
|
|
*/
|
|
|
|
import type { Result } from "@/utils/result";
|
|
|
|
export interface IMetricsRepository {
|
|
/** 上报 PWA 事件。自动注入当前秒级时间戳。 */
|
|
reportPwaEvent(input: {
|
|
deviceId: string;
|
|
deviceType: string;
|
|
pwaInstalled: boolean;
|
|
pwaSupported: boolean;
|
|
}): Promise<Result<void>>;
|
|
|
|
/** 上报用户环境信息(浏览器、UA 等)。 */
|
|
reportUserInfo(input: {
|
|
userId: string;
|
|
browser: string;
|
|
userAgent: string;
|
|
}): Promise<Result<void>>;
|
|
}
|