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
use js_sys::Object;
use wasm_bindgen::prelude::*;

use super::BaseSyntheticEvent;

#[wasm_bindgen]
extern "C" {
    /// React synthetic ClipboardEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type ClipboardEvent;
    #[wasm_bindgen(method, getter = clipboardData)]
    pub fn clipboard_data(this: &ClipboardEvent) -> web_sys::DataTransfer;

    /// React synthetic CompositionEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type CompositionEvent;
    #[wasm_bindgen(method, getter)]
    pub fn data(this: &CompositionEvent) -> String;

    /// React synthetic FocusEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type FocusEvent;
    #[wasm_bindgen(method, getter = relatedTarget)]
    pub fn related_target(this: &FocusEvent) -> Option<web_sys::EventTarget>;

    /// React synthetic FormEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type FormEvent;

    /// React synthetic KeyboardEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type KeyboardEvent;
    #[wasm_bindgen(method, getter = altKey)]
    pub fn alt_key(this: &KeyboardEvent) -> bool;
    #[wasm_bindgen(method, getter = charCode)]
    #[deprecated]
    pub fn char_code(this: &KeyboardEvent) -> u32;
    #[wasm_bindgen(method, getter = ctrlKey)]
    pub fn ctrl_key(this: &KeyboardEvent) -> bool;
    #[wasm_bindgen(method, getter)]
    pub fn code(this: &KeyboardEvent) -> String;
    /// See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
    #[wasm_bindgen(method, js_name = getModifierState)]
    pub fn get_modifier_state(this: &KeyboardEvent, key: &str) -> bool;
    /// See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
    #[wasm_bindgen(method, getter)]
    pub fn key(this: &KeyboardEvent) -> String;
    #[wasm_bindgen(method, getter = keyCode)]
    #[deprecated]
    pub fn key_code(this: &KeyboardEvent) -> u32;
    #[wasm_bindgen(method, getter)]
    pub fn locale(this: &KeyboardEvent) -> String;
    #[wasm_bindgen(method, getter)]
    pub fn location(this: &KeyboardEvent) -> u32;
    #[wasm_bindgen(method, getter = metaKey)]
    pub fn meta_key(this: &KeyboardEvent) -> bool;
    #[wasm_bindgen(method, getter)]
    pub fn repeat(this: &KeyboardEvent) -> bool;
    #[wasm_bindgen(method, getter = shiftKey)]
    pub fn shift_key(this: &KeyboardEvent) -> bool;
    #[wasm_bindgen(method, getter)]
    #[deprecated]
    pub fn which(this: &KeyboardEvent) -> u32;

    /// React synthetic TouchEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent, extends = super::UiEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type TouchEvent;
    #[wasm_bindgen(method, getter = altKey)]
    pub fn alt_key(this: &TouchEvent) -> bool;
    #[wasm_bindgen(method, getter = changedTouches)]
    pub fn changed_touches(this: &TouchEvent) -> web_sys::TouchList;
    #[wasm_bindgen(method, getter = ctrlKey)]
    pub fn ctrl_key(this: &TouchEvent) -> bool;
    /// See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
    #[wasm_bindgen(method, js_name = getModifierState)]
    pub fn get_modifier_state(this: &TouchEvent, key: &str) -> bool;
    #[wasm_bindgen(method, getter = metaKey)]
    pub fn meta_key(this: &TouchEvent) -> bool;
    #[wasm_bindgen(method, getter = shiftKey)]
    pub fn shift_key(this: &TouchEvent) -> bool;
    #[wasm_bindgen(method, getter = targetTouches)]
    pub fn target_touches(this: &TouchEvent) -> web_sys::TouchList;
    #[wasm_bindgen(method, getter)]
    pub fn touches(this: &TouchEvent) -> web_sys::TouchList;

    /// React synthetic DragEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent, extends = super::UiEvent, extends = super::MouseEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type DragEvent;
    #[wasm_bindgen(method, getter = dataTransfer)]
    pub fn data_transfer(this: &DragEvent) -> web_sys::DataTransfer;

    /// React synthetic DragEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent, extends = super::UiEvent, extends = super::MouseEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type PointerEvent;
    #[wasm_bindgen(method, getter = pointerId)]
    pub fn pointer_id(this: &PointerEvent) -> i32;
    #[wasm_bindgen(method, getter)]
    pub fn pressure(this: &PointerEvent) -> f32;
    #[wasm_bindgen(method, getter = tangentialPressure)]
    pub fn tangential_pressure(this: &PointerEvent) -> f32;
    #[wasm_bindgen(method, getter = tiltX)]
    pub fn tilt_x(this: &PointerEvent) -> i32;
    #[wasm_bindgen(method, getter = tiltY)]
    pub fn tilt_y(this: &PointerEvent) -> i32;
    #[wasm_bindgen(method, getter)]
    pub fn twist(this: &PointerEvent) -> i32;
    #[wasm_bindgen(method, getter)]
    pub fn width(this: &PointerEvent) -> i32;
    #[wasm_bindgen(method, getter)]
    pub fn height(this: &PointerEvent) -> i32;
    #[wasm_bindgen(method, getter = pointerType)]
    pub fn pointer_type(this: &PointerEvent) -> String;
    #[wasm_bindgen(method, getter = isPrimary)]
    pub fn is_primary(this: &PointerEvent) -> bool;

    /// React synthetic WheelEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent, extends = super::UiEvent, extends = super::MouseEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type WheelEvent;
    #[wasm_bindgen(method, getter = deltaMode)]
    pub fn delta_mode(this: &WheelEvent) -> u32;
    #[wasm_bindgen(method, getter = deltaX)]
    pub fn delta_x(this: &WheelEvent) -> f64;
    #[wasm_bindgen(method, getter = deltaY)]
    pub fn delta_y(this: &WheelEvent) -> f64;
    #[wasm_bindgen(method, getter = deltaZ)]
    pub fn delta_z(this: &WheelEvent) -> f64;

    /// React synthetic AnimationEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type AnimationEvent;
    #[wasm_bindgen(method, getter = animationName)]
    pub fn animation_name(this: &AnimationEvent) -> String;
    #[wasm_bindgen(method, getter = elapsedTime)]
    pub fn elapsed_time(this: &AnimationEvent) -> f32;
    #[wasm_bindgen(method, getter = pseudoElement)]
    pub fn pseudo_element(this: &AnimationEvent) -> String;

    /// React synthetic TransitionEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type TransitionEvent;
    #[wasm_bindgen(method, getter = elapsedTime)]
    pub fn elapsed_time(this: &TransitionEvent) -> f32;
    #[wasm_bindgen(method, getter = propertyName)]
    pub fn property_name(this: &TransitionEvent) -> String;
    #[wasm_bindgen(method, getter = pseudoElement)]
    pub fn pseudo_element(this: &TransitionEvent) -> String;

    /// React synthetic ChangeEvent
    #[wasm_bindgen(extends = Object, extends = BaseSyntheticEvent)]
    #[derive(Debug, Clone, PartialEq, Eq)]
    pub type ChangeEvent;
}