File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ gitDiffParser.parse(gitDiffText);
21
21
### API
22
22
23
23
``` ts
24
+ export type ChangeType = ' insert' | ' delete' | ' normal' ;
25
+
24
26
export interface Change {
25
27
content: string ;
26
- type: ' insert ' | ' delete ' | ' normal ' ;
28
+ type: ChangeType ;
27
29
isInsert? : boolean ;
28
30
isDelete? : boolean ;
29
31
isNormal? : boolean ;
@@ -41,6 +43,8 @@ export interface Hunk {
41
43
changes: Change [];
42
44
}
43
45
46
+ export type FileType = ' add' | ' delete' | ' modify' | ' rename' | ' copy' ;
47
+
44
48
export interface File {
45
49
hunks: Hunk [];
46
50
oldEndingNewLine: boolean ;
@@ -53,7 +57,7 @@ export interface File {
53
57
oldPath: string ;
54
58
newPath: string ;
55
59
isBinary? : boolean ;
56
- type: ' add ' | ' delete ' | ' modify ' | ' rename ' ;
60
+ type: FileType ;
57
61
}
58
62
59
63
export function parse(source : string ): File [];
Original file line number Diff line number Diff line change
1
+ export type ChangeType = 'insert' | 'delete' | 'normal' ;
2
+
1
3
export interface Change {
2
4
content : string ;
3
- type : 'insert' | 'delete' | 'normal' ;
5
+ type : ChangeType ;
4
6
isInsert ?: boolean ;
5
7
isDelete ?: boolean ;
6
8
isNormal ?: boolean ;
@@ -18,6 +20,8 @@ export interface Hunk {
18
20
changes : Change [ ] ;
19
21
}
20
22
23
+ export type FileType = 'add' | 'delete' | 'modify' | 'rename' | 'copy' ;
24
+
21
25
export interface File {
22
26
hunks : Hunk [ ] ;
23
27
oldEndingNewLine : boolean ;
@@ -30,7 +34,7 @@ export interface File {
30
34
oldPath : string ;
31
35
newPath : string ;
32
36
isBinary ?: boolean ;
33
- type : 'add' | 'delete' | 'modify' | 'rename' | 'copy' ;
37
+ type : FileType ;
34
38
}
35
39
36
40
export function parse ( source : string ) : File [ ] ;
You can’t perform that action at this time.
0 commit comments