Feature request: Include TypeScript .d.ts file with the npm package
See original GitHub issueExpected Behavior
As the project is written in TypeScript, I would expect it to also allow using the tool with it’s typings and to benefit from the defined types when writing migration scripts.
Actual Behavior
The npm package includes only the transpiled code so no types are available.
Possible Solution
Create a separate .d.ts
file for the API calls used in the documentation and include it in the npm package.
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Typescript should auto aquire d.ts files from npm package #9819
ts files in the lib folder of the respective packages? Just way 'require/import' auto resolves the module path. I understand for some modules...
Read more >Documentation - ECMAScript Modules in Node.js - TypeScript
When TypeScript finds a .d.ts file in package, whether it is treated as an ESM or CommonJS file is based on the containing...
Read more >ts-node - npm
ts -node is a TypeScript execution engine and REPL for Node.js. It JIT transforms TypeScript into JavaScript, enabling you to directly execute ...
Read more >TypeScript - Parcel
ts or .tsx file. In addition to stripping the types to convert TypeScript to JavaScript, Parcel also compiles modern language features like classes...
Read more >Usage of Angular libraries published to npm
Typically, library packages include typings in .d.ts files; see examples in node_modules/@angular/material . If the package of your library does not include ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@joshmedeski I’m not at the computer right now but try adding – before the -s parameter. We’re using this with the “use as a library” method. I have created a .ts file which imports the cli module similarly as in the JavaScript example. The parameter handling is done by the script though.
I’m pretty sure though I did the initial test with the command from the new documentation though…
@Khaledgarbaya I noticed the changes being applied through commits today. I’ll try to find time tomorrow to do a PR on the improvements on the typings file.
@Khaledgarbaya it seems all but one of the changes I’ve done have been added there meanwhile. I don’t bother making a PR from that.
The only change missing was adding
| number[]
toIValidation.in
. I added it as otherwise migration file generated withcontentful space generate
would not have been valid.