-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.d.ts
More file actions
55 lines (47 loc) · 1.09 KB
/
index.d.ts
File metadata and controls
55 lines (47 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
export type ChangeType = 'insert' | 'delete' | 'normal';
export interface InsertChange {
type: 'insert';
content: string;
lineNumber: number;
isInsert: true;
}
export interface DeleteChange {
type: 'delete';
content: string;
lineNumber: number;
isDelete: true;
}
export interface NormalChange {
type: 'normal';
content: string;
isNormal: true;
oldLineNumber: number;
newLineNumber: number;
}
export type Change = InsertChange | DeleteChange | NormalChange;
export interface Hunk {
content: string;
oldStart: number;
newStart: number;
oldLines: number;
newLines: number;
changes: Change[];
}
export type FileType = 'add' | 'delete' | 'modify' | 'rename' | 'copy';
export interface File {
hunks: Hunk[];
oldEndingNewLine: boolean;
newEndingNewLine: boolean;
oldMode: string;
newMode: string;
similarity?: number;
oldRevision: string;
newRevision: string;
oldPath: string;
newPath: string;
isBinary?: boolean;
type: FileType;
}
export default {
parse(source: string): File[];
};