magnetar/magnetar_sdk/src/types/emoji.rs

24 lines
579 B
Rust

use serde::{Deserialize, Serialize};
use ts_rs::TS;
use crate::types::Id;
use crate::{Packed, Required};
use magnetar_sdk_macros::pack;
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
#[ts(export)]
pub struct EmojiBase {
pub shortcode: String,
pub url: String,
pub category: Option<String>,
pub width: Option<i32>,
pub height: Option<i32>,
}
pack!(PackEmojiBase, Required<Id> as id & Required<EmojiBase> as emoji);
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
#[ts(export)]
#[repr(transparent)]
pub struct EmojiContext(pub Vec<PackEmojiBase>);