question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The published package is missing the type file nlp.d.ts

Adams-MacBook-Pro-5:nlp_compromise adamjuhasz$ ls -l
total 32
-rw-r--r--   1 adamjuhasz  staff  1080 Jan 27  2016 LICENSE.txt
-rw-r--r--   1 adamjuhasz  staff  4029 Jul  6 07:33 README.md
drwxr-xr-x   4 adamjuhasz  staff   136 Jul 27 08:42 builds
-rw-r--r--   1 adamjuhasz  staff  2626 Jun 20 17:38 changelog.md
-rw-r--r--   1 adamjuhasz  staff  2793 Jul 27 08:42 package.json
drwxr-xr-x  10 adamjuhasz  staff   340 Jul 27 08:42 src

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
WorldMakercommented, Dec 1, 2017

You can let Typescript build unannotated source to start to get an idea of type issues that its type system finds and a feel for the type information that it can inference from your existing code (a more “live” view of what you got from a one-off run of dts-gen for the current typing file). As you add type annotations you can watch it get better (and slowly get the type output better than the current type file giving up with an any as the return of the main function). Typescript supports starting with JSDoc-style type annotations as a first step if you are hesitant to jump straight to Typescript syntax/files.

At that point the type definitions would be a build artifact that directly updates as you update the API, and directly benefits as you JSDoc document the API.

Personally, I think there is a benefit to migrate more fully, more quickly to Typescript. I find it’s much easier to use ES6/ES2015 (and more recent) syntax/tools in Typescript and that Typescript is simpler than Babel to get a good build pipeline to support both ES5 and ES6/ES2015+. Obviously there is some learning curve to that, but it could simplify your build process some, maybe.

0reactions
spencermountaincommented, Nov 5, 2019

thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Introduction - TypeScript
How to write a high-quality TypeScript Declaration (d.ts) file. ... for learning how .d.ts files work is that you're typing an npm package...
Read more >
A quick introduction to “Type Declaration” files and adding ...
The typings (or types ) field points to the declaration file ( .d.ts ) that will be used by the TypeScript compiler to...
Read more >
The Typings File | Plugin API - Figma
While the written documentation can help you explore the API and explain how it works, the typings file provide TypeScript annotation that can...
Read more >
What Are Type Declaration Files In TypeScript? - maxoid.io
In TypeScript they are called Type Declaration files. ... Create a file with name typings.d.ts and moved interface User from file ...
Read more >
How do you produce a .d.ts "typings" definition file from an ...
js files. You can try including the .js file in your compilation along with the --allowJs setting to see if this gives you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found