@@ -78,8 +78,32 @@ export declare class DiffFile {
7878 additionLength : number ;
7979 deletionLength : number ;
8080 hasSomeLineCollapsed : boolean ;
81- static createInstance ( data : FileData_1 , bundle ?: ReturnType < DiffFile [ "getBundle" ] | DiffFile [ "_getFullBundle" ] > ) : DiffFile ;
82- static createInstance ( data : FileData_2 , bundle ?: ReturnType < DiffFile [ "getBundle" ] | DiffFile [ "_getFullBundle" ] > ) : DiffFile ;
81+ static createInstance ( data : {
82+ oldFile ?: {
83+ fileName ?: string | null ;
84+ fileLang ?: DiffHighlighterLang | null ;
85+ content ?: string | null ;
86+ } ;
87+ newFile ?: {
88+ fileName ?: string | null ;
89+ fileLang ?: DiffHighlighterLang | null ;
90+ content ?: string | null ;
91+ } ;
92+ hunks ?: string [ ] ;
93+ } , bundle ?: ReturnType < DiffFile [ "getBundle" ] | DiffFile [ "_getFullBundle" ] > ) : DiffFile ;
94+ static createInstance ( data : {
95+ oldFile ?: {
96+ fileName ?: string | null ;
97+ fileLang ?: string | null ;
98+ content ?: string | null ;
99+ } ;
100+ newFile ?: {
101+ fileName ?: string | null ;
102+ fileLang ?: string | null ;
103+ content ?: string | null ;
104+ } ;
105+ hunks ?: string [ ] ;
106+ } , bundle ?: ReturnType < DiffFile [ "getBundle" ] | DiffFile [ "_getFullBundle" ] > ) : DiffFile ;
83107 constructor ( _oldFileName : string , _oldFileContent : string , _newFileName : string , _newFileContent : string , _diffList : string [ ] , _oldFileLang ?: DiffHighlighterLang , _newFileLang ?: DiffHighlighterLang , uuid ?: string ) ;
84108 constructor ( _oldFileName : string , _oldFileContent : string , _newFileName : string , _newFileContent : string , _diffList : string [ ] , _oldFileLang ?: string , _newFileLang ?: string , uuid ?: string ) ;
85109 initId ( ) : void ;
@@ -117,12 +141,16 @@ export declare class DiffFile {
117141 value : string ;
118142 template ?: string ;
119143 } ;
120- getOldSyntaxLine : ( lineNumber : number ) => SyntaxLineWithTemplate ;
144+ getOldSyntaxLine : ( lineNumber : number ) => SyntaxLine & {
145+ template ?: string ;
146+ } ;
121147 getNewPlainLine : ( lineNumber : number ) => {
122148 value : string ;
123149 template ?: string ;
124150 } ;
125- getNewSyntaxLine : ( lineNumber : number ) => SyntaxLineWithTemplate ;
151+ getNewSyntaxLine : ( lineNumber : number ) => SyntaxLine & {
152+ template ?: string ;
153+ } ;
126154 subscribe : ( listener : ( ( ) => void ) & {
127155 isSyncExternal ?: boolean ;
128156 } ) => ( ) => void ;
@@ -140,15 +168,19 @@ export declare class DiffFile {
140168 value : string ;
141169 template ?: string ;
142170 } > ;
143- oldFileSyntaxLines : Record < number , SyntaxLineWithTemplate > ;
171+ oldFileSyntaxLines : Record < number , SyntaxLine & {
172+ template ?: string ;
173+ } > ;
144174 oldFilePlaceholderLines : Record < string , boolean > ;
145175 newFileLines : Record < number , string > ;
146176 newFileDiffLines : Record < string , DiffLineItem > ;
147177 newFilePlainLines : Record < number , {
148178 value : string ;
149179 template ?: string ;
150180 } > ;
151- newFileSyntaxLines : Record < number , SyntaxLineWithTemplate > ;
181+ newFileSyntaxLines : Record < number , SyntaxLine & {
182+ template ?: string ;
183+ } > ;
152184 newFilePlaceholderLines : Record < string , boolean > ;
153185 splitLineLength : number ;
154186 unifiedLineLength : number ;
@@ -198,15 +230,19 @@ export declare class DiffFile {
198230 value : string ;
199231 template ?: string ;
200232 } > ;
201- oldFileSyntaxLines : Record < number , SyntaxLineWithTemplate > ;
233+ oldFileSyntaxLines : Record < number , SyntaxLine & {
234+ template ?: string ;
235+ } > ;
202236 oldFilePlaceholderLines : Record < string , boolean > ;
203237 newFileLines : Record < number , string > ;
204238 newFileDiffLines : Record < string , DiffLineItem > ;
205239 newFilePlainLines : Record < number , {
206240 value : string ;
207241 template ?: string ;
208242 } > ;
209- newFileSyntaxLines : Record < number , SyntaxLineWithTemplate > ;
243+ newFileSyntaxLines : Record < number , SyntaxLine & {
244+ template ?: string ;
245+ } > ;
210246 newFilePlaceholderLines : Record < string , boolean > ;
211247 splitLineLength : number ;
212248 unifiedLineLength : number ;
@@ -418,12 +454,6 @@ export declare class DiffParser {
418454}
419455/** How many new lines will be added to a diff hunk by default. */
420456export declare const DefaultDiffExpansionStep = 40 ;
421- /**
422- * Regular expression matching invisible bidirectional Unicode characters that
423- * may be interpreted or compiled differently than what it appears. More info:
424- * https://github.co/hiddenchars
425- */
426- export declare const HiddenBidiCharsRegex : RegExp ;
427457export declare const _cacheMap : Cache$1 < string , File$1 > ;
428458export declare const changeDefaultComposeLength : ( compose : number ) => void ;
429459export declare const checkCurrentLineIsHidden : ( diffFile : DiffFile , lineNumber : number , side : SplitSide ) => {
@@ -434,12 +464,6 @@ export declare const checkDiffLineIncludeChange: (diffLine?: DiffLine) => boolea
434464export declare const defaultTransform : ( content : string ) => string ;
435465export declare const disableCache : ( ) => void ;
436466export declare const getCurrentComposeLength : ( ) => number ;
437- export declare const getDiffRange : ( additions : DiffLine [ ] , deletions : DiffLine [ ] , { getAdditionRaw, getDeletionRaw, getAdditionSyntax, getDeletionSyntax, } : {
438- getAdditionRaw : ( lineNumber : number ) => string ;
439- getDeletionRaw : ( lineNumber : number ) => string ;
440- getAdditionSyntax : ( lineNumber : number ) => SyntaxLineWithTemplate ;
441- getDeletionSyntax : ( lineNumber : number ) => SyntaxLineWithTemplate ;
442- } ) => void ;
443467export declare const getEnableFastDiffTemplate : ( ) => boolean ;
444468export declare const getLang : ( fileName : string ) => string ;
445469export declare const getPlainDiffTemplate : ( { diffLine, rawLine, operator, } : {
@@ -457,12 +481,12 @@ export declare const getSplitContentLines: (diffFile: DiffFile) => DiffSplitCont
457481export declare const getSplitLines : ( diffFile : DiffFile ) => DiffSplitLineItem [ ] ;
458482export declare const getSyntaxDiffTemplate : ( { diffLine, syntaxLine, operator, } : {
459483 diffLine : DiffLine ;
460- syntaxLine : SyntaxLineWithTemplate ;
484+ syntaxLine : SyntaxLine ;
461485 operator : "add" | "del" ;
462486} ) => void ;
463487export declare const getSyntaxDiffTemplateByFastDiff : ( { diffLine, syntaxLine, operator, } : {
464488 diffLine : DiffLine ;
465- syntaxLine : SyntaxLineWithTemplate ;
489+ syntaxLine : SyntaxLine ;
466490 operator : "add" | "del" ;
467491} ) => void ;
468492export declare const getSyntaxLineTemplate : ( line : SyntaxLine ) => string ;
@@ -482,7 +506,6 @@ export declare const highlighter: DiffHighlighter;
482506 * ```
483507 */
484508export declare const isTransformEnabled : ( ) => boolean ;
485- export declare const numIterator : < T > ( num : number , cb : ( index : number ) => T ) => T [ ] ;
486509export declare const parseInstance : DiffParser ;
487510export declare const processAST : ( ast : DiffAST ) => {
488511 syntaxFileObject : Record < number , SyntaxLine > ;
@@ -594,27 +617,11 @@ export declare enum SplitSide {
594617}
595618export declare function _getAST ( raw : string , fileName ?: string , lang ?: DiffHighlighterLang , theme ?: "light" | "dark" ) : DiffAST ;
596619export declare function _getAST ( raw : string , fileName ?: string , lang ?: string , theme ?: "light" | "dark" ) : DiffAST ;
597- export declare function assertNever ( _ : never , message : string ) : never ;
598620export declare function diffChanges ( addition : DiffLine , deletion : DiffLine ) : {
599621 addRange : DiffRange ;
600622 delRange : DiffRange ;
601623} ;
602624export declare function escapeHtml ( string : unknown ) : string ;
603- export declare function getFile ( raw : string , lang : DiffHighlighterLang , theme : "light" | "dark" , fileName ?: string , uuid ?: string ) : File$1 ;
604- export declare function getFile ( raw : string , lang : string , theme : "light" | "dark" , fileName ?: string , uuid ?: string ) : File$1 ;
605- /**
606- * Calculates whether or not a hunk header can be expanded up, down, both, or if
607- * the space represented by the hunk header is short and expansion there would
608- * mean merging with the hunk above.
609- *
610- * @param hunkIndex Index of the hunk to evaluate within the whole diff.
611- * @param hunkHeader Header of the hunk to evaluate.
612- * @param previousHunk Hunk previous to the one to evaluate. Null if the
613- * evaluated hunk is the first one.
614- */
615- export declare function getHunkHeaderExpansionType ( hunkIndex : number , hunkHeader : DiffHunkHeader , previousHunk : DiffHunk | null ) : DiffHunkExpansionType ;
616- /** Utility function for getting the digit count of the largest line number in an array of diff hunks */
617- export declare function getLargestLineNumber ( hunks : DiffHunk [ ] ) : number ;
618625/** Get the changed ranges in the strings, relative to each other. */
619626export declare function relativeChanges ( addition : DiffLine , deletion : DiffLine ) : {
620627 addRange : IRange ;
@@ -744,32 +751,6 @@ export type DiffUnifiedLineItem = {
744751 index : number ;
745752 lineNumber : number ;
746753} ;
747- export type FileData_1 = {
748- oldFile ?: {
749- fileName ?: string | null ;
750- fileLang ?: DiffHighlighterLang | null ;
751- content ?: string | null ;
752- } ;
753- newFile ?: {
754- fileName ?: string | null ;
755- fileLang ?: DiffHighlighterLang | null ;
756- content ?: string | null ;
757- } ;
758- hunks ?: string [ ] ;
759- } ;
760- export type FileData_2 = {
761- oldFile ?: {
762- fileName ?: string | null ;
763- fileLang ?: string | null ;
764- content ?: string | null ;
765- } ;
766- newFile ?: {
767- fileName ?: string | null ;
768- fileLang ?: string | null ;
769- content ?: string | null ;
770- } ;
771- hunks ?: string [ ] ;
772- } ;
773754export type HunkInfo = {
774755 oldStartIndex : number ;
775756 newStartIndex : number ;
0 commit comments