Skip to content

Commit

Permalink
fix "is not a module" highlightjs#2603
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigojcmello committed Jun 13, 2020
1 parent b1bce6e commit 95486e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions types/index.d.ts
Expand Up @@ -3,6 +3,8 @@
// eslint-disable-next-line
declare const hljs : HLJSApi;

export = hljs;

interface HLJSApi {
highlight: (languageName: string, code: string, ignoreIllegals?: boolean, continuation?: Mode) => HighlightResult
highlightAuto: (code: string, languageSubset?: string[]) => AutoHighlightResult
Expand Down

1 comment on commit 95486e1

@joshgoebel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience this only fixes the first of these... do you have any greater understanding of the issue? I'd really like to use ambient modules to make all of these "just work".

import hljs from 'highlight.js';
import core from 'highlight.js/lib/core.js';
import core2 from 'highlight.js/lib/highlight.js';
import basic from 'highlight.js/lib/languages/basic.js';

Please sign in to comment.