expose all serialized events as public

This commit is contained in:
Evan Almloff 2023-08-28 11:49:16 -05:00
parent b4ebf34595
commit f7dff22552
15 changed files with 30 additions and 15 deletions

View file

@ -49,8 +49,9 @@ impl PartialEq for AnimationData {
}
#[cfg(feature = "serialize")]
/// A serialized version of AnimationData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedAnimationData {
pub struct SerializedAnimationData {
animation_name: String,
pseudo_element: String,
elapsed_time: f32,

View file

@ -37,8 +37,9 @@ impl ClipboardData {
}
#[cfg(feature = "serialize")]
/// A serialized version of ClipboardData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedClipboardData {}
pub struct SerializedClipboardData {}
#[cfg(feature = "serialize")]
impl From<&ClipboardData> for SerializedClipboardData {

View file

@ -37,8 +37,9 @@ impl CompositionData {
}
#[cfg(feature = "serialize")]
/// A serialized version of CompositionData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedCompositionData {
pub struct SerializedCompositionData {
data: String,
}

View file

@ -98,8 +98,9 @@ impl DragData {
}
#[cfg(feature = "serialize")]
/// A serialized version of DragData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedDragData {
pub struct SerializedDragData {
mouse: crate::point_interaction::SerializedPointInteraction,
}

View file

@ -32,8 +32,9 @@ impl FocusData {
}
#[cfg(feature = "serialize")]
/// A serialized version of FocusData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedFocusData {}
pub struct SerializedFocusData {}
#[cfg(feature = "serialize")]
impl From<&FocusData> for SerializedFocusData {

View file

@ -42,8 +42,9 @@ impl ImageData {
}
#[cfg(feature = "serialize")]
/// A serialized version of ImageData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedImageData {
pub struct SerializedImageData {
load_error: bool,
}

View file

@ -79,8 +79,9 @@ impl KeyboardData {
}
#[cfg(feature = "serialize")]
/// A serialized version of KeyboardData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedKeyboardData {
pub struct SerializedKeyboardData {
auto_repeating: bool,
#[serde(deserialize_with = "resilient_deserialize_code")]
code: Code,

View file

@ -31,8 +31,9 @@ impl MediaData {
}
#[cfg(feature = "serialize")]
/// A serialized version of MediaData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedMediaData {}
pub struct SerializedMediaData {}
#[cfg(feature = "serialize")]
impl From<&MediaData> for SerializedMediaData {

View file

@ -208,8 +208,9 @@ impl PointInteraction for PointerData {
}
#[cfg(feature = "serialize")]
/// A serialized version of PointerData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedPointerData {
pub struct SerializedPointerData {
/// Common data for all pointer/mouse events
#[serde(flatten)]
point_data: crate::point_interaction::SerializedPointInteraction,

View file

@ -32,8 +32,9 @@ impl PartialEq for ScrollData {
}
#[cfg(feature = "serialize")]
/// A serialized version of ScrollData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedScrollData {}
pub struct SerializedScrollData {}
#[cfg(feature = "serialize")]
impl From<&ScrollData> for SerializedScrollData {

View file

@ -32,8 +32,9 @@ impl PartialEq for SelectionData {
}
#[cfg(feature = "serialize")]
/// A serialized version of SelectionData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedSelectionData {}
pub struct SerializedSelectionData {}
#[cfg(feature = "serialize")]
impl From<&SelectionData> for SerializedSelectionData {

View file

@ -32,8 +32,9 @@ impl ToggleData {
}
#[cfg(feature = "serialize")]
/// A serialized version of ToggleData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedToggleData {}
pub struct SerializedToggleData {}
#[cfg(feature = "serialize")]
impl From<&ToggleData> for SerializedToggleData {

View file

@ -59,8 +59,9 @@ impl TouchData {
}
#[cfg(feature = "serialize")]
/// A serialized version of TouchData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedTouchData {
pub struct SerializedTouchData {
alt_key: bool,
ctrl_key: bool,
meta_key: bool,

View file

@ -38,8 +38,9 @@ impl TransitionData {
}
#[cfg(feature = "serialize")]
/// A serialized version of TransitionData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedTransitionData {
pub struct SerializedTransitionData {
property_name: String,
pseudo_element: String,
elapsed_time: f32,

View file

@ -43,8 +43,9 @@ impl WheelData {
}
#[cfg(feature = "serialize")]
/// A serialized version of WheelData
#[derive(serde::Serialize, serde::Deserialize)]
struct SerializedWheelData {
pub struct SerializedWheelData {
delta: WheelDelta,
}