Closed xnerhu closed 1 year ago
another approach would be to use string union instead of enum
I'm sure there will be no problems with Open CDN. It handles only the distributive JS code.
dist/botd.d.ts:192:30 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided
TypeScript makes sure the package won't cause problems for users who use
--isolatedModules
. When an enum is not const, it's available in the JS runtime, which might be handy for JS users.another approach would be to use string union instead of enum
It's a good option. But only TS users will be able to use the
BotKind
type.
@Finesse For the sake of consistency I changed const enum to enum in the entire project
For the sake of consistency I changed const enum to enum in the entire project
@xnerhu Up to you. I see no technical problems.
Generally, the reasons to prefers const enums are:
If you think the consistency is more important, no problem.
Thanks for the review, I will merge it now.
@Finesse I had to replace
const enum BotKind
withenum BotKind
, because ofLet me know if that's ok and won't have side effects on CDN.