File: types.go

package info (click to toggle)
golang-github-chromedp-cdproto 0.0~git20230109.6b041c6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,584 kB
  • sloc: makefile: 2
file content (55 lines) | stat: -rw-r--r-- 2,901 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package performancetimeline

// Code generated by cdproto-gen. DO NOT EDIT.

import (
	"github.com/chromedp/cdproto/cdp"
	"github.com/chromedp/cdproto/dom"
)

// LargestContentfulPaint see https://github.com/WICG/LargestContentfulPaint
// and largest_contentful_paint.idl.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LargestContentfulPaint
type LargestContentfulPaint struct {
	RenderTime *cdp.TimeSinceEpoch `json:"renderTime"`
	LoadTime   *cdp.TimeSinceEpoch `json:"loadTime"`
	Size       float64             `json:"size"`                // The number of pixels being painted.
	ElementID  string              `json:"elementId,omitempty"` // The id attribute of the element, if available.
	URL        string              `json:"url,omitempty"`       // The URL of the image (may be trimmed).
	NodeID     cdp.BackendNodeID   `json:"nodeId,omitempty"`
}

// LayoutShiftAttribution [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LayoutShiftAttribution
type LayoutShiftAttribution struct {
	PreviousRect *dom.Rect         `json:"previousRect"`
	CurrentRect  *dom.Rect         `json:"currentRect"`
	NodeID       cdp.BackendNodeID `json:"nodeId,omitempty"`
}

// LayoutShift see
// https://wicg.github.io/layout-instability/#sec-layout-shift and
// layout_shift.idl.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-LayoutShift
type LayoutShift struct {
	Value          float64                   `json:"value"` // Score increment produced by this event.
	HadRecentInput bool                      `json:"hadRecentInput"`
	LastInputTime  *cdp.TimeSinceEpoch       `json:"lastInputTime"`
	Sources        []*LayoutShiftAttribution `json:"sources"`
}

// TimelineEvent [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/PerformanceTimeline#type-TimelineEvent
type TimelineEvent struct {
	FrameID            cdp.FrameID             `json:"frameId"`            // Identifies the frame that this event is related to. Empty for non-frame targets.
	Type               string                  `json:"type"`               // The event type, as specified in https://w3c.github.io/performance-timeline/#dom-performanceentry-entrytype This determines which of the optional "details" fiedls is present.
	Name               string                  `json:"name"`               // Name may be empty depending on the type.
	Time               *cdp.TimeSinceEpoch     `json:"time"`               // Time in seconds since Epoch, monotonically increasing within document lifetime.
	Duration           float64                 `json:"duration,omitempty"` // Event duration, if applicable.
	LcpDetails         *LargestContentfulPaint `json:"lcpDetails,omitempty"`
	LayoutShiftDetails *LayoutShift            `json:"layoutShiftDetails,omitempty"`
}