/**
* DO NOT MODIFY IT BY HAND. Run `yarn json-schemas:sync` instead.
*/
/**
* Browser-specific. Schema of a Session Replay data Segment.
*/
export type BrowserSegment = BrowserSegmentMetadata & {
/**
* The records contained by this Segment.
*/
readonly records: BrowserRecord[];
};
/**
* Browser-specific. Schema of a Session Replay Segment metadata.
*/
export type BrowserSegmentMetadata = SegmentContext & CommonSegmentMetadataSchema & {
/**
* The source of this record
*/
source: 'browser';
creation_reason: CreationReason;
};
/**
* The reason this Segment was created. For mobile there is only one possible value for this, which is always the default value.
*/
export type CreationReason = 'init' | 'segment_duration_limit' | 'segment_bytes_limit' | 'view_change' | 'before_unload' | 'visibility_hidden' | 'page_frozen';
/**
* Browser-specific. Schema of a Session Replay Record.
*/
export type BrowserRecord = BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord | MetaRecord | FocusRecord | ViewEndRecord | VisualViewportRecord | FrustrationRecord | BrowserChangeRecord;
/**
* Browser-specific. Schema of a Record type which contains a full snapshot of a document.
*/
export type BrowserFullSnapshotRecord = BrowserFullSnapshotV1Record | BrowserFullSnapshotChangeRecord;
/**
* Browser-specific. Schema of a Record type which contains a full snapshot of a document in V1 format.
*/
export type BrowserFullSnapshotV1Record = SlotSupportedCommonRecordSchema & {
/**
* The type of this Record.
*/
readonly type: 2;
readonly format?: SnapshotFormatV1;
data: BrowserNode;
};
/**
* Schema of common properties for a Record event type that is supported by slots.
*/
export type SlotSupportedCommonRecordSchema = CommonRecordSchema & {
/**
* Unique ID of the slot that generated this record.
*/
readonly slotId?: string;
};
/**
* The V1 snapshot format.
*/
export type SnapshotFormatV1 = 0;
/**
* Serialized node contained by this Record.
*/
export type SerializedNodeWithId = {
id: number;
} & SerializedNode;
/**
* Serialized node contained by this Record.
*/
export type SerializedNode = DocumentNode | DocumentFragmentNode | DocumentTypeNode | ElementNode | TextNode | CDataNode;
/**
* Browser-specific. Schema of a Record type which contains a full snapshot of a document in Change format.
*/
export type BrowserFullSnapshotChangeRecord = SlotSupportedCommonRecordSchema & {
/**
* The type of this Record.
*/
readonly type: 2;
readonly format: SnapshotFormatChange;
data: Change[];
};
/**
* The Change snapshot format.
*/
export type SnapshotFormatChange = 1;
/**
* Browser-specific. Schema representing an individual change within a BrowserChangeData collection.
*/
export type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]];
/**
* Browser-specific. Schema representing the addition of a string to the string table.
*/
export type AddStringChange = string;
/**
* Browser-specific. Schema representing the addition of a new node to the document.
*/
export type AddNodeChange = AddCDataSectionNodeChange | AddDocTypeNodeChange | AddDocumentNodeChange | AddDocumentFragmentNodeChange | AddElementNodeChange | AddShadowRootNodeChange | AddTextNodeChange;
/**
* Schema representing the addition of a new #cdata-section node.
*
* @minItems 2
*/
export type AddCDataSectionNodeChange = [InsertionPoint, '#cdata-section' | StringReference];
/**
* Browser-specific. Schema representing the insertion point of a node which is being added to the document.
*/
export type InsertionPoint = AppendChildInsertionPoint | InsertAfterPreviousInsertionPoint | InsertBeforeInsertionPoint | RootInsertionPoint;
/**
* A positive integer insertion point. Inserting a node at positive integer N indicates that the new node's parent is the node with an id N lower than the new node, and that we should insert the new node at the end of its parent's child list, as if the DOM method appendChild() was being used.
*/
export type AppendChildInsertionPoint = number;
/**
* A zero insertion point. Inserting a node at zero indicates that the new node should be inserted after the node with an id one lower than the new node, as if the DOM method after() is being used. Using a zero insertion point repeatedly is thus a quick way to insert a sequence of sibling elements.
*/
export type InsertAfterPreviousInsertionPoint = 0;
/**
* A negative integer insertion point. Inserting a node at negative integer -N indicates that the new node's next sibling is the node with an id N lower than the new node, and that we should insert the new node before its next sibling, as if the DOM method insertBefore() was being used.
*/
export type InsertBeforeInsertionPoint = number;
/**
* A null insertion point, indicating that the node should be inserted at the root of the document.
*/
export type RootInsertionPoint = null;
/**
* Browser-specific. Schema representing a string, expressed as an index into the string table.
*/
export type StringReference = number;
/**
* Schema representing the addition of a new #doctype node, using the format [#doctype, name, public ID, system ID].
*
* @minItems 5
*/
export type AddDocTypeNodeChange = [
InsertionPoint,
'#doctype' | StringReference,
StringOrStringReference,
StringOrStringReference,
StringOrStringReference
];
/**
* Browser-specific. Schema representing a string, either expressed as a literal or as an index into the string table.
*/
export type StringOrStringReference = string | StringReference;
/**
* Schema representing the addition of a new #document node.
*
* @minItems 2
*/
export type AddDocumentNodeChange = [InsertionPoint, '#document' | StringReference];
/**
* Schema representing the addition of a new #document-fragment node.
*
* @minItems 2
*/
export type AddDocumentFragmentNodeChange = [InsertionPoint, '#document-fragment' | StringReference];
/**
* Schema representing the addition of a new element node.
*
* @minItems 2
*/
export type AddElementNodeChange = [InsertionPoint, string | StringReference, ...AttributeAssignment[]];
/**
* Schema representing an assignment of a value to an attribute. The format is [name, value].
*
* @minItems 2
*/
export type AttributeAssignment = [StringOrStringReference, StringOrStringReference];
/**
* Schema representing the addition of a new #shadow-root node.
*
* @minItems 2
*/
export type AddShadowRootNodeChange = [InsertionPoint, '#shadow-root' | StringReference];
/**
* Schema representing the addition of a new #text node.
*
* @minItems 3
*/
export type AddTextNodeChange = [InsertionPoint, '#text' | StringReference, StringOrStringReference];
/**
* Browser-specific. Schema representing the removal of a node from the document.
*/
export type RemoveNodeChange = number;
/**
* Browser-specific. Schema representing a change to an node's attributes.
*
* @minItems 1
*/
export type AttributeChange = [NodeId, ...AttributeAssignmentOrDeletion[]];
/**
* Browser-specific. Schema representing the ID of a DOM node.
*/
export type NodeId = number;
/**
* Schema representing a change to an attribute, either by assignment of a new value or by deletion of the attribute.
*/
export type AttributeAssignmentOrDeletion = AttributeAssignment | AttributeDeletion;
/**
* Schema representing the deletion of an attribute.
*
* @minItems 1
*/
export type AttributeDeletion = [StringOrStringReference];
/**
* Browser-specific. Schema representing a change to the text content of a #text node.
*
* @minItems 2
*/
export type TextChange = [NodeId, StringOrStringReference];
/**
* Browser-specific. Schema representing a change in an element's size.
*
* @minItems 3
*/
export type SizeChange = [NodeId, number, number];
/**
* Browser-specific. Schema representing a scroll position change.
*
* @minItems 3
*/
export type ScrollPositionChange = [NodeId, number, number];
/**
* Browser-specific. Schema representing the addition of a new stylesheet to the document.
*/
export type AddStyleSheetChange = StyleSheetSnapshot;
/**
* Schema representing a snapshot of a CSS stylesheet.
*
* @minItems 1
*/
export type StyleSheetSnapshot = [StyleSheetRules] | [StyleSheetRules, StyleSheetMediaList] | [StyleSheetRules, StyleSheetMediaList, boolean];
/**
* Schema representing a CSS stylesheet's rules, encoded either as a single string or as an array containing a separate string for each rule.
*/
export type StyleSheetRules = StringOrStringReference | StringOrStringReference[];
/**
* If non-empty, the list of medias for which this stylesheet is active. Defaults to the empty list if not present.
*/
export type StyleSheetMediaList = StringOrStringReference[];
/**
* Browser-specific. Schema representing a change to the stylesheets attached to a DOM node. For or