fix: Update typescript typings and default configuration options
This commit is contained in:
parent
defd8f399b
commit
d131860324
3 changed files with 20 additions and 14 deletions
|
|
@ -14,13 +14,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var defaultConfig = {
|
var defaultConfig = {
|
||||||
wordByWord: true,
|
inputFormat: 'diff',
|
||||||
outputFormat: 'line-by-line',
|
outputFormat: 'line-by-line',
|
||||||
|
showFiles: false,
|
||||||
matching: 'none',
|
matching: 'none',
|
||||||
matchWordsThreshold: 0.25,
|
matchWordsThreshold: 0.25,
|
||||||
matchingMaxComparisons: 2500,
|
matchingMaxComparisons: 2500,
|
||||||
maxLineSizeInBlockForComparison: 200,
|
maxLineSizeInBlockForComparison: 200,
|
||||||
maxLineLengthHighlight: 10000,
|
maxLineLengthHighlight: 10000,
|
||||||
|
templates: {},
|
||||||
|
rawTemplates: {},
|
||||||
renderNothingWhenEmpty: false
|
renderNothingWhenEmpty: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import Diff2Html = require('diff2html');
|
||||||
let d2h = Diff2Html.Diff2Html;
|
let d2h = Diff2Html.Diff2Html;
|
||||||
|
|
||||||
class Diff2HtmlOptionsImpl implements Diff2Html.Options {
|
class Diff2HtmlOptionsImpl implements Diff2Html.Options {
|
||||||
constructor(public inputFormat: string) {
|
constructor (public inputFormat: 'diff' | 'json') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
11
typescript/diff2html.d.ts
vendored
11
typescript/diff2html.d.ts
vendored
|
|
@ -6,14 +6,17 @@
|
||||||
declare namespace Diff2Html {
|
declare namespace Diff2Html {
|
||||||
|
|
||||||
export interface Options {
|
export interface Options {
|
||||||
inputFormat?: string;
|
inputFormat?: 'diff' | 'json';
|
||||||
outputFormat?: string;
|
outputFormat?: 'line-by-line' | 'side-by-side';
|
||||||
showFiles?: boolean;
|
showFiles?: boolean;
|
||||||
matching?: string;
|
matching?: 'lines' | 'words' | 'none';
|
||||||
synchronisedScroll?: boolean;
|
|
||||||
matchWordsThreshold?: number;
|
matchWordsThreshold?: number;
|
||||||
matchingMaxComparisons?: number;
|
matchingMaxComparisons?: number;
|
||||||
|
maxLineSizeInBlockForComparison?: number;
|
||||||
maxLineLengthHighlight?: number;
|
maxLineLengthHighlight?: number;
|
||||||
|
templates?: object;
|
||||||
|
rawTemplates?: object;
|
||||||
|
renderNothingWhenEmpty?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Line {
|
export interface Line {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue