From 89573407e50dfcf304711ee087ae63bae07705c9 Mon Sep 17 00:00:00 2001 From: Rodrigo Fernandes Date: Sat, 5 Oct 2019 11:23:25 +0100 Subject: [PATCH] v2.12.1 --- dist/diff2html.d.ts | 71 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 dist/diff2html.d.ts diff --git a/dist/diff2html.d.ts b/dist/diff2html.d.ts new file mode 100644 index 0000000..cea93f6 --- /dev/null +++ b/dist/diff2html.d.ts @@ -0,0 +1,71 @@ +// Type definitions for diff2html +// Project: https://github.com/rtfpessoa/diff2html +// Definitions by: rtfpessoa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Diff2Html { + + export interface Options { + inputFormat?: 'diff' | 'json'; + outputFormat?: 'line-by-line' | 'side-by-side'; + showFiles?: boolean; + diffStyle?: 'word' | 'char'; + matching?: 'lines' | 'words' | 'none'; + matchWordsThreshold?: number; + matchingMaxComparisons?: number; + maxLineSizeInBlockForComparison?: number; + maxLineLengthHighlight?: number; + templates?: object; + rawTemplates?: object; + renderNothingWhenEmpty?: boolean; + } + + export interface Line { + content: string; + type: string; + oldNumber: number; + newNumber: number; + } + + export interface Block { + oldStartLine: number; + oldStartLine2?: number; + newStartLine: number; + header: string; + lines: Line[]; + } + + export interface Result { + addedLines: number; + deletedLines: number; + isCombined: boolean; + isGitDiff: boolean; + oldName: string; + newName: string; + language: string; + blocks: Block[]; + oldMode?: string; + newMode?: string; + deletedFileMode?: string; + newFileMode?: string; + isDeleted?: boolean; + isNew?: boolean; + isCopy?: boolean; + isRename?: boolean; + unchangedPercentage?: number; + changedPercentage?: number; + checksumBefore?: string; + checksumAfter?: string; + mode?: string; + } + + export interface Diff2Html { + getJsonFromDiff(input: string, configuration?: Options): Result[]; + getPrettyHtml(input: any, configuration?: Options): string; + } +} + +declare module "diff2html" { + var d2h: { "Diff2Html": Diff2Html.Diff2Html }; + export = d2h; +} diff --git a/package.json b/package.json index c15074d..1963bb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "diff2html", - "version": "2.12.0", + "version": "2.12.1", "homepage": "https://diff2html.xyz", "description": "Fast Diff to colorized HTML", "keywords": [