In your Cargo.toml: ```toml # Feature: typescript ts-rs = { workspace = true, features = ["bytes-impl"], optional = true } [features] typescript = [ "dep:ts-rs", ] ``` In your library code: ```rust #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] #[cfg_attr(feature = "typescript", derive(ts_rs::TS))] #[cfg_attr(feature = "typescript", ts(export))] pub struct Bundle { pub app_id: String, pub version: u32, pub app: Bytes, } ``` In a binary project that depends on the library: ```rust use bundle::Bundle; use ts_rs::TS; fn main() { Bundle::export_all_to("./@lib/pack").unwrap() } ``` Then you can run the binary, and check in the generated types.