1#![allow(dead_code)]
3#[allow(unused_imports)]
4use super::types::*;
5#[allow(unused_imports)]
6use derive_builder::Builder;
7#[allow(unused_imports)]
8use serde::{Deserialize, Serialize};
9#[allow(unused_imports)]
10use serde_json::Value as Json;
11pub type TimeSinceEpoch = JsFloat;
12#[allow(deprecated)]
13#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
14pub enum GestureSourceType {
15 #[serde(rename = "default")]
16 Default,
17 #[serde(rename = "touch")]
18 Touch,
19 #[serde(rename = "mouse")]
20 Mouse,
21}
22#[allow(deprecated)]
23#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
24pub enum MouseButton {
25 #[serde(rename = "none")]
26 None,
27 #[serde(rename = "left")]
28 Left,
29 #[serde(rename = "middle")]
30 Middle,
31 #[serde(rename = "right")]
32 Right,
33 #[serde(rename = "back")]
34 Back,
35 #[serde(rename = "forward")]
36 Forward,
37}
38#[allow(deprecated)]
39#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
40pub enum DispatchDragEventTypeOption {
41 #[serde(rename = "dragEnter")]
42 DragEnter,
43 #[serde(rename = "dragOver")]
44 DragOver,
45 #[serde(rename = "drop")]
46 Drop,
47 #[serde(rename = "dragCancel")]
48 DragCancel,
49}
50#[allow(deprecated)]
51#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
52pub enum DispatchKeyEventTypeOption {
53 #[serde(rename = "keyDown")]
54 KeyDown,
55 #[serde(rename = "keyUp")]
56 KeyUp,
57 #[serde(rename = "rawKeyDown")]
58 RawKeyDown,
59 #[serde(rename = "char")]
60 Char,
61}
62#[allow(deprecated)]
63#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
64pub enum DispatchMouseEventTypeOption {
65 #[serde(rename = "mousePressed")]
66 MousePressed,
67 #[serde(rename = "mouseReleased")]
68 MouseReleased,
69 #[serde(rename = "mouseMoved")]
70 MouseMoved,
71 #[serde(rename = "mouseWheel")]
72 MouseWheel,
73}
74#[allow(deprecated)]
75#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
76pub enum DispatchMouseEventPointerTypeOption {
77 #[serde(rename = "mouse")]
78 Mouse,
79 #[serde(rename = "pen")]
80 Pen,
81}
82#[allow(deprecated)]
83#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
84pub enum DispatchTouchEventTypeOption {
85 #[serde(rename = "touchStart")]
86 TouchStart,
87 #[serde(rename = "touchEnd")]
88 TouchEnd,
89 #[serde(rename = "touchMove")]
90 TouchMove,
91 #[serde(rename = "touchCancel")]
92 TouchCancel,
93}
94#[allow(deprecated)]
95#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
96pub enum EmulateTouchFromMouseEventTypeOption {
97 #[serde(rename = "mousePressed")]
98 MousePressed,
99 #[serde(rename = "mouseReleased")]
100 MouseReleased,
101 #[serde(rename = "mouseMoved")]
102 MouseMoved,
103 #[serde(rename = "mouseWheel")]
104 MouseWheel,
105}
106#[allow(deprecated)]
107#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
108#[builder(setter(into, strip_option))]
109#[serde(rename_all = "camelCase")]
110pub struct TouchPoint {
111 #[serde(default)]
112 #[doc = "X coordinate of the event relative to the main frame's viewport in CSS pixels."]
113 pub x: JsFloat,
114 #[serde(default)]
115 #[doc = "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\n the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."]
116 pub y: JsFloat,
117 #[builder(default)]
118 #[serde(skip_serializing_if = "Option::is_none")]
119 #[serde(default)]
120 #[doc = "X radius of the touch area (default: 1.0)."]
121 pub radius_x: Option<JsFloat>,
122 #[builder(default)]
123 #[serde(skip_serializing_if = "Option::is_none")]
124 #[serde(default)]
125 #[doc = "Y radius of the touch area (default: 1.0)."]
126 pub radius_y: Option<JsFloat>,
127 #[builder(default)]
128 #[serde(skip_serializing_if = "Option::is_none")]
129 #[serde(default)]
130 #[doc = "Rotation angle (default: 0.0)."]
131 pub rotation_angle: Option<JsFloat>,
132 #[builder(default)]
133 #[serde(skip_serializing_if = "Option::is_none")]
134 #[serde(default)]
135 #[doc = "Force (default: 1.0)."]
136 pub force: Option<JsFloat>,
137 #[builder(default)]
138 #[serde(skip_serializing_if = "Option::is_none")]
139 #[serde(default)]
140 #[doc = "The normalized tangential pressure, which has a range of \\[-1,1\\] (default: 0)."]
141 pub tangential_pressure: Option<JsFloat>,
142 #[builder(default)]
143 #[serde(skip_serializing_if = "Option::is_none")]
144 #[serde(default)]
145 #[doc = "The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range \\[-90,90\\], a positive tiltX is to the right (default: 0)"]
146 pub tilt_x: Option<JsFloat>,
147 #[builder(default)]
148 #[serde(skip_serializing_if = "Option::is_none")]
149 #[serde(default)]
150 #[doc = "The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range \\[-90,90\\], a positive tiltY is towards the user (default: 0)."]
151 pub tilt_y: Option<JsFloat>,
152 #[builder(default)]
153 #[serde(skip_serializing_if = "Option::is_none")]
154 #[serde(default)]
155 #[doc = "The clockwise rotation of a pen stylus around its own major axis, in degrees in the range \\[0,359\\] (default: 0)."]
156 pub twist: Option<JsUInt>,
157 #[builder(default)]
158 #[serde(skip_serializing_if = "Option::is_none")]
159 #[serde(default)]
160 #[doc = "Identifier used to track touch sources between events, must be unique within an event."]
161 pub id: Option<JsFloat>,
162}
163#[allow(deprecated)]
164#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
165#[builder(setter(into, strip_option))]
166#[serde(rename_all = "camelCase")]
167pub struct DragDataItem {
168 #[serde(default)]
169 #[doc = "Mime type of the dragged data."]
170 pub mime_type: String,
171 #[serde(default)]
172 #[doc = "Depending of the value of `mimeType`, it contains the dragged link,\n text, HTML markup or any other data."]
173 pub data: String,
174 #[builder(default)]
175 #[serde(skip_serializing_if = "Option::is_none")]
176 #[serde(default)]
177 #[doc = "Title associated with a link. Only valid when `mimeType` == \"text/uri-list\"."]
178 pub title: Option<String>,
179 #[builder(default)]
180 #[serde(skip_serializing_if = "Option::is_none")]
181 #[serde(default)]
182 #[doc = "Stores the base URL for the contained markup. Only valid when `mimeType`\n == \"text/html\"."]
183 #[serde(rename = "baseURL")]
184 pub base_url: Option<String>,
185}
186#[allow(deprecated)]
187#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
188#[builder(setter(into, strip_option))]
189#[serde(rename_all = "camelCase")]
190pub struct DragData {
191 pub items: Vec<DragDataItem>,
192 #[builder(default)]
193 #[serde(skip_serializing_if = "Option::is_none")]
194 #[serde(default)]
195 #[doc = "List of filenames that should be included when dropping"]
196 pub files: Option<Vec<String>>,
197 #[serde(default)]
198 #[doc = "Bit field representing allowed drag operations. Copy = 1, Link = 2, Move = 16"]
199 pub drag_operations_mask: JsUInt,
200}
201#[allow(deprecated)]
202#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
203#[builder(setter(into, strip_option))]
204#[serde(rename_all = "camelCase")]
205#[doc = "Dispatches a drag event into the page."]
206pub struct DispatchDragEvent {
207 #[doc = "Type of the drag event."]
208 pub r#type: DispatchDragEventTypeOption,
209 #[serde(default)]
210 #[doc = "X coordinate of the event relative to the main frame's viewport in CSS pixels."]
211 pub x: JsFloat,
212 #[serde(default)]
213 #[doc = "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\n the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."]
214 pub y: JsFloat,
215 pub data: DragData,
216 #[builder(default)]
217 #[serde(skip_serializing_if = "Option::is_none")]
218 #[serde(default)]
219 #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n (default: 0)."]
220 pub modifiers: Option<JsUInt>,
221}
222#[allow(deprecated)]
223#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
224#[builder(setter(into, strip_option))]
225#[serde(rename_all = "camelCase")]
226#[doc = "Dispatches a key event to the page."]
227pub struct DispatchKeyEvent {
228 #[doc = "Type of the key event."]
229 pub r#type: DispatchKeyEventTypeOption,
230 #[builder(default)]
231 #[serde(skip_serializing_if = "Option::is_none")]
232 #[serde(default)]
233 #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n (default: 0)."]
234 pub modifiers: Option<JsUInt>,
235 #[builder(default)]
236 #[serde(skip_serializing_if = "Option::is_none")]
237 #[doc = "Time at which the event occurred."]
238 pub timestamp: Option<TimeSinceEpoch>,
239 #[builder(default)]
240 #[serde(skip_serializing_if = "Option::is_none")]
241 #[serde(default)]
242 #[doc = "Text as generated by processing a virtual key code with a keyboard layout. Not needed for\n for `keyUp` and `rawKeyDown` events (default: \"\")"]
243 pub text: Option<String>,
244 #[builder(default)]
245 #[serde(skip_serializing_if = "Option::is_none")]
246 #[serde(default)]
247 #[doc = "Text that would have been generated by the keyboard if no modifiers were pressed (except for\n shift). Useful for shortcut (accelerator) key handling (default: \"\")."]
248 pub unmodified_text: Option<String>,
249 #[builder(default)]
250 #[serde(skip_serializing_if = "Option::is_none")]
251 #[serde(default)]
252 #[doc = "Unique key identifier (e.g., 'U+0041') (default: \"\")."]
253 pub key_identifier: Option<String>,
254 #[builder(default)]
255 #[serde(skip_serializing_if = "Option::is_none")]
256 #[serde(default)]
257 #[doc = "Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: \"\")."]
258 pub code: Option<String>,
259 #[builder(default)]
260 #[serde(skip_serializing_if = "Option::is_none")]
261 #[serde(default)]
262 #[doc = "Unique DOM defined string value describing the meaning of the key in the context of active\n modifiers, keyboard layout, etc (e.g., 'AltGr') (default: \"\")."]
263 pub key: Option<String>,
264 #[builder(default)]
265 #[serde(skip_serializing_if = "Option::is_none")]
266 #[serde(default)]
267 #[doc = "Windows virtual key code (default: 0)."]
268 pub windows_virtual_key_code: Option<JsUInt>,
269 #[builder(default)]
270 #[serde(skip_serializing_if = "Option::is_none")]
271 #[serde(default)]
272 #[doc = "Native virtual key code (default: 0)."]
273 pub native_virtual_key_code: Option<JsUInt>,
274 #[builder(default)]
275 #[serde(skip_serializing_if = "Option::is_none")]
276 #[serde(default)]
277 #[doc = "Whether the event was generated from auto repeat (default: false)."]
278 pub auto_repeat: Option<bool>,
279 #[builder(default)]
280 #[serde(skip_serializing_if = "Option::is_none")]
281 #[serde(default)]
282 #[doc = "Whether the event was generated from the keypad (default: false)."]
283 pub is_keypad: Option<bool>,
284 #[builder(default)]
285 #[serde(skip_serializing_if = "Option::is_none")]
286 #[serde(default)]
287 #[doc = "Whether the event was a system key event (default: false)."]
288 pub is_system_key: Option<bool>,
289 #[builder(default)]
290 #[serde(skip_serializing_if = "Option::is_none")]
291 #[serde(default)]
292 #[doc = "Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default:\n 0)."]
293 pub location: Option<JsUInt>,
294 #[builder(default)]
295 #[serde(skip_serializing_if = "Option::is_none")]
296 #[serde(default)]
297 #[doc = "Editing commands to send with the key event (e.g., 'selectAll') (default: \\[\\]).\n These are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding.\n See <https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h> for valid command names."]
298 pub commands: Option<Vec<String>>,
299}
300#[allow(deprecated)]
301#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
302#[builder(setter(into, strip_option))]
303#[serde(rename_all = "camelCase")]
304#[doc = "This method emulates inserting text that doesn't come from a key press,\n for example an emoji keyboard or an IME."]
305pub struct InsertText {
306 #[serde(default)]
307 #[doc = "The text to insert."]
308 pub text: String,
309}
310#[allow(deprecated)]
311#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
312#[builder(setter(into, strip_option))]
313#[serde(rename_all = "camelCase")]
314#[doc = "This method sets the current candidate text for IME.\n Use imeCommitComposition to commit the final text.\n Use imeSetComposition with empty string as text to cancel composition."]
315pub struct ImeSetComposition {
316 #[serde(default)]
317 #[doc = "The text to insert"]
318 pub text: String,
319 #[serde(default)]
320 #[doc = "selection start"]
321 pub selection_start: JsUInt,
322 #[serde(default)]
323 #[doc = "selection end"]
324 pub selection_end: JsUInt,
325 #[builder(default)]
326 #[serde(skip_serializing_if = "Option::is_none")]
327 #[serde(default)]
328 #[doc = "replacement start"]
329 pub replacement_start: Option<JsUInt>,
330 #[builder(default)]
331 #[serde(skip_serializing_if = "Option::is_none")]
332 #[serde(default)]
333 #[doc = "replacement end"]
334 pub replacement_end: Option<JsUInt>,
335}
336#[allow(deprecated)]
337#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
338#[builder(setter(into, strip_option))]
339#[serde(rename_all = "camelCase")]
340#[doc = "Dispatches a mouse event to the page."]
341pub struct DispatchMouseEvent {
342 #[doc = "Type of the mouse event."]
343 pub r#type: DispatchMouseEventTypeOption,
344 #[serde(default)]
345 #[doc = "X coordinate of the event relative to the main frame's viewport in CSS pixels."]
346 pub x: JsFloat,
347 #[serde(default)]
348 #[doc = "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\n the top of the viewport and Y increases as it proceeds towards the bottom of the viewport."]
349 pub y: JsFloat,
350 #[builder(default)]
351 #[serde(skip_serializing_if = "Option::is_none")]
352 #[serde(default)]
353 #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n (default: 0)."]
354 pub modifiers: Option<JsUInt>,
355 #[builder(default)]
356 #[serde(skip_serializing_if = "Option::is_none")]
357 #[doc = "Time at which the event occurred."]
358 pub timestamp: Option<TimeSinceEpoch>,
359 #[builder(default)]
360 #[serde(skip_serializing_if = "Option::is_none")]
361 #[doc = "Mouse button (default: \"none\")."]
362 pub button: Option<MouseButton>,
363 #[builder(default)]
364 #[serde(skip_serializing_if = "Option::is_none")]
365 #[serde(default)]
366 #[doc = "A number indicating which buttons are pressed on the mouse when a mouse event is triggered.\n Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0."]
367 pub buttons: Option<JsUInt>,
368 #[builder(default)]
369 #[serde(skip_serializing_if = "Option::is_none")]
370 #[serde(default)]
371 #[doc = "Number of times the mouse button was clicked (default: 0)."]
372 pub click_count: Option<JsUInt>,
373 #[builder(default)]
374 #[serde(skip_serializing_if = "Option::is_none")]
375 #[serde(default)]
376 #[doc = "The normalized pressure, which has a range of \\[0,1\\] (default: 0)."]
377 pub force: Option<JsFloat>,
378 #[builder(default)]
379 #[serde(skip_serializing_if = "Option::is_none")]
380 #[serde(default)]
381 #[doc = "The normalized tangential pressure, which has a range of \\[-1,1\\] (default: 0)."]
382 pub tangential_pressure: Option<JsFloat>,
383 #[builder(default)]
384 #[serde(skip_serializing_if = "Option::is_none")]
385 #[serde(default)]
386 #[doc = "The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range \\[-90,90\\], a positive tiltX is to the right (default: 0)."]
387 pub tilt_x: Option<JsFloat>,
388 #[builder(default)]
389 #[serde(skip_serializing_if = "Option::is_none")]
390 #[serde(default)]
391 #[doc = "The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range \\[-90,90\\], a positive tiltY is towards the user (default: 0)."]
392 pub tilt_y: Option<JsFloat>,
393 #[builder(default)]
394 #[serde(skip_serializing_if = "Option::is_none")]
395 #[serde(default)]
396 #[doc = "The clockwise rotation of a pen stylus around its own major axis, in degrees in the range \\[0,359\\] (default: 0)."]
397 pub twist: Option<JsUInt>,
398 #[builder(default)]
399 #[serde(skip_serializing_if = "Option::is_none")]
400 #[serde(default)]
401 #[doc = "X delta in CSS pixels for mouse wheel event (default: 0)."]
402 pub delta_x: Option<JsFloat>,
403 #[builder(default)]
404 #[serde(skip_serializing_if = "Option::is_none")]
405 #[serde(default)]
406 #[doc = "Y delta in CSS pixels for mouse wheel event (default: 0)."]
407 pub delta_y: Option<JsFloat>,
408 #[builder(default)]
409 #[serde(skip_serializing_if = "Option::is_none")]
410 #[doc = "Pointer type (default: \"mouse\")."]
411 pub pointer_type: Option<DispatchMouseEventPointerTypeOption>,
412}
413#[allow(deprecated)]
414#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
415#[builder(setter(into, strip_option))]
416#[serde(rename_all = "camelCase")]
417#[doc = "Dispatches a touch event to the page."]
418pub struct DispatchTouchEvent {
419 #[doc = "Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while\n TouchStart and TouchMove must contains at least one."]
420 pub r#type: DispatchTouchEventTypeOption,
421 #[doc = "Active touch points on the touch device. One event per any changed point (compared to\n previous touch event in a sequence) is generated, emulating pressing/moving/releasing points\n one by one."]
422 pub touch_points: Vec<TouchPoint>,
423 #[builder(default)]
424 #[serde(skip_serializing_if = "Option::is_none")]
425 #[serde(default)]
426 #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n (default: 0)."]
427 pub modifiers: Option<JsUInt>,
428 #[builder(default)]
429 #[serde(skip_serializing_if = "Option::is_none")]
430 #[doc = "Time at which the event occurred."]
431 pub timestamp: Option<TimeSinceEpoch>,
432}
433#[allow(deprecated)]
434#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
435pub struct CancelDragging(pub Option<Json>);
436#[allow(deprecated)]
437#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
438#[builder(setter(into, strip_option))]
439#[serde(rename_all = "camelCase")]
440#[doc = "Emulates touch event from the mouse event parameters."]
441pub struct EmulateTouchFromMouseEvent {
442 #[doc = "Type of the mouse event."]
443 pub r#type: EmulateTouchFromMouseEventTypeOption,
444 #[serde(default)]
445 #[doc = "X coordinate of the mouse pointer in DIP."]
446 pub x: JsUInt,
447 #[serde(default)]
448 #[doc = "Y coordinate of the mouse pointer in DIP."]
449 pub y: JsUInt,
450 #[doc = "Mouse button. Only \"none\", \"left\", \"right\" are supported."]
451 pub button: MouseButton,
452 #[builder(default)]
453 #[serde(skip_serializing_if = "Option::is_none")]
454 #[doc = "Time at which the event occurred (default: current time)."]
455 pub timestamp: Option<TimeSinceEpoch>,
456 #[builder(default)]
457 #[serde(skip_serializing_if = "Option::is_none")]
458 #[serde(default)]
459 #[doc = "X delta in DIP for mouse wheel event (default: 0)."]
460 pub delta_x: Option<JsFloat>,
461 #[builder(default)]
462 #[serde(skip_serializing_if = "Option::is_none")]
463 #[serde(default)]
464 #[doc = "Y delta in DIP for mouse wheel event (default: 0)."]
465 pub delta_y: Option<JsFloat>,
466 #[builder(default)]
467 #[serde(skip_serializing_if = "Option::is_none")]
468 #[serde(default)]
469 #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n (default: 0)."]
470 pub modifiers: Option<JsUInt>,
471 #[builder(default)]
472 #[serde(skip_serializing_if = "Option::is_none")]
473 #[serde(default)]
474 #[doc = "Number of times the mouse button was clicked (default: 0)."]
475 pub click_count: Option<JsUInt>,
476}
477#[allow(deprecated)]
478#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
479#[builder(setter(into, strip_option))]
480#[serde(rename_all = "camelCase")]
481#[doc = "Ignores input events (useful while auditing page)."]
482pub struct SetIgnoreInputEvents {
483 #[serde(default)]
484 #[doc = "Ignores input events processing when set to true."]
485 pub ignore: bool,
486}
487#[allow(deprecated)]
488#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
489#[builder(setter(into, strip_option))]
490#[serde(rename_all = "camelCase")]
491#[doc = "Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events.\n Drag and drop behavior can be directly controlled via `Input.dispatchDragEvent`."]
492pub struct SetInterceptDrags {
493 #[serde(default)]
494 pub enabled: bool,
495}
496#[allow(deprecated)]
497#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
498#[builder(setter(into, strip_option))]
499#[serde(rename_all = "camelCase")]
500#[doc = "Synthesizes a pinch gesture over a time period by issuing appropriate touch events."]
501pub struct SynthesizePinchGesture {
502 #[serde(default)]
503 #[doc = "X coordinate of the start of the gesture in CSS pixels."]
504 pub x: JsFloat,
505 #[serde(default)]
506 #[doc = "Y coordinate of the start of the gesture in CSS pixels."]
507 pub y: JsFloat,
508 #[serde(default)]
509 #[doc = "Relative scale factor after zooming (\\>1.0 zooms in, \\<1.0 zooms out)."]
510 pub scale_factor: JsFloat,
511 #[builder(default)]
512 #[serde(skip_serializing_if = "Option::is_none")]
513 #[serde(default)]
514 #[doc = "Relative pointer speed in pixels per second (default: 800)."]
515 pub relative_speed: Option<JsUInt>,
516 #[builder(default)]
517 #[serde(skip_serializing_if = "Option::is_none")]
518 #[doc = "Which type of input events to be generated (default: 'default', which queries the platform\n for the preferred input type)."]
519 pub gesture_source_type: Option<GestureSourceType>,
520}
521#[allow(deprecated)]
522#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
523#[builder(setter(into, strip_option))]
524#[serde(rename_all = "camelCase")]
525#[doc = "Synthesizes a scroll gesture over a time period by issuing appropriate touch events."]
526pub struct SynthesizeScrollGesture {
527 #[serde(default)]
528 #[doc = "X coordinate of the start of the gesture in CSS pixels."]
529 pub x: JsFloat,
530 #[serde(default)]
531 #[doc = "Y coordinate of the start of the gesture in CSS pixels."]
532 pub y: JsFloat,
533 #[builder(default)]
534 #[serde(skip_serializing_if = "Option::is_none")]
535 #[serde(default)]
536 #[doc = "The distance to scroll along the X axis (positive to scroll left)."]
537 pub x_distance: Option<JsFloat>,
538 #[builder(default)]
539 #[serde(skip_serializing_if = "Option::is_none")]
540 #[serde(default)]
541 #[doc = "The distance to scroll along the Y axis (positive to scroll up)."]
542 pub y_distance: Option<JsFloat>,
543 #[builder(default)]
544 #[serde(skip_serializing_if = "Option::is_none")]
545 #[serde(default)]
546 #[doc = "The number of additional pixels to scroll back along the X axis, in addition to the given\n distance."]
547 pub x_overscroll: Option<JsFloat>,
548 #[builder(default)]
549 #[serde(skip_serializing_if = "Option::is_none")]
550 #[serde(default)]
551 #[doc = "The number of additional pixels to scroll back along the Y axis, in addition to the given\n distance."]
552 pub y_overscroll: Option<JsFloat>,
553 #[builder(default)]
554 #[serde(skip_serializing_if = "Option::is_none")]
555 #[serde(default)]
556 #[doc = "Prevent fling (default: true)."]
557 pub prevent_fling: Option<bool>,
558 #[builder(default)]
559 #[serde(skip_serializing_if = "Option::is_none")]
560 #[serde(default)]
561 #[doc = "Swipe speed in pixels per second (default: 800)."]
562 pub speed: Option<JsUInt>,
563 #[builder(default)]
564 #[serde(skip_serializing_if = "Option::is_none")]
565 #[doc = "Which type of input events to be generated (default: 'default', which queries the platform\n for the preferred input type)."]
566 pub gesture_source_type: Option<GestureSourceType>,
567 #[builder(default)]
568 #[serde(skip_serializing_if = "Option::is_none")]
569 #[serde(default)]
570 #[doc = "The number of times to repeat the gesture (default: 0)."]
571 pub repeat_count: Option<JsUInt>,
572 #[builder(default)]
573 #[serde(skip_serializing_if = "Option::is_none")]
574 #[serde(default)]
575 #[doc = "The number of milliseconds delay between each repeat. (default: 250)."]
576 pub repeat_delay_ms: Option<JsUInt>,
577 #[builder(default)]
578 #[serde(skip_serializing_if = "Option::is_none")]
579 #[serde(default)]
580 #[doc = "The name of the interaction markers to generate, if not empty (default: \"\")."]
581 pub interaction_marker_name: Option<String>,
582}
583#[allow(deprecated)]
584#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
585#[builder(setter(into, strip_option))]
586#[serde(rename_all = "camelCase")]
587#[doc = "Synthesizes a tap gesture over a time period by issuing appropriate touch events."]
588pub struct SynthesizeTapGesture {
589 #[serde(default)]
590 #[doc = "X coordinate of the start of the gesture in CSS pixels."]
591 pub x: JsFloat,
592 #[serde(default)]
593 #[doc = "Y coordinate of the start of the gesture in CSS pixels."]
594 pub y: JsFloat,
595 #[builder(default)]
596 #[serde(skip_serializing_if = "Option::is_none")]
597 #[serde(default)]
598 #[doc = "Duration between touchdown and touchup events in ms (default: 50)."]
599 pub duration: Option<JsUInt>,
600 #[builder(default)]
601 #[serde(skip_serializing_if = "Option::is_none")]
602 #[serde(default)]
603 #[doc = "Number of times to perform the tap (e.g. 2 for double tap, default: 1)."]
604 pub tap_count: Option<JsUInt>,
605 #[builder(default)]
606 #[serde(skip_serializing_if = "Option::is_none")]
607 #[doc = "Which type of input events to be generated (default: 'default', which queries the platform\n for the preferred input type)."]
608 pub gesture_source_type: Option<GestureSourceType>,
609}
610#[allow(deprecated)]
611#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
612#[doc = "Dispatches a drag event into the page."]
613pub struct DispatchDragEventReturnObject(pub Option<Json>);
614#[allow(deprecated)]
615#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
616#[doc = "Dispatches a key event to the page."]
617pub struct DispatchKeyEventReturnObject(pub Option<Json>);
618#[allow(deprecated)]
619#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
620#[doc = "This method emulates inserting text that doesn't come from a key press,\n for example an emoji keyboard or an IME."]
621pub struct InsertTextReturnObject(pub Option<Json>);
622#[allow(deprecated)]
623#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
624#[doc = "This method sets the current candidate text for IME.\n Use imeCommitComposition to commit the final text.\n Use imeSetComposition with empty string as text to cancel composition."]
625pub struct ImeSetCompositionReturnObject(pub Option<Json>);
626#[allow(deprecated)]
627#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
628#[doc = "Dispatches a mouse event to the page."]
629pub struct DispatchMouseEventReturnObject(pub Option<Json>);
630#[allow(deprecated)]
631#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
632#[doc = "Dispatches a touch event to the page."]
633pub struct DispatchTouchEventReturnObject(pub Option<Json>);
634#[allow(deprecated)]
635#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
636#[doc = "Cancels any active dragging in the page."]
637pub struct CancelDraggingReturnObject(pub Option<Json>);
638#[allow(deprecated)]
639#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
640#[doc = "Emulates touch event from the mouse event parameters."]
641pub struct EmulateTouchFromMouseEventReturnObject(pub Option<Json>);
642#[allow(deprecated)]
643#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
644#[doc = "Ignores input events (useful while auditing page)."]
645pub struct SetIgnoreInputEventsReturnObject(pub Option<Json>);
646#[allow(deprecated)]
647#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
648#[doc = "Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events.\n Drag and drop behavior can be directly controlled via `Input.dispatchDragEvent`."]
649pub struct SetInterceptDragsReturnObject(pub Option<Json>);
650#[allow(deprecated)]
651#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
652#[doc = "Synthesizes a pinch gesture over a time period by issuing appropriate touch events."]
653pub struct SynthesizePinchGestureReturnObject(pub Option<Json>);
654#[allow(deprecated)]
655#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
656#[doc = "Synthesizes a scroll gesture over a time period by issuing appropriate touch events."]
657pub struct SynthesizeScrollGestureReturnObject(pub Option<Json>);
658#[allow(deprecated)]
659#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
660#[doc = "Synthesizes a tap gesture over a time period by issuing appropriate touch events."]
661pub struct SynthesizeTapGestureReturnObject(pub Option<Json>);
662#[allow(deprecated)]
663impl Method for DispatchDragEvent {
664 const NAME: &'static str = "Input.dispatchDragEvent";
665 type ReturnObject = DispatchDragEventReturnObject;
666}
667#[allow(deprecated)]
668impl Method for DispatchKeyEvent {
669 const NAME: &'static str = "Input.dispatchKeyEvent";
670 type ReturnObject = DispatchKeyEventReturnObject;
671}
672#[allow(deprecated)]
673impl Method for InsertText {
674 const NAME: &'static str = "Input.insertText";
675 type ReturnObject = InsertTextReturnObject;
676}
677#[allow(deprecated)]
678impl Method for ImeSetComposition {
679 const NAME: &'static str = "Input.imeSetComposition";
680 type ReturnObject = ImeSetCompositionReturnObject;
681}
682#[allow(deprecated)]
683impl Method for DispatchMouseEvent {
684 const NAME: &'static str = "Input.dispatchMouseEvent";
685 type ReturnObject = DispatchMouseEventReturnObject;
686}
687#[allow(deprecated)]
688impl Method for DispatchTouchEvent {
689 const NAME: &'static str = "Input.dispatchTouchEvent";
690 type ReturnObject = DispatchTouchEventReturnObject;
691}
692#[allow(deprecated)]
693impl Method for CancelDragging {
694 const NAME: &'static str = "Input.cancelDragging";
695 type ReturnObject = CancelDraggingReturnObject;
696}
697#[allow(deprecated)]
698impl Method for EmulateTouchFromMouseEvent {
699 const NAME: &'static str = "Input.emulateTouchFromMouseEvent";
700 type ReturnObject = EmulateTouchFromMouseEventReturnObject;
701}
702#[allow(deprecated)]
703impl Method for SetIgnoreInputEvents {
704 const NAME: &'static str = "Input.setIgnoreInputEvents";
705 type ReturnObject = SetIgnoreInputEventsReturnObject;
706}
707#[allow(deprecated)]
708impl Method for SetInterceptDrags {
709 const NAME: &'static str = "Input.setInterceptDrags";
710 type ReturnObject = SetInterceptDragsReturnObject;
711}
712#[allow(deprecated)]
713impl Method for SynthesizePinchGesture {
714 const NAME: &'static str = "Input.synthesizePinchGesture";
715 type ReturnObject = SynthesizePinchGestureReturnObject;
716}
717#[allow(deprecated)]
718impl Method for SynthesizeScrollGesture {
719 const NAME: &'static str = "Input.synthesizeScrollGesture";
720 type ReturnObject = SynthesizeScrollGestureReturnObject;
721}
722#[allow(deprecated)]
723impl Method for SynthesizeTapGesture {
724 const NAME: &'static str = "Input.synthesizeTapGesture";
725 type ReturnObject = SynthesizeTapGestureReturnObject;
726}
727#[allow(dead_code)]
728pub mod events {
729 #[allow(unused_imports)]
730 use super::super::types::*;
731 #[allow(unused_imports)]
732 use derive_builder::Builder;
733 #[allow(unused_imports)]
734 use serde::{Deserialize, Serialize};
735 #[allow(unused_imports)]
736 use serde_json::Value as Json;
737 #[allow(deprecated)]
738 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
739 pub struct DragInterceptedEvent {
740 pub params: DragInterceptedEventParams,
741 }
742 #[allow(deprecated)]
743 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
744 #[serde(rename_all = "camelCase")]
745 pub struct DragInterceptedEventParams {
746 pub data: super::DragData,
747 }
748}