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
Properly include and export TypeScript types (#248)
We need to copy the entrypoing typings file, as described in [the
TypeScript docs]:
> It’s important to note that the CommonJS entrypoint and the ES
> module entrypoint each needs its own declaration file, even if the
> contents are the same between them. Every declaration file is
> interpreted either as a CommonJS module or as an ES module, based on
> its file extension and the `"type"` field of the `package.json`, and
> this detected module kind must match the module kind that Node will
> detect for the corresponding JavaScript file for type checking to be
> correct. Attempting to use a single `.d.ts` file to type both an ES
> module entrypoint and a CommonJS entrypoint will cause TypeScript to
> think only one of those entrypoints exists, causing compiler errors
> for users of the package.
[the TypeScript docs]: https://www.typescriptlang.org/docs/handbook/esm-node.htmlCloses#247
0 commit comments