Skip to content

Commit 5e8737f

Browse files
WIP
1 parent 5dea662 commit 5e8737f

File tree

4 files changed

+716
-4
lines changed

4 files changed

+716
-4
lines changed

lib/cjs/generated/browserSessionReplay.d.ts

Lines changed: 179 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export declare type CreationReason = 'init' | 'segment_duration_limit' | 'segmen
2727
/**
2828
* Browser-specific. Schema of a Session Replay Record.
2929
*/
30-
export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord;
30+
export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord | BrowserChangeRecord;
3131
/**
3232
* Browser-specific. Schema of a Record type which contains the full snapshot of a screen.
3333
*/
@@ -303,6 +303,184 @@ export declare type FrustrationRecord = SlotSupportedCommonRecordSchema & {
303303
recordIds: number[];
304304
};
305305
};
306+
/**
307+
* Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.)
308+
*/
309+
export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & {
310+
/**
311+
* The type of this Record.
312+
*/
313+
readonly type: 12;
314+
data: BrowserChangeData;
315+
id?: number;
316+
};
317+
/**
318+
* Browser-specific. Schema of a Session Replay BrowserChangeData type.
319+
*/
320+
export declare type BrowserChangeData = {
321+
/**
322+
* Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node.
323+
*/
324+
adoptedStyleSheetsChanges?: AdoptedStyleSheetsChange[];
325+
/**
326+
* Changes to the attributes of a node.
327+
*/
328+
attributeChanges?: AttributeChange[];
329+
/**
330+
* Newly added nodes.
331+
*/
332+
nodesAdded?: AddNodeChange[];
333+
/**
334+
* Newly removed nodes.
335+
*/
336+
nodesRemoved?: NodeId[];
337+
/**
338+
* Changes to the scroll position of a node.
339+
*/
340+
scrollChanges?: ScrollPositionChange[];
341+
/**
342+
* Newly added strings.
343+
*/
344+
stringsAdded?: AddStringChange[];
345+
/**
346+
* Changes to the text content of a node.
347+
*/
348+
textChanges?: TextChange[];
349+
};
350+
/**
351+
* Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree.
352+
*
353+
* @minItems 1
354+
*/
355+
export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]];
356+
/**
357+
* Browser-specific. Schema representing the ID of a DOM node.
358+
*/
359+
export declare type NodeId = number;
360+
/**
361+
* Browser-specific. Schema representing a change to an node's attributes.
362+
*
363+
* @minItems 1
364+
*/
365+
export declare type AttributeChange = [NodeId, ...AttributeAssignmentOrDeletion[]];
366+
/**
367+
* Browser-specific. Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute.
368+
*
369+
* @minItems 2
370+
*/
371+
export declare type AttributeAssignmentOrDeletion = [string, string | null];
372+
/**
373+
* Browser-specific. Schema representing the addition of a new node to the document.
374+
*/
375+
export declare type AddNodeChange = AddCDataSectionNodeChange | AddDocTypeNodeChange | AddDocumentNodeChange | AddDocumentFragmentNodeChange | AddElementNodeChange | AddTextNodeChange | AddShadowRootNodeChange;
376+
/**
377+
* Browser-specific. Schema representing the addition of a new #cdata-section node to the document.
378+
*
379+
* @minItems 2
380+
*/
381+
export declare type AddCDataSectionNodeChange = [InsertionPoint, CDataSectionNodeName];
382+
/**
383+
* Browser-specific. Schema representing the insertion point of a node which is being added to the document.
384+
*/
385+
export declare type InsertionPoint = RootInsertionPoint | LastChildInsertionPoint | NextSiblingInsertionPoint;
386+
/**
387+
* A null insertion point, indicating that the node should be inserted at the root of the document.
388+
*/
389+
export declare type RootInsertionPoint = null;
390+
/**
391+
* A positive integer insertion point. Inserting a node at positive integer N indicates that the node should be inserted as the last child of the node with an id N lower than the new node.
392+
*/
393+
export declare type LastChildInsertionPoint = number;
394+
/**
395+
* A negative integer insertion point. Inserting a node at negative integer -N indicates that the node should be inserted as the next sibling of the node with an id N lower than the new node.
396+
*/
397+
export declare type NextSiblingInsertionPoint = number;
398+
/**
399+
* Browser-specific. Schema representing the node name for a #cdata-section node, expressed as either a reference to the string table or a literal string.
400+
*/
401+
export declare type CDataSectionNodeName = number | '#cdata-section';
402+
/**
403+
* Browser-specific. Schema representing the addition of a new #doctype node to the document.
404+
*
405+
* @minItems 5
406+
*/
407+
export declare type AddDocTypeNodeChange = [InsertionPoint, DocTypeNodeName, string, string, string];
408+
/**
409+
* Browser-specific. Schema representing the node name for a #doctype node, expressed as either a reference to the string table or a literal string.
410+
*/
411+
export declare type DocTypeNodeName = number | '#doctype';
412+
/**
413+
* Browser-specific. Schema representing the addition of a new #document node to the document.
414+
*
415+
* @minItems 2
416+
*/
417+
export declare type AddDocumentNodeChange = [InsertionPoint, DocumentNodeName];
418+
/**
419+
* Browser-specific. Schema representing the node name for a #document node, expressed as either a reference to the string table or a literal string.
420+
*/
421+
export declare type DocumentNodeName = number | '#document';
422+
/**
423+
* Browser-specific. Schema representing the addition of a new #document-fragment node to the document.
424+
*
425+
* @minItems 2
426+
*/
427+
export declare type AddDocumentFragmentNodeChange = [InsertionPoint, DocumentFragmentNodeName];
428+
/**
429+
* Browser-specific. Schema representing the node name for a #document-fragment node, expressed as either a reference to the string table or a literal string.
430+
*/
431+
export declare type DocumentFragmentNodeName = number | '#document-fragment';
432+
/**
433+
* Browser-specific. Schema representing the addition of a new element node to the document.
434+
*
435+
* @minItems 2
436+
*/
437+
export declare type AddElementNodeChange = [InsertionPoint, NodeName, ...AttributeAssignment[]];
438+
/**
439+
* Browser-specific. Schema representing a node name (i.e., Node#nodeName), expressed as either a reference to the string table or a literal string.
440+
*/
441+
export declare type NodeName = number | string;
442+
/**
443+
* Browser-specific. Schema representing an assignment of a value to an attribute.
444+
*
445+
* @minItems 2
446+
*/
447+
export declare type AttributeAssignment = [string, string];
448+
/**
449+
* Browser-specific. Schema representing the addition of a new #text node to the document.
450+
*
451+
* @minItems 3
452+
*/
453+
export declare type AddTextNodeChange = [InsertionPoint, TextNodeName, string];
454+
/**
455+
* Browser-specific. Schema representing the node name for a #text node, expressed as either a reference to the string table or a literal string.
456+
*/
457+
export declare type TextNodeName = number | '#text';
458+
/**
459+
* Browser-specific. Schema representing the addition of a new #shadow-root node to the document.
460+
*
461+
* @minItems 2
462+
*/
463+
export declare type AddShadowRootNodeChange = [InsertionPoint, ShadowRootNodeName];
464+
/**
465+
* Browser-specific. Schema representing the node name for a #shadow-root node, expressed as either a reference to the string table or a literal string.
466+
*/
467+
export declare type ShadowRootNodeName = number | '#shadow-root';
468+
/**
469+
* Browser-specific. Schema representing a scroll position change.
470+
*
471+
* @minItems 3
472+
*/
473+
export declare type ScrollPositionChange = [NodeId, number, number];
474+
/**
475+
* Browser-specific. Schema representing the addition of a string to the string table.
476+
*/
477+
export declare type AddStringChange = string;
478+
/**
479+
* Browser-specific. Schema representing a change to the text content of a #text node.
480+
*
481+
* @minItems 2
482+
*/
483+
export declare type TextChange = [NodeId, string];
306484
/**
307485
* Schema of a Session Replay Segment context.
308486
*/

