typeshare
typeshare copied to clipboard
Allow to generate unions instead of TS enums in Typescript
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";
Any chance of reviving this? If there's interest in getting this merged I wouldn't mind taking a look at it