@coralogix/browser 3.4.0 → 3.5.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +24 -21
  3. package/index.esm.js +1 -1
  4. package/index.esm2.js +128 -56
  5. package/package.json +1 -3
  6. package/sessionRecorder.esm.js +5535 -1314
  7. package/src/constants.d.ts +1 -2
  8. package/src/cx-rrweb/rrweb/index.d.ts +4 -0
  9. package/src/cx-rrweb/rrweb/record/cross-origin-iframe-mirror.d.ts +14 -0
  10. package/src/cx-rrweb/rrweb/record/error-handler.d.ts +6 -0
  11. package/src/cx-rrweb/rrweb/record/iframe-manager.d.ts +34 -0
  12. package/src/cx-rrweb/rrweb/record/index.d.ts +10 -0
  13. package/src/cx-rrweb/rrweb/record/mutation.d.ts +50 -0
  14. package/src/cx-rrweb/rrweb/record/observer.d.ts +9 -0
  15. package/src/cx-rrweb/rrweb/record/observers/canvas/2d.d.ts +2 -0
  16. package/src/cx-rrweb/rrweb/record/observers/canvas/canvas-manager.d.ts +37 -0
  17. package/src/cx-rrweb/rrweb/record/observers/canvas/canvas.d.ts +2 -0
  18. package/src/cx-rrweb/rrweb/record/observers/canvas/serialize-args.d.ts +6 -0
  19. package/src/cx-rrweb/rrweb/record/observers/canvas/webgl.d.ts +2 -0
  20. package/src/cx-rrweb/rrweb/record/processed-node-manager.d.ts +8 -0
  21. package/src/cx-rrweb/rrweb/record/shadow-dom-manager.d.ts +26 -0
  22. package/src/cx-rrweb/rrweb/record/stylesheet-manager.d.ts +17 -0
  23. package/src/cx-rrweb/rrweb/record/workers/image-bitmap-data-url-worker.d.ts +6 -0
  24. package/src/cx-rrweb/rrweb/types.d.ts +102 -0
  25. package/src/cx-rrweb/rrweb/utils/base64.d.ts +1 -0
  26. package/src/cx-rrweb/rrweb/utils.d.ts +66 -0
  27. package/src/cx-rrweb/rrweb-plugin-console-record/error-stack-parser.d.ts +37 -0
  28. package/src/cx-rrweb/rrweb-plugin-console-record/index.d.ts +42 -0
  29. package/src/cx-rrweb/rrweb-plugin-console-record/stringify.d.ts +2 -0
  30. package/src/cx-rrweb/rrweb-snapshot/index.d.ts +4 -0
  31. package/src/cx-rrweb/rrweb-snapshot/snapshot.d.ts +76 -0
  32. package/src/cx-rrweb/rrweb-snapshot/types.d.ts +50 -0
  33. package/src/cx-rrweb/rrweb-snapshot/utils.d.ts +51 -0
  34. package/src/cx-rrweb/rrweb-types/index.d.ts +558 -0
  35. package/src/cx-rrweb/rrweb-utils/index.d.ts +43 -0
  36. package/src/instrumentations/CoralogixErrorInstrumentation.d.ts +1 -0
  37. package/src/processors/CoralogixNavigationProcessor.d.ts +1 -0
  38. package/src/session/session-idle.d.ts +2 -0
  39. package/src/session/session.model.d.ts +3 -3
  40. package/src/session/sessionRecorder.d.ts +0 -3
  41. package/src/tools/cx-timers.d.ts +25 -0
  42. package/src/tools/global-keys.d.ts +2 -0
  43. package/src/types.d.ts +2 -1
  44. package/src/version.d.ts +1 -1
  45. package/src/tools/getZoneJsOriginalDom.d.ts +0 -1
  46. package/src/utils/zone-patch.d.ts +0 -10
