Wulf / tsync

Synchronize rust and typescript types!
Other
116 stars 10 forks source link

Support for const enums #50

Closed pendruct closed 5 months ago

pendruct commented 5 months ago

Hi, is there any way to do const enums?

For example,

enum Test {
  Foo,
  Bar
}

becomes

const enum Test {
  Foo,
  Bar
}

or..

enum Test {
  Foo = 5,
  Bar = 6
}

becomes

const enum Test {
  Foo = 5,
  Bar = 6
}

Currently it seems like the enums generated do not have the const prefix in the generated Typescript code. I only use const enums for my project

AnthonyMichaelTDM commented 5 months ago

^ this should work

pendruct commented 5 months ago

Wow, thanks so much! @AnthonyMichaelTDM Did you do all that just for me? That's so kind!

AnthonyMichaelTDM commented 5 months ago

🫡