Skip to content

Commit d18c5f1

Browse files
committed
fix(hljs): import highlight.js types explicitly for v11
highlight.js v11 ships its type defs inside `declare module 'highlight.js'` instead of as global ambient types, so the v10-era `/// <reference types="highlight.js" />` stopped exposing HLJSApi / Language / Mode (TS2304). Replace it with an `import type`. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent ee1b4fb commit d18c5f1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/agent/hljs-kql.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
//
99
// ─────────────────────────────────────────────────────────────────────
1010

11-
/// <reference types="highlight.js" />
11+
// highlight.js v11 ships its type definitions inside `declare module
12+
// 'highlight.js'` rather than as global ambient types, so the v10-era
13+
// `/// <reference types="highlight.js" />` no longer exposes `HLJSApi`,
14+
// `Language` or `Mode`. Import them explicitly instead (`import type` is
15+
// erased at compile time, so there is no runtime dependency change).
16+
import type { HLJSApi, Language, Mode } from "highlight.js";
1217

1318
// ── Keyword Lists (from @kusto/monaco-kusto Monarch definition) ─────
1419

0 commit comments

Comments
 (0)