fcl-js icon indicating copy to clipboard operation
fcl-js copied to clipboard

[FEATURE] Remove all enums and namespaces

Open tombeckenham opened this issue 9 months ago • 2 comments

Issue to be solved

Enums in typescript create overhead in the code as they aren't a native javascript feature. When running ts natively in node 23 - they don't work.

Suggest A Solution

Typescript template literals work better.

What are you currently working on that this is blocking?

Flow Wallet.

tombeckenham avatar Mar 31 '25 05:03 tombeckenham

Good suggestion — we'll be looking into improving the types shortly and will address this then.

chasefleming avatar Mar 31 '25 21:03 chasefleming

A non-breaking solution may be to declare the enums as both a value and a type. We can effectively leverage the same properties of enums without using the syntax in this case.

e.g.

const SomeEnum = {
  FOO: "foo"
} as const

type SomeEnum = (typeof SomeEnum)[keyof typeof SomeEnum]

jribbink avatar Apr 02 '25 01:04 jribbink