specta
specta copied to clipboard
Easily export your Rust types to other languages
You should be able to export a TS type without the Serde checking, like how we allow BigInt's to be configurable.
I noticed any type passed into a `Result` as value or error does not form into a separate type in the typescript definitions. example code: ```rs #[derive(serde::Serialize, specta::Type)] enum MyValue...
It's both bad for semver and also can cause unintended LSP hints. Right now Rust Analyser wants to import `FunctionDataType` from `specta::js_doc::FunctionDataType` not `specta::functions::FunctionDataType`
What should be public or not? Should it's args be a sealed struct or not?
I am currently searching for a way to map TypeScript branded types, like https://github.com/kourge/ts-brand cleanly using specta. My current (flawed) approach is: ``` #[cfg_attr(feature = "wasm", derive(specta::Type))] struct Brand
https://github.com/serde-rs/serde/pull/2641#pullrequestreview-1732728579 It's not too late to remove it.
I have a type like this: ```rust #[derive(Serialize, Deserialize, specta::Type)] pub struct Package { #[serde(rename(deserialize = "@version"))] pub version: String, } ``` But specta (2.0.0-rc7) raises the error: ``` error:...
Hack around the `'static` bound on Rust's built-in `TypeId` to allow the ID to be tied to a compiler intrinsic instead of the implementation location of the macro like it...