Distribute typescript definitions
See original GitHub issueIs 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:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top 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 >
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 Free
Top 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

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 Iimport * as katex from 'katex', which is completely different.Thanks for the pointers and suggestion. Here are the
@types/katextype 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.