From 6d07646a19cfacab3fbab22ca63f343334d6835b Mon Sep 17 00:00:00 2001 From: Rodrigo Fernandes Date: Mon, 8 Jul 2019 18:25:01 +0100 Subject: [PATCH] Update diff2html configuration options typings (#36629) --- types/diff2html/diff2html-tests.ts | 4 +--- types/diff2html/index.d.ts | 14 +++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/types/diff2html/diff2html-tests.ts b/types/diff2html/diff2html-tests.ts index 668853696a..5d5b79db84 100644 --- a/types/diff2html/diff2html-tests.ts +++ b/types/diff2html/diff2html-tests.ts @@ -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 = diff --git a/types/diff2html/index.d.ts b/types/diff2html/index.d.ts index 1b75f1e3df..16ec9aca94 100644 --- a/types/diff2html/index.d.ts +++ b/types/diff2html/index.d.ts @@ -2,17 +2,22 @@ // Project: https://github.com/rtfpessoa/diff2html // Definitions by: 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; } }