-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnodegit.d.ts
More file actions
1975 lines (1758 loc) · 67.3 KB
/
nodegit.d.ts
File metadata and controls
1975 lines (1758 loc) · 67.3 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
declare namespace NodeGit {
export class AnnotatedCommit {
static fromFetchhead(repo: NodeGit.Repository, branch_name: string, remote_url: string, id: NodeGit.Oid): Promise<NodeGit.AnnotatedCommit>;
static fromRef(repo: NodeGit.Repository, ref: NodeGit.Reference): Promise<NodeGit.AnnotatedCommit>;
static fromRevspec(repo: NodeGit.Repository, revspec: string): Promise<NodeGit.AnnotatedCommit>;
static lookup(repo: NodeGit.Repository, id: NodeGit.Oid): Promise<NodeGit.AnnotatedCommit>;
free(): void;
id(): NodeGit.Oid;
}
namespace Attr {
enum STATES {
UNSPECIFIED_T = 0,
TRUE_T = 1,
FALSE_T = 2,
VALUE_T = 3
}
}
export class Attr {
static addMacro(repo: NodeGit.Repository, name: string, values: string): number;
static cacheFlush(repo: NodeGit.Repository): void;
static get(repo: NodeGit.Repository, flags: number, path: string, name: string): Promise<string>;
static getMany(repo: NodeGit.Repository, flags: number, path: string, num_attr: number, names: string): any[];
static value(attr: string): number;
}
namespace Blame {
enum FLAG {
NORMAL = 0,
TRACK_COPIES_SAME_FILE = 1,
TRACK_COPIES_SAME_COMMIT_MOVES = 2,
TRACK_COPIES_SAME_COMMIT_COPIES = 4,
TRACK_COPIES_ANY_COMMIT_COPIES = 8,
FIRST_PARENT = 16
}
}
export class Blame {
static file(repo: NodeGit.Repository, path: string, options?: NodeGit.BlameOptions): NodeGit.Blame;
static initOptions(opts: NodeGit.BlameOptions, version: number): number;
buffer(buffer: string, buffer_len: number): Promise<NodeGit.Blame>;
free(): void;
getHunkByIndex(index: number): NodeGit.BlameHunk;
getHunkByLine(lineno: number): NodeGit.BlameHunk;
getHunkCount(): number;
}
export class BlameHunk {
linesInHunk: number;
finalCommitId: NodeGit.Oid;
finalStartLineNumber: number;
finalSignature: NodeGit.Signature;
origCommitId: NodeGit.Oid;
origPath: string;
origStartLineNumber: number;
origSignature: NodeGit.Signature;
}
export interface BlameOptions {
version: number;
flags: number;
minMatchCharacters: number;
newestCommit: NodeGit.Oid;
oldestCommit: NodeGit.Oid;
minLine: number;
maxLine: number;
}
export class Blob {
static createFromBuffer(repo: NodeGit.Repository, buffer: Buffer, len: number): NodeGit.Oid;
static createFromDisk(id: NodeGit.Oid, repo: NodeGit.Repository, path: string): number;
static createFromWorkdir(id: NodeGit.Oid, repo: NodeGit.Repository, relative_path: string): number;
static lookup(repo: NodeGit.Repository, id: string | Oid | Blob): Promise<NodeGit.Blob>;
static lookupPrefix(repo: NodeGit.Repository, id: NodeGit.Oid, len: number): Promise<NodeGit.Blob>;
free(): void;
id(): NodeGit.Oid;
isBinary(): number;
owner(): NodeGit.Repository;
rawcontent(): Buffer;
rawsize(): number;
content(): Buffer;
toString(): string;
filemode(): number;
}
namespace Branch {
enum BRANCH {
LOCAL = 1,
REMOTE = 2,
ALL = 3
}
}
export class Branch {
static create(repo: NodeGit.Repository, branch_name: string, target: NodeGit.Commit, force: number): Promise<NodeGit.Reference>;
static createFromAnnotated(repository: NodeGit.Repository, branch_name: string, commit: NodeGit.AnnotatedCommit, force: number): Reference;
static delete(branch: NodeGit.Reference): number;
static isHead(branch: NodeGit.Reference): number;
static iteratorNew(repo: NodeGit.Repository, list_flags: number): Promise<NodeGit.BranchIterator>;
static lookup(repo: NodeGit.Repository, branch_name: string, branch_type: number): Promise<NodeGit.Reference>;
static move(branch: NodeGit.Reference, new_branch_name: string, force: number): Promise<NodeGit.Reference>;
static name(ref: NodeGit.Reference): Promise<string>;
static setUpstream(branch: NodeGit.Reference, upstream_name: string): Promise<number>;
static upstream(branch: NodeGit.Reference): Promise<NodeGit.Reference>;
}
export class BranchIterator {
}
export class Buf {
containsNul(): number;
free(): void;
grow(target_size: number): Promise<NodeGit.Buf>;
isBinary(): number;
set(data: Buffer, datalen: number): Promise<NodeGit.Buf>;
ptr: string;
asize: number;
size: number;
}
namespace Cert {
enum TYPE {
NONE = 0,
X509 = 1,
HOSTKEY_LIBSSH2 = 2,
STRARRAY = 3
}
enum SSH {
MD5 = 1,
SHA1 = 2
}
}
export class Cert {
certType: number;
}
export class CertHostkey {
certType: number;
type: number;
hashMd5: string;
hashSha1: string;
}
export class CertX509 {
certType: number;
data: Buffer;
len: number;
}
namespace Checkout {
enum NOTIFY {
NONE = 0,
CONFLICT = 1,
DIRTY = 2,
UPDATED = 4,
UNTRACKED = 8,
IGNORED = 16,
ALL = 65535
}
enum STRATEGY {
NONE = 0,
SAFE = 1,
FORCE = 2,
RECREATE_MISSING = 4,
ALLOW_CONFLICTS = 16,
REMOVE_UNTRACKED = 32,
REMOVE_IGNORED = 64,
UPDATE_ONLY = 128,
DONT_UPDATE_INDEX = 256,
NO_REFRESH = 512,
SKIP_UNMERGED = 1024,
USE_OURS = 2048,
USE_THEIRS = 4096,
DISABLE_PATHSPEC_MATCH = 8192,
SKIP_LOCKED_DIRECTORIES = 262144,
DONT_OVERWRITE_IGNORED = 524288,
CONFLICT_STYLE_MERGE = 1048576,
CONFLICT_STYLE_DIFF3 = 2097152,
DONT_REMOVE_EXISTING = 4194304,
DONT_WRITE_INDEX = 8388608,
UPDATE_SUBMODULES = 65536,
UPDATE_SUBMODULES_IF_CHANGED = 131072
}
}
export class Checkout {
static head(repo: NodeGit.Repository, options?: NodeGit.CheckoutOptions): Promise<void>;
static index(repo: NodeGit.Repository, The: NodeGit.Index, options?: NodeGit.CheckoutOptions): Promise<void>;
static initOptions(opts: NodeGit.CheckoutOptions, version: number): number;
static tree(repo: NodeGit.Repository, treeish: NodeGit.Oid | Tree | Commit | Reference, options?: NodeGit.CheckoutOptions): Promise<void>;
}
export interface CheckoutOptions {
version?: number;
checkoutStrategy?: number;
disableFilters?: number;
dirMode?: number;
fileMode?: number;
fileOpenFlags?: number;
notifyFlags?: number;
notifyCb?: any;
notifyPayload?: void;
progressCb?: any;
progressPayload?: void;
paths?: NodeGit.Strarray;
baseline?: NodeGit.Tree;
baselineIndex?: NodeGit.Index;
targetDirectory?: string;
ancestorLabel?: string;
ourLabel?: string;
theirLabel?: string;
perfdataCb?: any;
perfdataPayload?: void;
}
export class Cherrypick {
static cherrypick(repo: NodeGit.Repository, commit: NodeGit.Commit, options?: NodeGit.CherrypickOptions): Promise<number>;
static commit(repo: NodeGit.Repository, cherrypick_commit: NodeGit.Commit, our_commit: NodeGit.Commit, mainline: number, merge_options?: NodeGit.MergeOptions): Promise<number>;
static initOptions(opts: NodeGit.CherrypickOptions, version: number): number;
}
export interface CherrypickOptions {
version: number;
mainline: number;
mergeOpts: NodeGit.MergeOptions;
checkoutOpts: NodeGit.CheckoutOptions;
}
namespace Clone {
enum LOCAL {
AUTO = 0,
LOCAL = 1,
NO_LOCAL = 2,
NO_LINKS = 3
}
}
export class Clone {
static clone(url: string, local_path: string, options?: NodeGit.CloneOptions): Promise<NodeGit.Repository>;
static initOptions(opts: NodeGit.CloneOptions, version: number): number;
}
export interface CloneOptions {
version?: number;
checkoutOpts?: NodeGit.CheckoutOptions;
fetchOpts?: NodeGit.FetchOptions;
bare?: number;
local?: number;
checkoutBranch?: string;
repositoryCbPayload?: void;
remoteCbPayload?: void;
}
export interface EventEmitter extends NodeJS.EventEmitter {
start(): void;
}
export class Commit {
static create(repo: NodeGit.Repository, update_ref: string, author: NodeGit.Signature, committer: NodeGit.Signature, message_encoding: string, message: string, tree: NodeGit.Tree, parent_count: number, parents: any[]): Oid;
static createV(id: NodeGit.Oid, repo: NodeGit.Repository, update_ref: string, author: NodeGit.Signature, committer: NodeGit.Signature, message_encoding: string, message: string, tree: NodeGit.Tree, parent_count: number): number;
static lookup(repo: NodeGit.Repository, id: string | Oid | Commit): Promise<NodeGit.Commit>;
static lookupPrefix(repo: NodeGit.Repository, id: NodeGit.Oid, len: number): Promise<NodeGit.Commit>;
amend(update_ref: string, author: NodeGit.Signature, committer: NodeGit.Signature, message_encoding: string, message: string, tree: NodeGit.Tree): Oid;
author(): Signature;
committer(): Signature;
free(): void;
headerField(field: string): Promise<NodeGit.Buf>;
id(): Oid;
message(): string;
messageEncoding(): string;
messageRaw(): string;
nthGenAncestor(n: number): Promise<NodeGit.Commit>;
owner(): Repository;
parent(n: number): Promise<NodeGit.Commit>;
parentId(n: number): Oid;
parentcount(): number;
rawHeader(): string;
summary(): string;
time(): number;
timeOffset(): number;
tree(tree_out: NodeGit.Tree): number;
treeId(): Oid;
sha(): string;
timeMs(): number;
date(): Date;
getTree(): Promise<NodeGit.Tree>;
getEntry(path: string): Promise<NodeGit.TreeEntry>;
history(): EventEmitter;
getParents(limit: number, callback: Function): Promise<NodeGit.Commit[]>;
parents(callback: Function): Oid[];
getDiff(callback: Function): Promise<NodeGit.Diff[]>;
getDiffWithOptions(options: NodeGit.Object, callback: Function): Promise<NodeGit.Diff[]>;
toString(): string;
}
namespace Config {
enum LEVEL {
SYSTEM = 1,
XDG = 2,
GLOBAL = 3,
LOCAL = 4,
APP = 5,
HIGHEST_LEVEL = -1
}
}
export class Config {
static openDefault(): Promise<NodeGit.Config>;
getStringBuf(name: string): Promise<NodeGit.Buf>;
setInt64(name: string, value: number): number;
setMultivar(name: string, regexp: string, value: string): number;
setString(name: string, value: string): Promise<number>;
snapshot(): Promise<NodeGit.Config>;
}
export class ConfigEntry {
name: string;
value: string;
level: number;
free: void;
payload: void;
}
namespace Cred {
enum TYPE {
USERPASS_PLAINTEXT = 1,
SSH_KEY = 2,
SSH_CUSTOM = 4,
DEFAULT = 8,
SSH_INTERACTIVE = 16,
USERNAME = 32,
SSH_MEMORY = 64
}
}
export class Cred {
static defaultNew(): Cred;
static sshKeyFromAgent(username: string): Cred;
static sshKeyMemoryNew(username: string, publickey: string, privatekey: string, passphrase: string): Promise<NodeGit.Cred>;
static sshKeyNew(username: string, publickey: string, privatekey: string, passphrase: string): Cred;
static usernameNew(username: string): Promise<NodeGit.Cred>;
static userpassPlaintextNew(username: string, password: string): Cred;
hasUsername(): number;
}
export class CredDefault {
}
export class CredUsername {
parent: NodeGit.Cred;
username: string;
}
export class CredUserpassPayload {
username: string;
password: string;
}
namespace Enums {
enum CVAR {
FALSE = 0,
TRUE = 1,
INT32 = 2,
string = 3
}
enum DIRECTION {
FETCH = 0,
PUSH = 1
}
enum FEATURE {
THREADS = 1,
HTTPS = 2,
SSH = 4
}
enum IDXENTRY_EXTENDED_FLAG {
IDXENTRY_INTENT_TO_ADD = 8192,
IDXENTRY_SKIP_WORKTREE = 16384,
IDXENTRY_EXTENDED2 = 32768,
S = 24576,
IDXENTRY_UPDATE = 1,
IDXENTRY_REMOVE = 2,
IDXENTRY_UPTODATE = 4,
IDXENTRY_ADDED = 8,
IDXENTRY_HASHED = 16,
IDXENTRY_UNHASHED = 32,
IDXENTRY_WT_REMOVE = 64,
IDXENTRY_CONFLICTED = 128,
IDXENTRY_UNPACKED = 256,
IDXENTRY_NEW_SKIP_WORKTREE = 512
}
enum INDXENTRY_FLAG {
IDXENTRY_EXTENDED = 16384,
IDXENTRY_VALID = 32768
}
}
export class Enums {}
export class CvarMap {
cvarType: number;
strMatch: string;
mapValue: number;
}
namespace Diff {
enum DELTA {
UNMODIFIED = 0,
ADDED = 1,
DELETED = 2,
MODIFIED = 3,
RENAMED = 4,
COPIED = 5,
IGNORED = 6,
UNTRACKED = 7,
TYPECHANGE = 8,
UNREADABLE = 9,
CONFLICTED = 10
}
enum FIND {
BY_CONFIG = 0,
RENAMES = 1,
RENAMES_FROM_REWRITES = 2,
COPIES = 4,
COPIES_FROM_UNMODIFIED = 8,
REWRITES = 16,
BREAK_REWRITES = 32,
AND_BREAK_REWRITES = 48,
FOR_UNTRACKED = 64,
ALL = 255,
IGNORE_LEADING_WHITESPACE = 0,
IGNORE_WHITESPACE = 4096,
DONT_IGNORE_WHITESPACE = 8192,
EXACT_MATCH_ONLY = 16384,
BREAK_REWRITES_FOR_RENAMES_ONLY = 32768,
REMOVE_UNMODIFIED = 65536
}
enum FLAG {
BINARY = 1,
NOT_BINARY = 2,
VALID_ID = 4,
EXISTS = 8
}
enum FORMAT {
PATCH = 1,
PATCH_HEADER = 2,
RAW = 3,
NAME_ONLY = 4,
NAME_STATUS = 5
}
enum FORMAT_EMAIL_FLAGS {
FORMAT_EMAIL_NONE = 0,
FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = 1
}
enum LINE {
CONTEXT = 32,
ADDITION = 43,
DELETION = 45,
CONTEXT_EOFNL = 61,
ADD_EOFNL = 62,
DEL_EOFNL = 60,
FILE_HDR = 70,
HUNK_HDR = 72,
BINARY = 66
}
enum OPTION {
NORMAL = 0,
REVERSE = 1,
INCLUDE_IGNORED = 2,
RECURSE_IGNORED_DIRS = 4,
INCLUDE_UNTRACKED = 8,
RECURSE_UNTRACKED_DIRS = 16,
INCLUDE_UNMODIFIED = 32,
INCLUDE_TYPECHANGE = 64,
INCLUDE_TYPECHANGE_TREES = 128,
IGNORE_FILEMODE = 256,
IGNORE_SUBMODULES = 512,
IGNORE_CASE = 1024,
INCLUDE_CASECHANGE = 2048,
DISABLE_PATHSPEC_MATCH = 4096,
SKIP_BINARY_CHECK = 8192,
ENABLE_FAST_UNTRACKED_DIRS = 16384,
UPDATE_INDEX = 32768,
INCLUDE_UNREADABLE = 65536,
INCLUDE_UNREADABLE_AS_UNTRACKED = 131072,
FORCE_TEXT = 1048576,
FORCE_BINARY = 2097152,
IGNORE_WHITESPACE = 4194304,
IGNORE_WHITESPACE_CHANGE = 8388608,
IGNORE_WHITESPACE_EOL = 16777216,
SHOW_UNTRACKED_CONTENT = 33554432,
SHOW_UNMODIFIED = 67108864,
PATIENCE = 268435456,
MINIMAL = 536870912,
SHOW_BINARY = 1073741824
}
enum STATS_FORMAT {
STATS_NONE = 0,
STATS_FULL = 1,
STATS_SHORT = 2,
STATS_NUMBER = 4,
STATS_INCLUDE_SUMMARY = 8
}
}
export class Diff {
static blobToBuffer(old_blob: NodeGit.Blob, old_as_path: string, buffer: string, buffer_as_path: string, opts: NodeGit.DiffOptions, file_cb: Function, binary_cb: Function, hunk_cb: Function, line_cb: Function): Promise<any>;
static indexToWorkdir(repo: NodeGit.Repository, index: NodeGit.Index, opts: NodeGit.DiffOptions): Promise<NodeGit.Diff>;
static treeToIndex(repo: NodeGit.Repository, old_tree: NodeGit.Tree, index: NodeGit.Index, opts: NodeGit.DiffOptions): Promise<NodeGit.Diff>;
static treeToTree(repo: NodeGit.Repository, old_tree: NodeGit.Tree, new_tree: NodeGit.Tree, opts: NodeGit.DiffOptions): Promise<NodeGit.Diff>;
static treeToWorkdir(repo: NodeGit.Repository, old_tree: NodeGit.Tree, opts: NodeGit.DiffOptions): Promise<NodeGit.Diff>;
static treeToWorkdirWithIndex(repo: NodeGit.Repository, old_tree: NodeGit.Tree, opts: NodeGit.DiffOptions): Promise<NodeGit.Diff>;
findSimilar(options: NodeGit.DiffFindOptions): Promise<number>;
getDelta(idx: number): DiffDelta;
getPerfdata(): Promise<NodeGit.DiffPerfdata>;
numDeltas(): number;
patches(): Promise<any[]>;
}
export class DescribeFormatOptions {
version: number;
abbreviatedSize: number;
alwaysUseLongFormat: number;
dirtySuffix: string;
}
export class DescribeOptions {
version: number;
maxCandidatesTags: number;
describeStrategy: number;
pattern: string;
onlyFollowFirstParent: number;
showCommitOidAsFallback: number;
}
namespace DiffBinary {
enum DIFF_BINARY {
NONE = 0,
LITERAL = 1,
DELTA = 2
}
}
export class DiffBinary {
oldFile: NodeGit.DiffBinaryFile;
newFile: NodeGit.DiffBinaryFile;
}
export class DiffBinaryFile {
type: number;
data: string;
datalen: number;
inflatedlen: number;
}
export class DiffDelta {
status: number;
flags: number;
similarity: number;
nfiles: number;
oldFile: NodeGit.DiffFile;
newFile: NodeGit.DiffFile;
}
export class DiffFile {
flags(): number;
id(): Oid;
mode(): number;
path(): string;
size(): number;
}
export interface DiffFindOptions {
version: number;
flags: number;
renameThreshold: number;
renameFromRewriteThreshold: number;
copyThreshold: number;
breakRewriteThreshold: number;
renameLimit: number;
}
export class DiffHunk {
oldStart: number;
oldLines: number;
newStart: number;
newLines: number;
headerLen: number;
header: string;
}
export class DiffLine {
content(): string;
origin: number;
oldLineno: number;
newLineno: number;
numLines: number;
contentLen: number;
contentOffset: number;
}
export interface DiffOptions {
version: number;
flags: number;
ignoreSubmodules: number;
pathspec: NodeGit.Strarray;
notifyCb: Function;
notifyPayload: void;
contextLines: number;
interhunkLines: number;
idAbbrev: number;
maxSize: number;
oldPrefix: string;
newPrefix: string;
}
export class DiffPerfdata {
version: number;
statCalls: number;
oidCalculations: number;
}
export class DiffStats {
}
namespace Error {
enum ERROR {
GITERR_NONE = 0,
GITERR_NOMEMORY = 1,
GITERR_OS = 2,
GITERR_INVALID = 3,
GITERR_REFERENCE = 4,
GITERR_ZLIB = 5,
GITERR_REPOSITORY = 6,
GITERR_CONFIG = 7,
GITERR_REGEX = 8,
GITERR_ODB = 9,
GITERR_INDEX = 10,
GITERR_OBJECT = 11,
GITERR_NET = 12,
GITERR_TAG = 13,
GITERR_TREE = 14,
GITERR_INDEXER = 15,
GITERR_SSL = 16,
GITERR_SUBMODULE = 17,
GITERR_THREAD = 18,
GITERR_STASH = 19,
GITERR_CHECKOUT = 20,
GITERR_FETCHHEAD = 21,
GITERR_MERGE = 22,
GITERR_SSH = 23,
GITERR_FILTER = 24,
GITERR_REVERT = 25,
GITERR_CALLBACK = 26,
GITERR_CHERRYPICK = 27,
GITERR_DESCRIBE = 28,
GITERR_REBASE = 29,
GITERR_FILESYSTEM = 30
}
enum CODE {
OK = 0,
ERROR = -1,
ENOTFOUND = -3,
EEXISTS = -4,
EAMBIGUOUS = -5,
EBUFS = -6,
EUSER = -7,
EBAREREPO = -8,
EUNBORNBRANCH = -9,
EUNMERGED = -10,
ENONFASTFORWARD = -11,
EINVALIDSPEC = -12,
ECONFLICT = -13,
ELOCKED = -14,
EMODIFIED = -15,
EAUTH = -16,
ECERTIFICATE = -17,
EAPPLIED = -18,
EPEEL = -19,
EEOF = -20,
EINVALID = -21,
EUNCOMMITTED = -22,
EDIRECTORY = -23,
PASSTHROUGH = -30,
ITEROVER = -31
}
}
export class Error {
message: string;
klass: number;
}
namespace Fetch {
enum PRUNE {
GIT_FETCH_PRUNE_UNSPECIFIED = 0,
GIT_FETCH_PRUNE = 1,
GIT_FETCH_NO_PRUNE = 2
}
}
export class Fetch {
static initOptions(opts: NodeGit.FetchOptions, version: number): number;
}
export interface FetchOptions {
version?: number;
callbacks?: NodeGit.RemoteCallbacks;
prune?: number;
updateFetchhead?: number;
downloadTags?: number;
}
namespace TreeEntry {
enum FILEMODE {
UNREADABLE = 0,
TREE = 16384,
BLOB = 33188,
EXECUTABLE = 33261,
LINK = 40960,
COMMIT = 57344
}
}
export class TreeEntry {
isFile(): Boolean;
isTree(): Boolean;
isDirectory(): Boolean;
isBlob(): Boolean;
sha(): string;
getTree(): Promise<NodeGit.Tree>;
getBlob(): Promise<NodeGit.Blob>;
path(): string;
toString(): string;
attr: number;
oid: NodeGit.Oid;
filenameLen: number;
filename: string;
}
namespace Filter {
enum FLAG {
DEFAULT = 0,
ALLOW_UNSAFE = 1
}
enum MODE {
TO_WORKTREE = 0,
SMUDGE = 0,
TO_ODB = 1,
CLEAN = 1
}
}
export class Filter {
static listContains(filters: NodeGit.FilterList, name: string): number;
static listLength(fl: NodeGit.FilterList): number;
static listNew(repo: NodeGit.Repository, mode: number, options: number): Promise<NodeGit.FilterList>;
static listStreamBlob(filters: NodeGit.FilterList, blob: NodeGit.Blob, target: NodeGit.Writestream): number;
static listStreamData(filters: NodeGit.FilterList, data: NodeGit.Buf, target: NodeGit.Writestream): number;
static listStreamFile(filters: NodeGit.FilterList, repo: NodeGit.Repository, path: string, target: NodeGit.Writestream): number;
static unregister(name: string): number;
lookup(name: string): Filter;
register(name: string, priority: number): number;
version: number;
attributes: string;
stream: Function;
}
export class FilterList {
}
export class Giterr {
static errClear(): void;
static errDetach(cpy: NodeGit.Error): number;
static errLast(): Error;
static errSetOom(): void;
static errSetString(error_class: number, string: string): void;
}
export class Graph {
static aheadBehind(repo: NodeGit.Repository, local: NodeGit.Oid, upstream: NodeGit.Oid): Promise<number>;
static descendantOf(repo: NodeGit.Repository, commit: NodeGit.Oid, ancestor: NodeGit.Oid): Promise<number>;
}
namespace Hashsig {
enum OPTION {
NORMAL = 0,
IGNORE_WHITESPACE = 1,
SMART_WHITESPACE = 2,
ALLOW_SMALL_FILES = 4
}
}
export class Hashsig {
static create(buf: string, buflen: number, opts: number): Promise<NodeGit.Hashsig>;
static createFromFile(path: string, opts: number): Promise<NodeGit.Hashsig>;
compare(b: NodeGit.Hashsig): number;
free(): void;
}
export class Ignore {
static addRule(repo: NodeGit.Repository, rules: string): number;
static clearInternalRules(repo: NodeGit.Repository): number;
static pathIsIgnored(repo: NodeGit.Repository, path: string): Promise<number>;
}
namespace Index {
enum ADD_OPTION {
ADD_DEFAULT = 0,
ADD_FORCE = 1,
ADD_DISABLE_PATHSPEC_MATCH = 2,
ADD_CHECK_PATHSPEC = 4
}
enum CAP {
IGNORE_CASE = 1,
NO_FILEMODE = 2,
NO_SYMLINKS = 4,
FROM_OWNER = -1
}
}
export class Index {
static entryIsConflict(entry: NodeGit.IndexEntry): number;
static entryStage(entry: NodeGit.IndexEntry): number;
static open(index_path: string): Promise<NodeGit.Index>;
add(source_entry: NodeGit.IndexEntry): number;
addAll(pathspec: NodeGit.Strarray, flags: number, callback: Function, payload: void): Promise<number>;
addByPath(path: string): number;
caps(): number;
checksum(): Oid;
clear(): number;
conflictAdd(ancestor_entry: NodeGit.IndexEntry, our_entry: NodeGit.IndexEntry, their_entry: NodeGit.IndexEntry): number;
conflictCleanup(): number;
conflictGet(path: string): Promise<NodeGit.IndexEntry>;
conflictRemove(path: string): number;
entryCount(): number;
getByIndex(n: number): IndexEntry;
getByPath(path: string, stage: number): IndexEntry;
hasConflicts(): number;
owner(): Repository;
path(): string;
read(force: number): number;
readTree(tree: NodeGit.Tree): number;
remove(path: string, stage: number): number;
removeAll(pathspec: NodeGit.Strarray, callback: Function, payload: void): Promise<number>;
removeByPath(path: string): number;
removeDirectory(dir: string, stage: number): number;
setCaps(caps: number): number;
updateAll(pathspec: NodeGit.Strarray, callback: Function, payload: void): Promise<number>;
write(): number;
writeTree(): Promise<NodeGit.Oid>;
writeTreeTo(repo: NodeGit.Repository): Promise<NodeGit.Oid>;
entries(): IndexEntry[];
}
export class IndexConflictIterator {}
export interface IndexEntry {
ctime: NodeGit.IndexTime;
mtime: NodeGit.IndexTime;
dev: number;
ino: number;
mode: number;
uid: number;
gid: number;
fileSize: number;
id: NodeGit.Oid;
flags: number;
flagsExtended: number;
path: string;
}
export class IndexTime {
seconds: number;
nanoseconds: number;
}
export class Indexer {
commit(stats: NodeGit.TransferProgress): number;
free(): void;
hash(): Oid;
}
namespace Libgit2 {
enum OPT {
GET_MWINDOW_SIZE = 0,
SET_MWINDOW_SIZE = 1,
GET_MWINDOW_MAPPED_LIMIT = 2,
SET_MWINDOW_MAPPED_LIMIT = 3,
GET_SEARCH_PATH = 4,
SET_SEARCH_PATH = 5,
SET_CACHE_OBJECT_LIMIT = 6,
SET_CACHE_MAX_SIZE = 7,
ENABLE_CACHING = 8,
GET_CACHED_MEMORY = 9,
GET_TEMPLATE_PATH = 10,
SET_TEMPLATE_PATH = 11,
SET_SSL_CERT_LOCATIONS = 12
}
}
export class Libgit2 {
static features(): number;
static init(): number;
static opts(option: number): number;
static shutdown(): number;
static version(major: number, minor: number, rev: number): void;
}
export class Mempack {}
namespace Merge {
enum ANALYSIS {
NONE = 0,
NORMAL = 1,
UP_TO_DATE = 2,
FASTFORWARD = 4,
UNBORN = 8
}
enum FILE_FAVOR {
NORMAL = 0,
OURS = 1,
THEIRS = 2,
UNION = 3
}
enum FILE_FLAGS {
FILE_DEFAULT = 0,
FILE_STYLE_MERGE = 1,
FILE_STYLE_DIFF3 = 2,
FILE_SIMPLIFY_ALNUM = 4,
FILE_IGNORE_WHITESPACE = 8,
FILE_IGNORE_WHITESPACE_CHANGE = 16,
FILE_IGNORE_WHITESPACE_EOL = 32,
FILE_DIFF_PATIENCE = 64,
FILE_DIFF_MINIMAL = 128
}
enum PREFERENCE {
NONE = 0,
NO_FASTFORWARD = 1,
FASTFORWARD_ONLY = 2
}
enum TREE_FLAG {
TREE_FIND_RENAMES = 1
}
}
export class Merge {
static merge(repo: NodeGit.Repository, theirHead: NodeGit.AnnotatedCommit, mergeOpts?: NodeGit.MergeOptions, checkoutOpts?: NodeGit.CheckoutOptions): any;
static base(repo: NodeGit.Repository, one: NodeGit.Oid, two: NodeGit.Oid): Promise<NodeGit.Oid>;
static bases(repo: NodeGit.Repository, one: NodeGit.Oid, two: NodeGit.Oid): Promise<NodeGit.Oidarray>;
static commits(repo: NodeGit.Repository, ourCommit: NodeGit.Commit, theirCommit: NodeGit.Commit, options?: NodeGit.MergeOptions): any;
static fileInitInput(opts: NodeGit.MergeFileInput, version: number): number;
static initOptions(opts: NodeGit.MergeOptions, version: number): number;
static trees(repo: NodeGit.Repository, ancestor_tree: NodeGit.Tree, our_tree: NodeGit.Tree, their_tree: NodeGit.Tree, opts: NodeGit.MergeOptions): Promise<NodeGit.Index>;
}
export interface MergeFileInput {
version: number;
ptr: string;
size: number;
path: string;
mode: number;
}
export interface MergeFileOptions {
version: number;
ancestorLabel: string;
ourLabel: string;
theirLabel: string;