/
event.go
217 lines (187 loc) · 8.31 KB
/
event.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
// Code generated by cdpgen. DO NOT EDIT.
package dom
import (
"github.com/mafredri/cdp/rpcc"
)
// AttributeModifiedClient is a client for AttributeModified events. Fired
// when `Element`'s attribute is modified.
type AttributeModifiedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*AttributeModifiedReply, error)
rpcc.Stream
}
// AttributeModifiedReply is the reply for AttributeModified events.
type AttributeModifiedReply struct {
NodeID NodeID `json:"nodeId"` // Id of the node that has changed.
Name string `json:"name"` // Attribute name.
Value string `json:"value"` // Attribute value.
}
// AttributeRemovedClient is a client for AttributeRemoved events. Fired when
// `Element`'s attribute is removed.
type AttributeRemovedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*AttributeRemovedReply, error)
rpcc.Stream
}
// AttributeRemovedReply is the reply for AttributeRemoved events.
type AttributeRemovedReply struct {
NodeID NodeID `json:"nodeId"` // Id of the node that has changed.
Name string `json:"name"` // A ttribute name.
}
// CharacterDataModifiedClient is a client for CharacterDataModified events.
// Mirrors `DOMCharacterDataModified` event.
type CharacterDataModifiedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*CharacterDataModifiedReply, error)
rpcc.Stream
}
// CharacterDataModifiedReply is the reply for CharacterDataModified events.
type CharacterDataModifiedReply struct {
NodeID NodeID `json:"nodeId"` // Id of the node that has changed.
CharacterData string `json:"characterData"` // New text value.
}
// ChildNodeCountUpdatedClient is a client for ChildNodeCountUpdated events.
// Fired when `Container`'s child node count has changed.
type ChildNodeCountUpdatedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ChildNodeCountUpdatedReply, error)
rpcc.Stream
}
// ChildNodeCountUpdatedReply is the reply for ChildNodeCountUpdated events.
type ChildNodeCountUpdatedReply struct {
NodeID NodeID `json:"nodeId"` // Id of the node that has changed.
ChildNodeCount int `json:"childNodeCount"` // New node count.
}
// ChildNodeInsertedClient is a client for ChildNodeInserted events. Mirrors
// `DOMNodeInserted` event.
type ChildNodeInsertedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ChildNodeInsertedReply, error)
rpcc.Stream
}
// ChildNodeInsertedReply is the reply for ChildNodeInserted events.
type ChildNodeInsertedReply struct {
ParentNodeID NodeID `json:"parentNodeId"` // Id of the node that has changed.
PreviousNodeID NodeID `json:"previousNodeId"` // If of the previous siblint.
Node Node `json:"node"` // Inserted node data.
}
// ChildNodeRemovedClient is a client for ChildNodeRemoved events. Mirrors
// `DOMNodeRemoved` event.
type ChildNodeRemovedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ChildNodeRemovedReply, error)
rpcc.Stream
}
// ChildNodeRemovedReply is the reply for ChildNodeRemoved events.
type ChildNodeRemovedReply struct {
ParentNodeID NodeID `json:"parentNodeId"` // Parent id.
NodeID NodeID `json:"nodeId"` // Id of the node that has been removed.
}
// DistributedNodesUpdatedClient is a client for DistributedNodesUpdated events.
// Called when distribution is changed.
type DistributedNodesUpdatedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*DistributedNodesUpdatedReply, error)
rpcc.Stream
}
// DistributedNodesUpdatedReply is the reply for DistributedNodesUpdated events.
type DistributedNodesUpdatedReply struct {
InsertionPointID NodeID `json:"insertionPointId"` // Insertion point where distributed nodes were updated.
DistributedNodes []BackendNode `json:"distributedNodes"` // Distributed nodes for given insertion point.
}
// DocumentUpdatedClient is a client for DocumentUpdated events. Fired when
// `Document` has been totally updated. Node ids are no longer valid.
type DocumentUpdatedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*DocumentUpdatedReply, error)
rpcc.Stream
}
// DocumentUpdatedReply is the reply for DocumentUpdated events.
type DocumentUpdatedReply struct{}
// InlineStyleInvalidatedClient is a client for InlineStyleInvalidated events.
// Fired when `Element`'s inline style is modified via a CSS property
// modification.
type InlineStyleInvalidatedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*InlineStyleInvalidatedReply, error)
rpcc.Stream
}
// InlineStyleInvalidatedReply is the reply for InlineStyleInvalidated events.
type InlineStyleInvalidatedReply struct {
NodeIDs []NodeID `json:"nodeIds"` // Ids of the nodes for which the inline styles have been invalidated.
}
// PseudoElementAddedClient is a client for PseudoElementAdded events. Called
// when a pseudo element is added to an element.
type PseudoElementAddedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*PseudoElementAddedReply, error)
rpcc.Stream
}
// PseudoElementAddedReply is the reply for PseudoElementAdded events.
type PseudoElementAddedReply struct {
ParentID NodeID `json:"parentId"` // Pseudo element's parent element id.
PseudoElement Node `json:"pseudoElement"` // The added pseudo element.
}
// PseudoElementRemovedClient is a client for PseudoElementRemoved events.
// Called when a pseudo element is removed from an element.
type PseudoElementRemovedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*PseudoElementRemovedReply, error)
rpcc.Stream
}
// PseudoElementRemovedReply is the reply for PseudoElementRemoved events.
type PseudoElementRemovedReply struct {
ParentID NodeID `json:"parentId"` // Pseudo element's parent element id.
PseudoElementID NodeID `json:"pseudoElementId"` // The removed pseudo element id.
}
// SetChildNodesClient is a client for SetChildNodes events. Fired when
// backend wants to provide client with the missing DOM structure. This happens
// upon most of the calls requesting node ids.
type SetChildNodesClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*SetChildNodesReply, error)
rpcc.Stream
}
// SetChildNodesReply is the reply for SetChildNodes events.
type SetChildNodesReply struct {
ParentID NodeID `json:"parentId"` // Parent node id to populate with children.
Nodes []Node `json:"nodes"` // Child nodes array.
}
// ShadowRootPoppedClient is a client for ShadowRootPopped events. Called when
// shadow root is popped from the element.
type ShadowRootPoppedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ShadowRootPoppedReply, error)
rpcc.Stream
}
// ShadowRootPoppedReply is the reply for ShadowRootPopped events.
type ShadowRootPoppedReply struct {
HostID NodeID `json:"hostId"` // Host element id.
RootID NodeID `json:"rootId"` // Shadow root id.
}
// ShadowRootPushedClient is a client for ShadowRootPushed events. Called when
// shadow root is pushed into the element.
type ShadowRootPushedClient interface {
// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
// triggered, context canceled or connection closed.
Recv() (*ShadowRootPushedReply, error)
rpcc.Stream
}
// ShadowRootPushedReply is the reply for ShadowRootPushed events.
type ShadowRootPushedReply struct {
HostID NodeID `json:"hostId"` // Host element id.
Root Node `json:"root"` // Shadow root.
}