-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathindex.d.ts
53 lines (45 loc) · 986 Bytes
/
index.d.ts
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
declare function parseDiff(input?: string | null): parseDiff.File[];
declare namespace parseDiff {
export interface File {
chunks: Chunk[];
deletions: number;
additions: number;
from?: string;
to?: string;
oldMode?: string;
newMode?: string;
index?: string[];
deleted?: true;
new?: true;
}
export interface Chunk {
content: string;
changes: Change[];
oldStart: number;
oldLines: number;
newStart: number;
newLines: number;
}
export interface NormalChange {
type: 'normal';
ln1: number;
ln2: number;
normal: true;
content: string;
}
export interface AddChange {
type: 'add';
add: true;
ln: number;
content: string;
}
export interface DeleteChange {
type: 'del';
del: true;
ln: number;
content: string;
}
export type ChangeType = 'normal' | 'add' | 'del';
export type Change = NormalChange | AddChange | DeleteChange;
}
export = parseDiff;