@highlight-run/rrweb 2.0.0-lambda.5 → 2.0.0-lambda.8

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/rrweb.d.cts CHANGED
@@ -9,6 +9,7 @@ import { Emitter } from '../../../../node_modules/@highlight-run/rrweb-types/dis
9
9
  import { EventType } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
10
10
  import { eventWithTime } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
11
11
  import { eventWithTime as eventWithTime_2 } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
12
+ import { eventWithTime as eventWithTime_3 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
12
13
  import { Handler } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
13
14
  import { hookResetter } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
14
15
  import { hooksParam } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
@@ -26,8 +27,10 @@ import { Mirror } from '../../../../node_modules/@highlight-run/rrweb-snapshot/d
26
27
  import { Mirror as Mirror_2 } from '../../../node_modules/@highlight-run/rrweb-snapshot/dist/rrweb-snapshot.js';
27
28
  import { Mirror as Mirror_3 } from 'rrweb-snapshot';
28
29
  import { MouseInteractions } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
30
+ import { nowTimestamp } from '../../../node_modules/@highlight-run/rrweb-utils/dist/rrweb-utils.js';
29
31
  import { PackFn } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
30
32
  import { playerMetaData } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
33
+ import { playerMetaData as playerMetaData_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
31
34
  import { RecordPlugin } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
32
35
  import { ReplayerEvents } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
33
36
  import { RRDocument } from '../../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
@@ -35,6 +38,7 @@ import { RRIFrameElement } from '../../../node_modules/@highlight-run/rrdom/dist
35
38
  import { RRNode } from '../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
36
39
  import { SamplingStrategy } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
37
40
  import { SessionInterval } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
41
+ import { SessionInterval as SessionInterval_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
38
42
  import { SlimDOMOptions } from '../../../node_modules/@highlight-run/rrweb-snapshot/dist/rrweb-snapshot.js';
39
43
  import { StateMachine } from '@xstate/fsm';
40
44
  import { textMutation } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
@@ -48,6 +52,8 @@ declare type AppendedIframe = {
48
52
  builtNode: HTMLIFrameElement | RRIFrameElement;
49
53
  };
50
54
 
55
+ export declare function buildHostDocument(options: HostDocumentOptions): string;
56
+
51
57
  export declare function canvasMutation({ event, mutation, target, imageMap, canvasEventMap, errorHandler, }: {
52
58
  event: Parameters<Replayer['applyIncremental']>[0];
53
59
  mutation: canvasMutationData;
@@ -63,6 +69,84 @@ declare function createPlayerService(context: PlayerContext, { getCastFn, applyE
63
69
 
64
70
  declare function createSpeedService(context: SpeedContext): StateMachine.Service<SpeedContext, SpeedEvent, SpeedState>;
65
71
 
72
+ export declare class EmbeddedReplayerClient {
73
+ private readonly iframe;
74
+ private readonly hostOrigin;
75
+ private readonly listeners;
76
+ private metadata;
77
+ private activityIntervals;
78
+ private dimensions;
79
+ private lastCurrentTime;
80
+ private ready;
81
+ private readyResolvers;
82
+ private disposed;
83
+ private pending;
84
+ constructor(iframe: HTMLIFrameElement, options?: EmbeddedReplayerClientOptions);
85
+ whenReady(): Promise<void>;
86
+ init(events: eventWithTime_3[], config?: SerializableReplayerConfig, autoplay?: boolean): void;
87
+ play(timeOffset?: number): void;
88
+ pause(timeOffset?: number): void;
89
+ resume(timeOffset?: number): void;
90
+ setConfig(config: SerializableReplayerConfig): void;
91
+ setLayout(scale: number, anchor?: ReplayAnchor): void;
92
+ replaceEvents(events: eventWithTime_3[]): void;
93
+ addEvent(event: eventWithTime_3): void;
94
+ enableInteract(): void;
95
+ disableInteract(): void;
96
+ destroy(): void;
97
+ on(event: string, listener: Listener): void;
98
+ off(event: string, listener: Listener): void;
99
+ getCurrentTime(): number;
100
+ getMetaData(): playerMetaData_2 | null;
101
+ getActivityIntervals(): SessionInterval_2[];
102
+ getDimensions(): ReplayDimensions | null;
103
+ private send;
104
+ private postToHost;
105
+ private flushPending;
106
+ private probe;
107
+ private onMessage;
108
+ private handle;
109
+ private emit;
110
+ }
111
+
112
+ export declare interface EmbeddedReplayerClientOptions {
113
+ hostOrigin?: string;
114
+ }
115
+
116
+ export declare class EmbeddedReplayerHost {
117
+ private readonly root;
118
+ private readonly parentWindow;
119
+ private readonly timeUpdateIntervalMs;
120
+ private readonly expectedParentOrigin;
121
+ private replayer;
122
+ private playing;
123
+ private timer;
124
+ private started;
125
+ private layout;
126
+ constructor(options?: EmbeddedReplayerHostOptions);
127
+ start(): void;
128
+ stop(): void;
129
+ private onMessage;
130
+ private handle;
131
+ private init;
132
+ private applyLayout;
133
+ private postDimensions;
134
+ private postInitialized;
135
+ private wireEvents;
136
+ private setPlaying;
137
+ private startTimePump;
138
+ private postTime;
139
+ private stopTimePump;
140
+ private post;
141
+ }
142
+
143
+ export declare interface EmbeddedReplayerHostOptions {
144
+ expectedParentOrigin?: string;
145
+ root?: HTMLElement;
146
+ parentWindow?: Window;
147
+ timeUpdateIntervalMs?: number;
148
+ }
149
+
66
150
  declare type ErrorHandler = (error: unknown) => void | boolean;
67
151
 
68
152
  export { EventType }
@@ -73,7 +157,7 @@ export declare const freezePage: () => void;
73
157
 
74
158
  declare function getBaseDimension(node: Node, rootIframe: Node): DocumentDimension;
75
159
 
76
- declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
160
+ declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule | null;
77
161
 
78
162
  declare function getPositionsAndIndex(nestedIndex: number[]): {
79
163
  positions: number[];
@@ -99,6 +183,73 @@ declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
99
183
 
100
184
  declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
101
185
 
186
+ export declare type HostCommand = {
187
+ type: 'ping';
188
+ } | {
189
+ type: 'init';
190
+ events: eventWithTime_3[];
191
+ config?: SerializableReplayerConfig;
192
+ autoplay?: boolean;
193
+ } | {
194
+ type: 'setLayout';
195
+ scale: number;
196
+ anchor?: ReplayAnchor;
197
+ } | {
198
+ type: 'play';
199
+ timeOffset?: number;
200
+ } | {
201
+ type: 'pause';
202
+ timeOffset?: number;
203
+ } | {
204
+ type: 'resume';
205
+ timeOffset?: number;
206
+ } | {
207
+ type: 'setConfig';
208
+ config: SerializableReplayerConfig;
209
+ } | {
210
+ type: 'replaceEvents';
211
+ events: eventWithTime_3[];
212
+ } | {
213
+ type: 'addEvent';
214
+ event: eventWithTime_3;
215
+ } | {
216
+ type: 'enableInteract';
217
+ } | {
218
+ type: 'disableInteract';
219
+ } | {
220
+ type: 'destroy';
221
+ };
222
+
223
+ export declare interface HostDocumentOptions {
224
+ scriptUrl: string;
225
+ styleUrl?: string;
226
+ extraStyleSources?: string[];
227
+ }
228
+
229
+ export declare type HostMessage = {
230
+ type: 'ready';
231
+ } | {
232
+ type: 'initialized';
233
+ metadata: playerMetaData_2;
234
+ activityIntervals: SessionInterval_2[];
235
+ } | {
236
+ type: 'replayer-event';
237
+ event: string;
238
+ payload?: unknown;
239
+ } | {
240
+ type: 'time';
241
+ currentTime: number;
242
+ } | {
243
+ type: 'dimensions';
244
+ width: number;
245
+ height: number;
246
+ top: number;
247
+ left: number;
248
+ } | {
249
+ type: 'error';
250
+ message: string;
251
+ };
252
+
102
253
  export { IncrementalSource }
103
254
 
104
255
  declare function inDom(n: Node): boolean;
@@ -121,14 +272,16 @@ declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeM
121
272
 
122
273
  declare function legacy_isTouchEvent(event: MouseEvent | TouchEvent | PointerEvent): event is TouchEvent;
123
274
 
275
+ declare type Listener = (payload?: unknown) => void;
276
+
124
277
  export declare let mirror: DeprecatedMirror;
125
278
 
126
279
  export { MouseInteractions }
127
280
 
128
- declare let nowTimestamp: () => number;
129
-
130
281
  declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler_2;
131
282
 
283
+ export declare function pickSerializableConfig(config: unknown): SerializableReplayerConfig;
284
+
132
285
  declare type PlayerAssets = {
133
286
  emitter: Emitter;
134
287
  applyEventsSynchronously(events: Array<eventWithTime_2>): void;
@@ -149,6 +302,7 @@ export declare type playerConfig = {
149
302
  insertStyleRules: string[];
150
303
  triggerFocus: boolean;
151
304
  UNSAFE_replayCanvas: boolean;
305
+ cspContent?: string;
152
306
  pauseAnimation?: boolean;
153
307
  mouseTail: boolean | {
154
308
  duration?: number;
@@ -275,9 +429,19 @@ export declare type recordOptions<T> = {
275
429
  };
276
430
  };
277
431
 
432
+ export declare type ReplayAnchor = 'top' | 'center';
433
+
434
+ export declare interface ReplayDimensions {
435
+ width: number;
436
+ height: number;
437
+ top: number;
438
+ left: number;
439
+ }
440
+
278
441
  export declare class Replayer {
279
442
  wrapper: HTMLDivElement;
280
443
  iframe: HTMLIFrameElement;
444
+ private UNSAFE_replayCanvas;
281
445
  service: ReturnType<typeof createPlayerService>;
282
446
  speedService: ReturnType<typeof createSpeedService>;
283
447
  get timer(): Timer;
@@ -382,6 +546,16 @@ declare type ResolveTree = {
382
546
  parent: ResolveTree | null;
383
547
  };
384
548
 
549
+ export declare const RRWEB_EMBEDDED_CHANNEL: "rrweb-embedded";
550
+
551
+ export declare const RRWEB_EMBEDDED_PROTOCOL_VERSION: 1;
552
+
553
+ declare const SERIALIZABLE_CONFIG_KEYS: readonly ["speed", "maxSpeed", "loadTimeout", "skipInactive", "inactivePeriodThreshold", "showWarning", "showDebug", "blockClass", "liveMode", "insertStyleRules", "triggerFocus", "UNSAFE_replayCanvas", "cspContent", "pauseAnimation", "mouseTail", "useVirtualDom", "inactiveThreshold", "inactiveSkipTime"];
554
+
555
+ declare type SerializableConfigKey = (typeof SERIALIZABLE_CONFIG_KEYS)[number];
556
+
557
+ export declare type SerializableReplayerConfig = Partial<Pick<playerConfig, SerializableConfigKey>>;
558
+
385
559
  declare function shadowHostInDom(n: Node): boolean;
386
560
 
387
561
  declare type SpeedContext = {
@@ -413,6 +587,8 @@ declare type SpeedState = {
413
587
  context: SpeedContext;
414
588
  };
415
589
 
590
+ export declare function startEmbeddedReplayerHost(options?: EmbeddedReplayerHostOptions): EmbeddedReplayerHost;
591
+
416
592
  declare class StyleSheetMirror {
417
593
  private id;
418
594
  private styleIDMap;
@@ -442,6 +618,7 @@ declare class Timer {
442
618
  addActions(actions: actionWithDelay[]): void;
443
619
  replaceActions(actions: actionWithDelay[]): void;
444
620
  start(): void;
621
+ updateLiveTime(): void;
445
622
  private rafCheck;
446
623
  clear(): void;
447
624
  setSpeed(speed: number): void;
@@ -479,8 +656,8 @@ declare namespace utils {
479
656
  getRootShadowHost,
480
657
  shadowHostInDom,
481
658
  inDom,
482
- mirror as _mirror,
483
659
  nowTimestamp,
660
+ mirror as _mirror,
484
661
  isCanvasNode,
485
662
  AppendedIframe,
486
663
  StyleSheetMirror
package/dist/rrweb.d.ts CHANGED
@@ -9,6 +9,7 @@ import { Emitter } from '../../../../node_modules/@highlight-run/rrweb-types/dis
9
9
  import { EventType } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
10
10
  import { eventWithTime } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
11
11
  import { eventWithTime as eventWithTime_2 } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
12
+ import { eventWithTime as eventWithTime_3 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
12
13
  import { Handler } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
13
14
  import { hookResetter } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
14
15
  import { hooksParam } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
@@ -26,8 +27,10 @@ import { Mirror } from '../../../../node_modules/@highlight-run/rrweb-snapshot/d
26
27
  import { Mirror as Mirror_2 } from '../../../node_modules/@highlight-run/rrweb-snapshot/dist/rrweb-snapshot.js';
27
28
  import { Mirror as Mirror_3 } from 'rrweb-snapshot';
28
29
  import { MouseInteractions } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
30
+ import { nowTimestamp } from '../../../node_modules/@highlight-run/rrweb-utils/dist/rrweb-utils.js';
29
31
  import { PackFn } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
30
32
  import { playerMetaData } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
33
+ import { playerMetaData as playerMetaData_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
31
34
  import { RecordPlugin } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
32
35
  import { ReplayerEvents } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
33
36
  import { RRDocument } from '../../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
@@ -35,6 +38,7 @@ import { RRIFrameElement } from '../../../node_modules/@highlight-run/rrdom/dist
35
38
  import { RRNode } from '../../../node_modules/@highlight-run/rrdom/dist/rrdom.js';
36
39
  import { SamplingStrategy } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
37
40
  import { SessionInterval } from '../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
41
+ import { SessionInterval as SessionInterval_2 } from '../../../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
38
42
  import { SlimDOMOptions } from '../../../node_modules/@highlight-run/rrweb-snapshot/dist/rrweb-snapshot.js';
39
43
  import { StateMachine } from '@xstate/fsm';
40
44
  import { textMutation } from '../../../node_modules/@highlight-run/rrweb-types/dist/rrweb-types.js';
@@ -48,6 +52,8 @@ declare type AppendedIframe = {
48
52
  builtNode: HTMLIFrameElement | RRIFrameElement;
49
53
  };
50
54
 
55
+ export declare function buildHostDocument(options: HostDocumentOptions): string;
56
+
51
57
  export declare function canvasMutation({ event, mutation, target, imageMap, canvasEventMap, errorHandler, }: {
52
58
  event: Parameters<Replayer['applyIncremental']>[0];
53
59
  mutation: canvasMutationData;
@@ -63,6 +69,84 @@ declare function createPlayerService(context: PlayerContext, { getCastFn, applyE
63
69
 
64
70
  declare function createSpeedService(context: SpeedContext): StateMachine.Service<SpeedContext, SpeedEvent, SpeedState>;
65
71
 
72
+ export declare class EmbeddedReplayerClient {
73
+ private readonly iframe;
74
+ private readonly hostOrigin;
75
+ private readonly listeners;
76
+ private metadata;
77
+ private activityIntervals;
78
+ private dimensions;
79
+ private lastCurrentTime;
80
+ private ready;
81
+ private readyResolvers;
82
+ private disposed;
83
+ private pending;
84
+ constructor(iframe: HTMLIFrameElement, options?: EmbeddedReplayerClientOptions);
85
+ whenReady(): Promise<void>;
86
+ init(events: eventWithTime_3[], config?: SerializableReplayerConfig, autoplay?: boolean): void;
87
+ play(timeOffset?: number): void;
88
+ pause(timeOffset?: number): void;
89
+ resume(timeOffset?: number): void;
90
+ setConfig(config: SerializableReplayerConfig): void;
91
+ setLayout(scale: number, anchor?: ReplayAnchor): void;
92
+ replaceEvents(events: eventWithTime_3[]): void;
93
+ addEvent(event: eventWithTime_3): void;
94
+ enableInteract(): void;
95
+ disableInteract(): void;
96
+ destroy(): void;
97
+ on(event: string, listener: Listener): void;
98
+ off(event: string, listener: Listener): void;
99
+ getCurrentTime(): number;
100
+ getMetaData(): playerMetaData_2 | null;
101
+ getActivityIntervals(): SessionInterval_2[];
102
+ getDimensions(): ReplayDimensions | null;
103
+ private send;
104
+ private postToHost;
105
+ private flushPending;
106
+ private probe;
107
+ private onMessage;
108
+ private handle;
109
+ private emit;
110
+ }
111
+
112
+ export declare interface EmbeddedReplayerClientOptions {
113
+ hostOrigin?: string;
114
+ }
115
+
116
+ export declare class EmbeddedReplayerHost {
117
+ private readonly root;
118
+ private readonly parentWindow;
119
+ private readonly timeUpdateIntervalMs;
120
+ private readonly expectedParentOrigin;
121
+ private replayer;
122
+ private playing;
123
+ private timer;
124
+ private started;
125
+ private layout;
126
+ constructor(options?: EmbeddedReplayerHostOptions);
127
+ start(): void;
128
+ stop(): void;
129
+ private onMessage;
130
+ private handle;
131
+ private init;
132
+ private applyLayout;
133
+ private postDimensions;
134
+ private postInitialized;
135
+ private wireEvents;
136
+ private setPlaying;
137
+ private startTimePump;
138
+ private postTime;
139
+ private stopTimePump;
140
+ private post;
141
+ }
142
+
143
+ export declare interface EmbeddedReplayerHostOptions {
144
+ expectedParentOrigin?: string;
145
+ root?: HTMLElement;
146
+ parentWindow?: Window;
147
+ timeUpdateIntervalMs?: number;
148
+ }
149
+
66
150
  declare type ErrorHandler = (error: unknown) => void | boolean;
67
151
 
68
152
  export { EventType }
@@ -73,7 +157,7 @@ export declare const freezePage: () => void;
73
157
 
74
158
  declare function getBaseDimension(node: Node, rootIframe: Node): DocumentDimension;
75
159
 
76
- declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
160
+ declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule | null;
77
161
 
78
162
  declare function getPositionsAndIndex(nestedIndex: number[]): {
79
163
  positions: number[];
@@ -99,6 +183,73 @@ declare function hasShadowRoot<T extends Node | RRNode>(n: T): n is T & {
99
183
 
100
184
  declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
101
185
 
186
+ export declare type HostCommand = {
187
+ type: 'ping';
188
+ } | {
189
+ type: 'init';
190
+ events: eventWithTime_3[];
191
+ config?: SerializableReplayerConfig;
192
+ autoplay?: boolean;
193
+ } | {
194
+ type: 'setLayout';
195
+ scale: number;
196
+ anchor?: ReplayAnchor;
197
+ } | {
198
+ type: 'play';
199
+ timeOffset?: number;
200
+ } | {
201
+ type: 'pause';
202
+ timeOffset?: number;
203
+ } | {
204
+ type: 'resume';
205
+ timeOffset?: number;
206
+ } | {
207
+ type: 'setConfig';
208
+ config: SerializableReplayerConfig;
209
+ } | {
210
+ type: 'replaceEvents';
211
+ events: eventWithTime_3[];
212
+ } | {
213
+ type: 'addEvent';
214
+ event: eventWithTime_3;
215
+ } | {
216
+ type: 'enableInteract';
217
+ } | {
218
+ type: 'disableInteract';
219
+ } | {
220
+ type: 'destroy';
221
+ };
222
+
223
+ export declare interface HostDocumentOptions {
224
+ scriptUrl: string;
225
+ styleUrl?: string;
226
+ extraStyleSources?: string[];
227
+ }
228
+
229
+ export declare type HostMessage = {
230
+ type: 'ready';
231
+ } | {
232
+ type: 'initialized';
233
+ metadata: playerMetaData_2;
234
+ activityIntervals: SessionInterval_2[];
235
+ } | {
236
+ type: 'replayer-event';
237
+ event: string;
238
+ payload?: unknown;
239
+ } | {
240
+ type: 'time';
241
+ currentTime: number;
242
+ } | {
243
+ type: 'dimensions';
244
+ width: number;
245
+ height: number;
246
+ top: number;
247
+ left: number;
248
+ } | {
249
+ type: 'error';
250
+ message: string;
251
+ };
252
+
102
253
  export { IncrementalSource }
103
254
 
104
255
  declare function inDom(n: Node): boolean;
@@ -121,14 +272,16 @@ declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeM
121
272
 
122
273
  declare function legacy_isTouchEvent(event: MouseEvent | TouchEvent | PointerEvent): event is TouchEvent;
123
274
 
275
+ declare type Listener = (payload?: unknown) => void;
276
+
124
277
  export declare let mirror: DeprecatedMirror;
125
278
 
126
279
  export { MouseInteractions }
127
280
 
128
- declare let nowTimestamp: () => number;
129
-
130
281
  declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler_2;
131
282
 
283
+ export declare function pickSerializableConfig(config: unknown): SerializableReplayerConfig;
284
+
132
285
  declare type PlayerAssets = {
133
286
  emitter: Emitter;
134
287
  applyEventsSynchronously(events: Array<eventWithTime_2>): void;
@@ -149,6 +302,7 @@ export declare type playerConfig = {
149
302
  insertStyleRules: string[];
150
303
  triggerFocus: boolean;
151
304
  UNSAFE_replayCanvas: boolean;
305
+ cspContent?: string;
152
306
  pauseAnimation?: boolean;
153
307
  mouseTail: boolean | {
154
308
  duration?: number;
@@ -275,9 +429,19 @@ export declare type recordOptions<T> = {
275
429
  };
276
430
  };
277
431
 
432
+ export declare type ReplayAnchor = 'top' | 'center';
433
+
434
+ export declare interface ReplayDimensions {
435
+ width: number;
436
+ height: number;
437
+ top: number;
438
+ left: number;
439
+ }
440
+
278
441
  export declare class Replayer {
279
442
  wrapper: HTMLDivElement;
280
443
  iframe: HTMLIFrameElement;
444
+ private UNSAFE_replayCanvas;
281
445
  service: ReturnType<typeof createPlayerService>;
282
446
  speedService: ReturnType<typeof createSpeedService>;
283
447
  get timer(): Timer;
@@ -382,6 +546,16 @@ declare type ResolveTree = {
382
546
  parent: ResolveTree | null;
383
547
  };
384
548
 
549
+ export declare const RRWEB_EMBEDDED_CHANNEL: "rrweb-embedded";
550
+
551
+ export declare const RRWEB_EMBEDDED_PROTOCOL_VERSION: 1;
552
+
553
+ declare const SERIALIZABLE_CONFIG_KEYS: readonly ["speed", "maxSpeed", "loadTimeout", "skipInactive", "inactivePeriodThreshold", "showWarning", "showDebug", "blockClass", "liveMode", "insertStyleRules", "triggerFocus", "UNSAFE_replayCanvas", "cspContent", "pauseAnimation", "mouseTail", "useVirtualDom", "inactiveThreshold", "inactiveSkipTime"];
554
+
555
+ declare type SerializableConfigKey = (typeof SERIALIZABLE_CONFIG_KEYS)[number];
556
+
557
+ export declare type SerializableReplayerConfig = Partial<Pick<playerConfig, SerializableConfigKey>>;
558
+
385
559
  declare function shadowHostInDom(n: Node): boolean;
386
560
 
387
561
  declare type SpeedContext = {
@@ -413,6 +587,8 @@ declare type SpeedState = {
413
587
  context: SpeedContext;
414
588
  };
415
589
 
590
+ export declare function startEmbeddedReplayerHost(options?: EmbeddedReplayerHostOptions): EmbeddedReplayerHost;
591
+
416
592
  declare class StyleSheetMirror {
417
593
  private id;
418
594
  private styleIDMap;
@@ -442,6 +618,7 @@ declare class Timer {
442
618
  addActions(actions: actionWithDelay[]): void;
443
619
  replaceActions(actions: actionWithDelay[]): void;
444
620
  start(): void;
621
+ updateLiveTime(): void;
445
622
  private rafCheck;
446
623
  clear(): void;
447
624
  setSpeed(speed: number): void;
@@ -479,8 +656,8 @@ declare namespace utils {
479
656
  getRootShadowHost,
480
657
  shadowHostInDom,
481
658
  inDom,
482
- mirror as _mirror,
483
659
  nowTimestamp,
660
+ mirror as _mirror,
484
661
  isCanvasNode,
485
662
  AppendedIframe,
486
663
  StyleSheetMirror