History

Update Git documentation (2.30.0)

Simon Legner committed 5 years ago

Commit 3600a9f1 parent 8f17cfa41 files · +4398 −1Browse files

Showing the changes to node_modules/simple-git/typings (1 of 41 files). Show all

Unified · Split

node_modules/simple-git/typings/response.d.ts+220−0
@@ -0,0 +1,220 @@
1export interface BranchDeletionSummary {
2 branch: string;
3 hash: any;
4 success: boolean;
5}
6
7export interface BranchSummary {
8 detached: boolean;
9 current: string;
10 all: string[];
11 branches: {
12 [key: string]: {
13 current: boolean;
14 name: string;
15 commit: string;
16 label: string;
17 };
18 };
19}
20
21export interface CommitSummary {
22 author: null | {
23 email: string;
24 name: string;
25 };
26 branch: string;
27 commit: string;
28 summary: {
29 changes: number;
30 insertions: number;
31 deletions: number;
32 };
33}
34
35export interface DiffResultTextFile {
36 file: string;
37 changes: number;
38 insertions: number;
39 deletions: number;
40 binary: boolean;
41}
42
43export interface DiffResultBinaryFile {
44 file: string;
45 before: number;
46 after: number;
47 binary: boolean;
48}
49
50export interface DiffResult {
51 /** The total number of files changed as reported in the summary line */
52 changed: number;
53
54 /** When present in the diff, lists the details of each file changed */
55 files: Array<DiffResultTextFile | DiffResultBinaryFile>;
56
57 /** The number of files changed with insertions */
58 insertions: number;
59
60 /** The number of files changed with deletions */
61 deletions: number;
62}
63
64export interface FetchResult {
65 raw: string;
66 remote: string | null;
67 branches: {
68 name: string;
69 tracking: string;
70 }[];
71 tags: {
72 name: string;
73 tracking: string;
74 }[];
75}
76
77export interface MoveSummary {
78 moves: any[];
79}
80
81export interface PullResult {
82 /** Array of all files that are referenced in the pull */
83 files: string[];
84
85 /** Map of file names to the number of insertions in that file */
86 insertions: { [key: string]: number };
87
88 /** Map of file names to the number of deletions in that file */
89 deletions: any;
90
91 summary: {
92 changes: number;
93 insertions: number;
94 deletions: number;
95 };
96
97 /** Array of file names that have been created */
98 created: string[];
99
100 /** Array of file names that have been deleted */
101 deleted: string[];
102}
103
104export interface RemoteWithoutRefs {
105 name: string;
106}
107
108export interface RemoteWithRefs extends RemoteWithoutRefs {
109 refs: {
110 fetch: string;
111 push: string;
112 };
113}
114
115export interface StatusResultRenamed {
116 from: string;
117 to: string;
118}
119
120export interface FileStatusSumary {
121 /* Path of the file */
122 path: string;
123 /* First digit of the status code of the file, e.g. 'M' = modified.
124 Represents the status of the index if no merge conflicts, otherwise represents
125 status of one side of the merge. */
126 index: string;
127 /* Second digit of the status code of the file. Represents status of the working directory
128 if no merge conflicts, otherwise represents status of other side of a merge. */
129 working_dir: string;
130}
131
132export interface StatusResult {
133 not_added: string[];
134 conflicted: string[];
135 created: string[];
136 deleted: string[];
137 modified: string[];
138 renamed: StatusResultRenamed[];
139 staged: string[];
140 files: FileStatusSumary[];
141 ahead: number;
142 behind: number;
143 current: string;
144 tracking: string;
145
146 /**
147 * Gets whether this represents a clean working branch.
148 */
149 isClean(): boolean;
150}
151
152export interface TagResult {
153 all: string[];
154 latest: string;
155}
156
157export interface DefaultLogFields {
158 hash: string;
159 date: string;
160 message: string;
161 refs: string;
162 body: string;
163 author_name: string;
164 author_email: string;
165}
166
167/**
168 * The ListLogLine represents a single entry in the `git.log`, the properties on the object
169 * are mixed in depending on the names used in the format (see `DefaultLogFields`), but some
170 * properties are dependent on the command used.
171 */
172export interface ListLogLine {
173 /**
174 * When using a `--stat=4096` or `--shortstat` options in the `git.log` or `git.stashList`,
175 * each entry in the `ListLogSummary` will also have a `diff` property representing as much
176 * detail as was given in the response.
177 */
178 diff?: DiffResult;
179}
180
181export interface ListLogSummary<T = DefaultLogFields> {
182 all: ReadonlyArray<T & ListLogLine>;
183 total: number;
184 latest: T & ListLogLine;
185}
186
187/**
188 * Where the file was deleted, if there is a modify/delete conflict
189 */
190export interface MergeConflictDeletion {
191 deleteRef: string;
192}
193
194/**
195 * Represents a single file with conflicts in the MergeSummary
196 */
197export interface MergeConflict {
198
199 /**
200 * Type of conflict
201 */
202 reason: string;
203
204 /**
205 * Path to file
206 */
207 file: string;
208
209 /**
210 * Additional detail for the specific type of conflict
211 */
212 meta?: MergeConflictDeletion;
213}
214
215export interface MergeSummary extends PullResult {
216 conflicts: MergeConflict[];
217 merges: string[];
218 result: "success" | string;
219 failed: boolean;
220}