Skip to content

Commit 128204d

Browse files
authored
Merge pull request #279 from rtfpessoa/JoshuaKGoldberg-type-shenanigans
Add typings for remaining highlight.js parts
2 parents 1c36b29 + 42c8e26 commit 128204d

5 files changed

Lines changed: 392 additions & 232 deletions

File tree

src/ui/js/diff2html-ui-base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HighlightJS } from 'highlight.js/lib/highlight.js';
1+
import * as HighlightJS from 'highlight.js/lib/highlight.js';
22
import { ICompiledMode, IHighlightResult, IAutoHighlightResult } from 'highlight.js';
33
import { nodeStream, mergeStreams } from './highlight.js-helpers';
44

@@ -26,15 +26,15 @@ export class Diff2HtmlUI {
2626
readonly config: typeof defaultDiff2HtmlUIConfig;
2727
readonly diffHtml: string;
2828
readonly targetElement: HTMLElement;
29-
readonly hljs: HighlightJS | null = null;
29+
readonly hljs: typeof HighlightJS | null = null;
3030

3131
currentSelectionColumnId = -1;
3232

3333
constructor(
3434
target: HTMLElement,
3535
diffInput?: string | DiffFile[],
3636
config: Diff2HtmlUIConfig = {},
37-
hljs?: HighlightJS,
37+
hljs?: typeof HighlightJS,
3838
) {
3939
this.config = { ...defaultDiff2HtmlUIConfig, ...config };
4040
this.diffHtml = diffInput !== undefined ? html(diffInput, this.config) : target.innerHTML;

0 commit comments

Comments
 (0)