[Request] Expose TypeScript types.
See original GitHub issueIs your request related to a specific problem you’re having?
Sometime I want to use some type from Highlight.js internal types. e.g. Language
, LanguageFn
.
But I can’t use it now.
The solution you’d prefer / feature you’d like to see added…
Expose all internal TypeScript types from highlight.js
.
So I can use it for more typing.
Any alternative solutions you considered… No.
Additional context… Types should be able to import like this.
import { LanguageFn, Language } from 'highlight.js';
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:36 (20 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 expose types returned by API in typescript
Each API call returns data of a certain type. In my main module, I export the API. I can't figure out the best...
Read more >TypeScript Safe API Requests - Level Up Coding - gitconnected
How to add TypeScript types to API requests made on the client, allowing type safety to spread to the entire web app.
Read more >A quick introduction to “Type Declaration” files and adding ...
Such type declaration files are called global type declarations since they are exposed to every TypeScript program (included in the ...
Read more >Including declarations in your npm package - TypeScript
browserify does not bundle its declaration files with its npm packages, so we needed to depend on @types/browserify for its declarations. typescript ,...
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
Also, please provide a list. We’re not going to export purely internal types because we do not wish to encourage their use, as anything that is not public API is subject to change at any time - and if you’re consuming it then you do so at your own risk.
Things I see that might be useful for plugin/grammar authors (at a quick glance):
I really am not familiar with the type publishing types side of this equation. Do you know what that would look like? If I just add
export
to the types will that magically work?There is also this which might or might not be related. https://github.com/highlightjs/highlight.js/issues/2682
We only use TypeScript for development listing but if someone knows how to improve this without making it way more complicated I’m all ears.