@@ -9,7 +9,7 @@ declare class Cache$1<K, V> extends Map<K, V> {
99declare class File$1 {
1010
1111 readonly raw : string ;
12- readonly lang : string ;
12+ readonly lang : DiffHighlighterLang | string ;
1313 readonly fileName ?: string ;
1414 ast ?: DiffAST ;
1515 rawFile : Record < number , string > ;
@@ -22,7 +22,8 @@ declare class File$1 {
2222 highlighterType ?: DiffHighlighter [ "type" ] ;
2323 maxLineNumber : number ;
2424 static createInstance ( data : File$1 ) : File$1 ;
25- constructor ( raw : string , lang : string , fileName ?: string ) ;
25+ constructor ( row : string , lang : DiffHighlighterLang , fileName ?: string ) ;
26+ constructor ( row : string , lang : string , fileName ?: string ) ;
2627 doSyntax ( { registerHighlighter, theme, } : {
2728 registerHighlighter ?: Omit < DiffHighlighter , "getHighlighterEngine" > ;
2829 theme ?: "light" | "dark" ;
@@ -49,10 +50,10 @@ export declare class DiffFile {
4950 _version_ : string ;
5051 _oldFileName : string ;
5152 _oldFileContent : string ;
52- _oldFileLang : string ;
53+ _oldFileLang : DiffHighlighterLang | string ;
5354 _newFileName : string ;
5455 _newFileContent : string ;
55- _newFileLang : string ;
56+ _newFileLang : DiffHighlighterLang | string ;
5657 _diffList : string [ ] ;
5758 diffLineLength : number ;
5859 splitLineLength : number ;
@@ -61,7 +62,9 @@ export declare class DiffFile {
6162 hasExpandSplitAll : boolean ;
6263 hasExpandUnifiedAll : boolean ;
6364 hasSomeLineCollapsed : boolean ;
64- static createInstance ( data : FileData , bundle ?: ReturnType < DiffFile [ "getBundle" ] | DiffFile [ "_getFullBundle" ] > ) : DiffFile ;
65+ static createInstance ( data : FileData_1 , bundle ?: ReturnType < DiffFile [ "getBundle" ] | DiffFile [ "_getFullBundle" ] > ) : DiffFile ;
66+ static createInstance ( data : FileData_2 , bundle ?: ReturnType < DiffFile [ "getBundle" ] | DiffFile [ "_getFullBundle" ] > ) : DiffFile ;
67+ constructor ( _oldFileName : string , _oldFileContent : string , _newFileName : string , _newFileContent : string , _diffList : string [ ] , _oldFileLang ?: DiffHighlighterLang , _newFileLang ?: DiffHighlighterLang , uuid ?: string ) ;
6568 constructor ( _oldFileName : string , _oldFileContent : string , _newFileName : string , _newFileContent : string , _diffList : string [ ] , _oldFileLang ?: string , _newFileLang ?: string , uuid ?: string ) ;
6669 initId ( ) : void ;
6770 getId ( ) : string ;
@@ -353,7 +356,6 @@ export declare const getDiffRange: (additions: DiffLine[], deletions: DiffLine[]
353356 getAdditionRaw : ( lineNumber : number ) => string ;
354357 getDeletionRaw : ( lineNumber : number ) => string ;
355358} ) => void ;
356- export declare const getFile : ( raw : string , lang : string , theme : "light" | "dark" , fileName ?: string , uuid ?: string ) => File$1 ;
357359export declare const getLang : ( fileName : string ) => string ;
358360export declare const getSplitContentLines : ( diffFile : DiffFile ) => DiffSplitContentLineItem [ ] ;
359361export declare const getSplitLines : ( diffFile : DiffFile ) => DiffSplitLineItem [ ] ;
@@ -413,6 +415,10 @@ export declare function diffChanges(addition: DiffLine, deletion: DiffLine): {
413415 addRange : DiffRange ;
414416 delRange : DiffRange ;
415417} ;
418+ export declare function getAst ( raw : string , fileName ?: string , lang ?: DiffHighlighterLang , theme ?: "light" | "dark" ) : DiffAST ;
419+ export declare function getAst ( raw : string , fileName ?: string , lang ?: string , theme ?: "light" | "dark" ) : DiffAST ;
420+ export declare function getFile ( raw : string , lang : DiffHighlighterLang , theme : "light" | "dark" , fileName ?: string , uuid ?: string ) : File$1 ;
421+ export declare function getFile ( raw : string , lang : string , theme : "light" | "dark" , fileName ?: string , uuid ?: string ) : File$1 ;
416422/**
417423 * Calculates whether or not a hunk header can be expanded up, down, both, or if
418424 * the space represented by the hunk header is short and expansion there would
@@ -519,14 +525,15 @@ export type DiffHighlighter = {
519525 setMaxLineToIgnoreSyntax : ( v : number ) => void ;
520526 ignoreSyntaxHighlightList : ( string | RegExp ) [ ] ;
521527 setIgnoreSyntaxHighlightList : ( v : ( string | RegExp ) [ ] ) => void ;
522- getAST : ( raw : string , fileName ?: string , lang ?: string , theme ?: "light" | "dark" ) => DiffAST ;
528+ getAST : typeof getAst ;
523529 processAST : ( ast : DiffAST ) => {
524530 syntaxFileObject : Record < number , SyntaxLine > ;
525531 syntaxFileLineNumber : number ;
526532 } ;
527533 hasRegisteredCurrentLang : ( lang : string ) => boolean ;
528534 getHighlighterEngine : ( ) => typeof lowlight ;
529535} ;
536+ export type DiffHighlighterLang = "arduino" | "bash" | "c" | "cpp" | "csharp" | "css" | "diff" | "go" | "graphql" | "ini" | "java" | "javascript" | "jsx" | "json" | "kotlin" | "less" | "lua" | "makefile" | "markdown" | "objectivec" | "perl" | "php" | "php-template" | "plaintext" | "python" | "python-repl" | "r" | "ruby" | "rust" | "scss" | "shell" | "sql" | "swift" | "typescript" | "tsx" | "vbnet" | "wasm" | "xml" | "yaml" | "abnf" | "accesslog" | "actionscript" | "ada" | "angelscript" | "apache" | "applescript" | "arcade" | "armasm" | "asciidoc" | "aspectj" | "autohotkey" | "autoit" | "avrasm" | "awk" | "axapta" | "basic" | "bnf" | "brainfuck" | "cal" | "capnproto" | "ceylon" | "clean" | "clojure" | "clojure-repl" | "cmake" | "coffeescript" | "coq" | "cos" | "crmsh" | "crystal" | "csp" | "d" | "dart" | "delphi" | "django" | "dns" | "dockerfile" | "dos" | "dsconfig" | "dts" | "dust" | "ebnf" | "elixir" | "elm" | "erb" | "erlang" | "erlang-repl" | "excel" | "fix" | "flix" | "fortran" | "fsharp" | "gams" | "gauss" | "gcode" | "gherkin" | "glsl" | "gml" | "golo" | "gradle" | "groovy" | "haml" | "handlebars" | "haskell" | "haxe" | "hsp" | "http" | "hy" | "inform7" | "irpf90" | "isbl" | "jboss-cli" | "julia" | "julia-repl" | "lasso" | "latex" | "ldif" | "leaf" | "lisp" | "livecodeserver" | "livescript" | "llvm" | "lsl" | "mathematica" | "matlab" | "maxima" | "mel" | "mercury" | "mipsasm" | "mizar" | "mojolicious" | "monkey" | "moonscript" | "n1ql" | "nestedtext" | "nginx" | "nim" | "nix" | "node-repl" | "nsis" | "ocaml" | "openscad" | "oxygene" | "parser3" | "pf" | "pgsql" | "pony" | "powershell" | "processing" | "profile" | "prolog" | "properties" | "protobuf" | "puppet" | "purebasic" | "q" | "qml" | "reasonml" | "rib" | "roboconf" | "routeros" | "rsl" | "ruleslanguage" | "sas" | "scala" | "scheme" | "scilab" | "smali" | "smalltalk" | "sml" | "sqf" | "stan" | "stata" | "step21" | "stylus" | "subunit" | "taggerscript" | "tap" | "tcl" | "thrift" | "tp" | "twig" | "vala" | "vbscript" | "vbscript-html" | "verilog" | "vhdl" | "vim" | "wren" | "x86asm" | "xl" | "xquery" | "zephi" ;
530537export type DiffSplitContentLineItem = {
531538 type : DiffFileLineType . content ;
532539 index : number ;
@@ -552,7 +559,20 @@ export type DiffUnifiedLineItem = {
552559 index : number ;
553560 lineNumber : number ;
554561} ;
555- export type FileData = {
562+ export type FileData_1 = {
563+ oldFile ?: {
564+ fileName ?: string | null ;
565+ fileLang ?: DiffHighlighterLang | null ;
566+ content ?: string | null ;
567+ } ;
568+ newFile ?: {
569+ fileName ?: string | null ;
570+ fileLang ?: DiffHighlighterLang | null ;
571+ content ?: string | null ;
572+ } ;
573+ hunks ?: string [ ] ;
574+ } ;
575+ export type FileData_2 = {
556576 oldFile ?: {
557577 fileName ?: string | null ;
558578 fileLang ?: string | null ;
0 commit comments