diff --git a/crates/db_schema/src/newtypes.rs b/crates/db_schema/src/newtypes.rs index 0cc35cde5..2ac034ede 100644 --- a/crates/db_schema/src/newtypes.rs +++ b/crates/db_schema/src/newtypes.rs @@ -244,6 +244,8 @@ pub struct ModlogCombinedId(i32); #[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)] #[cfg_attr(feature = "full", derive(DieselNewType))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export))] /// The inbox combined id pub struct InboxCombinedId(i32); diff --git a/crates/db_schema/src/source/combined/inbox.rs b/crates/db_schema/src/source/combined/inbox.rs index 09bc68d67..83643a93c 100644 --- a/crates/db_schema/src/source/combined/inbox.rs +++ b/crates/db_schema/src/source/combined/inbox.rs @@ -22,6 +22,8 @@ use serde_with::skip_serializing_none; #[cfg_attr(feature = "full", diesel(table_name = inbox_combined))] #[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))] #[cfg_attr(feature = "full", cursor_keys_module(name = inbox_combined_keys))] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(optional_fields, export))] /// A combined inbox table. pub struct InboxCombined { pub id: InboxCombinedId, diff --git a/crates/db_views/site/src/api.rs b/crates/db_views/site/src/api.rs index 263f9f3e3..e1dd272f3 100644 --- a/crates/db_views/site/src/api.rs +++ b/crates/db_views/site/src/api.rs @@ -696,6 +696,8 @@ pub struct ResolveObject { } #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(export))] pub enum PostOrCommentOrPrivateMessage { Post(Post), Comment(Comment), @@ -711,6 +713,8 @@ pub enum PostOrCommentOrPrivateMessage { /// Be careful with any changes to this struct, to avoid breaking changes which could prevent /// importing older backups. #[derive(Debug, Serialize, Deserialize, Clone, Default)] +#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] +#[cfg_attr(feature = "ts-rs", ts(optional_fields, export))] pub struct UserSettingsBackup { pub display_name: Option, pub bio: Option,