@@ -0,0 +1,50 @@
1
+ import type { serializedNodeWithId } from '../rrweb-types';
2
+ export type tagMap = {
3
+ [key: string]: string;
4
+ };
5
+ export type DialogAttributes = {
6
+ open: string;
7
+ rr_open_mode: 'modal' | 'non-modal';
8
+ };
9
+ export interface ICanvas extends HTMLCanvasElement {
10
+ __context: string;
11
+ }
12
+ export type idNodeMap = Map<number, Node>;
13
+ export type nodeMetaMap = WeakMap<Node, serializedNodeWithId>;
14
+ export type MaskInputOptions = Partial<{
15
+ color: boolean;
16
+ date: boolean;
17
+ 'datetime-local': boolean;
18
+ email: boolean;
19
+ month: boolean;
20
+ number: boolean;
21
+ range: boolean;
22
+ search: boolean;
23
+ tel: boolean;
24
+ text: boolean;
25
+ time: boolean;
26
+ url: boolean;
27
+ week: boolean;
28
+ textarea: boolean;
29
+ select: boolean;
30
+ password: boolean;
31
+ }>;
32
+ export type SlimDOMOptions = Partial<{
33
+ script: boolean;
34
+ comment: boolean;
35
+ headFavicon: boolean;
36
+ headWhitespace: boolean;
37
+ headMetaDescKeywords: boolean;
38
+ headMetaSocial: boolean;
39
+ headMetaRobots: boolean;
40
+ headMetaHttpEquiv: boolean;
41
+ headMetaAuthorship: boolean;
42
+ headMetaVerification: boolean;
43
+ headTitleMutations: boolean;
44
+ }>;
45
+ export type MaskTextFn = (text: string, element: HTMLElement | null) => string;
46
+ export type MaskInputFn = (text: string, element: HTMLElement) => string;
47
+ export type KeepIframeSrcFn = (src: string) => boolean;
48
+ export type BuildCache = {
49
+ stylesWithHoverClass: Map<string, string>;
50
+ };
@@ -0,0 +1,51 @@
1
+ import type { MaskInputFn, MaskInputOptions } from './types';
2
+ import type { IMirror, serializedNodeWithId, serializedNode } from '../rrweb-types';
3
+ export declare function isElement(n: Node): n is Element;
4
+ export declare function isShadowRoot(n: Node): n is ShadowRoot;
5
+ export declare function isNativeShadowDom(shadowRoot: ShadowRoot): boolean;
6
+ declare interface CSSImportRule extends CSSRule {
7
+ readonly href: string;
8
+ readonly layerName: string | null;
9
+ readonly media: MediaList;
10
+ readonly styleSheet: CSSStyleSheet;
11
+ readonly supportsText?: string | null;
12
+ }
13
+ export declare function escapeImportStatement(rule: CSSImportRule): string;
14
+ export declare function stringifyStylesheet(s: CSSStyleSheet): string | null;
15
+ export declare function stringifyRule(rule: CSSRule, sheetHref: string | null): string;
16
+ export declare function fixSafariColons(cssStringified: string): string;
17
+ export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule;
18
+ export declare function isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule;
19
+ export declare class Mirror implements IMirror<Node> {
20
+ private idNodeMap;
21
+ private nodeMetaMap;
22
+ getId(n: Node | undefined | null): number;
23
+ getNode(id: number): Node | null;
24
+ getIds(): number[];
25
+ getMeta(n: Node): serializedNodeWithId | null;
26
+ removeNodeFromMap(n: Node): void;
27
+ has(id: number): boolean;
28
+ hasNode(node: Node): boolean;
29
+ add(n: Node, meta: serializedNodeWithId): void;
30
+ replace(id: number, n: Node): void;
31
+ reset(): void;
32
+ }
33
+ export declare function createMirror(): Mirror;
34
+ export declare function maskInputValue({ element, maskInputOptions, tagName, type, value, maskInputFn, }: {
35
+ element: HTMLElement;
36
+ maskInputOptions: MaskInputOptions;
37
+ tagName: string;
38
+ type: string | null;
39
+ value: string | null;
40
+ maskInputFn?: MaskInputFn;
41
+ }): string;
42
+ export declare function toLowerCase<T extends string>(str: T): Lowercase<T>;
43
+ export declare function is2DCanvasBlank(canvas: HTMLCanvasElement): boolean;
44
+ export declare function isNodeMetaEqual(a: serializedNode, b: serializedNode): boolean;
45
+ export declare function getInputType(element: HTMLElement): Lowercase<string> | null;
46
+ export declare function extractFileExtension(path: string, baseURL?: string): string | null;
47
+ export declare function absolutifyURLs(cssText: string | null, href: string): string;
48
+ export declare function normalizeCssString(cssText: string, _testNoPxNorm?: boolean): string;
49
+ export declare function splitCssText(cssText: string, style: HTMLStyleElement, _testNoPxNorm?: boolean): string[];
50
+ export declare function markCssSplits(cssText: string, style: HTMLStyleElement): string;
51
+ export {};
@@ -0,0 +1,558 @@
1
+ export declare enum EventType {
2
+ DomContentLoaded = 0,
3
+ Load = 1,
4
+ FullSnapshot = 2,
5
+ IncrementalSnapshot = 3,
6
+ Meta = 4,
7
+ Custom = 5,
8
+ Plugin = 6
9
+ }
10
+ export type domContentLoadedEvent = {
11
+ type: EventType.DomContentLoaded;
12
+ data: unknown;
13
+ };
14
+ export type loadedEvent = {
15
+ type: EventType.Load;
16
+ data: unknown;
17
+ };
18
+ export type fullSnapshotEvent = {
19
+ type: EventType.FullSnapshot;
20
+ data: {
21
+ node: serializedNodeWithId;
22
+ initialOffset: {
23
+ top: number;
24
+ left: number;
25
+ };
26
+ };
27
+ };
28
+ export type incrementalSnapshotEvent = {
29
+ type: EventType.IncrementalSnapshot;
30
+ data: incrementalData;
31
+ };
32
+ export type metaEvent = {
33
+ type: EventType.Meta;
34
+ data: {
35
+ href: string;
36
+ width: number;
37
+ height: number;
38
+ };
39
+ };
40
+ export type customEvent<T = unknown> = {
41
+ type: EventType.Custom;
42
+ data: {
43
+ tag: string;
44
+ payload: T;
45
+ };
46
+ };
47
+ export type pluginEvent<T = unknown> = {
48
+ type: EventType.Plugin;
49
+ data: {
50
+ plugin: string;
51
+ payload: T;
52
+ };
53
+ };
54
+ export declare enum IncrementalSource {
55
+ Mutation = 0,
56
+ MouseMove = 1,
57
+ MouseInteraction = 2,
58
+ Scroll = 3,
59
+ ViewportResize = 4,
60
+ Input = 5,
61
+ TouchMove = 6,
62
+ MediaInteraction = 7,
63
+ StyleSheetRule = 8,
64
+ CanvasMutation = 9,
65
+ Font = 10,
66
+ Log = 11,
67
+ Drag = 12,
68
+ StyleDeclaration = 13,
69
+ Selection = 14,
70
+ AdoptedStyleSheet = 15,
71
+ CustomElement = 16
72
+ }
73
+ export type mutationData = {
74
+ source: IncrementalSource.Mutation;
75
+ } & mutationCallbackParam;
76
+ export type mousemoveData = {
77
+ source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
78
+ positions: mousePosition[];
79
+ };
80
+ export type mouseInteractionData = {
81
+ source: IncrementalSource.MouseInteraction;
82
+ } & mouseInteractionParam;
83
+ export type scrollData = {
84
+ source: IncrementalSource.Scroll;
85
+ } & scrollPosition;
86
+ export type viewportResizeData = {
87
+ source: IncrementalSource.ViewportResize;
88
+ } & viewportResizeDimension;
89
+ export type inputData = {
90
+ source: IncrementalSource.Input;
91
+ id: number;
92
+ } & inputValue;
93
+ export type mediaInteractionData = {
94
+ source: IncrementalSource.MediaInteraction;
95
+ } & mediaInteractionParam;
96
+ export type styleSheetRuleData = {
97
+ source: IncrementalSource.StyleSheetRule;
98
+ } & styleSheetRuleParam;
99
+ export type styleDeclarationData = {
100
+ source: IncrementalSource.StyleDeclaration;
101
+ } & styleDeclarationParam;
102
+ export type canvasMutationData = {
103
+ source: IncrementalSource.CanvasMutation;
104
+ } & canvasMutationParam;
105
+ export type fontData = {
106
+ source: IncrementalSource.Font;
107
+ } & fontParam;
108
+ export type selectionData = {
109
+ source: IncrementalSource.Selection;
110
+ } & selectionParam;
111
+ export type adoptedStyleSheetData = {
112
+ source: IncrementalSource.AdoptedStyleSheet;
113
+ } & adoptedStyleSheetParam;
114
+ export type customElementData = {
115
+ source: IncrementalSource.CustomElement;
116
+ } & customElementParam;
117
+ export type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData;
118
+ export type eventWithoutTime = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
119
+ export type event = eventWithoutTime;
120
+ export type eventWithTime = eventWithoutTime & {
121
+ timestamp: number;
122
+ delay?: number;
123
+ };
124
+ export type canvasEventWithTime = eventWithTime & {
125
+ type: EventType.IncrementalSnapshot;
126
+ data: canvasMutationData;
127
+ };
128
+ export type blockClass = string | RegExp;
129
+ export type maskTextClass = string | RegExp;
130
+ export type SamplingStrategy = Partial<{
131
+ mousemove: boolean | number;
132
+ mousemoveCallback: number;
133
+ mouseInteraction: boolean | Record<string, boolean | undefined>;
134
+ scroll: number;
135
+ media: number;
136
+ input: 'all' | 'last';
137
+ canvas: 'all' | number;
138
+ }>;
139
+ export interface ICrossOriginIframeMirror {
140
+ getId(iframe: HTMLIFrameElement, remoteId: number, parentToRemoteMap?: Map<number, number>, remoteToParentMap?: Map<number, number>): number;
141
+ getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];
142
+ getRemoteId(iframe: HTMLIFrameElement, parentId: number, map?: Map<number, number>): number;
143
+ getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];
144
+ reset(iframe?: HTMLIFrameElement): void;
145
+ }
146
+ export type RecordPlugin<TOptions = unknown> = {
147
+ name: string;
148
+ observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
149
+ eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
150
+ getMirror?: (mirrors: {
151
+ nodeMirror: IMirror<Node>;
152
+ crossOriginIframeMirror: ICrossOriginIframeMirror;
153
+ crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
154
+ }) => void;
155
+ options: TOptions;
156
+ };
157
+ export type hooksParam = {
158
+ mutation?: mutationCallBack;
159
+ mousemove?: mousemoveCallBack;
160
+ mouseInteraction?: mouseInteractionCallBack;
161
+ scroll?: scrollCallback;
162
+ viewportResize?: viewportResizeCallback;
163
+ input?: inputCallback;
164
+ mediaInteaction?: mediaInteractionCallback;
165
+ styleSheetRule?: styleSheetRuleCallback;
166
+ styleDeclaration?: styleDeclarationCallback;
167
+ canvasMutation?: canvasMutationCallback;
168
+ font?: fontCallback;
169
+ selection?: selectionCallback;
170
+ customElement?: customElementCallback;
171
+ };
172
+ export type mutationRecord = Readonly<{
173
+ type: string;
174
+ target: Node;
175
+ oldValue: string | null;
176
+ addedNodes: NodeList;
177
+ removedNodes: NodeList;
178
+ attributeName: string | null;
179
+ }>;
180
+ export type textCursor = {
181
+ node: Node;
182
+ value: string | null;
183
+ };
184
+ export type textMutation = {
185
+ id: number;
186
+ value: string | null;
187
+ };
188
+ export type styleOMValue = {
189
+ [key: string]: styleValueWithPriority | string | false;
190
+ };
191
+ export type styleValueWithPriority = [string, string];
192
+ export type attributeCursor = {
193
+ node: Node;
194
+ attributes: {
195
+ [key: string]: string | styleOMValue | null;
196
+ };
197
+ styleDiff: styleOMValue;
198
+ _unchangedStyles: styleOMValue;
199
+ };
200
+ export type attributeMutation = {
201
+ id: number;
202
+ attributes: {
203
+ [key: string]: string | styleOMValue | null;
204
+ };
205
+ };
206
+ export type removedNodeMutation = {
207
+ parentId: number;
208
+ id: number;
209
+ isShadow?: boolean;
210
+ };
211
+ export type addedNodeMutation = {
212
+ parentId: number;
213
+ previousId?: number | null;
214
+ nextId: number | null;
215
+ node: serializedNodeWithId;
216
+ };
217
+ export type mutationCallbackParam = {
218
+ texts: textMutation[];
219
+ attributes: attributeMutation[];
220
+ removes: removedNodeMutation[];
221
+ adds: addedNodeMutation[];
222
+ isAttachIframe?: true;
223
+ };
224
+ export type mutationCallBack = (m: mutationCallbackParam) => void;
225
+ export type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag) => void;
226
+ export type mousePosition = {
227
+ x: number;
228
+ y: number;
229
+ id: number;
230
+ timeOffset: number;
231
+ };
232
+ export type mouseMovePos = {
233
+ x: number;
234
+ y: number;
235
+ id: number;
236
+ debugData: incrementalData;
237
+ };
238
+ export declare enum MouseInteractions {
239
+ MouseUp = 0,
240
+ MouseDown = 1,
241
+ Click = 2,
242
+ ContextMenu = 3,
243
+ DblClick = 4,
244
+ Focus = 5,
245
+ Blur = 6,
246
+ TouchStart = 7,
247
+ TouchMove_Departed = 8,
248
+ TouchEnd = 9,
249
+ TouchCancel = 10
250
+ }
251
+ export declare enum PointerTypes {
252
+ Mouse = 0,
253
+ Pen = 1,
254
+ Touch = 2
255
+ }
256
+ export declare enum CanvasContext {
257
+ '2D' = 0,
258
+ WebGL = 1,
259
+ WebGL2 = 2
260
+ }
261
+ export type SerializedCanvasArg = {
262
+ rr_type: 'ArrayBuffer';
263
+ base64: string;
264
+ } | {
265
+ rr_type: 'Blob';
266
+ data: Array<CanvasArg>;
267
+ type?: string;
268
+ } | {
269
+ rr_type: string;
270
+ src: string;
271
+ } | {
272
+ rr_type: string;
273
+ args: Array<CanvasArg>;
274
+ } | {
275
+ rr_type: string;
276
+ index: number;
277
+ };
278
+ export type CanvasArg = SerializedCanvasArg | string | number | boolean | null | CanvasArg[];
279
+ type mouseInteractionParam = {
280
+ type: MouseInteractions;
281
+ id: number;
282
+ x?: number;
283
+ y?: number;
284
+ pointerType?: PointerTypes;
285
+ };
286
+ export type mouseInteractionCallBack = (d: mouseInteractionParam) => void;
287
+ export type scrollPosition = {
288
+ id: number;
289
+ x: number;
290
+ y: number;
291
+ };
292
+ export type scrollCallback = (p: scrollPosition) => void;
293
+ export type styleSheetAddRule = {
294
+ rule: string;
295
+ index?: number | number[];
296
+ };
297
+ export type styleSheetDeleteRule = {
298
+ index: number | number[];
299
+ };
300
+ export type styleSheetRuleParam = {
301
+ id?: number;
302
+ styleId?: number;
303
+ removes?: styleSheetDeleteRule[];
304
+ adds?: styleSheetAddRule[];
305
+ replace?: string;
306
+ replaceSync?: string;
307
+ };
308
+ export type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
309
+ export type adoptedStyleSheetParam = {
310
+ id: number;
311
+ styles?: {
312
+ styleId: number;
313
+ rules: styleSheetAddRule[];
314
+ }[];
315
+ styleIds: number[];
316
+ };
317
+ export type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;
318
+ export type styleDeclarationParam = {
319
+ id?: number;
320
+ styleId?: number;
321
+ index: number[];
322
+ set?: {
323
+ property: string;
324
+ value: string | null;
325
+ priority: string | undefined;
326
+ };
327
+ remove?: {
328
+ property: string;
329
+ };
330
+ };
331
+ export type styleDeclarationCallback = (s: styleDeclarationParam) => void;
332
+ export type canvasMutationCommand = {
333
+ property: string;
334
+ args: Array<unknown>;
335
+ setter?: true;
336
+ };
337
+ export type canvasMutationParam = {
338
+ id: number;
339
+ type: CanvasContext;
340
+ commands: canvasMutationCommand[];
341
+ } | ({
342
+ id: number;
343
+ type: CanvasContext;
344
+ } & canvasMutationCommand);
345
+ export type canvasMutationWithType = {
346
+ type: CanvasContext;
347
+ } & canvasMutationCommand;
348
+ export type canvasMutationCallback = (p: canvasMutationParam) => void;
349
+ export type canvasManagerMutationCallback = (target: HTMLCanvasElement, p: canvasMutationWithType) => void;
350
+ export type ImageBitmapDataURLWorkerParams = {
351
+ id: number;
352
+ bitmap: ImageBitmap;
353
+ width: number;
354
+ height: number;
355
+ dataURLOptions: DataURLOptions;
356
+ };
357
+ export type ImageBitmapDataURLWorkerResponse = {
358
+ id: number;
359
+ } | {
360
+ id: number;
361
+ type: string;
362
+ base64: string;
363
+ width: number;
364
+ height: number;
365
+ };
366
+ export type fontParam = {
367
+ family: string;
368
+ fontSource: string;
369
+ buffer: boolean;
370
+ descriptors?: FontFaceDescriptors;
371
+ };
372
+ export type fontCallback = (p: fontParam) => void;
373
+ export type viewportResizeDimension = {
374
+ width: number;
375
+ height: number;
376
+ };
377
+ export type viewportResizeCallback = (d: viewportResizeDimension) => void;
378
+ export type inputValue = {
379
+ text: string;
380
+ isChecked: boolean;
381
+ userTriggered?: boolean;
382
+ };
383
+ export type inputCallback = (v: inputValue & {
384
+ id: number;
385
+ }) => void;
386
+ export declare enum MediaInteractions {
387
+ Play = 0,
388
+ Pause = 1,
389
+ Seeked = 2,
390
+ VolumeChange = 3,
391
+ RateChange = 4
392
+ }
393
+ export type mediaInteractionParam = {
394
+ type: MediaInteractions;
395
+ id: number;
396
+ currentTime?: number;
397
+ volume?: number;
398
+ muted?: boolean;
399
+ loop?: boolean;
400
+ playbackRate?: number;
401
+ };
402
+ export type mediaInteractionCallback = (p: mediaInteractionParam) => void;
403
+ export type DocumentDimension = {
404
+ x: number;
405
+ y: number;
406
+ relativeScale: number;
407
+ absoluteScale: number;
408
+ };
409
+ export type SelectionRange = {
410
+ start: number;
411
+ startOffset: number;
412
+ end: number;
413
+ endOffset: number;
414
+ };
415
+ export type selectionParam = {
416
+ ranges: Array<SelectionRange>;
417
+ };
418
+ export type selectionCallback = (p: selectionParam) => void;
419
+ export type customElementParam = {
420
+ define?: {
421
+ name: string;
422
+ };
423
+ };
424
+ export type customElementCallback = (c: customElementParam) => void;
425
+ interface INode extends Node {
426
+ __sn: serializedNodeWithId;
427
+ }
428
+ export type DeprecatedMirror = {
429
+ map: {
430
+ [key: number]: INode;
431
+ };
432
+ getId: (n: Node) => number;
433
+ getNode: (id: number) => INode | null;
434
+ removeNodeFromMap: (n: Node) => void;
435
+ has: (id: number) => boolean;
436
+ reset: () => void;
437
+ };
438
+ export type throttleOptions = {
439
+ leading?: boolean;
440
+ trailing?: boolean;
441
+ };
442
+ export type listenerHandler = () => void;
443
+ export type hookResetter = () => void;
444
+ export type playerMetaData = {
445
+ startTime: number;
446
+ endTime: number;
447
+ totalTime: number;
448
+ };
449
+ export type actionWithDelay = {
450
+ doAction: () => void;
451
+ delay: number;
452
+ };
453
+ export type Handler = (event?: unknown) => void;
454
+ export type Emitter = {
455
+ on(type: string, handler: Handler): void;
456
+ emit(type: string, event?: unknown): void;
457
+ off(type: string, handler: Handler): void;
458
+ };
459
+ export type Arguments<T> = T extends (...payload: infer U) => unknown ? U : unknown;
460
+ export type KeepIframeSrcFn = (src: string) => boolean;
461
+ declare global {
462
+ interface Window {
463
+ FontFace: typeof FontFace;
464
+ }
465
+ }
466
+ export type IWindow = Window & typeof globalThis;
467
+ export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
468
+ export type GetTypedKeys<Obj extends object, ValueType> = TakeTypeHelper<Obj, ValueType>[keyof TakeTypeHelper<Obj, ValueType>];
469
+ export type TakeTypeHelper<Obj extends object, ValueType> = {
470
+ [K in keyof Obj]: Obj[K] extends ValueType ? K : never;
471
+ };
472
+ export type TakeTypedKeyValues<Obj extends object, Type> = Pick<Obj, TakeTypeHelper<Obj, Type>[keyof TakeTypeHelper<Obj, Type>]>;
473
+ export declare enum NodeType {
474
+ Document = 0,
475
+ DocumentType = 1,
476
+ Element = 2,
477
+ Text = 3,
478
+ CDATA = 4,
479
+ Comment = 5
480
+ }
481
+ export type documentNode = {
482
+ type: NodeType.Document;
483
+ childNodes: serializedNodeWithId[];
484
+ compatMode?: string;
485
+ };
486
+ export type documentTypeNode = {
487
+ type: NodeType.DocumentType;
488
+ name: string;
489
+ publicId: string;
490
+ systemId: string;
491
+ };
492
+ type cssTextKeyAttr = {
493
+ _cssText?: string;
494
+ };
495
+ export type attributes = cssTextKeyAttr & {
496
+ [key: string]: string | number | true | null;
497
+ };
498
+ export type legacyAttributes = {
499
+ selected: false;
500
+ };
501
+ export type mediaAttributes = {
502
+ rr_mediaState: 'played' | 'paused';
503
+ rr_mediaCurrentTime: number;
504
+ rr_mediaPlaybackRate?: number;
505
+ rr_mediaMuted?: boolean;
506
+ rr_mediaLoop?: boolean;
507
+ rr_mediaVolume?: number;
508
+ };
509
+ export type elementNode = {
510
+ type: NodeType.Element;
511
+ tagName: string;
512
+ attributes: attributes;
513
+ childNodes: serializedNodeWithId[];
514
+ isSVG?: true;
515
+ needBlock?: boolean;
516
+ isCustom?: true;
517
+ };
518
+ export type textNode = {
519
+ type: NodeType.Text;
520
+ textContent: string;
521
+ isStyle?: true;
522
+ };
523
+ export type cdataNode = {
524
+ type: NodeType.CDATA;
525
+ textContent: '';
526
+ };
527
+ export type commentNode = {
528
+ type: NodeType.Comment;
529
+ textContent: string;
530
+ };
531
+ export type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
532
+ rootId?: number;
533
+ isShadowHost?: boolean;
534
+ isShadow?: boolean;
535
+ };
536
+ export type serializedNodeWithId = serializedNode & {
537
+ id: number;
538
+ };
539
+ export type serializedElementNodeWithId = Extract<serializedNodeWithId, Record<'type', NodeType.Element>>;
540
+ export interface IMirror<TNode> {
541
+ getId(n: TNode | undefined | null): number;
542
+ getNode(id: number): TNode | null;
543
+ getIds(): number[];
544
+ getMeta(n: TNode): serializedNodeWithId | null;
545
+ removeNodeFromMap(n: TNode): void;
546
+ has(id: number): boolean;
547
+ hasNode(node: TNode): boolean;
548
+ add(n: TNode, meta: serializedNodeWithId): void;
549
+ replace(id: number, n: TNode): void;
550
+ reset(): void;
551
+ }
552
+ export type DataURLOptions = Partial<{
553
+ type: string;
554
+ quality: number;
555
+ }>;
556
+ export type PackFn = (event: eventWithTime) => string;
557
+ export type UnpackFn = (raw: string) => eventWithTime;
558
+ export {};
@@ -0,0 +1,43 @@
1
+ type BasePrototypeCache = {
2
+ Node: typeof Node.prototype;
3
+ ShadowRoot: typeof ShadowRoot.prototype;
4
+ MutationObserver: typeof MutationObserver.prototype;
5
+ Element: typeof Element.prototype;
6
+ };
7
+ export declare const isAngularZonePresent: () => boolean;
8
+ export declare function getUntaintedPrototype<T extends keyof BasePrototypeCache>(key: T): BasePrototypeCache[T];
9
+ export declare function getUntaintedAccessor<K extends keyof BasePrototypeCache, T extends keyof BasePrototypeCache[K]>(key: K, instance: BasePrototypeCache[K], accessor: T): BasePrototypeCache[K][T];
10
+ export declare function getUntaintedMethod<K extends keyof BasePrototypeCache, T extends keyof BasePrototypeCache[K]>(key: K, instance: BasePrototypeCache[K], method: T): BasePrototypeCache[K][T];
11
+ export declare function ownerDocument(n: Node): Document | null;
12
+ export declare function childNodes(n: Node): NodeListOf<Node>;
13
+ export declare function parentNode(n: Node): ParentNode | null;
14
+ export declare function parentElement(n: Node): HTMLElement | null;
15
+ export declare function textContent(n: Node): string | null;
16
+ export declare function contains(n: Node, other: Node): boolean;
17
+ export declare function getRootNode(n: Node): Node;
18
+ export declare function host(n: ShadowRoot): Element | null;
19
+ export declare function styleSheets(n: ShadowRoot): StyleSheetList;
20
+ export declare function shadowRoot(n: Node): ShadowRoot | null;
21
+ export declare function querySelector(n: Element, selectors: string): Element | null;
22
+ export declare function querySelectorAll(n: Element, selectors: string): NodeListOf<Element>;
23
+ export declare function mutationObserverCtor(): (typeof MutationObserver)['prototype']['constructor'];
24
+ export declare function patch(source: {
25
+ [key: string]: any;
26
+ }, name: string, replacement: (...args: any[]) => any): () => void;
27
+ declare const _default: {
28
+ ownerDocument: typeof ownerDocument;
29
+ childNodes: typeof childNodes;
30
+ parentNode: typeof parentNode;
31
+ parentElement: typeof parentElement;
32
+ textContent: typeof textContent;
33
+ contains: typeof contains;
34
+ getRootNode: typeof getRootNode;
35
+ host: typeof host;
36
+ styleSheets: typeof styleSheets;
37
+ shadowRoot: typeof shadowRoot;
38
+ querySelector: typeof querySelector;
39
+ querySelectorAll: typeof querySelectorAll;
40
+ mutationObserver: typeof mutationObserverCtor;
41
+ patch: typeof patch;
42
+ };
43
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instrumentation';
2
2
  import { CoralogixRumLabels } from '../types';
3
+ export declare function extractMfePath(fileName: string): string | undefined;
3
4
  export declare const ERROR_INSTRUMENTATION_NAME = "errors";
4
5
  export declare const ErrorAttributes: {
5
6
  TYPE: string;