Skip to content

Commit bf49abe

Browse files
[PANA-5245] Add Change types for stylesheets, media, and the visual viewport (#329)
1 parent 9095192 commit bf49abe

15 files changed

Lines changed: 504 additions & 27 deletions

lib/cjs/generated/browserSessionReplay.d.ts

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & {
317317
/**
318318
* Browser-specific. Schema representing an individual change within a BrowserChangeData collection.
319319
*/
320-
export declare type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AdoptedStyleSheetsChange[]];
320+
export declare type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]];
321321
/**
322322
* Browser-specific. Schema representing the addition of a string to the string table.
323323
*/
@@ -451,11 +451,89 @@ export declare type SizeChange = [NodeId, number, number];
451451
*/
452452
export declare type ScrollPositionChange = [NodeId, number, number];
453453
/**
454-
* Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree.
454+
* Browser-specific. Schema representing the addition of a new stylesheet to the document.
455+
*/
456+
export declare type AddStyleSheetChange = StyleSheetSnapshot;
457+
/**
458+
* Schema representing a snapshot of a CSS stylesheet.
459+
*
460+
* @minItems 1
461+
*/
462+
export declare type StyleSheetSnapshot = [StyleSheetRules] | [StyleSheetRules, StyleSheetMediaList] | [StyleSheetRules, StyleSheetMediaList, boolean];
463+
/**
464+
* Schema representing a CSS stylesheet's rules, encoded either as a single string or as an array containing a separate string for each rule.
465+
*/
466+
export declare type StyleSheetRules = StringOrStringReference | StringOrStringReference[];
467+
/**
468+
* If non-empty, the list of medias for which this stylesheet is active. Defaults to the empty list if not present.
469+
*/
470+
export declare type StyleSheetMediaList = StringOrStringReference[];
471+
/**
472+
* Browser-specific. Schema representing a change to the stylesheets attached to a DOM node. For <link> or <style> elements, which use classic CSSOM APIs, at most one stylesheet can be attached. For #document, #document-fragment, or #shadow-root nodes, which use the `adoptedStyleSheets` API, any number of stylesheets can be attached.
455473
*
456474
* @minItems 1
457475
*/
458-
export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]];
476+
export declare type AttachedStyleSheetsChange = [NodeId, ...StyleSheetId[]];
477+
/**
478+
* Browser-specific. Schema representing the ID of a stylesheet.
479+
*/
480+
export declare type StyleSheetId = number;
481+
/**
482+
* Browser-specific. Schema representing a change to the playback state of the media associated with an <audio> or <video> element.
483+
*
484+
* @minItems 2
485+
*/
486+
export declare type MediaPlaybackStateChange = [NodeId, PlaybackStatePlaying | PlaybackStatePaused];
487+
/**
488+
* A playback state indicating that the associated media is playing.
489+
*/
490+
export declare type PlaybackStatePlaying = 0;
491+
/**
492+
* A playback state indicating that the associated media is paused.
493+
*/
494+
export declare type PlaybackStatePaused = 1;
495+
/**
496+
* Browser-specific. Schema representing a change to the visual viewport, defined in terms of the web platform VisualViewport API.
497+
*
498+
* @minItems 7
499+
*/
500+
export declare type VisualViewportChange = [
501+
VisualViewportOffsetLeft,
502+
VisualViewportOffsetTop,
503+
VisualViewportPageLeft,
504+
VisualViewportPageTop,
505+
VisualViewportWidth,
506+
VisualViewportHeight,
507+
VisualViewportScale
508+
];
509+
/**
510+
* The offset of the left edge of the visual viewport from the left edge of the layout viewport in CSS pixels.
511+
*/
512+
export declare type VisualViewportOffsetLeft = number;
513+
/**
514+
* The offset of the top edge of the visual viewport from the top edge of the layout viewport in CSS pixels.
515+
*/
516+
export declare type VisualViewportOffsetTop = number;
517+
/**
518+
* The x coordinate of the visual viewport relative to the initial containing block origin of the top edge in CSS pixels.
519+
*/
520+
export declare type VisualViewportPageLeft = number;
521+
/**
522+
* The y coordinate of the visual viewport relative to the initial containing block origin of the top edge in CSS pixels.
523+
*/
524+
export declare type VisualViewportPageTop = number;
525+
/**
526+
* The width of the visual viewport in CSS pixels.
527+
*/
528+
export declare type VisualViewportWidth = number;
529+
/**
530+
* The height of the visual viewport in CSS pixels.
531+
*/
532+
export declare type VisualViewportHeight = number;
533+
/**
534+
* The pinch-zoom scaling factor applied to the visual viewport.
535+
*/
536+
export declare type VisualViewportScale = number;
459537
/**
460538
* Schema of a Session Replay Segment context.
461539
*/

