You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ajv is an example of a package that uses TypeScript, but the generated .d.ts by TypeScript suffers from the missing export = issue (extra .default is needed when imported with NodeNext).
As a workaround, I'm opening a PR to their library to explicitly export the Ajv class, but I wasn't able to figure out the settings needed to get TypeScript to generate a better .d.ts. It would be great to update the docs to cover that case.
The text was updated successfully, but these errors were encountered:
benasher44
changed the title
Missing export = when it's TypeScript's fault (kinda)
What to do for missing export = when it's TypeScript's fault (kinda)
Jan 6, 2024
The source of the issue there, as far as declaration file correctness goes, is that the TS contains some direct module.exports manipulation, which the type system / TS module system doesn’t track.
ajv is an example of a package that uses TypeScript, but the generated .d.ts by TypeScript suffers from the missing
export =
issue (extra .default is needed when imported with NodeNext).As a workaround, I'm opening a PR to their library to explicitly export the Ajv class, but I wasn't able to figure out the settings needed to get TypeScript to generate a better .d.ts. It would be great to update the docs to cover that case.
The text was updated successfully, but these errors were encountered: