Skip to content

Commit 8957340

Browse files
committed
v2.12.1
1 parent d4cd379 commit 8957340

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

dist/diff2html.d.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Type definitions for diff2html
2+
// Project: https://github.com/rtfpessoa/diff2html
3+
// Definitions by: rtfpessoa <https://github.com/rtfpessoa/>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
declare namespace Diff2Html {
7+
8+
export interface Options {
9+
inputFormat?: 'diff' | 'json';
10+
outputFormat?: 'line-by-line' | 'side-by-side';
11+
showFiles?: boolean;
12+
diffStyle?: 'word' | 'char';
13+
matching?: 'lines' | 'words' | 'none';
14+
matchWordsThreshold?: number;
15+
matchingMaxComparisons?: number;
16+
maxLineSizeInBlockForComparison?: number;
17+
maxLineLengthHighlight?: number;
18+
templates?: object;
19+
rawTemplates?: object;
20+
renderNothingWhenEmpty?: boolean;
21+
}
22+
23+
export interface Line {
24+
content: string;
25+
type: string;
26+
oldNumber: number;
27+
newNumber: number;
28+
}
29+
30+
export interface Block {
31+
oldStartLine: number;
32+
oldStartLine2?: number;
33+
newStartLine: number;
34+
header: string;
35+
lines: Line[];
36+
}
37+
38+
export interface Result {
39+
addedLines: number;
40+
deletedLines: number;
41+
isCombined: boolean;
42+
isGitDiff: boolean;
43+
oldName: string;
44+
newName: string;
45+
language: string;
46+
blocks: Block[];
47+
oldMode?: string;
48+
newMode?: string;
49+
deletedFileMode?: string;
50+
newFileMode?: string;
51+
isDeleted?: boolean;
52+
isNew?: boolean;
53+
isCopy?: boolean;
54+
isRename?: boolean;
55+
unchangedPercentage?: number;
56+
changedPercentage?: number;
57+
checksumBefore?: string;
58+
checksumAfter?: string;
59+
mode?: string;
60+
}
61+
62+
export interface Diff2Html {
63+
getJsonFromDiff(input: string, configuration?: Options): Result[];
64+
getPrettyHtml(input: any, configuration?: Options): string;
65+
}
66+
}
67+
68+
declare module "diff2html" {
69+
var d2h: { "Diff2Html": Diff2Html.Diff2Html };
70+
export = d2h;
71+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "diff2html",
3-
"version": "2.12.0",
3+
"version": "2.12.1",
44
"homepage": "https://diff2html.xyz",
55
"description": "Fast Diff to colorized HTML",
66
"keywords": [

0 commit comments

Comments
 (0)