lib/cjs/generated/sessionReplay.d.ts

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & {
325325
/**
326326
* Browser-specific. Schema representing an individual change within a BrowserChangeData collection.
327327
*/
328-
export declare type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AdoptedStyleSheetsChange[]];
328+
export declare type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]];
329329
/**
330330
* Browser-specific. Schema representing the addition of a string to the string table.
331331
*/
@@ -459,11 +459,89 @@ export declare type SizeChange = [NodeId, number, number];
459459
*/
460460
export declare type ScrollPositionChange = [NodeId, number, number];
461461
/**
462-
* Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree.
462+
* Browser-specific. Schema representing the addition of a new stylesheet to the document.
463+
*/
464+
export declare type AddStyleSheetChange = StyleSheetSnapshot;
465+
/**
466+
* Schema representing a snapshot of a CSS stylesheet.
467+
*
468+
* @minItems 1
469+
*/
470+
export declare type StyleSheetSnapshot = [StyleSheetRules] | [StyleSheetRules, StyleSheetMediaList] | [StyleSheetRules, StyleSheetMediaList, boolean];
471+
/**
472+
* Schema representing a CSS stylesheet's rules, encoded either as a single string or as an array containing a separate string for each rule.
473+
*/
474+
export declare type StyleSheetRules = StringOrStringReference | StringOrStringReference[];
475+
/**
476+
* If non-empty, the list of medias for which this stylesheet is active. Defaults to the empty list if not present.
477+
*/
478+
export declare type StyleSheetMediaList = StringOrStringReference[];
479+
/**
480+
* Browser-specific. Schema representing a change to the stylesheets attached to a DOM node. For <link> or <style> elements, which use classic CSSOM APIs, at most one stylesheet can be attached. For #document, #document-fragment, or #shadow-root nodes, which use the `adoptedStyleSheets` API, any number of stylesheets can be attached.
463481
*
464482
* @minItems 1
465483
*/
466-
export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]];
484+
export declare type AttachedStyleSheetsChange = [NodeId, ...StyleSheetId[]];
485+
/**
486+
* Browser-specific. Schema representing the ID of a stylesheet.
487+
*/
488+
export declare type StyleSheetId = number;
489+
/**
490+
* Browser-specific. Schema representing a change to the playback state of the media associated with an <audio> or <video> element.
491+
*
492+
* @minItems 2
493+
*/
494+
export declare type MediaPlaybackStateChange = [NodeId, PlaybackStatePlaying | PlaybackStatePaused];
495+
/**
496+
* A playback state indicating that the associated media is playing.
497+
*/
498+
export declare type PlaybackStatePlaying = 0;
499+
/**
500+
* A playback state indicating that the associated media is paused.
501+
*/
502+
export declare type PlaybackStatePaused = 1;
503+
/**
504+
* Browser-specific. Schema representing a change to the visual viewport, defined in terms of the web platform VisualViewport API.
505+
*
506+
* @minItems 7
507+
*/
508+
export declare type VisualViewportChange = [
509+
VisualViewportOffsetLeft,
510+
VisualViewportOffsetTop,
511+
VisualViewportPageLeft,
512+
VisualViewportPageTop,
513+
VisualViewportWidth,
514+
VisualViewportHeight,
515+
VisualViewportScale
516+
];
517+
/**
518+
* The offset of the left edge of the visual viewport from the left edge of the layout viewport in CSS pixels.
519+
*/
520+
export declare type VisualViewportOffsetLeft = number;
521+
/**
522+
* The offset of the top edge of the visual viewport from the top edge of the layout viewport in CSS pixels.
523+
*/
524+
export declare type VisualViewportOffsetTop = number;
525+
/**
526+
* The x coordinate of the visual viewport relative to the initial containing block origin of the top edge in CSS pixels.
527+
*/
528+
export declare type VisualViewportPageLeft = number;
529+
/**
530+
* The y coordinate of the visual viewport relative to the initial containing block origin of the top edge in CSS pixels.
531+
*/
532+
export declare type VisualViewportPageTop = number;
533+
/**
534+
* The width of the visual viewport in CSS pixels.
535+
*/
536+
export declare type VisualViewportWidth = number;
537+
/**
538+
* The height of the visual viewport in CSS pixels.
539+
*/
540+
export declare type VisualViewportHeight = number;
541+
/**
542+
* The pinch-zoom scaling factor applied to the visual viewport.
543+
*/
544+
export declare type VisualViewportScale = number;
467545
/**
468546
* Mobile-specific. Schema of a Session Replay data Segment.
469547
*/

