Skip to content

Commit a4ee4e4

Browse files
committed
(chore) declare ambient modules for lib/core & languges
1 parent 0656588 commit a4ee4e4

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/highlight.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const NO_MATCH = Symbol("nomatch");
2020

2121
/**
2222
* @param {any} hljs - object that is extended (legacy)
23+
* @returns {HLJSApi}
2324
*/
2425
const HLJS = function(hljs) {
2526
// Convenience variables for build-in objects

types/index.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,22 @@ interface ModeDetails {
210210
subLanguage?: string | string[]
211211
compiled?: boolean
212212
}
213+
214+
// deprecated API since v10
215+
// declare module 'highlight.js/lib/highlight.js';
216+
217+
declare module 'highlight.js' {
218+
export = hljs;
219+
}
220+
221+
declare module 'highlight.js/lib/core' {
222+
export = hljs;
223+
}
224+
225+
declare module 'highlight.js/lib/core.js' {
226+
export = hljs;
227+
}
228+
229+
declare module 'highlight.js/lib/languages/*' {
230+
export default function(hljs?: HLJSApi): LanguageDetail;
231+
}

0 commit comments

Comments
 (0)