ts-rs-macros
derive macro for ts-rs
12.0.1
13M downloads/mo
#2700 most downloaded on crates.io
Aleph-Alpha/ts-rs
What this package is like to depend on
Last release 6 months ago
31 Jan 2026
Release timing varies
gaps range from 8 days to 1.2 years
Rarely documented
notes for 10 of 47 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
47 releases · first in 2020
3 releases in the last 12 months
see the full history below
Release timeline
47 releases · Dec 2020 to Jan 2026Releases
latest 47-
12.0.131 Jan 2026Nothing published for this version
-
12.0.031 Jan 2026Release notes
Open source →Hello again! Today, we're excited to announce v12 of ts-rs! 🥳
While this is a breaking release, we expect a seamless upgrade for most users.
Even though we adjusted the representation of two types, their new and improved bindings should be less restrictive in most cases and therefore require minimal intervention.
Besides that, only code that interacts directly with theTStrait should be affected and easily fixed.Changes to
HashMap& friends (again)With v12, we once again changed how
HashMap,BTreeMap, etc. are represented in TypeScript.
As a result, bindings are more flexible, work in more scenarios, and better match the expectations of TypeScript developers.With this change,
HashMap<K, V>will result in{ [key in K]: V }.
The exception to this is whenKis an enum - only then we generate{ [key in K]?: V }instead.Before, indexing into an object required dealing with
undefinedvalues. With this change, this is no longer forced onto users, which is the expected behavior for most TypeScript developers. If you wanttscto be pedantic aboutundefinedvalues, enable noUncheckedIndexedAccess, which exists for this very purpose.To aid migration, you can set the
TS_RS_USE_V11_HASHMAPenvironment variable to revert to the previous behavior. However, we do intend on removing this flag in a future release.Chunky Integers
By default, large integers that don't fit into a 64-bit float are exported as
bigint.
With this release, this has now become configurable through environment variables and/or.cargo/config.toml.Better Configuration!
Using environment variables, the generation and exporting of bindings can be configured. With v12, we now allow for the same level of control when exporting bindings programmatically.
The Type of Nothing
With this release, we altered the representation of unit structs and unit variants from
Record<string, never>toRecord<symbol, never>.
It is equally expressive, but avoids a quirk in the TS typesystem when contained within an enum variant.What Else?
- Support for types from the
arrayveccrate - Support for types from the
jiffcrate - More lenient handling of serde attributes, resulting in less warnings
- Improved documentation & README
- Bug fixes! 🙂
Changelog
- Ignore
#[serde(crate = ...)]by @gustavo-shigueo in #447 - Add environment variable to configure binding for large integers by @NyxCode in #448
- refactor: fix clippy lints by @sandr01d in #455
- Add support for
jiffv0.2 by @demhadais in #458 - Fix trait bound generation when using
#[ts(optional)]on anOption<Generic>by @gustavo-shigueo in #454 - Fix skip until comma edge case by @gustavo-shigueo in #466
- Parse #[serde(borrow)] to not emit warnings by @NyxCode in #471
- Added support for arrayvec 0.6 & 0.7 by @VirgileHenry in #469
- Polish Docs & Release v12 by @NyxCode in #460
New Contributors
- @sandr01d made their first contribution in #455
- @demhadais made their first contribution in #458
- @VirgileHenry made their first contribution in #469
Full Changelog: v11.1.0...v12.0.0
Release notes
Open source →Breaking
- Change generated type of unit structs to
Record<symbol, never>(#431) - Change generated type of
HashMapto{ [key in K]: V }ifKis not an enum (#446) - Enable programmatic configuration of binding generation (#460)
Features
- Add
TS_RS_LARGE_INTenvironment variable to configure binding fori64,u64,i128, etc. (#448) - Add support for
arrayvec(#469) - Add support for
jiff(#458)
Fixes
- Support for types from the
-
11.1.014 Oct 2025Release notes
Open source →Today, we're happy to publish a small follow-up to v11.0.1!
This release fixes a nasty build failure when using the
formatfeature.
Note: For those that use theformatfeature, this release bumps the MSRV to 1.88. We'd have preferred to do this in a major release, but felt this was acceptable since the build was broken by one of the dependencies anyway.New features
TypeScript enums with
#[ts(repr(enum))#[ts(repr(enum))instructs ts-rs to generate anenum, instead of atypefor your rust enum.#[derive(TS)] #[ts(repr(enum))] enum Role { User, Admin, } // will generate `export enum Role { "User", "Admin" }`
Discriminants are preserved, and you can use the variant's name as discriminant instead using
#[ts(repr(enum = name))]#[ts(optional_fields)]in enumsThe
#[ts(optional_fields)]attribute can now be applied directly to enums, or even to individual enum variants.Control over file extensions in imports
Normally, we generate
import { Type } from "file"statements. In some scenarios though, it might be necessary to use a.tsor even.jsextension instead.
This is now possible by setting theTS_RS_IMPORT_EXTENSIONenvironment variable.Note: With the introduction of this feature, we deprecate the
import-esmcargo feature. It will be removed in a future major release.Full changelog
- Regression:
#[ts(optional)]with#[ts(type)]by @NyxCode in #416 - release v11.0.1 by @NyxCode in #417
- Make
rename_allcompatible with tuple and unit structs as a no-op attribute by @gustavo-shigueo in #422 - Replace
import-esmwithTS_RS_IMPORT_EXTENSIONby @gustavo-shigueo in #423 - Updated chrono Duration emitted type by @fxf8 in #434
- Add optional_fields to enum by @gustavo-shigueo in #432
- Add
#[ts(repr(enum)]attribute by @gustavo-shigueo in #425 - Fix build with
formatfeature by @gustavo-shigueo in #438
New Contributors
Release notes
Open source →Features
- Add
#[ts(repr(enum))]attribute (#425) - Add support for
#[ts(optional_fields)]in enums and enum variants (#432) - Deprecate
import-esmcargo feature in favour ofRS_RS_IMPORT_EXTENSION(#423)
Fixes
- Fix bindings for
chrono::Duration(#434)
- Regression:
-
11.0.105 Jun 2025 -
11.0.003 Jun 2025Release notes
Open source →We are excited to announce v11.0.0!
Upgrading from
v10.x.x- With the
serde-compatfeature enabled (default), fields annotated with both#[serde(skip_serializing(_if))]and#[serde(default)]are now turned into optional properties.
See "Improved serde compatibility" under "New features" below - The API of the
ts_rs::TStrait has slightly changed.
Some trivial adjustments to your code might be necessary, though only if you interact withts_rs::TSdirectly.
Most users should not be affected by this.
New features
Everything's optional!
With v11, we introduce
#[ts(optional_fields)], which can cut down on annoying boilerplace.
This attribute can be applied to structs and has the same effect as adding#[ts(optional)]to every field.Example:
#[derive(TS)] #[ts(optional_fields)] struct Form { first_name: Option<String>, // first_name?: string last_name: Option<String>, // last_name?: string email: Option<String>, // email?: string }
Improved serde compatibility
In the past,
#[serde(skip_serializing)]and#[serde(skip_serializing_if = "..")]were ignored by ts-rs.
With v11, we now take these attributes into account, as long as they are used together with#[serde(default)].
This ensures that the generated type is valid for both serializing and deserializing rust structures by default.A field annotated with
#[serde(skip_serializing_(if))]and#[serde(default)]will be treated as if it was annotated with#[ts(optional = nullable)].
This behavior can be overridden using#[ts(optional = false)].Example:
// now generates `type User = { nickname?: string | null }`, // making it correct for both serialization and deserialization by default. #[derive(Serialize, Deserialize, TS)] struct User { #[serde(skip_serializing_if = "Option::is_none", default)] nickname: Option<String>, }
More flexible attributes
#[doc = ..],#[ts(rename = "..")]and#[ts(export_to = "..")]now accept arbitrary expressions!
This enables some cool new patterns and makes integrating ts-rs in unusual setups easier.Example:
// Renamed to the name of the current module #[derive(TS)] #[ts(rename = module_path!().rsplit_once("::").unwrap().1)] struct Model; // Comment containing the file path where the type was defined #[derive(TS)] #[doc = concat!("Defined in ", file!())] struct UserGroup { . }
Optional tuple structs
The
#[ts(optional)]attribute can now also be applied to fields of tuple structs.Example:
// generates `type Location = [Country, State, City?]` #[derive(TS)] struct Location(Country, State, #[ts(optional)] City);
Full changelog
- Add
#[ts(optional)]to struct by @gustavo-shigueo in #366 - Add MSRV test to CI by @gustavo-shigueo in #381
- remove lazy_static by @ValiuchenkoVladyslav in #373
- Fix
#[ts(as = "...")]dependency list by @gustavo-shigueo in #385 - Prevent naming collisions with by @gustavo-shigueo in #386
- Handle serde fail gracefully by @gustavo-shigueo in #389
- Merge same path imports by @gustavo-shigueo in #392
- Allow arbitrary expressions in top-level
#[ts(rename)]by @NyxCode in #398 - Allow arbitrary expressions in
#[ts(export_to)]by @NyxCode in #399 - Remove duplicate validation by @gustavo-shigueo in #404
- Allow arbitrary expressions in
#[doc]by @NyxCode in #411 - Allow
#[ts(flatten)]for fields of type HashMap by @gustavo-shigueo in #406 - Handle
serde(skip_serializing_if)+serde(default)by @manifest in #393 - release v11.0.0 by @NyxCode in #413
New Contributors
- @ValiuchenkoVladyslav made their first contribution in #373
- @manifest made their first contribution in #393
Release notes
Open source →Breaking
#[serde(skip_serializing)]and#[serde(skip_serializing_if = ..)]are no longer ignored when used together with#[serde(default)]. (#393)- Changed return type of
TS::output_path()fromOption<&'static Path>toOption<PathBuf>. This will only break your code if you manually implementTSor directly interact with theTStrait. - Replaced
TS::DOCSwithTS::docs(). This will only break your code if you manually implementTSor directly interact with theTStrait. - Added
OptionInnerTypeassociated type to theTStrait. If you manually implementTS, you must set this associated type toSelfin all of your implementations. - Raised MSRV to
1.78.0due to use of#[diagnostic::on_unimplemented]andlet ... else { ... }
Features
- Add support for
#[serde(skip_serializing)]and#[serde(skip_serializing_if = ..)]when used together with#[serde(default)]. Since these fields might be absent(#393) - Add support for arbitrary expressions in doc attributes, e.g
#[doc = concat!("defined in ", file!())]. This would result both in a rustdoc and JSDoc comment. - The
#[ts(rename)]attribute on structs, enums and variants now accepts any expression. This makes it possible to, for example, rename a struct to the name of a module it is contained in using#[ts(rename = module_path!().rsplit_once("::").unwrap().1)] - The
#[ts(export_to)]attribute on structs and enums now accepts any expression. - Added
#[ts(optional_fields)]and#[ts(optional_fields = nullable)]attribute to structs, this attribute is equivalent to using the corresponding#[ts(optional)]or#[ts(optional = nullable)]on every field of the struct. (#366)
Fixes
- With the
-
10.1.001 Dec 2024Release notes
Open source →v10.1 is a small follow-up to v10, bringing some bug-fixes and support for
tokio.New Features
- add support for tokio by @joriskleiber in #353 (
tokio-implfeature gate)
Fixes
- feat(serde-json-impl): handle bool for serde_json::Value by @GuillaumeDecMeetsMore in #358
- Include
nullinserde_json::Valueby @NyxCode in #359 - Fix empty struct tagged enum variant by @gustavo-shigueo in #371
- Add
cargo test export_bindingsto README by @dessalines in #363 - Add generated type to README by @gustavo-shigueo in #365
- Fix typo in
#[ts(rename_all_fields)]by @sebastinez in #368
New Contributors
- @GuillaumeDecMeetsMore made their first contribution in #358
- @joriskleiber made their first contribution in #353
- @dessalines made their first contribution in #363
- @sebastinez made their first contribution in #368
New Contributors
- @GuillaumeDecMeetsMore made their first contribution in #358
- @joriskleiber made their first contribution in #353
- @dessalines made their first contribution in #363
- @sebastinez made their first contribution in #368
Full Changelog: v10.0.0...v10.1.0
Release notes
Open source →Features
- Add support for synchronization primitives from
tokio(featuretokio-impl)
Fixes
- Fix incorrect behavior of the tag attribute for structs without any fields declared with braces
- Fix representation of
serde_json::Value
- add support for tokio by @joriskleiber in #353 (
-
10.0.019 Sep 2024Release notes
Open source →While v10.0.0 is a technically breaking change, we expect it to be a drop-in replacement for almost all users.
Changes to
HashMap<K, V>(& friends)In this release, we've changed how
HashMap<K, V>is represented in TypeScript.
Before v10, ts-rs generated{ [key: K]: V }. This was never technically correct, resulting intscaccepting some code which it should not have. Additionally, this resulted in issues when e.g trying to use anenumas key.
With v10, we now generate{ [key in K]?: V }instead.What's New?
- Multiple types can be exported to the same file using
#[ts(export_to = "..")] #[ts(as = "..")]and#[ts(type = "..")]now also work on enum variants- Support for more crates (
bson,smol_str)
Full changelog
- Change
HashMapto export mapped types by @gustavo-shigueo in #339 - feat: add bson ObjectId impl by @ShaunSHamilton in #340
- Fix JSDoc formatting for Rust block comments by @gustavo-shigueo in #342
- Fix error in internally tagged enums with flattened fields by @gustavo-shigueo in #344
- feat: Allow multiple types to set
#[ts(export_to = "...")]to the same file by @escritorio-gustavo in #316 - Always use forward slash on import paths by @gustavo-shigueo in #346
- feature: support smol_str by @corvusrabus in #350
- Support
#[ts(as = "...")]and#[ts(type = "...")]on enum variants by @escritorio-gustavo in #284
New Contributors
- @ShaunSHamilton made their first contribution in #340
- @corvusrabus made their first contribution in #350
Release notes
Open source →Breaking
- Change how
HashMap<K, V>is represented in TypeScript. The resulting bindings ({ [key in K]?: V }instead of{ [key: K]: V }) are more accurate and flexible.
Features
- Allow multile types to have the same
#[ts(export_to = "...")]attribute and be exported to the same file (#316) - The
bson-uuid-implfeature now supportsbson::oid::ObjectIdas well (#340) - Add support for types from
smol_strbehind cargo featuresmol_str-impl(#350) - Support
#[ts(as = "...")]and#[ts(type = "...")]on enum variants (#384)
Fixes
- Multiple types can be exported to the same file using
-
9.0.128 Jun 2024Release notes
Open source →Release notes
Open source →Fixes
- Allow using
#[ts(flatten)]on fields using generic parameters (#336)
- Allow using
-
9.0.020 Jun 2024Release notes
Open source →While v9.0.0 is a technically breaking change, we expect it to be a drop-in replacement for almost all users.
Only code interacting withTS::dependency_typesandTS::genericswill need to be adjusted.What's new?
Removal of
TypeListThe biggest change of v9.0.0 is an internal one: We removed
TypeListfrom the API.
This fixes the long-standing issue of complex types failing to compile withoverflow evaluating the requirementorreached the recursion limit
Even if you did not run into those, we do expect this change to also improve compilation times.
Allow for
_in#[ts(as = "..")]Similar to how it works in serde,
_can be used in#[ts(as = "..")]to refer to the type of the field.
This is particularly useful for more complex type overrides.Allow
#[ts(as = "..")]and#[ts(type = "..")]on structs and enumsThese two attributes can now be used directly on structs and enums.
Previously, it was necessary to add these attributes on every field where the type was used.
This feature is particularly useful for exposing newtypes transparently.To see a list of all changes, check out CHANGELOG.md!
All changes
- Release 8.1.0 by @NyxCode in #283
- add support for top level type overrides by @dr-bonez in #286
- Fix
#[ts(rename_all_fields = "...")]on enums containing tuple or unit variants by @escritorio-gustavo in #287 - add support for top level
asby @dr-bonez in #288 - Prevent empty
Dependenciesfrom being added todependency_typesby @escritorio-gustavo in #291 - Rework attribute parsing by @escritorio-gustavo in #290
- Add MSRV to cargo.toml and README by @escritorio-gustavo in #300
- Fix race condition in imports test by @escritorio-gustavo in #302
- Fix inconsistencies with
serdeand addSCREAMING-KEBAB-CASEby @escritorio-gustavo in #298 - Support
#[serde(with = "...")]for struct fields by @escritorio-gustavo in #280 - dedup dependencies by @kamadorueda in #293
- Fix location of rename_all errors by @escritorio-gustavo in #303
- Infered types (
_) in#[ts(as = "...")]by @escritorio-gustavo in #299 - Track
Cargo.lockfiles to improve CI speed by @escritorio-gustavo in #295 - Fix #308 by @NyxCode in #309
- Fix missing case in #299 by @escritorio-gustavo in #310
- Coerce passed type to TS before invoking ::name() by @paultag in #318
- Recusion Limit - Round 2 by @NyxCode in #306
- Testing with --no-default-features didnt seem to work in CI by @NyxCode in #319
- Insert newline at end of generated files by @lucperkins in #321
- bug: Fix issue with absolute paths by @escritorio-gustavo in #323
New Contributors
- @dr-bonez made their first contribution in #286
- @kamadorueda made their first contribution in #293
- @paultag made their first contribution in #318
- @lucperkins made their first contribution in #321
Full Changelog: v8.1.0...v9.0.0
Release notes
Open source →Breaking
#[serde(with = "...")]requires the use of#[ts(as = "...")]or#[ts(type = "...")](#280)- Fix incompatibility with serde for
snake_case,kebab-caseandSCREAMING_SNAKE_CASE(#298) #[ts(rename_all = "...")]no longer accepts variations in the string's casing, dashes and underscores to make behavior consistent with serde (#298)- Remove
TypeList, and replaceTS::dependency_types/TS::genericswithTS::visit_dependencies/TS::visit_generics. This finally resolves "overflow evaluating the requirement", "reached the recursion limit" errors. Also, compile times should benefit. This is a technically breaking change for those interacting with theTStrait directly. For those just using#[derive(TS)]and#[ts(...)], nothing changes!
Features
- Add support for
#[ts(type = "..")]directly on structs and enums (#286) - Add support for
#[ts(as = "..")]directly on structs and enums (#288) - Add support for
#[ts(rename_all = "SCREAMING-KEBAB-CASE")](#298) - Support
_in#[ts(type = "..")]to refer to the type of the field (#299)
Fixes
- Fix
#[ts(rename_all_fields = "...")]on enums containing tuple or unit variants (#287) - Fix "overflow evaluating the requirement" and "reached the recursion limit" errors in some cases (#293)
- Fix ambiguity causing "multiple applicable items in scope" errors in some cases (#309)
- Fix issues with absolute
TS_RS_EXPORT_DIRpaths (#323) - Add newlines to the end of exported files (#321)
-
8.1.022 Mar 2024Release notes
Open source →v8.1.0 is a mostly a small follow-up to v8.0.0, fixing a couple of rough edges.
We expect v8.1.0 to be fully compatible to v8.0.0.
Additionally, we've added support for
serde_jsonbehind theserde-json-implcargo feature.
This might seem like a small change, but a lot of work over the past months has now paid off and made cleanly supportingserde_json::Valuepossible.Features
- Add
#[ts(crate = "..")]to allow usage of#[derive(TS)]from other proc-macro crates (#274) - Add support types from
serde_jsonbehind cargo featureserde-json-impl(#276) HashMapand similar types are now represented as{ [key: K]: V }instead ofRecord<K, V>(#277)
Fixes
- Macro expansion for types with generic parameters now works without the
TStrait in scope (#281) - Fix flattening a struct that contains a flattened enum (#282)
Full Changelog: v8.0.0...v8.1.0
Release notes
Open source →Breaking
Features
- Add
#[ts(crate = "..")]to allow usage of#[derive(TS)]from other proc-macro crates (#274) - Add support types from
serde_jsonbehind cargo featureserde-json-impl(#276)
Fixes
- Add
-
8.0.018 Mar 2024Release notes
Open source →After a lot of work and quite some time, we're happy to announce v8.0.0 of ts-rs. 🥳
Migration from
7.x.xWhile this is a major release, we do expect that it's drop-in upgrade for most usecases.
However, if your setup is more involved (e.g interacting with theTStrait directly, doing post-processing on the output, etc.), some changes might be necessary.If you're having any trouble migrating, please feel free to open a discussion or issue, we're happy to help.
Highlights
- Automatic export of dependencies
If a struct or enum is annotated with#[ts(export)], all of its dependencies will be exported automatically, even if they are not annotated with#[ts(export)]. This behaviour is more convenient and always results in correctimportstatements.
More importantly, this enables the use of ts-rs within libraries. Consumers of such a library will automatically get a copy of the types their types depend on. - New handling of generic types
Handling of generic types has been massively improved in this release. Not only is it way more robust than before, but we're also able to support all the edge-cases we couldn't before. For example, structs with trait bounds, generic type aliases and structs containing associated types are all supported now! - Improved handling for enums
Support for enums and their different representations (internally tagged, externally tagged, untagged) has been massively improved in this release, thanks to @escritorio-gustavo!
In all these cases, ts-rs's behaviour matches more or less exactly with that of serde. - Easier exports
Exporting types is now much easier than before. For one, runningcargo testnow exports all dependencies of types annotated with#[ts(export)]. The output directory can now be customized by setting theTS_RS_EXPORT_DIRenvironment variable.
For more complicated setups, where#[ts(export)]is not sufficient, we've reworked the API for exporting types from code.
Acknowledgements
We've had a lot of new contributors since the last release!
I'm also excited to welcome @escritorio-gustavo as a new maintainer, who has been instrumental in making8.0.0happen!Breaking changes
- Export types as
typeinstead ofìnterface(#203) - Automatically export all dependencies when using
#[ts(export)], addTS::dependency_types()(#221) - Remove support for "skip_serializing", "skip_serializing_if" and "skip_deserializing". (#204)
- Initially supporting these by skipping a field was a mistake. If a user wishes to skip a field, they can still
annotate it with#[ts(skip)]
- Initially supporting these by skipping a field was a mistake. If a user wishes to skip a field, they can still
- Added
TS::dependency_types()(#221) - Added
TS::generics()(#241) - Added
TS::WithoutGenerics(#241) - Removed
TS::transparent()(#243) - Handling of output paths (#247, #250, #256)
- All paths specified using
#[ts(export_to = "...")]are now relative toTS_RS_EXPORT_DIR, which defaults to./bindings/
- All paths specified using
- Replace
TS::exportwithTS::export,TS::export_allandTS::export_to_all(#263)
Features
- Implement
#[ts(as = "..")](#174) - For small arrays, generate tuples instead of
Array<T>(#209) - Implement
#[ts(optional = nullable)](#213) - Allow inlining of fields with generic types (#212, #215, #216)
- Allow flattening enum fields (#206)
- Add
semver-implcargo feature with support for the semver crate (#176) - Support
HashMapwith custom hashers (#173) - Add
import-esmcargo feature to import files with a.jsextension (#192) - Implement
#[ts(...)]equivalents for#[serde(tag = "...")],#[serde(tag = "...", content = "...")]and#[serde(untagged)](#227) - Support
#[serde(untagged)]on individual enum variants (#226) - Support for
#[serde(rename_all_fields = "...")](#225) - Export Rust doc comments/attributes on structs/enums as TSDoc strings (#187)
Result,Option,HashMapandVechad their implementations ofTSchanged (#241)- Implement
#[ts(...)]equivalent for#[serde(tag = "...")]being used on a struct with named fields (#244) - Implement
#[ts(concrete(..))]to specify a concrete type for a generic parameter (#264) - Implement
#[ts(bound = "...")]to manually override the generatedwhereclause (#269)
Fixes
- Fix
#[ts(skip)]and#[serde(skip)]in variants of adjacently or internally tagged enums (#231) rename_allwithcamelCaseproduces wrong names if fields were already in camelCase (#198)- Improve support for references (#199)
- Generic type aliases generate correctly (#233)
- Improve compiler errors (#257)
- Update dependencies (#255)
Full Changelog: v7.1.1...v8.0.0
Release notes
Open source →Breaking
- Export types as
typeinstead ofìnterface(#203) - Automatically export all dependencies when using
#[ts(export)], addTS::dependency_types()(#221) - Remove support for "skip_serializing", "skip_serializing_if" and "skip_deserializing". (#204)
- Initially supporting these by skipping a field was a mistake. If a user wishes to skip a field, they can still
annotate it with
#[ts(skip)]
- Initially supporting these by skipping a field was a mistake. If a user wishes to skip a field, they can still
annotate it with
- Added
TS::dependency_types()(#221) - Added
TS::generics()(#241) - Added
TS::WithoutGenerics(#241) - Removed
TS::transparent()(#243) - Handling of output paths (#247, #250, #256)
- All paths specified using
#[ts(export_to = "...")]are now relative toTS_RS_EXPORT_DIR, which defaults to./bindings/
- All paths specified using
- Replace
TS::exportwithTS::export,TS::export_allandTS::export_to_all(#263)
Features
- Implement
#[ts(as = "..")](#174) - For small arrays, generate tuples instead of
Array<T>(#209) - Implement
#[ts(optional = nullable)](#213) - Allow inlining of fields with generic types (#212, #215, #216)
- Allow flattening enum fields (#206)
- Add
semver-implcargo feature with support for the semver crate (#176) - Support
HashMapwith custom hashers (#173) - Add
import-esmcargo feature to import files with a.jsextension (#192) - Implement
#[ts(...)]equivalents for#[serde(tag = "...")],#[serde(tag = "...", content = "...")]and#[serde(untagged)](#227) - Support
#[serde(untagged)]on individual enum variants (#226) - Support for
#[serde(rename_all_fields = "...")](#225) - Export Rust doc comments/attributes on structs/enums as TSDoc strings (#187)
Result,Option,HashMapandVechad their implementations ofTSchanged (#241)- Implement
#[ts(...)]equivalent for#[serde(tag = "...")]being used on a struct with named fields (#244) - Implement
#[ts(concrete(..))]to specify a concrete type for a generic parameter (#264)
Fixes
- Fix
#[ts(skip)]and#[serde(skip)]in variants of adjacently or internally tagged enums (#231) rename_allwithcamelCaseproduces wrong names if fields were already in camelCase (#198)- Improve support for references (#199)
- Generic type aliases generate correctly (#233)
- Improve compiler errors (#257)
- Update dependencies (#255)
- Automatic export of dependencies
-
7.1.119 Jan 2024Nothing published for this version
-
7.1.011 Jan 2024Nothing published for this version
-
7.0.007 Aug 2023Nothing published for this version
-
6.2.029 May 2022Nothing published for this version
-
6.1.228 Jan 2022Nothing published for this version
-
6.1.124 Jan 2022Nothing published for this version
-
6.1.001 Dec 2021Nothing published for this version
-
6.0.601 Dec 2021Nothing published for this version
-
6.0.514 Nov 2021Nothing published for this version
-
6.0.414 Nov 2021Nothing published for this version
-
6.0.314 Nov 2021Nothing published for this version
-
6.0.214 Nov 2021Nothing published for this version
-
6.0.114 Nov 2021Nothing published for this version
-
6.0.011 Nov 2021Nothing published for this version
-
5.1.002 Nov 2021Nothing published for this version
-
5.0.001 Nov 2021Nothing published for this version
-
4.0.027 Sep 2021Nothing published for this version
-
3.1.027 Sep 2021Nothing published for this version
-
3.0.003 May 2021Nothing published for this version
-
2.3.006 Apr 2021Nothing published for this version
-
2.2.022 Jan 2021Nothing published for this version
-
2.1.219 Dec 2020Nothing published for this version
-
2.1.119 Dec 2020Nothing published for this version
-
2.1.019 Dec 2020Nothing published for this version
-
2.0.119 Dec 2020Nothing published for this version
-
2.0.019 Dec 2020Nothing published for this version
-
1.0.118 Dec 2020Nothing published for this version
-
1.0.018 Dec 2020Nothing published for this version
-
0.2.117 Dec 2020Nothing published for this version
-
0.2.016 Dec 2020Nothing published for this version
-
0.1.416 Dec 2020Nothing published for this version
-
0.1.315 Dec 2020Nothing published for this version
-
0.1.215 Dec 2020Nothing published for this version
-
0.1.115 Dec 2020Nothing published for this version
-
0.1.015 Dec 2020Nothing published for this version
-
0.0.115 Dec 2020Nothing published for this version