2023-03-20 21:32:31 +00:00
|
|
|
use lemmy_db_schema::newtypes::CustomEmojiId;
|
|
|
|
use lemmy_db_views::structs::CustomEmojiView;
|
|
|
|
use serde::{Deserialize, Serialize};
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg(feature = "full")]
|
|
|
|
use ts_rs::TS;
|
2023-03-20 21:32:31 +00:00
|
|
|
use url::Url;
|
|
|
|
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Create a custom emoji.
|
2023-03-20 21:32:31 +00:00
|
|
|
pub struct CreateCustomEmoji {
|
|
|
|
pub category: String,
|
|
|
|
pub shortcode: String,
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
2023-03-20 21:32:31 +00:00
|
|
|
pub image_url: Url,
|
|
|
|
pub alt_text: String,
|
|
|
|
pub keywords: Vec<String>,
|
|
|
|
}
|
|
|
|
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Edit a custom emoji.
|
2023-03-20 21:32:31 +00:00
|
|
|
pub struct EditCustomEmoji {
|
|
|
|
pub id: CustomEmojiId,
|
|
|
|
pub category: String,
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
2023-03-20 21:32:31 +00:00
|
|
|
pub image_url: Url,
|
|
|
|
pub alt_text: String,
|
|
|
|
pub keywords: Vec<String>,
|
|
|
|
}
|
|
|
|
|
2024-02-11 05:32:14 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq, Hash)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// Delete a custom emoji.
|
2023-03-20 21:32:31 +00:00
|
|
|
pub struct DeleteCustomEmoji {
|
|
|
|
pub id: CustomEmojiId,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
2023-04-26 04:26:10 +00:00
|
|
|
#[cfg_attr(feature = "full", derive(TS))]
|
|
|
|
#[cfg_attr(feature = "full", ts(export))]
|
2023-05-10 19:20:39 +00:00
|
|
|
/// A response for a custom emoji.
|
2023-03-20 21:32:31 +00:00
|
|
|
pub struct CustomEmojiResponse {
|
|
|
|
pub custom_emoji: CustomEmojiView,
|
|
|
|
}
|