-
Notifications
You must be signed in to change notification settings - Fork 48
/
command.go
305 lines (256 loc) · 13.6 KB
/
command.go
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
// Code generated by cdpgen. DO NOT EDIT.
package css
import (
"github.com/mafredri/cdp/protocol/dom"
)
// GetMatchedStylesForNodeArgs represents the arguments for GetMatchedStylesForNode in the CSS domain.
type GetMatchedStylesForNodeArgs struct {
NodeID dom.NodeID `json:"nodeId"` // No description.
}
// NewGetMatchedStylesForNodeArgs initializes GetMatchedStylesForNodeArgs with the required arguments.
func NewGetMatchedStylesForNodeArgs(nodeID dom.NodeID) *GetMatchedStylesForNodeArgs {
args := new(GetMatchedStylesForNodeArgs)
args.NodeID = nodeID
return args
}
// GetMatchedStylesForNodeReply represents the return values for GetMatchedStylesForNode in the CSS domain.
type GetMatchedStylesForNodeReply struct {
InlineStyle *Style `json:"inlineStyle,omitempty"` // Inline style for the specified DOM node.
AttributesStyle *Style `json:"attributesStyle,omitempty"` // Attribute-defined element style (e.g. resulting from "width=20 height=100%").
MatchedCSSRules []RuleMatch `json:"matchedCSSRules,omitempty"` // CSS rules matching this node, from all applicable stylesheets.
PseudoElements []PseudoElementMatches `json:"pseudoElements,omitempty"` // Pseudo style matches for this node.
Inherited []InheritedStyleEntry `json:"inherited,omitempty"` // A chain of inherited styles (from the immediate node parent up to the DOM tree root).
CSSKeyframesRules []KeyframesRule `json:"cssKeyframesRules,omitempty"` // A list of CSS keyframed animations matching this node.
}
// GetInlineStylesForNodeArgs represents the arguments for GetInlineStylesForNode in the CSS domain.
type GetInlineStylesForNodeArgs struct {
NodeID dom.NodeID `json:"nodeId"` // No description.
}
// NewGetInlineStylesForNodeArgs initializes GetInlineStylesForNodeArgs with the required arguments.
func NewGetInlineStylesForNodeArgs(nodeID dom.NodeID) *GetInlineStylesForNodeArgs {
args := new(GetInlineStylesForNodeArgs)
args.NodeID = nodeID
return args
}
// GetInlineStylesForNodeReply represents the return values for GetInlineStylesForNode in the CSS domain.
type GetInlineStylesForNodeReply struct {
InlineStyle *Style `json:"inlineStyle,omitempty"` // Inline style for the specified DOM node.
AttributesStyle *Style `json:"attributesStyle,omitempty"` // Attribute-defined element style (e.g. resulting from "width=20 height=100%").
}
// GetComputedStyleForNodeArgs represents the arguments for GetComputedStyleForNode in the CSS domain.
type GetComputedStyleForNodeArgs struct {
NodeID dom.NodeID `json:"nodeId"` // No description.
}
// NewGetComputedStyleForNodeArgs initializes GetComputedStyleForNodeArgs with the required arguments.
func NewGetComputedStyleForNodeArgs(nodeID dom.NodeID) *GetComputedStyleForNodeArgs {
args := new(GetComputedStyleForNodeArgs)
args.NodeID = nodeID
return args
}
// GetComputedStyleForNodeReply represents the return values for GetComputedStyleForNode in the CSS domain.
type GetComputedStyleForNodeReply struct {
ComputedStyle []ComputedStyleProperty `json:"computedStyle"` // Computed style for the specified DOM node.
}
// GetPlatformFontsForNodeArgs represents the arguments for GetPlatformFontsForNode in the CSS domain.
type GetPlatformFontsForNodeArgs struct {
NodeID dom.NodeID `json:"nodeId"` // No description.
}
// NewGetPlatformFontsForNodeArgs initializes GetPlatformFontsForNodeArgs with the required arguments.
func NewGetPlatformFontsForNodeArgs(nodeID dom.NodeID) *GetPlatformFontsForNodeArgs {
args := new(GetPlatformFontsForNodeArgs)
args.NodeID = nodeID
return args
}
// GetPlatformFontsForNodeReply represents the return values for GetPlatformFontsForNode in the CSS domain.
type GetPlatformFontsForNodeReply struct {
Fonts []PlatformFontUsage `json:"fonts"` // Usage statistics for every employed platform font.
}
// GetStyleSheetTextArgs represents the arguments for GetStyleSheetText in the CSS domain.
type GetStyleSheetTextArgs struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
}
// NewGetStyleSheetTextArgs initializes GetStyleSheetTextArgs with the required arguments.
func NewGetStyleSheetTextArgs(styleSheetID StyleSheetID) *GetStyleSheetTextArgs {
args := new(GetStyleSheetTextArgs)
args.StyleSheetID = styleSheetID
return args
}
// GetStyleSheetTextReply represents the return values for GetStyleSheetText in the CSS domain.
type GetStyleSheetTextReply struct {
Text string `json:"text"` // The stylesheet text.
}
// CollectClassNamesArgs represents the arguments for CollectClassNames in the CSS domain.
type CollectClassNamesArgs struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
}
// NewCollectClassNamesArgs initializes CollectClassNamesArgs with the required arguments.
func NewCollectClassNamesArgs(styleSheetID StyleSheetID) *CollectClassNamesArgs {
args := new(CollectClassNamesArgs)
args.StyleSheetID = styleSheetID
return args
}
// CollectClassNamesReply represents the return values for CollectClassNames in the CSS domain.
type CollectClassNamesReply struct {
ClassNames []string `json:"classNames"` // Class name list.
}
// SetStyleSheetTextArgs represents the arguments for SetStyleSheetText in the CSS domain.
type SetStyleSheetTextArgs struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
Text string `json:"text"` // No description.
}
// NewSetStyleSheetTextArgs initializes SetStyleSheetTextArgs with the required arguments.
func NewSetStyleSheetTextArgs(styleSheetID StyleSheetID, text string) *SetStyleSheetTextArgs {
args := new(SetStyleSheetTextArgs)
args.StyleSheetID = styleSheetID
args.Text = text
return args
}
// SetStyleSheetTextReply represents the return values for SetStyleSheetText in the CSS domain.
type SetStyleSheetTextReply struct {
SourceMapURL *string `json:"sourceMapURL,omitempty"` // URL of source map associated with script (if any).
}
// SetRuleSelectorArgs represents the arguments for SetRuleSelector in the CSS domain.
type SetRuleSelectorArgs struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
Range SourceRange `json:"range"` // No description.
Selector string `json:"selector"` // No description.
}
// NewSetRuleSelectorArgs initializes SetRuleSelectorArgs with the required arguments.
func NewSetRuleSelectorArgs(styleSheetID StyleSheetID, rang SourceRange, selector string) *SetRuleSelectorArgs {
args := new(SetRuleSelectorArgs)
args.StyleSheetID = styleSheetID
args.Range = rang
args.Selector = selector
return args
}
// SetRuleSelectorReply represents the return values for SetRuleSelector in the CSS domain.
type SetRuleSelectorReply struct {
SelectorList SelectorList `json:"selectorList"` // The resulting selector list after modification.
}
// SetKeyframeKeyArgs represents the arguments for SetKeyframeKey in the CSS domain.
type SetKeyframeKeyArgs struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
Range SourceRange `json:"range"` // No description.
KeyText string `json:"keyText"` // No description.
}
// NewSetKeyframeKeyArgs initializes SetKeyframeKeyArgs with the required arguments.
func NewSetKeyframeKeyArgs(styleSheetID StyleSheetID, rang SourceRange, keyText string) *SetKeyframeKeyArgs {
args := new(SetKeyframeKeyArgs)
args.StyleSheetID = styleSheetID
args.Range = rang
args.KeyText = keyText
return args
}
// SetKeyframeKeyReply represents the return values for SetKeyframeKey in the CSS domain.
type SetKeyframeKeyReply struct {
KeyText Value `json:"keyText"` // The resulting key text after modification.
}
// SetStyleTextsArgs represents the arguments for SetStyleTexts in the CSS domain.
type SetStyleTextsArgs struct {
Edits []StyleDeclarationEdit `json:"edits"` // No description.
}
// NewSetStyleTextsArgs initializes SetStyleTextsArgs with the required arguments.
func NewSetStyleTextsArgs(edits []StyleDeclarationEdit) *SetStyleTextsArgs {
args := new(SetStyleTextsArgs)
args.Edits = edits
return args
}
// SetStyleTextsReply represents the return values for SetStyleTexts in the CSS domain.
type SetStyleTextsReply struct {
Styles []Style `json:"styles"` // The resulting styles after modification.
}
// SetMediaTextArgs represents the arguments for SetMediaText in the CSS domain.
type SetMediaTextArgs struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // No description.
Range SourceRange `json:"range"` // No description.
Text string `json:"text"` // No description.
}
// NewSetMediaTextArgs initializes SetMediaTextArgs with the required arguments.
func NewSetMediaTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetMediaTextArgs {
args := new(SetMediaTextArgs)
args.StyleSheetID = styleSheetID
args.Range = rang
args.Text = text
return args
}
// SetMediaTextReply represents the return values for SetMediaText in the CSS domain.
type SetMediaTextReply struct {
Media Media `json:"media"` // The resulting CSS media rule after modification.
}
// CreateStyleSheetReply represents the return values for CreateStyleSheet in the CSS domain.
type CreateStyleSheetReply struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // Identifier of the created "via-inspector" stylesheet.
}
// AddRuleArgs represents the arguments for AddRule in the CSS domain.
type AddRuleArgs struct {
StyleSheetID StyleSheetID `json:"styleSheetId"` // The css style sheet identifier where a new rule should be inserted.
RuleText string `json:"ruleText"` // The text of a new rule.
Location SourceRange `json:"location"` // Text position of a new rule in the target style sheet.
}
// NewAddRuleArgs initializes AddRuleArgs with the required arguments.
func NewAddRuleArgs(styleSheetID StyleSheetID, ruleText string, location SourceRange) *AddRuleArgs {
args := new(AddRuleArgs)
args.StyleSheetID = styleSheetID
args.RuleText = ruleText
args.Location = location
return args
}
// AddRuleReply represents the return values for AddRule in the CSS domain.
type AddRuleReply struct {
Rule Rule `json:"rule"` // The newly created rule.
}
// ForcePseudoStateArgs represents the arguments for ForcePseudoState in the CSS domain.
type ForcePseudoStateArgs struct {
NodeID dom.NodeID `json:"nodeId"` // The element id for which to force the pseudo state.
ForcedPseudoClasses []string `json:"forcedPseudoClasses"` // Element pseudo classes to force when computing the element's style.
}
// NewForcePseudoStateArgs initializes ForcePseudoStateArgs with the required arguments.
func NewForcePseudoStateArgs(nodeID dom.NodeID, forcedPseudoClasses []string) *ForcePseudoStateArgs {
args := new(ForcePseudoStateArgs)
args.NodeID = nodeID
args.ForcedPseudoClasses = forcedPseudoClasses
return args
}
// GetMediaQueriesReply represents the return values for GetMediaQueries in the CSS domain.
type GetMediaQueriesReply struct {
Medias []Media `json:"medias"` // No description.
}
// SetEffectivePropertyValueForNodeArgs represents the arguments for SetEffectivePropertyValueForNode in the CSS domain.
type SetEffectivePropertyValueForNodeArgs struct {
NodeID dom.NodeID `json:"nodeId"` // The element id for which to set property.
PropertyName string `json:"propertyName"` // No description.
Value string `json:"value"` // No description.
}
// NewSetEffectivePropertyValueForNodeArgs initializes SetEffectivePropertyValueForNodeArgs with the required arguments.
func NewSetEffectivePropertyValueForNodeArgs(nodeID dom.NodeID, propertyName string, value string) *SetEffectivePropertyValueForNodeArgs {
args := new(SetEffectivePropertyValueForNodeArgs)
args.NodeID = nodeID
args.PropertyName = propertyName
args.Value = value
return args
}
// GetBackgroundColorsArgs represents the arguments for GetBackgroundColors in the CSS domain.
type GetBackgroundColorsArgs struct {
NodeID dom.NodeID `json:"nodeId"` // Id of the node to get background colors for.
}
// NewGetBackgroundColorsArgs initializes GetBackgroundColorsArgs with the required arguments.
func NewGetBackgroundColorsArgs(nodeID dom.NodeID) *GetBackgroundColorsArgs {
args := new(GetBackgroundColorsArgs)
args.NodeID = nodeID
return args
}
// GetBackgroundColorsReply represents the return values for GetBackgroundColors in the CSS domain.
type GetBackgroundColorsReply struct {
BackgroundColors []string `json:"backgroundColors,omitempty"` // The range of background colors behind this element, if it contains any visible text. If no visible text is present, this will be undefined. In the case of a flat background color, this will consist of simply that color. In the case of a gradient, this will consist of each of the color stops. For anything more complicated, this will be an empty array. Images will be ignored (as if the image had failed to load).
ComputedFontSize *string `json:"computedFontSize,omitempty"` // The computed font size for this node, as a CSS computed value string (e.g. '12px').
ComputedFontWeight *string `json:"computedFontWeight,omitempty"` // The computed font weight for this node, as a CSS computed value string (e.g. 'normal' or '100').
ComputedBodyFontSize *string `json:"computedBodyFontSize,omitempty"` // The computed font size for the document body, as a computed CSS value string (e.g. '16px').
}
// TakeCoverageDeltaReply represents the return values for TakeCoverageDelta in the CSS domain.
type TakeCoverageDeltaReply struct {
Coverage []RuleUsage `json:"coverage"` // No description.
}
// StopRuleUsageTrackingReply represents the return values for StopRuleUsageTracking in the CSS domain.
type StopRuleUsageTrackingReply struct {
RuleUsage []RuleUsage `json:"ruleUsage"` // No description.
}