diff --git a/src/highlight.js b/src/highlight.js index 8f59f1ae9c..4f98f38ea5 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -20,6 +20,7 @@ const NO_MATCH = Symbol("nomatch"); /** * @param {any} hljs - object that is extended (legacy) + * @returns {HLJSApi} */ const HLJS = function(hljs) { // Convenience variables for build-in objects diff --git a/types/index.d.ts b/types/index.d.ts index b9eb0d317a..59fd9d1926 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -210,3 +210,22 @@ interface ModeDetails { subLanguage?: string | string[] compiled?: boolean } + +// deprecated API since v10 +// declare module 'highlight.js/lib/highlight.js'; + +declare module 'highlight.js' { + export = hljs; +} + +declare module 'highlight.js/lib/core' { + export = hljs; +} + +declare module 'highlight.js/lib/core.js' { + export = hljs; +} + +declare module 'highlight.js/lib/languages/*' { + export default function(hljs?: HLJSApi): LanguageDetail; +}