-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
68 lines (48 loc) · 1.28 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Minimum TypeScript Version: 3.8
// ## Types
export interface Author {
name: string;
email: string;
commitCount: number;
}
export interface Branches {
local: string[];
remote?: Record<string, string[]>;
}
export interface Commit {
author: Pick<Author, 'email' | 'name'>;
hash: string;
date: number;
parent: string[];
files?: File[];
}
export interface Config {
[key: string]: (string | Config);
}
export type FileStatus = 'added' | 'deleted' | 'ignored' | 'modified' | 'renamed' | 'unmodified' | 'untracked';
export interface File {
type: FileStatus;
fileName: string;
}
export interface GitLogConfig {
dir: string;
}
export interface LogOption {
count: number;
withFile: boolean;
branch: string | 'HEAD';
}
export type Remote = Record<string, { fetch: string, push: string }>;
export interface Tag {
name: string;
hash: string;
}
// # Functions
export function authors(params?: LogOption): Promise<Author[]>;
export function branches(withRemote: boolean): Promise<Branches>;
export function commits(params?: LogOption): Promise<Commit[]>;
export function config(): Promise<Config>;
export function remotes(): Promise<Remote>;
export function tags(): Tag[];
export function setGitLogConfig(config: GitLogConfig): void;
export function status(): File[];