-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtypes.ts
70 lines (61 loc) · 1.1 KB
/
types.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import fs from 'fs';
import { FileStatusCode } from './enums';
/**
* Type of files stored in the .git/objects store.
*
* @export
*/
export type GitObjectType = 'blob' | 'commit' | 'tree' | 'tag';
export interface GitObject {
type: GitObjectType;
length: number;
data: Buffer;
}
export interface FileStats {
/**
* Information about a file.
*
* @type {fs.Stats}
*/
stat: fs.Stats;
/**
* Path from the root of the current git repo.
*
* @type {string}
*/
pathFromGitRoot: string;
}
export interface FileStatus {
/**
* Path from the gitRoot to the file.
*
* @type {string}
*/
name: string;
/**
* Status of the file in the staging area.
*
* @type {FileStatusCode}
*/
staging: FileStatusCode;
/**
* Status of the file in the Work Tree.
*
* @type {FileStatusCode}
*/
worktree: FileStatusCode;
}
export interface DiffEntry {
/**
* Path from the gitRoot to the file.
*
* @type {string}
*/
name: string;
/**
* Status of the file in Staging or WorkTree.
*
* @type {FileStatusCode}
*/
status: FileStatusCode;
}