This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 408
Expand file tree
/
Copy pathnodegit.js.flow
More file actions
188 lines (138 loc) · 4.34 KB
/
nodegit.js.flow
File metadata and controls
188 lines (138 loc) · 4.34 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
declare module 'nodegit' {
declare class DiffLine {
}
declare class ConvenientHunk {
lines(): Promise<Array<DiffLine>>;
header(): string;
}
declare class DiffFile {
mode(): number;
path(): string;
}
declare class ConvenientPatch {
hunks(): Promise<Array<ConvenientHunk>>;
size(): number;
isRenamed(): boolean;
isUntracked(): boolean;
isAdded(): boolean;
isRenamed(): boolean;
isDeleted(): boolean;
newFile(): ?DiffFile;
oldFile(): ?DiffFile;
}
declare class Status {
static OPT: {INCLUDE_UNTRACKED: number, RECURSE_UNTRACKED_DIRS: number, RENAMES_INDEX_TO_WORKDIR: number, RENAMES_HEAD_TO_INDEX: number};
}
declare class Diff {
static indexToWorkdir(repo: Repository, index: Index, options: Object): Promise<Diff>;
static treeToIndex(repo: Repository, tree: ?Tree, index: Index, options: Object): Promise<Diff>;
static treeToWorkdirWithIndex(repo: Repository, tree: ?Tree, options: Object): Promise<Diff>;
static OPTION: {SHOW_UNTRACKED_CONTENT: number, RECURSE_UNTRACKED_DIRS: number};
static FIND: {RENAMES: number, FOR_UNTRACKED: number};
patches(): Promise<Array<ConvenientPatch>>;
findSimilar(options: Object): Promise<number>;
}
declare class Oid {
}
declare class IndexEntry {
id: Oid;
mode: number;
path: string;
fileSize: number;
flags: number;
flagsExtended: number;
}
declare class Index {
removeByPath(path: string): number;
addByPath(path: string): number;
add(entry: IndexEntry): number;
getByPath(path: string, stage?: number): ?IndexEntry;
write(): Promise<number>;
writeTree(): Promise<Oid>;
}
declare class TreeEntry {
getBlob(): Promise<Blob>;
}
declare class Tree {
getEntry(path: string): TreeEntry;
}
declare class Commit {
getTree(): Promise<Tree>;
}
declare class Blob {
toString(): string;
}
declare class StatusFile {
path(): string;
headToIndex(): DiffDelta;
indexToWorkdir(): DiffDelta;
isDeleted(): boolean;
isRenamed(): boolean;
inWorkingTree(): boolean;
inIndex(): boolean;
}
declare class DiffDelta {
newFile(): DiffFile;
oldFile(): DiffFile;
}
declare class StatusEntry {
headToIndex(): DiffDelta;
indexToWorkdir(): DiffDelta;
}
declare class Reset {
static default(repo: Repository, target: Commit, path: string): Promise<number>;
}
declare class Signature {
static default(repo: Repository): Signature;
}
declare class Remote {
name(): string;
url(): string;
getPushRefspecs(): Promise<Array<string>>;
push(refspecs: ?Array<string>, options: Object): Promise<void>;
fetch(refspecs: ?Array<string>, options: Object, message: string): Promise<void>;
disconnect(): Promise<void>;
stop(): void;
}
declare class FetchOptions {
}
declare class Cred {
static userpassPlaintextNew(username: string, password: string): Cred;
static sshKeyFromAgent(username: string): Cred;
static defaultNew(): Cred;
}
declare class Reference {
name(): string;
shorthand(): string;
}
declare class Branch {
static upstream(branch: Reference): Promise<?Reference>;
}
declare class Config {
getStringBuf(name: string): ?string;
setString(name: string, value: string): Promise<void>;
}
declare class TransferProgress {
totalObjects(): number;
receivedObjects(): number;
}
declare class Repository {
static open(path: string): Promise<Repository>;
openIndex(): Promise<Index>;
isEmpty(): boolean;
getHeadCommit(): Promise<Commit>;
getCommit(sha: Oid | string): Promise<Commit>;
getBlob(id: Oid | string): Promise<Blob>;
createBlobFromBuffer(buf: Buffer): Oid;
createCommit(updateRef: string, author: Signature, committer: Signature, message: string, oid: Oid, parents: ?Array<Commit>): Promise<Oid>;
getStatusExt(): Promise<Array<StatusFile>>;
getRemotes(): Array<string>;
getRemote(name: string): Promise<?Remote>;
getReference(name: string): Promise<?Reference>;
getCurrentBranch(): Promise<Reference>;
fetch(remote: string | Remote, options: Object | FetchOptions): Promise<void>;
configSnapshot(): Promise<Config>;
config(): Promise<Config>;
mergeBranches(to: string | Reference, from: string | Reference, signature?: Signature): Promise<Oid>;
}
}