Skip to content

Commit

Permalink
(chore) declare ambient modules for lib/core & languges
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Jun 16, 2020
1 parent 0656588 commit a4ee4e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit a4ee4e4

Please sign in to comment.