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.

[Request] Expose TypeScript types.

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:36 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
joshgoebelcommented, Dec 29, 2020

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):

  • HLJSOptions
  • Language
  • LanguageFn
  • Mode
  • ModeCallback
2reactions
joshgoebelcommented, Dec 29, 2020

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.

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 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 >

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