forked from chromedp/chromedp
/
types.go
157 lines (129 loc) · 4.64 KB
/
types.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
package emulation
import (
"errors"
"github.com/mailru/easyjson"
"github.com/mailru/easyjson/jlexer"
"github.com/mailru/easyjson/jwriter"
)
// AUTOGENERATED. DO NOT EDIT.
// ScreenOrientation screen orientation.
type ScreenOrientation struct {
Type OrientationType `json:"type,omitempty"` // Orientation type.
Angle int64 `json:"angle,omitempty"` // Orientation angle.
}
// VirtualTimePolicy advance: If the scheduler runs out of immediate work,
// the virtual time base may fast forward to allow the next delayed task (if
// any) to run; pause: The virtual time base may not advance;
// pauseIfNetworkFetchesPending: The virtual time base may not advance if there
// are any pending resource fetches.
type VirtualTimePolicy string
// String returns the VirtualTimePolicy as string value.
func (t VirtualTimePolicy) String() string {
return string(t)
}
// VirtualTimePolicy values.
const (
VirtualTimePolicyAdvance VirtualTimePolicy = "advance"
VirtualTimePolicyPause VirtualTimePolicy = "pause"
VirtualTimePolicyPauseIfNetworkFetchesPending VirtualTimePolicy = "pauseIfNetworkFetchesPending"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t VirtualTimePolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t VirtualTimePolicy) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *VirtualTimePolicy) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch VirtualTimePolicy(in.String()) {
case VirtualTimePolicyAdvance:
*t = VirtualTimePolicyAdvance
case VirtualTimePolicyPause:
*t = VirtualTimePolicyPause
case VirtualTimePolicyPauseIfNetworkFetchesPending:
*t = VirtualTimePolicyPauseIfNetworkFetchesPending
default:
in.AddError(errors.New("unknown VirtualTimePolicy value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *VirtualTimePolicy) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// OrientationType orientation type.
type OrientationType string
// String returns the OrientationType as string value.
func (t OrientationType) String() string {
return string(t)
}
// OrientationType values.
const (
OrientationTypePortraitPrimary OrientationType = "portraitPrimary"
OrientationTypePortraitSecondary OrientationType = "portraitSecondary"
OrientationTypeLandscapePrimary OrientationType = "landscapePrimary"
OrientationTypeLandscapeSecondary OrientationType = "landscapeSecondary"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t OrientationType) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t OrientationType) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *OrientationType) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch OrientationType(in.String()) {
case OrientationTypePortraitPrimary:
*t = OrientationTypePortraitPrimary
case OrientationTypePortraitSecondary:
*t = OrientationTypePortraitSecondary
case OrientationTypeLandscapePrimary:
*t = OrientationTypeLandscapePrimary
case OrientationTypeLandscapeSecondary:
*t = OrientationTypeLandscapeSecondary
default:
in.AddError(errors.New("unknown OrientationType value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *OrientationType) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}
// EnabledConfiguration touch/gesture events configuration. Default: current
// platform.
type EnabledConfiguration string
// String returns the EnabledConfiguration as string value.
func (t EnabledConfiguration) String() string {
return string(t)
}
// EnabledConfiguration values.
const (
EnabledConfigurationMobile EnabledConfiguration = "mobile"
EnabledConfigurationDesktop EnabledConfiguration = "desktop"
)
// MarshalEasyJSON satisfies easyjson.Marshaler.
func (t EnabledConfiguration) MarshalEasyJSON(out *jwriter.Writer) {
out.String(string(t))
}
// MarshalJSON satisfies json.Marshaler.
func (t EnabledConfiguration) MarshalJSON() ([]byte, error) {
return easyjson.Marshal(t)
}
// UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
func (t *EnabledConfiguration) UnmarshalEasyJSON(in *jlexer.Lexer) {
switch EnabledConfiguration(in.String()) {
case EnabledConfigurationMobile:
*t = EnabledConfigurationMobile
case EnabledConfigurationDesktop:
*t = EnabledConfigurationDesktop
default:
in.AddError(errors.New("unknown EnabledConfiguration value"))
}
}
// UnmarshalJSON satisfies json.Unmarshaler.
func (t *EnabledConfiguration) UnmarshalJSON(buf []byte) error {
return easyjson.Unmarshal(buf, t)
}