Commit 753d46f
committed
Properly include and export TypeScript types
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.html
Closes #2471 parent f7509e6 commit 753d46f
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | | - | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
0 commit comments