@leanbase.com/js 0.2.1 → 0.2.2-alpha.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/dist/extensions/replay/external/config.d.ts +9 -0
- package/dist/extensions/replay/external/denylist.d.ts +5 -0
- package/dist/extensions/replay/external/lazy-loaded-session-recorder.d.ts +153 -0
- package/dist/extensions/replay/external/mutation-throttler.d.ts +20 -0
- package/dist/extensions/replay/external/network-plugin.d.ts +15 -0
- package/dist/extensions/replay/external/sessionrecording-utils.d.ts +19 -0
- package/dist/extensions/replay/external/triggerMatching.d.ts +102 -0
- package/dist/extensions/replay/rrweb-plugins/patch.d.ts +3 -0
- package/dist/extensions/replay/session-recording.d.ts +75 -0
- package/dist/extensions/replay/types/rrweb-types.d.ts +439 -0
- package/dist/extensions/replay/types/rrweb.d.ts +82 -0
- package/dist/extensions/sampling.d.ts +4 -0
- package/dist/leanbase.d.ts +3 -0
- package/dist/leanbase.iife.js +1 -1
- package/dist/leanbase.iife.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +708 -0
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +135 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/version.d.ts +1 -1
- package/lib/extensions/replay/external/config.d.ts +9 -0
- package/lib/extensions/replay/external/config.js +221 -0
- package/lib/extensions/replay/external/config.js.map +1 -0
- package/lib/extensions/replay/external/denylist.d.ts +5 -0
- package/lib/extensions/replay/external/denylist.js +28 -0
- package/lib/extensions/replay/external/denylist.js.map +1 -0
- package/lib/extensions/replay/external/lazy-loaded-session-recorder.d.ts +153 -0
- package/lib/extensions/replay/external/lazy-loaded-session-recorder.js +1042 -0
- package/lib/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -0
- package/lib/extensions/replay/external/mutation-throttler.d.ts +20 -0
- package/lib/extensions/replay/external/mutation-throttler.js +77 -0
- package/lib/extensions/replay/external/mutation-throttler.js.map +1 -0
- package/lib/extensions/replay/external/network-plugin.d.ts +15 -0
- package/lib/extensions/replay/external/network-plugin.js +503 -0
- package/lib/extensions/replay/external/network-plugin.js.map +1 -0
- package/lib/extensions/replay/external/sessionrecording-utils.d.ts +19 -0
- package/lib/extensions/replay/external/sessionrecording-utils.js +125 -0
- package/lib/extensions/replay/external/sessionrecording-utils.js.map +1 -0
- package/lib/extensions/replay/external/triggerMatching.d.ts +102 -0
- package/lib/extensions/replay/external/triggerMatching.js +342 -0
- package/lib/extensions/replay/external/triggerMatching.js.map +1 -0
- package/lib/extensions/replay/rrweb-plugins/patch.d.ts +3 -0
- package/lib/extensions/replay/rrweb-plugins/patch.js +32 -0
- package/lib/extensions/replay/rrweb-plugins/patch.js.map +1 -0
- package/lib/extensions/replay/session-recording.d.ts +75 -0
- package/lib/extensions/replay/session-recording.js +279 -0
- package/lib/extensions/replay/session-recording.js.map +1 -0
- package/lib/extensions/replay/types/rrweb-types.d.ts +439 -0
- package/lib/extensions/replay/types/rrweb-types.js +83 -0
- package/lib/extensions/replay/types/rrweb-types.js.map +1 -0
- package/lib/extensions/replay/types/rrweb.d.ts +82 -0
- package/lib/extensions/replay/types/rrweb.js +9 -0
- package/lib/extensions/replay/types/rrweb.js.map +1 -0
- package/lib/extensions/sampling.d.ts +4 -0
- package/lib/extensions/sampling.js +23 -0
- package/lib/extensions/sampling.js.map +1 -0
- package/lib/leanbase.d.ts +3 -0
- package/lib/leanbase.js +25 -0
- package/lib/leanbase.js.map +1 -1
- package/lib/types.d.ts +135 -0
- package/lib/types.js.map +1 -1
- package/lib/utils/logger.d.ts +10 -0
- package/lib/utils/logger.js +15 -0
- package/lib/utils/logger.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +5 -21
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
export type DataURLOptions = Partial<{
|
|
2
|
+
type: string;
|
|
3
|
+
quality: number;
|
|
4
|
+
}>;
|
|
5
|
+
export interface INode extends Node {
|
|
6
|
+
__sn: serializedNodeWithId;
|
|
7
|
+
}
|
|
8
|
+
export interface IMirror<TNode> {
|
|
9
|
+
getId(n: TNode | undefined | null): number;
|
|
10
|
+
getNode(id: number): TNode | null;
|
|
11
|
+
getIds(): number[];
|
|
12
|
+
getMeta(n: TNode): serializedNodeWithId | null;
|
|
13
|
+
removeNodeFromMap(n: TNode): void;
|
|
14
|
+
has(id: number): boolean;
|
|
15
|
+
hasNode(node: TNode): boolean;
|
|
16
|
+
add(n: TNode, meta: serializedNodeWithId): void;
|
|
17
|
+
replace(id: number, n: TNode): void;
|
|
18
|
+
reset(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare class Mirror implements IMirror<Node> {
|
|
21
|
+
private idNodeMap;
|
|
22
|
+
private nodeMetaMap;
|
|
23
|
+
getId(n: Node | undefined | null): number;
|
|
24
|
+
getNode(id: number): Node | null;
|
|
25
|
+
getIds(): number[];
|
|
26
|
+
getMeta(n: Node): serializedNodeWithId | null;
|
|
27
|
+
removeNodeFromMap(n: Node): void;
|
|
28
|
+
has(id: number): boolean;
|
|
29
|
+
hasNode(node: Node): boolean;
|
|
30
|
+
add(n: Node, meta: serializedNodeWithId): void;
|
|
31
|
+
replace(id: number, n: Node): void;
|
|
32
|
+
reset(): void;
|
|
33
|
+
}
|
|
34
|
+
export type attributes = {
|
|
35
|
+
[key: string]: string | number | true | null;
|
|
36
|
+
};
|
|
37
|
+
export declare enum NodeType {
|
|
38
|
+
Document = 0,
|
|
39
|
+
DocumentType = 1,
|
|
40
|
+
Element = 2,
|
|
41
|
+
Text = 3,
|
|
42
|
+
CDATA = 4,
|
|
43
|
+
Comment = 5
|
|
44
|
+
}
|
|
45
|
+
export type documentNode = {
|
|
46
|
+
type: NodeType.Document;
|
|
47
|
+
childNodes: serializedNodeWithId[];
|
|
48
|
+
compatMode?: string;
|
|
49
|
+
};
|
|
50
|
+
export type documentTypeNode = {
|
|
51
|
+
type: NodeType.DocumentType;
|
|
52
|
+
name: string;
|
|
53
|
+
publicId: string;
|
|
54
|
+
systemId: string;
|
|
55
|
+
};
|
|
56
|
+
export type elementNode = {
|
|
57
|
+
type: NodeType.Element;
|
|
58
|
+
tagName: string;
|
|
59
|
+
attributes: attributes;
|
|
60
|
+
childNodes: serializedNodeWithId[];
|
|
61
|
+
isSVG?: true;
|
|
62
|
+
needBlock?: boolean;
|
|
63
|
+
isCustom?: true;
|
|
64
|
+
};
|
|
65
|
+
export type textNode = {
|
|
66
|
+
type: NodeType.Text;
|
|
67
|
+
textContent: string;
|
|
68
|
+
isStyle?: true;
|
|
69
|
+
};
|
|
70
|
+
export type cdataNode = {
|
|
71
|
+
type: NodeType.CDATA;
|
|
72
|
+
textContent: '';
|
|
73
|
+
};
|
|
74
|
+
export type commentNode = {
|
|
75
|
+
type: NodeType.Comment;
|
|
76
|
+
textContent: string;
|
|
77
|
+
};
|
|
78
|
+
export type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
79
|
+
rootId?: number;
|
|
80
|
+
isShadowHost?: boolean;
|
|
81
|
+
isShadow?: boolean;
|
|
82
|
+
};
|
|
83
|
+
export type serializedNodeWithId = serializedNode & {
|
|
84
|
+
id: number;
|
|
85
|
+
};
|
|
86
|
+
export type blockClass = string | RegExp;
|
|
87
|
+
export type maskTextClass = string | RegExp;
|
|
88
|
+
export type IWindow = Window & typeof globalThis;
|
|
89
|
+
export type listenerHandler = () => void;
|
|
90
|
+
export type KeepIframeSrcFn = (src: string) => boolean;
|
|
91
|
+
export type PackFn = (event: eventWithTime) => string;
|
|
92
|
+
export declare enum EventType {
|
|
93
|
+
DomContentLoaded = 0,
|
|
94
|
+
Load = 1,
|
|
95
|
+
FullSnapshot = 2,
|
|
96
|
+
IncrementalSnapshot = 3,
|
|
97
|
+
Meta = 4,
|
|
98
|
+
Custom = 5,
|
|
99
|
+
Plugin = 6
|
|
100
|
+
}
|
|
101
|
+
export declare enum IncrementalSource {
|
|
102
|
+
Mutation = 0,
|
|
103
|
+
MouseMove = 1,
|
|
104
|
+
MouseInteraction = 2,
|
|
105
|
+
Scroll = 3,
|
|
106
|
+
ViewportResize = 4,
|
|
107
|
+
Input = 5,
|
|
108
|
+
TouchMove = 6,
|
|
109
|
+
MediaInteraction = 7,
|
|
110
|
+
StyleSheetRule = 8,
|
|
111
|
+
CanvasMutation = 9,
|
|
112
|
+
Font = 10,
|
|
113
|
+
Log = 11,
|
|
114
|
+
Drag = 12,
|
|
115
|
+
StyleDeclaration = 13,
|
|
116
|
+
Selection = 14,
|
|
117
|
+
AdoptedStyleSheet = 15,
|
|
118
|
+
CustomElement = 16
|
|
119
|
+
}
|
|
120
|
+
export type domContentLoadedEvent = {
|
|
121
|
+
type: EventType.DomContentLoaded;
|
|
122
|
+
data: unknown;
|
|
123
|
+
};
|
|
124
|
+
export type loadedEvent = {
|
|
125
|
+
type: EventType.Load;
|
|
126
|
+
data: unknown;
|
|
127
|
+
};
|
|
128
|
+
export type fullSnapshotEvent = {
|
|
129
|
+
type: EventType.FullSnapshot;
|
|
130
|
+
data: {
|
|
131
|
+
node: serializedNodeWithId;
|
|
132
|
+
initialOffset: {
|
|
133
|
+
top: number;
|
|
134
|
+
left: number;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export type metaEvent = {
|
|
139
|
+
type: EventType.Meta;
|
|
140
|
+
data: {
|
|
141
|
+
href: string;
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export type customEvent<T = unknown> = {
|
|
147
|
+
type: EventType.Custom;
|
|
148
|
+
data: {
|
|
149
|
+
tag: string;
|
|
150
|
+
payload: T;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
export type pluginEvent<T = unknown> = {
|
|
154
|
+
type: EventType.Plugin;
|
|
155
|
+
data: {
|
|
156
|
+
plugin: string;
|
|
157
|
+
payload: T;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export type styleOMValue = {
|
|
161
|
+
[key: string]: styleValueWithPriority | string | false;
|
|
162
|
+
};
|
|
163
|
+
export type styleValueWithPriority = [string, string];
|
|
164
|
+
export type textMutation = {
|
|
165
|
+
id: number;
|
|
166
|
+
value: string | null;
|
|
167
|
+
};
|
|
168
|
+
export type attributeMutation = {
|
|
169
|
+
id: number;
|
|
170
|
+
attributes: {
|
|
171
|
+
[key: string]: string | styleOMValue | null;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
export type removedNodeMutation = {
|
|
175
|
+
parentId: number;
|
|
176
|
+
id: number;
|
|
177
|
+
isShadow?: boolean;
|
|
178
|
+
};
|
|
179
|
+
export type addedNodeMutation = {
|
|
180
|
+
parentId: number;
|
|
181
|
+
previousId?: number | null;
|
|
182
|
+
nextId: number | null;
|
|
183
|
+
node: serializedNodeWithId;
|
|
184
|
+
};
|
|
185
|
+
export type mutationCallbackParam = {
|
|
186
|
+
texts: textMutation[];
|
|
187
|
+
attributes: attributeMutation[];
|
|
188
|
+
removes: removedNodeMutation[];
|
|
189
|
+
adds: addedNodeMutation[];
|
|
190
|
+
isAttachIframe?: true;
|
|
191
|
+
};
|
|
192
|
+
export type mutationData = {
|
|
193
|
+
source: IncrementalSource.Mutation;
|
|
194
|
+
} & mutationCallbackParam;
|
|
195
|
+
export type mousePosition = {
|
|
196
|
+
x: number;
|
|
197
|
+
y: number;
|
|
198
|
+
id: number;
|
|
199
|
+
timeOffset: number;
|
|
200
|
+
};
|
|
201
|
+
export declare enum MouseInteractions {
|
|
202
|
+
MouseUp = 0,
|
|
203
|
+
MouseDown = 1,
|
|
204
|
+
Click = 2,
|
|
205
|
+
ContextMenu = 3,
|
|
206
|
+
DblClick = 4,
|
|
207
|
+
Focus = 5,
|
|
208
|
+
Blur = 6,
|
|
209
|
+
TouchStart = 7,
|
|
210
|
+
TouchMove_Departed = 8,
|
|
211
|
+
TouchEnd = 9,
|
|
212
|
+
TouchCancel = 10
|
|
213
|
+
}
|
|
214
|
+
export declare enum PointerTypes {
|
|
215
|
+
Mouse = 0,
|
|
216
|
+
Pen = 1,
|
|
217
|
+
Touch = 2
|
|
218
|
+
}
|
|
219
|
+
type mouseInteractionParam = {
|
|
220
|
+
type: MouseInteractions;
|
|
221
|
+
id: number;
|
|
222
|
+
x?: number;
|
|
223
|
+
y?: number;
|
|
224
|
+
pointerType?: PointerTypes;
|
|
225
|
+
};
|
|
226
|
+
export type mouseInteractionData = {
|
|
227
|
+
source: IncrementalSource.MouseInteraction;
|
|
228
|
+
} & mouseInteractionParam;
|
|
229
|
+
export type mousemoveData = {
|
|
230
|
+
source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
|
|
231
|
+
positions: mousePosition[];
|
|
232
|
+
};
|
|
233
|
+
export type scrollPosition = {
|
|
234
|
+
id: number;
|
|
235
|
+
x: number;
|
|
236
|
+
y: number;
|
|
237
|
+
};
|
|
238
|
+
export type scrollData = {
|
|
239
|
+
source: IncrementalSource.Scroll;
|
|
240
|
+
} & scrollPosition;
|
|
241
|
+
export type viewportResizeDimension = {
|
|
242
|
+
width: number;
|
|
243
|
+
height: number;
|
|
244
|
+
};
|
|
245
|
+
export type viewportResizeData = {
|
|
246
|
+
source: IncrementalSource.ViewportResize;
|
|
247
|
+
} & viewportResizeDimension;
|
|
248
|
+
export type inputValue = {
|
|
249
|
+
text: string;
|
|
250
|
+
isChecked: boolean;
|
|
251
|
+
userTriggered?: boolean;
|
|
252
|
+
};
|
|
253
|
+
export type inputData = {
|
|
254
|
+
source: IncrementalSource.Input;
|
|
255
|
+
id: number;
|
|
256
|
+
} & inputValue;
|
|
257
|
+
export declare enum MediaInteractions {
|
|
258
|
+
Play = 0,
|
|
259
|
+
Pause = 1,
|
|
260
|
+
Seeked = 2,
|
|
261
|
+
VolumeChange = 3,
|
|
262
|
+
RateChange = 4
|
|
263
|
+
}
|
|
264
|
+
export type mediaInteractionParam = {
|
|
265
|
+
type: MediaInteractions;
|
|
266
|
+
id: number;
|
|
267
|
+
currentTime?: number;
|
|
268
|
+
volume?: number;
|
|
269
|
+
muted?: boolean;
|
|
270
|
+
loop?: boolean;
|
|
271
|
+
playbackRate?: number;
|
|
272
|
+
};
|
|
273
|
+
export type mediaInteractionData = {
|
|
274
|
+
source: IncrementalSource.MediaInteraction;
|
|
275
|
+
} & mediaInteractionParam;
|
|
276
|
+
export type styleSheetAddRule = {
|
|
277
|
+
rule: string;
|
|
278
|
+
index?: number | number[];
|
|
279
|
+
};
|
|
280
|
+
export type styleSheetDeleteRule = {
|
|
281
|
+
index: number | number[];
|
|
282
|
+
};
|
|
283
|
+
export type styleSheetRuleParam = {
|
|
284
|
+
id?: number;
|
|
285
|
+
styleId?: number;
|
|
286
|
+
removes?: styleSheetDeleteRule[];
|
|
287
|
+
adds?: styleSheetAddRule[];
|
|
288
|
+
replace?: string;
|
|
289
|
+
replaceSync?: string;
|
|
290
|
+
};
|
|
291
|
+
export type styleSheetRuleData = {
|
|
292
|
+
source: IncrementalSource.StyleSheetRule;
|
|
293
|
+
} & styleSheetRuleParam;
|
|
294
|
+
export declare enum CanvasContext {
|
|
295
|
+
'2D' = 0,
|
|
296
|
+
WebGL = 1,
|
|
297
|
+
WebGL2 = 2
|
|
298
|
+
}
|
|
299
|
+
export type canvasMutationCommand = {
|
|
300
|
+
property: string;
|
|
301
|
+
args: Array<unknown>;
|
|
302
|
+
setter?: true;
|
|
303
|
+
};
|
|
304
|
+
export type canvasMutationParam = {
|
|
305
|
+
id: number;
|
|
306
|
+
type: CanvasContext;
|
|
307
|
+
commands: canvasMutationCommand[];
|
|
308
|
+
} | ({
|
|
309
|
+
id: number;
|
|
310
|
+
type: CanvasContext;
|
|
311
|
+
} & canvasMutationCommand);
|
|
312
|
+
export type canvasMutationData = {
|
|
313
|
+
source: IncrementalSource.CanvasMutation;
|
|
314
|
+
} & canvasMutationParam;
|
|
315
|
+
export type fontParam = {
|
|
316
|
+
family: string;
|
|
317
|
+
fontSource: string;
|
|
318
|
+
buffer: boolean;
|
|
319
|
+
descriptors?: FontFaceDescriptors;
|
|
320
|
+
};
|
|
321
|
+
export type fontData = {
|
|
322
|
+
source: IncrementalSource.Font;
|
|
323
|
+
} & fontParam;
|
|
324
|
+
export type SelectionRange = {
|
|
325
|
+
start: number;
|
|
326
|
+
startOffset: number;
|
|
327
|
+
end: number;
|
|
328
|
+
endOffset: number;
|
|
329
|
+
};
|
|
330
|
+
export type selectionParam = {
|
|
331
|
+
ranges: Array<SelectionRange>;
|
|
332
|
+
};
|
|
333
|
+
export type selectionData = {
|
|
334
|
+
source: IncrementalSource.Selection;
|
|
335
|
+
} & selectionParam;
|
|
336
|
+
export type styleDeclarationParam = {
|
|
337
|
+
id?: number;
|
|
338
|
+
styleId?: number;
|
|
339
|
+
index: number[];
|
|
340
|
+
set?: {
|
|
341
|
+
property: string;
|
|
342
|
+
value: string | null;
|
|
343
|
+
priority: string | undefined;
|
|
344
|
+
};
|
|
345
|
+
remove?: {
|
|
346
|
+
property: string;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
export type styleDeclarationData = {
|
|
350
|
+
source: IncrementalSource.StyleDeclaration;
|
|
351
|
+
} & styleDeclarationParam;
|
|
352
|
+
export type adoptedStyleSheetParam = {
|
|
353
|
+
id: number;
|
|
354
|
+
styles?: {
|
|
355
|
+
styleId: number;
|
|
356
|
+
rules: styleSheetAddRule[];
|
|
357
|
+
}[];
|
|
358
|
+
styleIds: number[];
|
|
359
|
+
};
|
|
360
|
+
export type adoptedStyleSheetData = {
|
|
361
|
+
source: IncrementalSource.AdoptedStyleSheet;
|
|
362
|
+
} & adoptedStyleSheetParam;
|
|
363
|
+
export type customElementParam = {
|
|
364
|
+
define?: {
|
|
365
|
+
name: string;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
export type customElementData = {
|
|
369
|
+
source: IncrementalSource.CustomElement;
|
|
370
|
+
} & customElementParam;
|
|
371
|
+
export type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData;
|
|
372
|
+
export type incrementalSnapshotEvent = {
|
|
373
|
+
type: EventType.IncrementalSnapshot;
|
|
374
|
+
data: incrementalData;
|
|
375
|
+
};
|
|
376
|
+
export type eventWithoutTime = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
|
|
377
|
+
export type eventWithTime = eventWithoutTime & {
|
|
378
|
+
timestamp: number;
|
|
379
|
+
delay?: number;
|
|
380
|
+
};
|
|
381
|
+
export type mutationCallBack = (m: mutationCallbackParam) => void;
|
|
382
|
+
export type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag) => void;
|
|
383
|
+
export type mouseInteractionCallBack = (d: mouseInteractionParam) => void;
|
|
384
|
+
export type scrollCallback = (p: scrollPosition) => void;
|
|
385
|
+
export type viewportResizeCallback = (d: viewportResizeDimension) => void;
|
|
386
|
+
export type inputCallback = (v: inputValue & {
|
|
387
|
+
id: number;
|
|
388
|
+
}) => void;
|
|
389
|
+
export type mediaInteractionCallback = (p: mediaInteractionParam) => void;
|
|
390
|
+
export type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
|
|
391
|
+
export type styleDeclarationCallback = (s: styleDeclarationParam) => void;
|
|
392
|
+
export type canvasMutationCallback = (p: canvasMutationParam) => void;
|
|
393
|
+
export type fontCallback = (p: fontParam) => void;
|
|
394
|
+
export type selectionCallback = (p: selectionParam) => void;
|
|
395
|
+
export type customElementCallback = (c: customElementParam) => void;
|
|
396
|
+
export type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;
|
|
397
|
+
export type hooksParam = {
|
|
398
|
+
mutation?: mutationCallBack;
|
|
399
|
+
mousemove?: mousemoveCallBack;
|
|
400
|
+
mouseInteraction?: mouseInteractionCallBack;
|
|
401
|
+
scroll?: scrollCallback;
|
|
402
|
+
viewportResize?: viewportResizeCallback;
|
|
403
|
+
input?: inputCallback;
|
|
404
|
+
mediaInteaction?: mediaInteractionCallback;
|
|
405
|
+
styleSheetRule?: styleSheetRuleCallback;
|
|
406
|
+
styleDeclaration?: styleDeclarationCallback;
|
|
407
|
+
canvasMutation?: canvasMutationCallback;
|
|
408
|
+
font?: fontCallback;
|
|
409
|
+
selection?: selectionCallback;
|
|
410
|
+
customElement?: customElementCallback;
|
|
411
|
+
};
|
|
412
|
+
export type SamplingStrategy = Partial<{
|
|
413
|
+
mousemove: boolean | number;
|
|
414
|
+
mousemoveCallback: number;
|
|
415
|
+
mouseInteraction: boolean | Record<string, boolean | undefined>;
|
|
416
|
+
scroll: number;
|
|
417
|
+
media: number;
|
|
418
|
+
input: 'all' | 'last';
|
|
419
|
+
canvas: 'all' | number;
|
|
420
|
+
}>;
|
|
421
|
+
export interface ICrossOriginIframeMirror {
|
|
422
|
+
getId(iframe: HTMLIFrameElement, remoteId: number, parentToRemoteMap?: Map<number, number>, remoteToParentMap?: Map<number, number>): number;
|
|
423
|
+
getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];
|
|
424
|
+
getRemoteId(iframe: HTMLIFrameElement, parentId: number, map?: Map<number, number>): number;
|
|
425
|
+
getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];
|
|
426
|
+
reset(iframe?: HTMLIFrameElement): void;
|
|
427
|
+
}
|
|
428
|
+
export type RecordPlugin<TOptions = unknown> = {
|
|
429
|
+
name: string;
|
|
430
|
+
observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
|
|
431
|
+
eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
|
|
432
|
+
getMirror?: (mirrors: {
|
|
433
|
+
nodeMirror: Mirror;
|
|
434
|
+
crossOriginIframeMirror: ICrossOriginIframeMirror;
|
|
435
|
+
crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
|
|
436
|
+
}) => void;
|
|
437
|
+
options: TOptions;
|
|
438
|
+
};
|
|
439
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { blockClass, eventWithTime, hooksParam, KeepIframeSrcFn, maskTextClass, PackFn, RecordPlugin, SamplingStrategy } from './rrweb-types';
|
|
2
|
+
type MaskInputOptions = Partial<{
|
|
3
|
+
color: boolean;
|
|
4
|
+
date: boolean;
|
|
5
|
+
'datetime-local': boolean;
|
|
6
|
+
email: boolean;
|
|
7
|
+
month: boolean;
|
|
8
|
+
number: boolean;
|
|
9
|
+
range: boolean;
|
|
10
|
+
search: boolean;
|
|
11
|
+
tel: boolean;
|
|
12
|
+
text: boolean;
|
|
13
|
+
time: boolean;
|
|
14
|
+
url: boolean;
|
|
15
|
+
week: boolean;
|
|
16
|
+
textarea: boolean;
|
|
17
|
+
select: boolean;
|
|
18
|
+
password: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
type MaskInputFn = (text: string, element: HTMLElement) => string;
|
|
21
|
+
type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
|
22
|
+
type SlimDOMOptions = Partial<{
|
|
23
|
+
script: boolean;
|
|
24
|
+
comment: boolean;
|
|
25
|
+
headFavicon: boolean;
|
|
26
|
+
headWhitespace: boolean;
|
|
27
|
+
headMetaDescKeywords: boolean;
|
|
28
|
+
headMetaSocial: boolean;
|
|
29
|
+
headMetaRobots: boolean;
|
|
30
|
+
headMetaHttpEquiv: boolean;
|
|
31
|
+
headMetaAuthorship: boolean;
|
|
32
|
+
headMetaVerification: boolean;
|
|
33
|
+
headTitleMutations: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
type DataURLOptions = Partial<{
|
|
36
|
+
type: string;
|
|
37
|
+
quality: number;
|
|
38
|
+
}>;
|
|
39
|
+
type ErrorHandler = (error: unknown) => void | boolean;
|
|
40
|
+
export type recordOptions = {
|
|
41
|
+
emit?: (e: eventWithTime, isCheckout?: boolean) => void;
|
|
42
|
+
checkoutEveryNth?: number;
|
|
43
|
+
checkoutEveryNms?: number;
|
|
44
|
+
blockClass?: blockClass;
|
|
45
|
+
blockSelector?: string;
|
|
46
|
+
ignoreClass?: string;
|
|
47
|
+
ignoreSelector?: string;
|
|
48
|
+
maskTextClass?: maskTextClass;
|
|
49
|
+
maskTextSelector?: string;
|
|
50
|
+
maskAllInputs?: boolean;
|
|
51
|
+
maskInputOptions?: MaskInputOptions;
|
|
52
|
+
maskInputFn?: MaskInputFn;
|
|
53
|
+
maskTextFn?: MaskTextFn;
|
|
54
|
+
slimDOMOptions?: SlimDOMOptions | 'all' | true;
|
|
55
|
+
ignoreCSSAttributes?: Set<string>;
|
|
56
|
+
inlineStylesheet?: boolean;
|
|
57
|
+
hooks?: hooksParam;
|
|
58
|
+
packFn?: PackFn;
|
|
59
|
+
sampling?: SamplingStrategy;
|
|
60
|
+
dataURLOptions?: DataURLOptions;
|
|
61
|
+
recordDOM?: boolean;
|
|
62
|
+
recordCanvas?: boolean;
|
|
63
|
+
recordCrossOriginIframes?: boolean;
|
|
64
|
+
recordAfter?: 'DOMContentLoaded' | 'load';
|
|
65
|
+
userTriggeredOnInput?: boolean;
|
|
66
|
+
collectFonts?: boolean;
|
|
67
|
+
inlineImages?: boolean;
|
|
68
|
+
plugins?: RecordPlugin[];
|
|
69
|
+
mousemoveWait?: number;
|
|
70
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
71
|
+
errorHandler?: ErrorHandler;
|
|
72
|
+
};
|
|
73
|
+
export type rrwebRecord = {
|
|
74
|
+
(options: recordOptions): () => void;
|
|
75
|
+
addCustomEvent: (tag: string, payload: any) => void;
|
|
76
|
+
takeFullSnapshot: () => void;
|
|
77
|
+
mirror: {
|
|
78
|
+
getId(n: Node | undefined | null): number;
|
|
79
|
+
getNode(id: number): Node | null;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function appendArray(currentValue: string[] | undefined, sampleType: string | string[]): string[];
|
|
2
|
+
export declare function updateThreshold(currentValue: number | undefined, percent: number): number;
|
|
3
|
+
export declare function simpleHash(str: string): number;
|
|
4
|
+
export declare function sampleOnProperty(prop: string, percent: number): boolean;
|
package/dist/leanbase.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { SessionPropsManager } from './session-props';
|
|
|
8
8
|
import { PageViewManager } from './page-view';
|
|
9
9
|
import { ScrollManager } from './scroll-manager';
|
|
10
10
|
import { ConsentManager } from './consent';
|
|
11
|
+
import { SessionRecording } from './extensions/replay/session-recording';
|
|
11
12
|
export declare class Leanbase extends PostHogCore {
|
|
12
13
|
config: LeanbaseConfig;
|
|
13
14
|
scrollManager: ScrollManager;
|
|
@@ -18,6 +19,7 @@ export declare class Leanbase extends PostHogCore {
|
|
|
18
19
|
sessionPersistence?: LeanbasePersistence;
|
|
19
20
|
sessionManager?: SessionIdManager;
|
|
20
21
|
sessionPropsManager?: SessionPropsManager;
|
|
22
|
+
sessionRecording?: SessionRecording;
|
|
21
23
|
isRemoteConfigLoaded?: boolean;
|
|
22
24
|
personProcessingSetOncePropertiesSent: boolean;
|
|
23
25
|
isLoaded: boolean;
|
|
@@ -35,6 +37,7 @@ export declare class Leanbase extends PostHogCore {
|
|
|
35
37
|
getLibraryVersion(): string;
|
|
36
38
|
getCustomUserAgent(): void;
|
|
37
39
|
getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
|
|
40
|
+
getPersistedProperty<T>(key: string): T | undefined;
|
|
38
41
|
setPersistedProperty<T>(key: PostHogPersistedProperty, value: T | null): void;
|
|
39
42
|
calculateEventProperties(eventName: string, eventProperties: PostHogEventProperties, timestamp: Date, uuid: string, readOnly?: boolean): Properties;
|
|
40
43
|
isIdentified(): boolean;
|