$ account madonoharu
tsify is a Rust library that generates TypeScript type declarations from Rust types, primarily for the wasm-bindgen ecosystem. The core mechanism is a `#[derive(Tsify)]` proc macro that produces a `Tsify` trait impl whose `DECL` constant is emitted into the wasm-bindgen `typescript_custom_section`, so `wasm-pack` automatically appends the generated `.d.ts` alongside the JS output. It maps Rust structs, enums, and type aliases to TypeScript interfaces, type aliases, namespaces, and unions, respecting serde attributes (`rename`, `tag`, `untagged`, `flatten`, `skip`, `default`, `transparent`) and offering tsify-specific overrides (`type`, `type_params`, `type_prefix`/`type_suffix`, `rename`, `namespace`, and serializer options like `missing_as_null` / `hashmap_as_object` / `large_number_types_as_bigints`). A second runtime type, `Ts<T>`, provides a memory-safe alternative to the deprecated `into_wasm_abi`/`from_wasm_abi` attributes by deferring deserialization out of the infallible ABI boundary into the function body, avoiding the destructor-skipping `throw_str` leak path.