long.js
long.js copied to clipboard
Change source of truth for types to umd/index.d.ts to resolve issue with typescript import in 5.x (Resolves #109)
The previous PR to resolve this issue (#124) ended up duplicating the types to the umd module.
Moving the source-of-truth to the ./umd/index.d.ts
file enables the ./index.d.ts
file to import the class from the umd subdirectory with no issues. The other way around, however, seems to be the cause of the issues.
My suggestion is to move the source of truth to the umd declaration file, and import it from the root index.d.ts, as to avoid duplicated code, while still keeping the types functional.
This would resolve #109
@dcodeIO hello! Could you review the PR?
Have ya'll verified that the proposed change indeed works for both ESM and CJS/UMD?
@dcodeIO we're trying to move a project from CJS to ESM, and it looks like if we swap the imports like in this PR, it works in both CJS and ESM.
Would love to get this merged! 🙏
Also would love to get this merged. Requires we enable skipLibCheck
which we don't love
@dcodeIO Were you able to review this? We need this fix. I have tested it as well and it works fine.
Any news ?