func (c *DOMSnapshot) CaptureSnapshot(ctx context.Context, computedStyles []string, includePaintOrder bool, includeDOMRects bool, includeBlendedBackgroundColors bool, includeTextColorOpacities bool) ([]*DOMSnapshotDocumentSnapshot, []string, error) {
	var v DOMSnapshotCaptureSnapshotParams
	v.ComputedStyles = computedStyles
	v.IncludePaintOrder = includePaintOrder
	v.IncludeDOMRects = includeDOMRects
	v.IncludeBlendedBackgroundColors = includeBlendedBackgroundColors
	v.IncludeTextColorOpacities = includeTextColorOpacities
	return c.CaptureSnapshotWithParams(ctx, &v)
}
CaptureSnapshot - Returns a document snapshot, including the full DOM tree of the root node (including iframes, template contents, and imported documents) in a flattened array, as well as layout and white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is flattened.
computedStyles - Whitelist of computed styles to return.
includePaintOrder - Whether to include layout object paint orders into the snapshot.
includeDOMRects - Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot
includeBlendedBackgroundColors - Whether to include blended background colors in the snapshot (default: false). Blended background color is achieved by blending background colors of all elements that overlap with the current element.
includeTextColorOpacities - Whether to include text color opacity in the snapshot (default: false). An element might have the opacity property set that affects the text color of the element. The final text color opacity is computed based on the opacity of all overlapping elements.
Returns -  documents - The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. strings - Shared string table that all string properties refer to with indexes.
package gcdapi
import (
	"context"
	"github.com/wirepair/gcd/v2/gcdmessage"
)
type DOMSnapshotDOMNode struct {
	NodeType             int                         `json:"nodeType"`                        
	NodeName             string                      `json:"nodeName"`                        
	NodeValue            string                      `json:"nodeValue"`                       
	TextValue            string                      `json:"textValue,omitempty"`             
	InputValue           string                      `json:"inputValue,omitempty"`            
	InputChecked         bool                        `json:"inputChecked,omitempty"`          
	OptionSelected       bool                        `json:"optionSelected,omitempty"`        
	BackendNodeId        int                         `json:"backendNodeId"`                   
	ChildNodeIndexes     []int                       `json:"childNodeIndexes,omitempty"`      
	Attributes           []*DOMSnapshotNameValue     `json:"attributes,omitempty"`            
	PseudoElementIndexes []int                       `json:"pseudoElementIndexes,omitempty"`  
	LayoutNodeIndex      int                         `json:"layoutNodeIndex,omitempty"`       
	DocumentURL          string                      `json:"documentURL,omitempty"`           
	BaseURL              string                      `json:"baseURL,omitempty"`               
	ContentLanguage      string                      `json:"contentLanguage,omitempty"`       
	DocumentEncoding     string                      `json:"documentEncoding,omitempty"`      
	PublicId             string                      `json:"publicId,omitempty"`              
	SystemId             string                      `json:"systemId,omitempty"`              
	FrameId              string                      `json:"frameId,omitempty"`               
	ContentDocumentIndex int                         `json:"contentDocumentIndex,omitempty"`  
	PseudoType           string                      `json:"pseudoType,omitempty"`            
	ShadowRootType       string                      `json:"shadowRootType,omitempty"`        
	IsClickable          bool                        `json:"isClickable,omitempty"`           
	EventListeners       []*DOMDebuggerEventListener `json:"eventListeners,omitempty"`        
	CurrentSourceURL     string                      `json:"currentSourceURL,omitempty"`      
	OriginURL            string                      `json:"originURL,omitempty"`             
	ScrollOffsetX        float64                     `json:"scrollOffsetX,omitempty"`         
	ScrollOffsetY        float64                     `json:"scrollOffsetY,omitempty"`         
}
type DOMSnapshotInlineTextBox struct {
	BoundingBox         *DOMRect `json:"boundingBox"`          
	StartCharacterIndex int      `json:"startCharacterIndex"`  
	NumCharacters       int      `json:"numCharacters"`        
}
type DOMSnapshotLayoutTreeNode struct {
	DomNodeIndex      int                         `json:"domNodeIndex"`                 
	BoundingBox       *DOMRect                    `json:"boundingBox"`                  
	LayoutText        string                      `json:"layoutText,omitempty"`         
	InlineTextNodes   []*DOMSnapshotInlineTextBox `json:"inlineTextNodes,omitempty"`    
	StyleIndex        int                         `json:"styleIndex,omitempty"`         
	PaintOrder        int                         `json:"paintOrder,omitempty"`         
	IsStackingContext bool                        `json:"isStackingContext,omitempty"`  
}
type DOMSnapshotComputedStyle struct {
	Properties []*DOMSnapshotNameValue `json:"properties"`  
}
type DOMSnapshotNameValue struct {
	Name  string `json:"name"`   
	Value string `json:"value"`  
}
type DOMSnapshotRareStringData struct {
	Index []int `json:"index"`  
	Value []int `json:"value"`  
}
type DOMSnapshotRareBooleanData struct {
	Index []int `json:"index"`  
}
type DOMSnapshotRareIntegerData struct {
	Index []int `json:"index"`  
	Value []int `json:"value"`  
}
type DOMSnapshotDocumentSnapshot struct {
	DocumentURL     int                            `json:"documentURL"`              
	Title           int                            `json:"title"`                    
	BaseURL         int                            `json:"baseURL"`                  
	ContentLanguage int                            `json:"contentLanguage"`          
	EncodingName    int                            `json:"encodingName"`             
	PublicId        int                            `json:"publicId"`                 
	SystemId        int                            `json:"systemId"`                 
	FrameId         int                            `json:"frameId"`                  
	Nodes           *DOMSnapshotNodeTreeSnapshot   `json:"nodes"`                    
	Layout          *DOMSnapshotLayoutTreeSnapshot `json:"layout"`                   
	TextBoxes       *DOMSnapshotTextBoxSnapshot    `json:"textBoxes"`                
	ScrollOffsetX   float64                        `json:"scrollOffsetX,omitempty"`  
	ScrollOffsetY   float64                        `json:"scrollOffsetY,omitempty"`  
	ContentWidth    float64                        `json:"contentWidth,omitempty"`   
	ContentHeight   float64                        `json:"contentHeight,omitempty"`  
}
type DOMSnapshotNodeTreeSnapshot struct {
	ParentIndex          []int                       `json:"parentIndex,omitempty"`           
	NodeType             []int                       `json:"nodeType,omitempty"`              
	NodeName             []int                       `json:"nodeName,omitempty"`              
	NodeValue            []int                       `json:"nodeValue,omitempty"`             
	BackendNodeId        []int                       `json:"backendNodeId,omitempty"`         
	Attributes           []int                       `json:"attributes,omitempty"`            
	TextValue            *DOMSnapshotRareStringData  `json:"textValue,omitempty"`             
	InputValue           *DOMSnapshotRareStringData  `json:"inputValue,omitempty"`            
	InputChecked         *DOMSnapshotRareBooleanData `json:"inputChecked,omitempty"`          
	OptionSelected       *DOMSnapshotRareBooleanData `json:"optionSelected,omitempty"`        
	ContentDocumentIndex *DOMSnapshotRareIntegerData `json:"contentDocumentIndex,omitempty"`  
	PseudoType           *DOMSnapshotRareStringData  `json:"pseudoType,omitempty"`            
	IsClickable          *DOMSnapshotRareBooleanData `json:"isClickable,omitempty"`           
	CurrentSourceURL     *DOMSnapshotRareStringData  `json:"currentSourceURL,omitempty"`      
	OriginURL            *DOMSnapshotRareStringData  `json:"originURL,omitempty"`             
}
type DOMSnapshotLayoutTreeSnapshot struct {
	NodeIndex               []int                       `json:"nodeIndex"`                          
	Styles                  []int                       `json:"styles"`                             
	Bounds                  []float64                   `json:"bounds"`                             
	Text                    []int                       `json:"text"`                               
	StackingContexts        *DOMSnapshotRareBooleanData `json:"stackingContexts"`                   
	PaintOrders             []int                       `json:"paintOrders,omitempty"`              
	OffsetRects             []float64                   `json:"offsetRects,omitempty"`              
	ScrollRects             []float64                   `json:"scrollRects,omitempty"`              
	ClientRects             []float64                   `json:"clientRects,omitempty"`              
	BlendedBackgroundColors []int                       `json:"blendedBackgroundColors,omitempty"`  
	TextColorOpacities      []float64                   `json:"textColorOpacities,omitempty"`       
}
type DOMSnapshotTextBoxSnapshot struct {
	LayoutIndex []int     `json:"layoutIndex"`  
	Bounds      []float64 `json:"bounds"`       
	Start       []int     `json:"start"`        
	Length      []int     `json:"length"`       
}
type DOMSnapshot struct {
	target gcdmessage.ChromeTargeter
}
func NewDOMSnapshot(target gcdmessage.ChromeTargeter) *DOMSnapshot {
	c := &DOMSnapshot{target: target}
	return c
}
func (c *DOMSnapshot) Disable(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOMSnapshot.disable"})
}
func (c *DOMSnapshot) Enable(ctx context.Context) (*gcdmessage.ChromeResponse, error) {
	return c.target.SendDefaultRequest(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOMSnapshot.enable"})
}
type DOMSnapshotGetSnapshotParams struct {
	ComputedStyleWhitelist []string `json:"computedStyleWhitelist"`
	IncludeEventListeners bool `json:"includeEventListeners,omitempty"`
	IncludePaintOrder bool `json:"includePaintOrder,omitempty"`
	IncludeUserAgentShadowTree bool `json:"includeUserAgentShadowTree,omitempty"`
}
func (c *DOMSnapshot) GetSnapshotWithParams(ctx context.Context, v *DOMSnapshotGetSnapshotParams) ([]*DOMSnapshotDOMNode, []*DOMSnapshotLayoutTreeNode, []*DOMSnapshotComputedStyle, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOMSnapshot.getSnapshot", Params: v})
	if err != nil {
		return nil, nil, nil, err
	}
	var chromeData struct {
		Result struct {
			DomNodes        []*DOMSnapshotDOMNode
			LayoutTreeNodes []*DOMSnapshotLayoutTreeNode
			ComputedStyles  []*DOMSnapshotComputedStyle
		}
	}
	if resp == nil {
		return nil, nil, nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, nil, nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, nil, nil, err
	}
	return chromeData.Result.DomNodes, chromeData.Result.LayoutTreeNodes, chromeData.Result.ComputedStyles, nil
}
func (c *DOMSnapshot) GetSnapshot(ctx context.Context, computedStyleWhitelist []string, includeEventListeners bool, includePaintOrder bool, includeUserAgentShadowTree bool) ([]*DOMSnapshotDOMNode, []*DOMSnapshotLayoutTreeNode, []*DOMSnapshotComputedStyle, error) {
	var v DOMSnapshotGetSnapshotParams
	v.ComputedStyleWhitelist = computedStyleWhitelist
	v.IncludeEventListeners = includeEventListeners
	v.IncludePaintOrder = includePaintOrder
	v.IncludeUserAgentShadowTree = includeUserAgentShadowTree
	return c.GetSnapshotWithParams(ctx, &v)
}
type DOMSnapshotCaptureSnapshotParams struct {
	ComputedStyles []string `json:"computedStyles"`
	IncludePaintOrder bool `json:"includePaintOrder,omitempty"`
	IncludeDOMRects bool `json:"includeDOMRects,omitempty"`
	IncludeBlendedBackgroundColors bool `json:"includeBlendedBackgroundColors,omitempty"`
	IncludeTextColorOpacities bool `json:"includeTextColorOpacities,omitempty"`
}
func (c *DOMSnapshot) CaptureSnapshotWithParams(ctx context.Context, v *DOMSnapshotCaptureSnapshotParams) ([]*DOMSnapshotDocumentSnapshot, []string, error) {
	resp, err := c.target.SendCustomReturn(ctx, &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOMSnapshot.captureSnapshot", Params: v})
	if err != nil {
		return nil, nil, err
	}
	var chromeData struct {
		Result struct {
			Documents []*DOMSnapshotDocumentSnapshot
			Strings   []string
		}
	}
	if resp == nil {
		return nil, nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, nil, err
	}
	return chromeData.Result.Documents, chromeData.Result.Strings, nil
}