UNPKG

2.86 kBTypeScriptView Raw
1
2export interface BranchDeletionSummary {
3 branch: string;
4 hash: any;
5 success: boolean;
6}
7
8 export interface BranchSummary {
9 detached: boolean;
10 current: string;
11 all: string[];
12 branches: {[key: string]: {
13 current: string,
14 name: string,
15 commit: string,
16 label: string
17 }};
18 }
19
20export interface CommitSummary {
21 author: null | {
22 email: string;
23 name: string;
24 };
25 branch: string;
26 commit: string;
27 summary: {
28 changes: number;
29 insertions: number;
30 deletions: number;
31 };
32}
33
34export interface DiffResultTextFile {
35 file: string;
36 changes: number,
37 insertions: number;
38 deletions: number;
39 binary: boolean;
40}
41
42export interface DiffResultBinaryFile {
43 file: string;
44 before: number;
45 after: number;
46 binary: boolean;
47}
48
49export interface DiffResult {
50 files: Array<DiffResultTextFile | DiffResultBinaryFile>;
51 insertions: number;
52 deletions: number;
53}
54
55export interface FetchResult {
56 raw: string;
57 remote: string | null;
58 branches: {
59 name: string;
60 tracking: string;
61 }[];
62 tags: {
63 name: string;
64 tracking: string;
65 }[];
66}
67
68export interface MoveSummary {
69 moves: any[];
70}
71
72export interface PullResult {
73
74 /** Array of all files that are referenced in the pull */
75 files: string[];
76
77 /** Map of file names to the number of insertions in that file */
78 insertions: {[key: string]: number};
79
80 /** Map of file names to the number of deletions in that file */
81 deletions: any;
82
83 summary: {
84 changes: number;
85 insertions: number;
86 deletions: number;
87 };
88
89 /** Array of file names that have been created */
90 created: string[];
91
92 /** Array of file names that have been deleted */
93 deleted: string[];
94}
95
96export interface RemoteWithoutRefs {
97 name: string;
98}
99
100export interface RemoteWithRefs extends RemoteWithoutRefs {
101 refs: {
102 fetch: string;
103 push: string;
104 }
105}
106
107export interface StatusResultRenamed {
108 from: string;
109 to: string;
110}
111
112export interface StatusResult {
113 not_added: string[];
114 conflicted: string[];
115 created: string[];
116 deleted: string[];
117 modified: string[];
118 renamed: StatusResultRenamed[];
119 staged: string[];
120 files: {
121 path: string;
122 index: string;
123 working_dir: string;
124 }[];
125 ahead: number;
126 behind: number;
127 current: string;
128 tracking: string;
129
130 /**
131 * Gets whether this represents a clean working branch.
132 */
133 isClean(): boolean;
134}
135
136export interface TagResult {
137 all: string[];
138 latest: string;
139}
140
141export interface DefaultLogFields {
142 hash: string;
143 date: string;
144 message: string;
145 refs: string;
146 body: string;
147 author_name: string;
148 author_email: string;
149}
150
151export interface ListLogSummary<T = DefaultLogFields> {
152 all: ReadonlyArray<T>;
153 total: number;
154 latest: T;
155}