(target: HTMLElement, diffInput?: string | DiffFile[], config: Diff2HtmlUIConfig = {}, hljs?: HLJSApi)
| 44 | currentSelectionColumnId = -1; |
| 45 | |
| 46 | constructor(target: HTMLElement, diffInput?: string | DiffFile[], config: Diff2HtmlUIConfig = {}, hljs?: HLJSApi) { |
| 47 | this.config = { ...defaultDiff2HtmlUIConfig, ...config }; |
| 48 | this.diffHtml = diffInput !== undefined ? html(diffInput, this.config) : target.innerHTML; |
| 49 | this.targetElement = target; |
| 50 | if (hljs !== undefined) this.hljs = hljs; |
| 51 | } |
| 52 | |
| 53 | draw(): void { |
| 54 | this.targetElement.innerHTML = this.diffHtml; |