Closed sya-ri closed 1 year ago
Have you tried this API by creating a Typescript project?
==> Actually no, i code in raw JS since two years as my first language ever and because of school that i vistited until a month ago i never really had time to take a look at TS, so i thought i am gonna do a small implementation based on what i know from other packages and if something is not working someone will create a PR for that, that's what happened now.
Thanks for the enum/type explanation, that is good to know ^^
If #48 is not merged, it will not compile. I thought about putting it in one PR but splitting it into two PRs in case I could discuss this change with you.
Using "declare enum" gives an undefined error. It can also define an enum on the js side, but using "type" is better. d.ts can only define types/interfaces (in other words, inputs and outputs), not new enums. Have you tried this API by creating a Typescript project? Also, this change is just a fix for broken code, not a breaking change.
Before
Source code (src/index.ts)
Error
After
Source code (src/index.ts)