Skip to content

Conversation

@akozhemiakin
Copy link

@akozhemiakin akozhemiakin commented Sep 27, 2023

Resolves #35

Now for unit enums, you can choose to generate a TypeScript union type instead
of a TypeScript enum.

#[typeshare(ts_union)]
pub enum UnitEnum {
    VariantA,
    VariantB,
    VariantC,
}

This would generate the following TypeScript code:

export type UnitEnum = "VariantA" | "VariantB" | "VariantC";

@Tehnix
Copy link

Tehnix commented Feb 14, 2025

Any chance of reviving this? If there's interest in getting this merged I wouldn't mind taking a look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for generating TypeScript union types for non-algebraic enums

2 participants