File tree Expand file tree Collapse file tree 3 files changed +20
-14
lines changed
Expand file tree Collapse file tree 3 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1414 }
1515
1616 var defaultConfig = {
17- wordByWord : true ,
17+ inputFormat : 'diff' ,
1818 outputFormat : 'line-by-line' ,
19+ showFiles : false ,
1920 matching : 'none' ,
2021 matchWordsThreshold : 0.25 ,
2122 matchingMaxComparisons : 2500 ,
2223 maxLineSizeInBlockForComparison : 200 ,
2324 maxLineLengthHighlight : 10000 ,
25+ templates : { } ,
26+ rawTemplates : { } ,
2427 renderNothingWhenEmpty : false
2528 } ;
2629
Original file line number Diff line number Diff line change @@ -5,18 +5,18 @@ import Diff2Html = require('diff2html');
55let d2h = Diff2Html . Diff2Html ;
66
77class Diff2HtmlOptionsImpl implements Diff2Html . Options {
8- constructor ( public inputFormat : string ) {
9- }
8+ constructor ( public inputFormat : 'diff' | 'json' ) {
9+ }
1010}
1111
1212let strInput =
13- 'diff --git a/sample b/sample\n' +
14- 'index 0000001..0ddf2ba\n' +
15- '--- a/sample\n' +
16- '+++ b/sample\n' +
17- '@@ -1 +1 @@\n' +
18- '-test\n' +
19- '+test1r\n' ;
13+ 'diff --git a/sample b/sample\n' +
14+ 'index 0000001..0ddf2ba\n' +
15+ '--- a/sample\n' +
16+ '+++ b/sample\n' +
17+ '@@ -1 +1 @@\n' +
18+ '-test\n' +
19+ '+test1r\n' ;
2020
2121let strConfiguration = new Diff2HtmlOptionsImpl ( 'diff' ) ;
2222let diffInput = d2h . getJsonFromDiff ( strInput , strConfiguration ) ;
Original file line number Diff line number Diff line change 66declare namespace Diff2Html {
77
88 export interface Options {
9- inputFormat ?: string ;
10- outputFormat ?: string ;
9+ inputFormat ?: 'diff' | 'json' ;
10+ outputFormat ?: 'line-by-line' | 'side-by-side' ;
1111 showFiles ?: boolean ;
12- matching ?: string ;
13- synchronisedScroll ?: boolean ;
12+ matching ?: 'lines' | 'words' | 'none' ;
1413 matchWordsThreshold ?: number ;
1514 matchingMaxComparisons ?: number ;
15+ maxLineSizeInBlockForComparison ?: number ;
1616 maxLineLengthHighlight ?: number ;
17+ templates ?: object ;
18+ rawTemplates ?: object ;
19+ renderNothingWhenEmpty ?: boolean ;
1720 }
1821
1922 export interface Line {
You can’t perform that action at this time.
0 commit comments