mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
adding report analytics (#30404)
This commit is contained in:
committed by
Pranav Senthilnathan
parent
696ea3460b
commit
72061aed07
20
types/weixin-app/index.d.ts
vendored
20
types/weixin-app/index.d.ts
vendored
@@ -3559,19 +3559,19 @@ declare namespace wx {
|
||||
/**
|
||||
* 写log日志,可以提供任意个参数,每个参数的类型为Object/Array/Number/String,参数p1到pN的内容会写入日志
|
||||
*/
|
||||
log: (...args: any[]) => void;
|
||||
log(...args: any[]): void;
|
||||
/**
|
||||
* 写warn日志,参数同log方法
|
||||
*/
|
||||
warn: (...args: any[]) => void;
|
||||
warn(...args: any[]): void;
|
||||
/**
|
||||
* 写debug日志,参数同log方法
|
||||
*/
|
||||
debug: (...args: any[]) => void;
|
||||
debug(...args: any[]): void;
|
||||
/**
|
||||
* 写info日志,参数同log方法
|
||||
*/
|
||||
info: (...args: any[]) => void;
|
||||
info(...args: any[]): void;
|
||||
}
|
||||
|
||||
// #region LogManager
|
||||
@@ -3592,6 +3592,14 @@ declare namespace wx {
|
||||
*/
|
||||
function reportMonitor(name: string, value: number): void;
|
||||
|
||||
/**
|
||||
* 自定义分析数据上报接口。使用前,需要在小程序管理后台自定义分析中新建事件,配置好事件名与字段。
|
||||
*
|
||||
* @param eventName 事件名
|
||||
* @param data 上报的自定义数据
|
||||
*/
|
||||
function reportAnalytics(eventName: string, data: object): void;
|
||||
|
||||
/**
|
||||
* 用于延迟一部分操作到下一个时间片再执行(类似于 setTimeout)。
|
||||
* @param func
|
||||
@@ -3887,7 +3895,9 @@ declare namespace wx {
|
||||
value?: infer T;
|
||||
}
|
||||
? T
|
||||
: Def extends (...args: any[]) => infer T ? T : never;
|
||||
: Def extends (...args: any[]) => infer T
|
||||
? T
|
||||
: never;
|
||||
|
||||
/**
|
||||
* Component实例方法
|
||||
|
||||
@@ -474,3 +474,5 @@ function testAccountInfo(): string {
|
||||
const accountInfo: wx.AccountInfo = wx.getAccountInfoSync();
|
||||
return accountInfo.miniProgram.appId;
|
||||
}
|
||||
|
||||
wx.reportAnalytics("test-event", { a: 1, b: "2" });
|
||||
|
||||
Reference in New Issue
Block a user