Update diff2html configuration options typings (#36629)

This commit is contained in:
Rodrigo Fernandes 2019-07-08 18:25:01 +01:00 committed by Andrew Branch
parent d314939efe
commit 6d07646a19
2 changed files with 10 additions and 8 deletions

View File

@ -1,11 +1,9 @@
import Diff2Html = require('diff2html');
let d2h = Diff2Html.Diff2Html;
class Diff2HtmlOptionsImpl implements Diff2Html.Options {
constructor (public inputFormat: string) {
}
constructor(public inputFormat: 'diff' | 'json') {}
}
let strInput =

View File

@ -2,17 +2,22 @@
// Project: https://github.com/rtfpessoa/diff2html
// Definitions by: rtfpessoa <https://github.com/rtfpessoa>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare namespace Diff2Html {
export interface Options {
inputFormat?: string;
outputFormat?: string;
inputFormat?: 'diff' | 'json';
outputFormat?: 'line-by-line' | 'side-by-side';
showFiles?: boolean;
matching?: string;
synchronisedScroll?: boolean;
matching?: 'lines' | 'words' | 'none';
matchWordsThreshold?: number;
matchingMaxComparisons?: number;
maxLineSizeInBlockForComparison?: number;
maxLineLengthHighlight?: number;
templates?: object;
rawTemplates?: object;
renderNothingWhenEmpty?: boolean;
}
export interface Line {
@ -57,7 +62,6 @@ declare namespace Diff2Html {
export interface Diff2Html {
getJsonFromDiff(input: string, configuration?: Options): Result[];
getPrettyHtml(input: any, configuration?: Options): string;
getPrettyHtmlFromJson(input: Result[], configuration?: Options): string;
}
}