@fle-sdk/event-tracking-web 1.2.0-beta.0 → 1.2.0
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.
- package/README.md +340 -112
- package/lib/index.esm.js +1979 -16
- package/lib/index.esm.min.js +1 -0
- package/lib/index.js +1987 -16
- package/lib/index.min.js +1 -0
- package/lib/types/index.d.ts +132 -85
- package/lib/types/tools.d.ts +209 -109
- package/lib/types/type.d.ts +466 -228
- package/package.json +9 -6
- package/lib/index.ems.js +0 -16
- package/lib/index.ems.js.map +0 -1
- package/lib/index.esm.js.map +0 -1
- package/lib/index.js.map +0 -1
package/lib/types/type.d.ts
CHANGED
|
@@ -1,228 +1,466 @@
|
|
|
1
|
-
export interface Target extends Window {
|
|
2
|
-
/**
|
|
3
|
-
* @description 自定义扩展取消监听函数
|
|
4
|
-
* @default
|
|
5
|
-
*/
|
|
6
|
-
detachEvent?: (type: string, fun: (event: Event) => void, bol: boolean) => void;
|
|
7
|
-
/**
|
|
8
|
-
* @description 自定义扩展添加监听函数
|
|
9
|
-
* @default
|
|
10
|
-
*/
|
|
11
|
-
attachEvent?: (type: string, fun: (event: Event) => void, bol: boolean) => void;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* @
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @description
|
|
52
|
-
* @default
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @description
|
|
57
|
-
* @default
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @description
|
|
62
|
-
* @default
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @description
|
|
67
|
-
* @default
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @description
|
|
72
|
-
* @default
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
* @
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* @description
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* @
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
* @
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* @
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @description
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* @description
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @description
|
|
187
|
-
*/
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* @description
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* @description
|
|
195
|
-
*/
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @description
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* @description
|
|
203
|
-
*/
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
1
|
+
export interface Target extends Window {
|
|
2
|
+
/**
|
|
3
|
+
* @description 自定义扩展取消监听函数
|
|
4
|
+
* @default
|
|
5
|
+
*/
|
|
6
|
+
detachEvent?: (type: string, fun: (event: Event) => void, bol: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* @description 自定义扩展添加监听函数
|
|
9
|
+
* @default
|
|
10
|
+
*/
|
|
11
|
+
attachEvent?: (type: string, fun: (event: Event) => void, bol: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare type ContentType = "application/x-www-form-urlencoded" | "application/json";
|
|
14
|
+
export interface EventParams extends Event {
|
|
15
|
+
/**
|
|
16
|
+
* @description 重写添加 arguments
|
|
17
|
+
* @default
|
|
18
|
+
*/
|
|
19
|
+
arguments?: IArguments | unknown[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @description JSON对象类型,支持嵌套对象和基本类型
|
|
23
|
+
* 使用 Record 类型以支持更灵活的值类型
|
|
24
|
+
* 先定义 JsonProps,避免在 JsonValue 中直接循环引用
|
|
25
|
+
*/
|
|
26
|
+
export interface JsonProps extends Record<string, JsonValue | unknown> {
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @description JSON值类型,支持所有可序列化的值
|
|
30
|
+
* 包含基本类型、JsonProps 对象和 JsonValue 数组
|
|
31
|
+
*/
|
|
32
|
+
export declare type JsonValue = string | number | boolean | null | undefined | JsonProps | JsonValue[];
|
|
33
|
+
/**
|
|
34
|
+
* @description 事件类型
|
|
35
|
+
*/
|
|
36
|
+
export declare type EventTypes = "PageView" | "PageRetained" | "CustomTrack" | "WebClick";
|
|
37
|
+
export interface PresetParams {
|
|
38
|
+
/**
|
|
39
|
+
* @description 应用唯一标识(由接口生成)
|
|
40
|
+
*/
|
|
41
|
+
appKey?: string;
|
|
42
|
+
/**
|
|
43
|
+
* @description 数据接收地址
|
|
44
|
+
*/
|
|
45
|
+
serverUrl?: string;
|
|
46
|
+
/**
|
|
47
|
+
* @description 手动指定客户端平台类型(h5、pc、ipad、other)
|
|
48
|
+
*/
|
|
49
|
+
platform?: PlatformType | string;
|
|
50
|
+
/**
|
|
51
|
+
* @description 是否在网页控制台打印发送的数据
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
showLog?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* @description 是否开启全埋点 指的是:页面浏览、元素点击事件自动上报
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
autoTrack?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* @description (是否使用客户端系统时间)注意:客户端系统时间可能会不准确,导致该字段不准确
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
useClientTime?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* @description 接口发送超时时长,超过该时长未发送成功将强制取消,单位:毫秒
|
|
67
|
+
* @default 3000
|
|
68
|
+
*/
|
|
69
|
+
sendTimeout?: number;
|
|
70
|
+
/**
|
|
71
|
+
* @description 是否采集单页面应用的路由变化
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
isTrackSinglePage?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* @description 数据类型
|
|
77
|
+
* @default "application/json"
|
|
78
|
+
*/
|
|
79
|
+
contentType?: ContentType;
|
|
80
|
+
/**
|
|
81
|
+
* @description 全局自定义业务参数
|
|
82
|
+
* @default {}
|
|
83
|
+
*/
|
|
84
|
+
business?: JsonProps;
|
|
85
|
+
/**
|
|
86
|
+
* @description 请求头
|
|
87
|
+
* @default {}
|
|
88
|
+
*/
|
|
89
|
+
header?: JsonProps;
|
|
90
|
+
/**
|
|
91
|
+
* @description 数据采样率,0-1之间,1表示100%采样
|
|
92
|
+
* @default 1
|
|
93
|
+
*/
|
|
94
|
+
sampleRate?: number;
|
|
95
|
+
/**
|
|
96
|
+
* @description 是否启用批量发送
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
batchSend?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* @description 批量发送间隔时间(ms)
|
|
102
|
+
* @default 5000
|
|
103
|
+
*/
|
|
104
|
+
batchInterval?: number;
|
|
105
|
+
/**
|
|
106
|
+
* @description 批量发送最大数量
|
|
107
|
+
* @default 10
|
|
108
|
+
*/
|
|
109
|
+
batchMaxSize?: number;
|
|
110
|
+
}
|
|
111
|
+
export interface InitParams extends PresetParams {
|
|
112
|
+
/**
|
|
113
|
+
* @description 应用唯一标识(由接口生成)
|
|
114
|
+
*/
|
|
115
|
+
appKey: string;
|
|
116
|
+
/**
|
|
117
|
+
* @description 数据接收地址
|
|
118
|
+
*/
|
|
119
|
+
serverUrl: string;
|
|
120
|
+
}
|
|
121
|
+
export declare type PlatformType = "h5" | "pc" | "ipad" | "other";
|
|
122
|
+
export interface SystemsInfoTypes {
|
|
123
|
+
language?: string;
|
|
124
|
+
/**
|
|
125
|
+
* 网络类型
|
|
126
|
+
*/
|
|
127
|
+
network?: string;
|
|
128
|
+
ua?: string;
|
|
129
|
+
/**
|
|
130
|
+
* @description 客户端(Mac/Android/iPhone/iPad/iPod/WeChat)
|
|
131
|
+
*/
|
|
132
|
+
client?: string;
|
|
133
|
+
/**
|
|
134
|
+
* @description 客户端平台类型(h5、pc、ipad)
|
|
135
|
+
*/
|
|
136
|
+
platform?: PlatformType | string;
|
|
137
|
+
}
|
|
138
|
+
export interface TrackParams {
|
|
139
|
+
/**
|
|
140
|
+
* @description 控件/自定义事件的唯一标识
|
|
141
|
+
*/
|
|
142
|
+
partkey: string | number;
|
|
143
|
+
/**
|
|
144
|
+
* @description 自定义代码埋点描述
|
|
145
|
+
* @default "自定义代码埋点上报"
|
|
146
|
+
*/
|
|
147
|
+
desc?: string;
|
|
148
|
+
/**
|
|
149
|
+
* @description 自定义业务参数
|
|
150
|
+
* @default {}
|
|
151
|
+
*/
|
|
152
|
+
business?: JsonProps;
|
|
153
|
+
/**
|
|
154
|
+
* @description 请求头
|
|
155
|
+
* @default {}
|
|
156
|
+
*/
|
|
157
|
+
header?: JsonProps;
|
|
158
|
+
}
|
|
159
|
+
export interface TargetEleProps {
|
|
160
|
+
/**
|
|
161
|
+
* @description dom节点名称
|
|
162
|
+
*/
|
|
163
|
+
nodeName?: string;
|
|
164
|
+
/**
|
|
165
|
+
* @description id类名
|
|
166
|
+
*/
|
|
167
|
+
id?: string;
|
|
168
|
+
/**
|
|
169
|
+
* @description class类名
|
|
170
|
+
*/
|
|
171
|
+
className?: string;
|
|
172
|
+
/**
|
|
173
|
+
* @description 元素触发位置:[x, y]
|
|
174
|
+
*/
|
|
175
|
+
position?: [number, number];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* @description 基础系统信息
|
|
179
|
+
*/
|
|
180
|
+
export interface PrivateParamProps {
|
|
181
|
+
/**
|
|
182
|
+
* @description 当前URL
|
|
183
|
+
*/
|
|
184
|
+
currentUrl?: string;
|
|
185
|
+
/**
|
|
186
|
+
* @description 目标URL
|
|
187
|
+
*/
|
|
188
|
+
targetUrl?: string;
|
|
189
|
+
/**
|
|
190
|
+
* @description 手动埋点参数
|
|
191
|
+
*/
|
|
192
|
+
business?: JsonProps;
|
|
193
|
+
/**
|
|
194
|
+
* @description 触发元素属性
|
|
195
|
+
*/
|
|
196
|
+
targetEle?: TargetEleProps;
|
|
197
|
+
/**
|
|
198
|
+
* @description 页面可视区宽度
|
|
199
|
+
*/
|
|
200
|
+
pageWidth?: number;
|
|
201
|
+
/**
|
|
202
|
+
* @description 页面可视区高度
|
|
203
|
+
*/
|
|
204
|
+
pageHeight?: number;
|
|
205
|
+
/**
|
|
206
|
+
* @description 显示屏宽度
|
|
207
|
+
*/
|
|
208
|
+
screenWidth?: number;
|
|
209
|
+
/**
|
|
210
|
+
* @description 显示屏高度
|
|
211
|
+
*/
|
|
212
|
+
screenHeight?: number;
|
|
213
|
+
/**
|
|
214
|
+
* @description 手动触发的指针类型
|
|
215
|
+
*/
|
|
216
|
+
pointerType?: PointerType;
|
|
217
|
+
/**
|
|
218
|
+
* @description 触发元素链路
|
|
219
|
+
*/
|
|
220
|
+
elementSelector?: string;
|
|
221
|
+
/**
|
|
222
|
+
* @description 用户信息
|
|
223
|
+
*/
|
|
224
|
+
userInfo?: JsonProps;
|
|
225
|
+
/**
|
|
226
|
+
* @description 路由参数
|
|
227
|
+
*/
|
|
228
|
+
urlParams?: JsonProps;
|
|
229
|
+
/**
|
|
230
|
+
* @description 系统信息
|
|
231
|
+
*/
|
|
232
|
+
systemsInfo?: SystemsInfoTypes;
|
|
233
|
+
/**
|
|
234
|
+
* @description SDk版本
|
|
235
|
+
*/
|
|
236
|
+
sdkVersion?: string;
|
|
237
|
+
/**
|
|
238
|
+
* @description 页面停留时长(毫秒)
|
|
239
|
+
*/
|
|
240
|
+
retainedDuration?: number;
|
|
241
|
+
/**
|
|
242
|
+
* @description 设备唯一标识
|
|
243
|
+
*/
|
|
244
|
+
deviceId?: string;
|
|
245
|
+
}
|
|
246
|
+
export interface TrackingPostParams {
|
|
247
|
+
/**
|
|
248
|
+
* @description 事件类型
|
|
249
|
+
*/
|
|
250
|
+
event: EventTypes;
|
|
251
|
+
/**
|
|
252
|
+
* @description 埋点事件描述
|
|
253
|
+
*/
|
|
254
|
+
desc: string;
|
|
255
|
+
/**
|
|
256
|
+
* @description 当前埋点事件Key
|
|
257
|
+
*/
|
|
258
|
+
itemKey?: string;
|
|
259
|
+
/**
|
|
260
|
+
* @description 发送请求时间戳(毫秒)
|
|
261
|
+
*/
|
|
262
|
+
requestTime?: number;
|
|
263
|
+
/**
|
|
264
|
+
* @description 私有参数
|
|
265
|
+
*/
|
|
266
|
+
privateParamMap?: PrivateParamProps;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @description 获取参数选项接口
|
|
270
|
+
*/
|
|
271
|
+
export interface GetParamsOptions {
|
|
272
|
+
event: EventTypes;
|
|
273
|
+
desc: string;
|
|
274
|
+
privateParamMap?: PrivateParamProps;
|
|
275
|
+
itemKey?: string;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @description Ajax请求参数接口
|
|
279
|
+
*/
|
|
280
|
+
export interface AjaxParams {
|
|
281
|
+
type?: HttpMethod;
|
|
282
|
+
url: string;
|
|
283
|
+
data?: string;
|
|
284
|
+
contentType?: ContentType;
|
|
285
|
+
header?: JsonProps;
|
|
286
|
+
success?: (data: JsonProps) => void;
|
|
287
|
+
error?: (err?: Error | JsonProps, status?: number) => void;
|
|
288
|
+
timeout?: number;
|
|
289
|
+
credentials?: boolean;
|
|
290
|
+
cors?: boolean;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* @description SendBeacon参数接口
|
|
294
|
+
*/
|
|
295
|
+
export interface SendBeaconParams {
|
|
296
|
+
url: string;
|
|
297
|
+
data: TrackingPostParams | JsonProps;
|
|
298
|
+
contentType: ContentType;
|
|
299
|
+
}
|
|
300
|
+
export declare type HistoryType = "load" | "beforeunload" | "pushState" | "replaceState" | "popstate" | "hashchange";
|
|
301
|
+
/**
|
|
302
|
+
* @description HTTP请求方法类型
|
|
303
|
+
*/
|
|
304
|
+
export declare type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
305
|
+
/**
|
|
306
|
+
* @description 指针设备类型
|
|
307
|
+
*/
|
|
308
|
+
export declare type PointerType = "mouse" | "touch" | "pen";
|
|
309
|
+
/**
|
|
310
|
+
* @description 网络连接类型
|
|
311
|
+
*/
|
|
312
|
+
export declare type NetworkConnectionType = "slow-2g" | "2g" | "3g" | "4g" | "5g";
|
|
313
|
+
/**
|
|
314
|
+
* @description 网络连接信息接口
|
|
315
|
+
*/
|
|
316
|
+
export interface NetworkConnection {
|
|
317
|
+
effectiveType?: NetworkConnectionType;
|
|
318
|
+
downlink?: number;
|
|
319
|
+
rtt?: number;
|
|
320
|
+
saveData?: boolean;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* @description 浏览器信息接口
|
|
324
|
+
*/
|
|
325
|
+
export interface BrowserInfo {
|
|
326
|
+
name: string;
|
|
327
|
+
version: number;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* @description 响应结果接口
|
|
331
|
+
*/
|
|
332
|
+
export interface TrackingResponse {
|
|
333
|
+
success: boolean;
|
|
334
|
+
message?: string;
|
|
335
|
+
data?: JsonProps;
|
|
336
|
+
code?: number;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* @description 批量发送数据格式
|
|
340
|
+
*/
|
|
341
|
+
export interface BatchTrackingData {
|
|
342
|
+
events: TrackingPostParams[];
|
|
343
|
+
timestamp?: number;
|
|
344
|
+
deviceId?: string;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* @description 工具类型:将对象的所有属性变为必需
|
|
348
|
+
*/
|
|
349
|
+
export declare type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
350
|
+
/**
|
|
351
|
+
* @description 工具类型:将对象的所有属性变为可选
|
|
352
|
+
*/
|
|
353
|
+
export declare type PartialFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
354
|
+
/**
|
|
355
|
+
* @description 工具类型:深度只读
|
|
356
|
+
*/
|
|
357
|
+
export declare type DeepReadonly<T> = {
|
|
358
|
+
readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* @description 工具类型:深度部分
|
|
362
|
+
*/
|
|
363
|
+
export declare type DeepPartial<T> = {
|
|
364
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* @description 工具类型:提取函数参数类型
|
|
368
|
+
*/
|
|
369
|
+
export declare type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;
|
|
370
|
+
/**
|
|
371
|
+
* @description 工具类型:提取函数返回类型
|
|
372
|
+
*/
|
|
373
|
+
export declare type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
|
|
374
|
+
/**
|
|
375
|
+
* @description 设备指纹信息
|
|
376
|
+
*/
|
|
377
|
+
export interface DeviceFingerprint {
|
|
378
|
+
/**
|
|
379
|
+
* @description 用户代理字符串
|
|
380
|
+
*/
|
|
381
|
+
userAgent?: string;
|
|
382
|
+
/**
|
|
383
|
+
* @description 屏幕宽度
|
|
384
|
+
*/
|
|
385
|
+
screenWidth?: number;
|
|
386
|
+
/**
|
|
387
|
+
* @description 屏幕高度
|
|
388
|
+
*/
|
|
389
|
+
screenHeight?: number;
|
|
390
|
+
/**
|
|
391
|
+
* @description 颜色深度
|
|
392
|
+
*/
|
|
393
|
+
colorDepth?: number;
|
|
394
|
+
/**
|
|
395
|
+
* @description 像素深度
|
|
396
|
+
*/
|
|
397
|
+
pixelDepth?: number;
|
|
398
|
+
/**
|
|
399
|
+
* @description 时区
|
|
400
|
+
*/
|
|
401
|
+
timezone?: string;
|
|
402
|
+
/**
|
|
403
|
+
* @description 时区偏移
|
|
404
|
+
*/
|
|
405
|
+
timezoneOffset?: number;
|
|
406
|
+
/**
|
|
407
|
+
* @description 浏览器语言
|
|
408
|
+
*/
|
|
409
|
+
language?: string;
|
|
410
|
+
/**
|
|
411
|
+
* @description 支持的语言列表
|
|
412
|
+
*/
|
|
413
|
+
languages?: string[];
|
|
414
|
+
/**
|
|
415
|
+
* @description 平台信息
|
|
416
|
+
*/
|
|
417
|
+
platform?: string;
|
|
418
|
+
/**
|
|
419
|
+
* @description WebGL指纹
|
|
420
|
+
*/
|
|
421
|
+
webgl?: string;
|
|
422
|
+
/**
|
|
423
|
+
* @description Canvas指纹
|
|
424
|
+
*/
|
|
425
|
+
canvas?: string;
|
|
426
|
+
/**
|
|
427
|
+
* @description 音频指纹
|
|
428
|
+
*/
|
|
429
|
+
audio?: string;
|
|
430
|
+
/**
|
|
431
|
+
* @description 字体指纹
|
|
432
|
+
*/
|
|
433
|
+
fonts?: string;
|
|
434
|
+
/**
|
|
435
|
+
* @description 插件指纹
|
|
436
|
+
*/
|
|
437
|
+
plugins?: string;
|
|
438
|
+
/**
|
|
439
|
+
* @description 是否支持localStorage
|
|
440
|
+
*/
|
|
441
|
+
localStorage?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* @description 是否支持sessionStorage
|
|
444
|
+
*/
|
|
445
|
+
sessionStorage?: boolean;
|
|
446
|
+
/**
|
|
447
|
+
* @description 是否支持IndexedDB
|
|
448
|
+
*/
|
|
449
|
+
indexedDB?: boolean;
|
|
450
|
+
/**
|
|
451
|
+
* @description CPU核心数
|
|
452
|
+
*/
|
|
453
|
+
hardwareConcurrency?: number;
|
|
454
|
+
/**
|
|
455
|
+
* @description 设备内存(GB)
|
|
456
|
+
*/
|
|
457
|
+
deviceMemory?: number;
|
|
458
|
+
/**
|
|
459
|
+
* @description 最大触摸点数
|
|
460
|
+
*/
|
|
461
|
+
maxTouchPoints?: number;
|
|
462
|
+
/**
|
|
463
|
+
* @description 网络连接信息
|
|
464
|
+
*/
|
|
465
|
+
connection?: string | NetworkConnection;
|
|
466
|
+
}
|