lib/esm/generated/browserSessionReplay.d.ts

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ export declare type BrowserChangeRecord = SlotSupportedCommonRecordSchema & {
317317
/**
318318
* Browser-specific. Schema representing an individual change within a BrowserChangeData collection.
319319
*/
320-
export declare type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AdoptedStyleSheetsChange[]];
320+
export declare type Change = [0, ...AddStringChange[]] | [1, ...AddNodeChange[]] | [2, ...RemoveNodeChange[]] | [3, ...AttributeChange[]] | [4, ...TextChange[]] | [5, ...SizeChange[]] | [6, ...ScrollPositionChange[]] | [7, ...AddStyleSheetChange[]] | [8, ...AttachedStyleSheetsChange[]] | [9, ...MediaPlaybackStateChange[]] | [10, ...VisualViewportChange[]];
321321
/**
322322
* Browser-specific. Schema representing the addition of a string to the string table.
323323
*/
@@ -451,11 +451,89 @@ export declare type SizeChange = [NodeId, number, number];
451451
*/
452452
export declare type ScrollPositionChange = [NodeId, number, number];
453453
/**
454-
* Browser-specific. Schema representing a change to the adopted stylesheets of a document or shadow DOM subtree.
454+
* Browser-specific. Schema representing the addition of a new stylesheet to the document.
455+
*/
456+
export declare type AddStyleSheetChange = StyleSheetSnapshot;
457+
/**
458+
* Schema representing a snapshot of a CSS stylesheet.
459+
*
460+
* @minItems 1
461+
*/
462+
export declare type StyleSheetSnapshot = [StyleSheetRules] | [StyleSheetRules, StyleSheetMediaList] | [StyleSheetRules, StyleSheetMediaList, boolean];
463+
/**
464+
* Schema representing a CSS stylesheet's rules, encoded either as a single string or as an array containing a separate string for each rule.
465+
*/
466+
export declare type StyleSheetRules = StringOrStringReference | StringOrStringReference[];
467+
/**
468+
* If non-empty, the list of medias for which this stylesheet is active. Defaults to the empty list if not present.
469+
*/
470+
export declare type StyleSheetMediaList = StringOrStringReference[];
471+
/**
472+
* Browser-specific. Schema representing a change to the stylesheets attached to a DOM node. For <link> or <style> elements, which use classic CSSOM APIs, at most one stylesheet can be attached. For #document, #document-fragment, or #shadow-root nodes, which use the `adoptedStyleSheets` API, any number of stylesheets can be attached.
455473
*
456474
* @minItems 1
457475
*/
458-
export declare type AdoptedStyleSheetsChange = [NodeId, ...StyleSheet[]];
476+
export declare type AttachedStyleSheetsChange = [NodeId, ...StyleSheetId[]];
477+
/**
478+
* Browser-specific. Schema representing the ID of a stylesheet.
479+
*/
480+
export declare type StyleSheetId = number;
481+
/**
482+
* Browser-specific. Schema representing a change to the playback state of the media associated with an <audio> or <video> element.
483+
*
484+
* @minItems 2
485+
*/
486+
export declare type MediaPlaybackStateChange = [NodeId, PlaybackStatePlaying | PlaybackStatePaused];
487+
/**
488+
* A playback state indicating that the associated media is playing.
489+
*/
490+
export declare type PlaybackStatePlaying = 0;
491+
/**
492+
* A playback state indicating that the associated media is paused.
493+
*/
494+
export declare type PlaybackStatePaused = 1;
495+
/**
496+
* Browser-specific. Schema representing a change to the visual viewport, defined in terms of the web platform VisualViewport API.
497+
*
498+
* @minItems 7
499+
*/
500+
export declare type VisualViewportChange = [
501+
VisualViewportOffsetLeft,
502+
VisualViewportOffsetTop,
503+
VisualViewportPageLeft,
504+
VisualViewportPageTop,
505+
VisualViewportWidth,
506+
VisualViewportHeight,
507+
VisualViewportScale
508+
];
509+
/**
510+
* The offset of the left edge of the visual viewport from the left edge of the layout viewport in CSS pixels.
511+
*/
512+
export declare type VisualViewportOffsetLeft = number;
513+
/**
514+
* The offset of the top edge of the visual viewport from the top edge of the layout viewport in CSS pixels.
515+
*/
516+
export declare type VisualViewportOffsetTop = number;
517+
/**
518+
* The x coordinate of the visual viewport relative to the initial containing block origin of the top edge in CSS pixels.
519+
*/
520+
export declare type VisualViewportPageLeft = number;
521+
/**
522+
* The y coordinate of the visual viewport relative to the initial containing block origin of the top edge in CSS pixels.
523+
*/
524+
export declare type VisualViewportPageTop = number;
525+
/**
526+
* The width of the visual viewport in CSS pixels.
527+
*/
528+
export declare type VisualViewportWidth = number;
529+
/**
530+
* The height of the visual viewport in CSS pixels.
531+
*/
532+
export declare type VisualViewportHeight = number;
533+
/**
534+
* The pinch-zoom scaling factor applied to the visual viewport.
535+
*/
536+
export declare type VisualViewportScale = number;
459537
/**
460538
* Schema of a Session Replay Segment context.
461539
*/

0 commit comments

Comments
 (0)