posthog-js 1.428.8 → 1.428.9
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/LICENSE +64 -0
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.d.ts +1 -0
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/lazy-recorder.js.map +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -1
- package/dist/module.d.ts +1 -0
- package/dist/module.full.d.ts +1 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +1 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.no-external.d.ts +1 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.d.ts +1 -0
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.d.ts +577 -653
- package/dist/posthog-recorder.js +1 -1
- package/dist/posthog-recorder.js.map +1 -1
- package/dist/recorder.d.ts +577 -653
- package/dist/rrweb-plugin-console-record.d.ts +436 -500
- package/dist/rrweb-types.d.ts +688 -735
- package/dist/rrweb.d.ts +1303 -1433
- package/dist/src/entrypoints/rrweb-types.es.d.ts +9 -0
- package/dist/src/extensions/replay/types/rrweb-types.d.ts +1 -0
- package/lib/package.json +1 -1
- package/lib/src/entrypoints/rrweb-types.es.d.ts +9 -0
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js +12 -2
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -1
- package/lib/src/extensions/replay/types/rrweb-types.d.ts +1 -0
- package/lib/src/extensions/replay/types/rrweb-types.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,507 +1,443 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
CDATA = 4,
|
|
315
|
-
Comment = 5
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
declare type pluginEvent<T = unknown> = {
|
|
319
|
-
type: EventType.Plugin;
|
|
320
|
-
data: {
|
|
321
|
-
plugin: string;
|
|
322
|
-
payload: T;
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
declare enum PointerTypes {
|
|
327
|
-
Mouse = 0,
|
|
328
|
-
Pen = 1,
|
|
329
|
-
Touch = 2
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
declare type RecordPlugin<TOptions = unknown> = {
|
|
333
|
-
name: string;
|
|
334
|
-
observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
|
|
335
|
-
eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
|
|
336
|
-
getMirror?: (mirrors: {
|
|
337
|
-
nodeMirror: IMirror<Node>;
|
|
338
|
-
crossOriginIframeMirror: ICrossOriginIframeMirror;
|
|
339
|
-
crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
|
|
340
|
-
}) => void;
|
|
341
|
-
options: TOptions;
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
declare type removedNodeMutation = {
|
|
345
|
-
parentId: number;
|
|
346
|
-
id: number;
|
|
347
|
-
isShadow?: boolean;
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
declare type scrollData = {
|
|
351
|
-
source: IncrementalSource.Scroll;
|
|
352
|
-
} & scrollPosition;
|
|
353
|
-
|
|
354
|
-
declare type scrollPosition = {
|
|
355
|
-
id: number;
|
|
356
|
-
x: number;
|
|
357
|
-
y: number;
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
declare type selectionData = {
|
|
361
|
-
source: IncrementalSource.Selection;
|
|
362
|
-
} & selectionParam;
|
|
363
|
-
|
|
364
|
-
declare type selectionParam = {
|
|
365
|
-
ranges: Array<SelectionRange>;
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
declare type SelectionRange = {
|
|
369
|
-
start: number;
|
|
370
|
-
startOffset: number;
|
|
371
|
-
end: number;
|
|
372
|
-
endOffset: number;
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
declare type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
376
|
-
rootId?: number;
|
|
377
|
-
isShadowHost?: boolean;
|
|
378
|
-
isShadow?: boolean;
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
declare type serializedNodeWithId = serializedNode & {
|
|
382
|
-
id: number;
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
declare type styleDeclarationData = {
|
|
386
|
-
source: IncrementalSource.StyleDeclaration;
|
|
387
|
-
} & styleDeclarationParam;
|
|
388
|
-
|
|
389
|
-
declare type styleDeclarationParam = {
|
|
390
|
-
id?: number;
|
|
391
|
-
styleId?: number;
|
|
392
|
-
index: number[];
|
|
393
|
-
set?: {
|
|
394
|
-
property: string;
|
|
395
|
-
value: string | null;
|
|
396
|
-
priority: string | undefined;
|
|
397
|
-
};
|
|
398
|
-
remove?: {
|
|
399
|
-
property: string;
|
|
400
|
-
};
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
declare type styleOMValue = {
|
|
404
|
-
[key: string]: styleValueWithPriority | string | false;
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
declare type styleSheetAddRule = {
|
|
408
|
-
rule: string;
|
|
409
|
-
index?: number | number[];
|
|
410
|
-
};
|
|
411
|
-
|
|
412
|
-
declare type styleSheetDeleteRule = {
|
|
413
|
-
index: number | number[];
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
declare type styleSheetRuleData = {
|
|
417
|
-
source: IncrementalSource.StyleSheetRule;
|
|
418
|
-
} & styleSheetRuleParam;
|
|
419
|
-
|
|
420
|
-
declare type styleSheetRuleParam = {
|
|
421
|
-
id?: number;
|
|
422
|
-
styleId?: number;
|
|
423
|
-
removes?: styleSheetDeleteRule[];
|
|
424
|
-
adds?: styleSheetAddRule[];
|
|
425
|
-
replace?: string;
|
|
426
|
-
replaceSync?: string;
|
|
427
|
-
};
|
|
428
|
-
|
|
429
|
-
declare type styleValueWithPriority = [string, string];
|
|
430
|
-
|
|
431
|
-
declare type textMutation = {
|
|
432
|
-
id: number;
|
|
433
|
-
value: string | null;
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
declare type textNode = {
|
|
437
|
-
type: NodeType.Text;
|
|
438
|
-
textContent: string;
|
|
439
|
-
isStyle?: true;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
declare type viewportResizeData = {
|
|
443
|
-
source: IncrementalSource.ViewportResize;
|
|
444
|
-
} & viewportResizeDimension;
|
|
445
|
-
|
|
446
|
-
declare type viewportResizeDimension = {
|
|
447
|
-
width: number;
|
|
448
|
-
height: number;
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare enum EventType {
|
|
3
|
+
DomContentLoaded = 0,
|
|
4
|
+
Load = 1,
|
|
5
|
+
FullSnapshot = 2,
|
|
6
|
+
IncrementalSnapshot = 3,
|
|
7
|
+
Meta = 4,
|
|
8
|
+
Custom = 5,
|
|
9
|
+
Plugin = 6
|
|
10
|
+
}
|
|
11
|
+
type domContentLoadedEvent = {
|
|
12
|
+
type: EventType.DomContentLoaded;
|
|
13
|
+
data: unknown;
|
|
14
|
+
};
|
|
15
|
+
type loadedEvent = {
|
|
16
|
+
type: EventType.Load;
|
|
17
|
+
data: unknown;
|
|
18
|
+
};
|
|
19
|
+
type fullSnapshotEvent = {
|
|
20
|
+
type: EventType.FullSnapshot;
|
|
21
|
+
data: {
|
|
22
|
+
node: serializedNodeWithId;
|
|
23
|
+
initialOffset: {
|
|
24
|
+
top: number;
|
|
25
|
+
left: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type incrementalSnapshotEvent = {
|
|
30
|
+
type: EventType.IncrementalSnapshot;
|
|
31
|
+
data: incrementalData;
|
|
32
|
+
};
|
|
33
|
+
type metaEvent = {
|
|
34
|
+
type: EventType.Meta;
|
|
35
|
+
data: {
|
|
36
|
+
href: string;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type customEvent<T = unknown> = {
|
|
42
|
+
type: EventType.Custom;
|
|
43
|
+
data: {
|
|
44
|
+
tag: string;
|
|
45
|
+
payload: T;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type pluginEvent<T = unknown> = {
|
|
49
|
+
type: EventType.Plugin;
|
|
50
|
+
data: {
|
|
51
|
+
plugin: string;
|
|
52
|
+
payload: T;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
declare enum IncrementalSource {
|
|
56
|
+
Mutation = 0,
|
|
57
|
+
MouseMove = 1,
|
|
58
|
+
MouseInteraction = 2,
|
|
59
|
+
Scroll = 3,
|
|
60
|
+
ViewportResize = 4,
|
|
61
|
+
Input = 5,
|
|
62
|
+
TouchMove = 6,
|
|
63
|
+
MediaInteraction = 7,
|
|
64
|
+
StyleSheetRule = 8,
|
|
65
|
+
CanvasMutation = 9,
|
|
66
|
+
Font = 10,
|
|
67
|
+
Log = 11,
|
|
68
|
+
Drag = 12,
|
|
69
|
+
StyleDeclaration = 13,
|
|
70
|
+
Selection = 14,
|
|
71
|
+
AdoptedStyleSheet = 15,
|
|
72
|
+
CustomElement = 16
|
|
73
|
+
}
|
|
74
|
+
type mutationData = {
|
|
75
|
+
source: IncrementalSource.Mutation;
|
|
76
|
+
} & mutationCallbackParam;
|
|
77
|
+
type mousemoveData = {
|
|
78
|
+
source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
|
|
79
|
+
positions: mousePosition[];
|
|
80
|
+
};
|
|
81
|
+
type mouseInteractionData = {
|
|
82
|
+
source: IncrementalSource.MouseInteraction;
|
|
83
|
+
} & mouseInteractionParam;
|
|
84
|
+
type scrollData = {
|
|
85
|
+
source: IncrementalSource.Scroll;
|
|
86
|
+
} & scrollPosition;
|
|
87
|
+
type viewportResizeData = {
|
|
88
|
+
source: IncrementalSource.ViewportResize;
|
|
89
|
+
} & viewportResizeDimension;
|
|
90
|
+
type inputData = {
|
|
91
|
+
source: IncrementalSource.Input;
|
|
92
|
+
id: number;
|
|
93
|
+
} & inputValue;
|
|
94
|
+
type mediaInteractionData = {
|
|
95
|
+
source: IncrementalSource.MediaInteraction;
|
|
96
|
+
} & mediaInteractionParam;
|
|
97
|
+
type styleSheetRuleData = {
|
|
98
|
+
source: IncrementalSource.StyleSheetRule;
|
|
99
|
+
} & styleSheetRuleParam;
|
|
100
|
+
type styleDeclarationData = {
|
|
101
|
+
source: IncrementalSource.StyleDeclaration;
|
|
102
|
+
} & styleDeclarationParam;
|
|
103
|
+
type canvasMutationData = {
|
|
104
|
+
source: IncrementalSource.CanvasMutation;
|
|
105
|
+
} & canvasMutationParam;
|
|
106
|
+
type fontData = {
|
|
107
|
+
source: IncrementalSource.Font;
|
|
108
|
+
} & fontParam;
|
|
109
|
+
type selectionData = {
|
|
110
|
+
source: IncrementalSource.Selection;
|
|
111
|
+
} & selectionParam;
|
|
112
|
+
type adoptedStyleSheetData = {
|
|
113
|
+
source: IncrementalSource.AdoptedStyleSheet;
|
|
114
|
+
} & adoptedStyleSheetParam;
|
|
115
|
+
type customElementData = {
|
|
116
|
+
source: IncrementalSource.CustomElement;
|
|
117
|
+
} & customElementParam;
|
|
118
|
+
type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData;
|
|
119
|
+
type eventWithoutTime = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
|
|
120
|
+
type eventWithTime = eventWithoutTime & {
|
|
121
|
+
timestamp: number;
|
|
122
|
+
delay?: number;
|
|
123
|
+
};
|
|
124
|
+
interface ICrossOriginIframeMirror {
|
|
125
|
+
getId(iframe: HTMLIFrameElement, remoteId: number, parentToRemoteMap?: Map<number, number>, remoteToParentMap?: Map<number, number>): number;
|
|
126
|
+
getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];
|
|
127
|
+
getRemoteId(iframe: HTMLIFrameElement, parentId: number, map?: Map<number, number>): number;
|
|
128
|
+
getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];
|
|
129
|
+
reset(iframe?: HTMLIFrameElement): void;
|
|
130
|
+
}
|
|
131
|
+
type RecordPlugin<TOptions = unknown> = {
|
|
132
|
+
name: string;
|
|
133
|
+
observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
|
|
134
|
+
eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
|
|
135
|
+
getMirror?: (mirrors: {
|
|
136
|
+
nodeMirror: IMirror<Node>;
|
|
137
|
+
crossOriginIframeMirror: ICrossOriginIframeMirror;
|
|
138
|
+
crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
|
|
139
|
+
}) => void;
|
|
140
|
+
options: TOptions;
|
|
141
|
+
};
|
|
142
|
+
type textMutation = {
|
|
143
|
+
id: number;
|
|
144
|
+
value: string | null;
|
|
145
|
+
};
|
|
146
|
+
type styleOMValue = {
|
|
147
|
+
[key: string]: styleValueWithPriority | string | false;
|
|
148
|
+
};
|
|
149
|
+
type styleValueWithPriority = [string, string];
|
|
150
|
+
type attributeMutation = {
|
|
151
|
+
id: number;
|
|
152
|
+
attributes: {
|
|
153
|
+
[key: string]: string | styleOMValue | null;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
type removedNodeMutation = {
|
|
157
|
+
parentId: number;
|
|
158
|
+
id: number;
|
|
159
|
+
isShadow?: boolean;
|
|
160
|
+
};
|
|
161
|
+
type addedNodeMutation = {
|
|
162
|
+
parentId: number;
|
|
163
|
+
previousId?: number | null;
|
|
164
|
+
nextId: number | null;
|
|
165
|
+
node: serializedNodeWithId;
|
|
166
|
+
};
|
|
167
|
+
type mutationCallbackParam = {
|
|
168
|
+
texts: textMutation[];
|
|
169
|
+
attributes: attributeMutation[];
|
|
170
|
+
removes: removedNodeMutation[];
|
|
171
|
+
adds: addedNodeMutation[];
|
|
172
|
+
isAttachIframe?: true;
|
|
173
|
+
};
|
|
174
|
+
type mousePosition = {
|
|
175
|
+
x: number;
|
|
176
|
+
y: number;
|
|
177
|
+
id: number;
|
|
178
|
+
timeOffset: number;
|
|
179
|
+
};
|
|
180
|
+
declare enum MouseInteractions {
|
|
181
|
+
MouseUp = 0,
|
|
182
|
+
MouseDown = 1,
|
|
183
|
+
Click = 2,
|
|
184
|
+
ContextMenu = 3,
|
|
185
|
+
DblClick = 4,
|
|
186
|
+
Focus = 5,
|
|
187
|
+
Blur = 6,
|
|
188
|
+
TouchStart = 7,
|
|
189
|
+
TouchMove_Departed = 8,
|
|
190
|
+
TouchEnd = 9,
|
|
191
|
+
TouchCancel = 10
|
|
192
|
+
}
|
|
193
|
+
declare enum PointerTypes {
|
|
194
|
+
Mouse = 0,
|
|
195
|
+
Pen = 1,
|
|
196
|
+
Touch = 2
|
|
197
|
+
}
|
|
198
|
+
declare enum CanvasContext {
|
|
199
|
+
"2D" = 0,
|
|
200
|
+
WebGL = 1,
|
|
201
|
+
WebGL2 = 2
|
|
202
|
+
}
|
|
203
|
+
type mouseInteractionParam = {
|
|
204
|
+
type: MouseInteractions;
|
|
205
|
+
id: number;
|
|
206
|
+
x?: number;
|
|
207
|
+
y?: number;
|
|
208
|
+
pointerType?: PointerTypes;
|
|
209
|
+
};
|
|
210
|
+
type scrollPosition = {
|
|
211
|
+
id: number;
|
|
212
|
+
x: number;
|
|
213
|
+
y: number;
|
|
214
|
+
};
|
|
215
|
+
type styleSheetAddRule = {
|
|
216
|
+
rule: string;
|
|
217
|
+
index?: number | number[];
|
|
218
|
+
};
|
|
219
|
+
type styleSheetDeleteRule = {
|
|
220
|
+
index: number | number[];
|
|
221
|
+
};
|
|
222
|
+
type styleSheetRuleParam = {
|
|
223
|
+
id?: number;
|
|
224
|
+
styleId?: number;
|
|
225
|
+
removes?: styleSheetDeleteRule[];
|
|
226
|
+
adds?: styleSheetAddRule[];
|
|
227
|
+
replace?: string;
|
|
228
|
+
replaceSync?: string;
|
|
229
|
+
};
|
|
230
|
+
type adoptedStyleSheetParam = {
|
|
231
|
+
id: number;
|
|
232
|
+
styles?: {
|
|
233
|
+
styleId: number;
|
|
234
|
+
rules: styleSheetAddRule[];
|
|
235
|
+
}[];
|
|
236
|
+
styleIds: number[];
|
|
237
|
+
};
|
|
238
|
+
type styleDeclarationParam = {
|
|
239
|
+
id?: number;
|
|
240
|
+
styleId?: number;
|
|
241
|
+
index: number[];
|
|
242
|
+
set?: {
|
|
243
|
+
property: string;
|
|
244
|
+
value: string | null;
|
|
245
|
+
priority: string | undefined;
|
|
246
|
+
};
|
|
247
|
+
remove?: {
|
|
248
|
+
property: string;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
type canvasMutationCommand = {
|
|
252
|
+
property: string;
|
|
253
|
+
args: Array<unknown>;
|
|
254
|
+
setter?: true;
|
|
255
|
+
};
|
|
256
|
+
type canvasMutationParam = {
|
|
257
|
+
id: number;
|
|
258
|
+
type: CanvasContext;
|
|
259
|
+
commands: canvasMutationCommand[];
|
|
260
|
+
displayWidth?: number;
|
|
261
|
+
displayHeight?: number;
|
|
262
|
+
} | ({
|
|
263
|
+
id: number;
|
|
264
|
+
type: CanvasContext;
|
|
265
|
+
displayWidth?: number;
|
|
266
|
+
displayHeight?: number;
|
|
267
|
+
} & canvasMutationCommand);
|
|
268
|
+
type fontParam = {
|
|
269
|
+
family: string;
|
|
270
|
+
fontSource: string;
|
|
271
|
+
buffer: boolean;
|
|
272
|
+
descriptors?: FontFaceDescriptors;
|
|
273
|
+
};
|
|
274
|
+
type viewportResizeDimension = {
|
|
275
|
+
width: number;
|
|
276
|
+
height: number;
|
|
277
|
+
};
|
|
278
|
+
type inputValue = {
|
|
279
|
+
text: string;
|
|
280
|
+
isChecked: boolean;
|
|
281
|
+
userTriggered?: boolean;
|
|
282
|
+
};
|
|
283
|
+
declare enum MediaInteractions {
|
|
284
|
+
Play = 0,
|
|
285
|
+
Pause = 1,
|
|
286
|
+
Seeked = 2,
|
|
287
|
+
VolumeChange = 3,
|
|
288
|
+
RateChange = 4
|
|
289
|
+
}
|
|
290
|
+
type mediaInteractionParam = {
|
|
291
|
+
type: MediaInteractions;
|
|
292
|
+
id: number;
|
|
293
|
+
currentTime?: number;
|
|
294
|
+
volume?: number;
|
|
295
|
+
muted?: boolean;
|
|
296
|
+
loop?: boolean;
|
|
297
|
+
playbackRate?: number;
|
|
298
|
+
};
|
|
299
|
+
type SelectionRange = {
|
|
300
|
+
start: number;
|
|
301
|
+
startOffset: number;
|
|
302
|
+
end: number;
|
|
303
|
+
endOffset: number;
|
|
304
|
+
};
|
|
305
|
+
type selectionParam = {
|
|
306
|
+
ranges: Array<SelectionRange>;
|
|
307
|
+
};
|
|
308
|
+
type customElementParam = {
|
|
309
|
+
define?: {
|
|
310
|
+
name: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
type listenerHandler = () => void;
|
|
453
314
|
declare global {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
315
|
+
interface Window {
|
|
316
|
+
FontFace: typeof FontFace;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
type IWindow = Window & typeof globalThis;
|
|
320
|
+
declare enum NodeType {
|
|
321
|
+
Document = 0,
|
|
322
|
+
DocumentType = 1,
|
|
323
|
+
Element = 2,
|
|
324
|
+
Text = 3,
|
|
325
|
+
CDATA = 4,
|
|
326
|
+
Comment = 5
|
|
327
|
+
}
|
|
328
|
+
type documentNode = {
|
|
329
|
+
type: NodeType.Document;
|
|
330
|
+
childNodes: serializedNodeWithId[];
|
|
331
|
+
compatMode?: string;
|
|
332
|
+
};
|
|
333
|
+
type documentTypeNode = {
|
|
334
|
+
type: NodeType.DocumentType;
|
|
335
|
+
name: string;
|
|
336
|
+
publicId: string;
|
|
337
|
+
systemId: string;
|
|
338
|
+
};
|
|
339
|
+
type cssTextKeyAttr = {
|
|
340
|
+
_cssText?: string;
|
|
341
|
+
};
|
|
342
|
+
type attributes = cssTextKeyAttr & {
|
|
343
|
+
[key: string]: string | number | true | null;
|
|
344
|
+
};
|
|
345
|
+
type elementNode = {
|
|
346
|
+
type: NodeType.Element;
|
|
347
|
+
tagName: string;
|
|
348
|
+
attributes: attributes;
|
|
349
|
+
childNodes: serializedNodeWithId[];
|
|
350
|
+
isSVG?: true;
|
|
351
|
+
needBlock?: boolean;
|
|
352
|
+
isCustom?: true;
|
|
353
|
+
};
|
|
354
|
+
type textNode = {
|
|
355
|
+
type: NodeType.Text;
|
|
356
|
+
textContent: string;
|
|
357
|
+
/**
|
|
358
|
+
* @deprecated styles are now always snapshotted against parent <style> element
|
|
359
|
+
* style mutations can still happen via an added textNode, but they don't need this attribute for correct replay
|
|
360
|
+
*/
|
|
361
|
+
isStyle?: true;
|
|
362
|
+
};
|
|
363
|
+
type cdataNode = {
|
|
364
|
+
type: NodeType.CDATA;
|
|
365
|
+
textContent: "";
|
|
366
|
+
};
|
|
367
|
+
type commentNode = {
|
|
368
|
+
type: NodeType.Comment;
|
|
369
|
+
textContent: string;
|
|
370
|
+
};
|
|
371
|
+
type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
372
|
+
rootId?: number;
|
|
373
|
+
isShadowHost?: boolean;
|
|
374
|
+
isShadow?: boolean;
|
|
375
|
+
};
|
|
376
|
+
type serializedNodeWithId = serializedNode & {
|
|
377
|
+
id: number;
|
|
378
|
+
};
|
|
379
|
+
interface IMirror<TNode> {
|
|
380
|
+
getId(n: TNode | undefined | null): number;
|
|
381
|
+
getNode(id: number): TNode | null;
|
|
382
|
+
getIds(): number[];
|
|
383
|
+
getMeta(n: TNode): serializedNodeWithId | null;
|
|
384
|
+
removeNodeFromMap(n: TNode): void;
|
|
385
|
+
has(id: number): boolean;
|
|
386
|
+
hasNode(node: TNode): boolean;
|
|
387
|
+
add(n: TNode, meta: serializedNodeWithId): void;
|
|
388
|
+
replace(id: number, n: TNode): void;
|
|
389
|
+
reset(): void;
|
|
457
390
|
}
|
|
458
391
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
392
|
+
//#region src/index.d.ts
|
|
393
|
+
type StringifyOptions = {
|
|
394
|
+
stringLengthLimit?: number;
|
|
395
|
+
/**
|
|
396
|
+
* limit of number of keys in an object
|
|
397
|
+
* if an object contains more keys than this limit, we would call its toString function directly
|
|
398
|
+
*/
|
|
399
|
+
numOfKeysLimit: number;
|
|
400
|
+
/**
|
|
401
|
+
* limit number of depth in an object
|
|
402
|
+
* if an object is too deep, toString process may cause browser OOM
|
|
403
|
+
*/
|
|
404
|
+
depthOfLimit: number;
|
|
405
|
+
};
|
|
406
|
+
type LogRecordOptions = {
|
|
407
|
+
level?: LogLevel[];
|
|
408
|
+
lengthThreshold?: number;
|
|
409
|
+
stringifyOptions?: StringifyOptions;
|
|
410
|
+
logger?: Logger | "console";
|
|
411
|
+
};
|
|
412
|
+
type LogData = {
|
|
413
|
+
level: LogLevel;
|
|
414
|
+
trace: string[];
|
|
415
|
+
payload: string[];
|
|
416
|
+
};
|
|
417
|
+
type Logger = {
|
|
418
|
+
assert?: typeof console.assert;
|
|
419
|
+
clear?: typeof console.clear;
|
|
420
|
+
count?: typeof console.count;
|
|
421
|
+
countReset?: typeof console.countReset;
|
|
422
|
+
debug?: typeof console.debug;
|
|
423
|
+
dir?: typeof console.dir;
|
|
424
|
+
dirxml?: typeof console.dirxml;
|
|
425
|
+
error?: typeof console.error;
|
|
426
|
+
group?: typeof console.group;
|
|
427
|
+
groupCollapsed?: typeof console.groupCollapsed;
|
|
428
|
+
groupEnd?: () => void;
|
|
429
|
+
info?: typeof console.info;
|
|
430
|
+
log?: typeof console.log;
|
|
431
|
+
table?: typeof console.table;
|
|
432
|
+
time?: typeof console.time;
|
|
433
|
+
timeEnd?: typeof console.timeEnd;
|
|
434
|
+
timeLog?: typeof console.timeLog;
|
|
435
|
+
trace?: typeof console.trace;
|
|
436
|
+
warn?: typeof console.warn;
|
|
504
437
|
};
|
|
438
|
+
type LogLevel = keyof Logger;
|
|
439
|
+
declare const PLUGIN_NAME = "rrweb/console@1";
|
|
440
|
+
declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
|
|
505
441
|
|
|
506
442
|
export { PLUGIN_NAME, getRecordConsolePlugin };
|
|
507
443
|
export type { LogData, LogLevel, Logger, StringifyOptions };
|