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.

Distribute typescript definitions

See original GitHub issue

Is your feature request related to a problem? Please describe. When using katex in typescript, one has to use the @types/katex package to get some type interference. However, these type definitions are quite minimal.

Describe the solution you’d like: Provide full typescript definitions automatically.

Describe alternatives you’ve considered: Using @types/katex.

Additional context: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jameshfishercommented, Mar 3, 2022

The @types/katex type definitions seem completely broken. Katex as of v0.15 seems to have only a default export, so I have to import katex from 'katex'. But the type definitions demand that I import * as katex from 'katex', which is completely different.

1reaction
edemainecommented, Jan 31, 2022

Thanks for the pointers and suggestion. Here are the @types/katex type definitions.

An advantage of publishing them ourselves is we can update them together with KaTeX versioning (though it’s pretty rare for them to change, we might add an option or two). Overall it seems like a good idea, related to #2110.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Publishing - TypeScript
If your types are generated by your source code, publish the types with your source code. Both TypeScript and JavaScript projects can generate...
Read more >
How to generate Type Definitions for Distribution on NPM
In the tsconfig.json I added the field which tells the Typescript compiler to generate the type definition. { + "declaration": true,.
Read more >
How To Bundle TypeScript Type Definitions - Chris Krycho
Type definition module files in the root of the distributed package, mapping to the distributed modules of the package (wherever they live).
Read more >
TypeScript Definitions & JavaScript API Library - GetStream.io
So naturally, it's been our ambition to eventually distribute Type Definitions for our JavaScript API Client library.
Read more >
Distribution of TypeScript definiton files - Stack Overflow
The ideal way is definitely to ship typings alongside the actual code. This makes the story very easy for package consumers to get...
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