lib/cjs/generated/sessionReplay.d.ts

Lines changed: 179 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export declare type CreationReason = 'init' | 'segment_duration_limit' | 'segmen
3535
/**
3636
* Browser-specific. Schema of a Session Replay Record.
3737
*/
38-
export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord;
38+
export declare type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord | BrowserChangeRecord;
3939
/**
4040
* Browser-specific. Schema of a Record type which contains the full snapshot of a screen.
4141
*/
@@ -311,6 +311,184 @@ export declare type FrustrationRecord = SlotSupportedCommonRecordSchema & {
311311
recordIds: number[];
312312
};
313313
};
314+
/**
315+
* Browser-specific. Schema of a Record type which represents changes and mutations using a compact encoding. (Experimental.)
316+
*/
317+
export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & {
318+
/**
319+
* The type of this Record.
320+
*/
321+
readonly type: 12;
322+
data: BrowserChangeData;
323+
id?: number;
324+
};
325+
/**
326+
* Browser-specific. Schema of a Session Replay BrowserChangeData type.
327+
*/
328+
export declare type BrowserChangeData = {
329+
/**
330+
* Changes to the `adoptedStyleSheets` list of a Document, DocumentFragment, or ShadowRoot node.
331+
*/
332+
adoptedStyleSheetsChanges?: AdoptedStyleSheetsChange[];
333+
/**
334+
* Changes to the attributes of a node.
335+
*/
336+
attributeChanges?: AttributeChange[];
337+
/**
338+
* Newly added nodes.
339+
*/
340+
nodesAdded?: AddNodeChange[];
341+
/**
342+
* Newly removed nodes.
343+
*/
344+
nodesRemoved?: NodeId[];
345+
/**
346+
* Changes to the scroll position of a node.
347+
*/
348+
scrollChanges?: ScrollPositionChange[];
349+
/**
350+
* Newly added strings.
351+
*/
352+
stringsAdded?: AddStringChange[];
353+
/**
354+
* Changes to the text content of a node.
355+
*/
356+
textChanges?: TextChange[];
357+
};
358+
/**
359+
* Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree.
360+
*
361+
* @minItems 1
362+
*/
363+
export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]];
364+
/**
365+
* Browser-specific. Schema representing the ID of a DOM node.
366+
*/
367+
export declare type NodeId = number;
368+
/**
369+
* Browser-specific. Schema representing a change to an node's attributes.
370+
*
371+
* @minItems 1
372+
*/
373+
export declare type AttributeChange = [NodeId, ...AttributeAssignmentOrDeletion[]];
374+
/**
375+
* Browser-specific. Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute.
376+
*
377+
* @minItems 2
378+
*/
379+
export declare type AttributeAssignmentOrDeletion = [string, string | null];
380+
/**
381+
* Browser-specific. Schema representing the addition of a new node to the document.
382+
*/
383+
export declare type AddNodeChange = AddCDataSectionNodeChange | AddDocTypeNodeChange | AddDocumentNodeChange | AddDocumentFragmentNodeChange | AddElementNodeChange | AddTextNodeChange | AddShadowRootNodeChange;
384+
/**
385+
* Browser-specific. Schema representing the addition of a new #cdata-section node to the document.
386+
*
387+
* @minItems 2
388+
*/
389+
export declare type AddCDataSectionNodeChange = [InsertionPoint, CDataSectionNodeName];
390+
/**
391+
* Browser-specific. Schema representing the insertion point of a node which is being added to the document.
392+
*/
393+
export declare type InsertionPoint = RootInsertionPoint | LastChildInsertionPoint | NextSiblingInsertionPoint;
394+
/**
395+
* A null insertion point, indicating that the node should be inserted at the root of the document.
396+
*/
397+
export declare type RootInsertionPoint = null;
398+
/**
399+
* A positive integer insertion point. Inserting a node at positive integer N indicates that the node should be inserted as the last child of the node with an id N lower than the new node.
400+
*/
401+
export declare type LastChildInsertionPoint = number;
402+
/**
403+
* A negative integer insertion point. Inserting a node at negative integer -N indicates that the node should be inserted as the next sibling of the node with an id N lower than the new node.
404+
*/
405+
export declare type NextSiblingInsertionPoint = number;
406+
/**
407+
* Browser-specific. Schema representing the node name for a #cdata-section node, expressed as either a reference to the string table or a literal string.
408+
*/
409+
export declare type CDataSectionNodeName = number | '#cdata-section';
410+
/**
411+
* Browser-specific. Schema representing the addition of a new #doctype node to the document.
412+
*
413+
* @minItems 5
414+
*/
415+
export declare type AddDocTypeNodeChange = [InsertionPoint, DocTypeNodeName, string, string, string];
416+
/**
417+
* Browser-specific. Schema representing the node name for a #doctype node, expressed as either a reference to the string table or a literal string.
418+
*/
419+
export declare type DocTypeNodeName = number | '#doctype';
420+
/**
421+
* Browser-specific. Schema representing the addition of a new #document node to the document.
422+
*
423+
* @minItems 2
424+
*/
425+
export declare type AddDocumentNodeChange = [InsertionPoint, DocumentNodeName];
426+
/**
427+
* Browser-specific. Schema representing the node name for a #document node, expressed as either a reference to the string table or a literal string.
428+
*/
429+
export declare type DocumentNodeName = number | '#document';
430+
/**
431+
* Browser-specific. Schema representing the addition of a new #document-fragment node to the document.
432+
*
433+
* @minItems 2
434+
*/
435+
export declare type AddDocumentFragmentNodeChange = [InsertionPoint, DocumentFragmentNodeName];
436+
/**
437+
* Browser-specific. Schema representing the node name for a #document-fragment node, expressed as either a reference to the string table or a literal string.
438+
*/
439+
export declare type DocumentFragmentNodeName = number | '#document-fragment';
440+
/**
441+
* Browser-specific. Schema representing the addition of a new element node to the document.
442+
*
443+
* @minItems 2
444+
*/
445+
export declare type AddElementNodeChange = [InsertionPoint, NodeName, ...AttributeAssignment[]];
446+
/**
447+
* Browser-specific. Schema representing a node name (i.e., Node#nodeName), expressed as either a reference to the string table or a literal string.
448+
*/
449+
export declare type NodeName = number | string;
450+
/**
451+
* Browser-specific. Schema representing an assignment of a value to an attribute.
452+
*
453+
* @minItems 2
454+
*/
455+
export declare type AttributeAssignment = [string, string];
456+
/**
457+
* Browser-specific. Schema representing the addition of a new #text node to the document.
458+
*
459+
* @minItems 3
460+
*/
461+
export declare type AddTextNodeChange = [InsertionPoint, TextNodeName, string];
462+
/**
463+
* Browser-specific. Schema representing the node name for a #text node, expressed as either a reference to the string table or a literal string.
464+
*/
465+
export declare type TextNodeName = number | '#text';
466+
/**
467+
* Browser-specific. Schema representing the addition of a new #shadow-root node to the document.
468+
*
469+
* @minItems 2
470+
*/
471+
export declare type AddShadowRootNodeChange = [InsertionPoint, ShadowRootNodeName];
472+
/**
473+
* Browser-specific. Schema representing the node name for a #shadow-root node, expressed as either a reference to the string table or a literal string.
474+
*/
475+
export declare type ShadowRootNodeName = number | '#shadow-root';
476+
/**
477+
* Browser-specific. Schema representing a scroll position change.
478+
*
479+
* @minItems 3
480+
*/
481+
export declare type ScrollPositionChange = [NodeId, number, number];
482+
/**
483+
* Browser-specific. Schema representing the addition of a string to the string table.
484+
*/
485+
export declare type AddStringChange = string;
486+
/**
487+
* Browser-specific. Schema representing a change to the text content of a #text node.
488+
*
489+
* @minItems 2
490+
*/
491+
export declare type TextChange = [NodeId, string];
314492
/**
315493
* Mobile-specific. Schema of a Session Replay data Segment.
316494
*/

0 commit comments

Comments
 (0)