es-git 0.2.0-next.113 → 0.2.0-next.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +514 -0
- package/index.js +8 -1
- package/package.json +11 -11
package/index.d.ts
CHANGED
|
@@ -3,6 +3,72 @@
|
|
|
3
3
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Represents a hunk of a blame operation, which is a range of lines
|
|
8
|
+
* and information about who last modified them.
|
|
9
|
+
*/
|
|
10
|
+
export interface BlameHunk {
|
|
11
|
+
/** The oid of the commit where this line was last changed. */
|
|
12
|
+
finalCommitId: string
|
|
13
|
+
/** The 1-based line number in the final file where this hunk starts. */
|
|
14
|
+
finalStartLineNumber: number
|
|
15
|
+
/** The number of lines in this hunk. */
|
|
16
|
+
linesInHunk: number
|
|
17
|
+
/** The signature of the commit where this line was last changed. */
|
|
18
|
+
finalSignature?: Signature
|
|
19
|
+
/** The path to the file where this line was originally written. */
|
|
20
|
+
path?: string
|
|
21
|
+
/** The 1-based line number in the original file where this hunk starts. */
|
|
22
|
+
origStartLineNumber: number
|
|
23
|
+
/** The oid of the commit where this line was originally written. */
|
|
24
|
+
origCommitId: string
|
|
25
|
+
/** The signature of the commit where this line was originally written. */
|
|
26
|
+
origSignature?: Signature
|
|
27
|
+
/**
|
|
28
|
+
* True if the hunk has been determined to be a boundary commit (the commit
|
|
29
|
+
* when the file was first introduced to the repository).
|
|
30
|
+
*/
|
|
31
|
+
isBoundary: boolean
|
|
32
|
+
}
|
|
33
|
+
/** Options for controlling blame behavior */
|
|
34
|
+
export interface BlameOptions {
|
|
35
|
+
/** The minimum line number to blame (1-based index) */
|
|
36
|
+
minLine?: number
|
|
37
|
+
/** The maximum line number to blame (1-based index) */
|
|
38
|
+
maxLine?: number
|
|
39
|
+
/**
|
|
40
|
+
* The oid of the newest commit to consider. The blame algorithm will stop
|
|
41
|
+
* when this commit is reached.
|
|
42
|
+
*/
|
|
43
|
+
newestCommit?: string
|
|
44
|
+
/**
|
|
45
|
+
* The oid of the oldest commit to consider. The blame algorithm will
|
|
46
|
+
* stop when this commit is reached.
|
|
47
|
+
*/
|
|
48
|
+
oldestCommit?: string
|
|
49
|
+
/**
|
|
50
|
+
* The path to the file being worked on. Path has to be relative to the
|
|
51
|
+
* repo root.
|
|
52
|
+
*/
|
|
53
|
+
path?: string
|
|
54
|
+
/**
|
|
55
|
+
* Track lines that have moved within a file. This is the git-blame -M
|
|
56
|
+
* option.
|
|
57
|
+
*/
|
|
58
|
+
trackLinesMovement?: boolean
|
|
59
|
+
/** Restrict search to commits reachable following only first parents. */
|
|
60
|
+
firstParent?: boolean
|
|
61
|
+
/** Ignore whitespace differences. */
|
|
62
|
+
ignoreWhitespace?: boolean
|
|
63
|
+
/** Track lines that have been copied from another file that exists in any commit. */
|
|
64
|
+
trackCopiesAnyCommitCopies?: boolean
|
|
65
|
+
/** Track lines that have been copied from another file that exists in the same commit. */
|
|
66
|
+
trackCopiesSameCommitCopies?: boolean
|
|
67
|
+
/** Track lines that have moved across files in the same commit. */
|
|
68
|
+
trackCopiesSameCommitMoves?: boolean
|
|
69
|
+
/** Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses. */
|
|
70
|
+
useMailmap?: boolean
|
|
71
|
+
}
|
|
6
72
|
/**
|
|
7
73
|
* Ensure the branch name is well-formed.
|
|
8
74
|
*
|
|
@@ -1376,6 +1442,66 @@ export interface SignaturePayload {
|
|
|
1376
1442
|
email: string
|
|
1377
1443
|
timeOptions?: SignatureTimeOptions
|
|
1378
1444
|
}
|
|
1445
|
+
export interface Status {
|
|
1446
|
+
current: boolean
|
|
1447
|
+
indexNew: boolean
|
|
1448
|
+
indexModified: boolean
|
|
1449
|
+
indexDeleted: boolean
|
|
1450
|
+
indexRenamed: boolean
|
|
1451
|
+
indexTypechange: boolean
|
|
1452
|
+
wtNew: boolean
|
|
1453
|
+
wtModified: boolean
|
|
1454
|
+
wtDeleted: boolean
|
|
1455
|
+
wtTypechange: boolean
|
|
1456
|
+
wtRenamed: boolean
|
|
1457
|
+
ignored: boolean
|
|
1458
|
+
conflicted: boolean
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* - `Index` : Only gives status based on HEAD to index comparison, not looking at
|
|
1462
|
+
* working directory changes.
|
|
1463
|
+
* - `Workdir` : Only gives status based on index to working directory comparison, not
|
|
1464
|
+
* comparing the index to the HEAD.
|
|
1465
|
+
* - `IndexAndWorkdi` : The default, this roughly matches `git status --porcelain` regarding
|
|
1466
|
+
* which files are included and in what order.
|
|
1467
|
+
*/
|
|
1468
|
+
export type StatusShow = 'Index' | 'Workdir' | 'IndexAndWorkdir';
|
|
1469
|
+
export interface StatusOptions {
|
|
1470
|
+
/**
|
|
1471
|
+
* Select the files on which to report status.
|
|
1472
|
+
* The default, if unspecified, is to show the index and the working directory.
|
|
1473
|
+
*/
|
|
1474
|
+
show?: StatusShow
|
|
1475
|
+
/**
|
|
1476
|
+
* Path patterns to match (using fnmatch-style matching).
|
|
1477
|
+
* If the `disablePathspecMatch` option is given, then this is a literal
|
|
1478
|
+
* path to match. If this is not called, then there will be no patterns to
|
|
1479
|
+
* match and the entire directory will be used.
|
|
1480
|
+
*/
|
|
1481
|
+
pathspecs?: Array<string>
|
|
1482
|
+
/**
|
|
1483
|
+
* Flag whether untracked files will be included.
|
|
1484
|
+
* Untracked files will only be included if the workdir files are included
|
|
1485
|
+
* in the status "show" option.
|
|
1486
|
+
*/
|
|
1487
|
+
includeUntracked?: boolean
|
|
1488
|
+
includeIgnored?: boolean
|
|
1489
|
+
includeUnmodified?: boolean
|
|
1490
|
+
excludeSubmodules?: boolean
|
|
1491
|
+
recurseUntrackedDirs?: boolean
|
|
1492
|
+
disablePathspecMatch?: boolean
|
|
1493
|
+
recurseIgnoredDirs?: boolean
|
|
1494
|
+
renamesHeadToIndex?: boolean
|
|
1495
|
+
renamesIndexToWorkdir?: boolean
|
|
1496
|
+
sortCaseSensitively?: boolean
|
|
1497
|
+
sortCaseInsensitively?: boolean
|
|
1498
|
+
renamesFromRewrites?: boolean
|
|
1499
|
+
noRefresh?: boolean
|
|
1500
|
+
updateIndex?: boolean
|
|
1501
|
+
includeUnreadable?: boolean
|
|
1502
|
+
includeUnreadableAsUntracked?: boolean
|
|
1503
|
+
renameThreshold?: number
|
|
1504
|
+
}
|
|
1379
1505
|
/**
|
|
1380
1506
|
* Determine whether a tag name is valid, meaning that (when prefixed with refs/tags/) that
|
|
1381
1507
|
* it is a valid reference name, and that any additional tag name restrictions are imposed
|
|
@@ -1420,6 +1546,146 @@ export interface CreateLightweightTagOptions {
|
|
|
1420
1546
|
* - `PostOrder` : Runs the traversal in post-order.
|
|
1421
1547
|
*/
|
|
1422
1548
|
export type TreeWalkMode = 'PreOrder' | 'PostOrder';
|
|
1549
|
+
/** A wrapper around git2::Blame providing Node.js bindings */
|
|
1550
|
+
export declare class Blame {
|
|
1551
|
+
/**
|
|
1552
|
+
* Gets the number of hunks in the blame result
|
|
1553
|
+
*
|
|
1554
|
+
* @category Blame/Methods
|
|
1555
|
+
* @signature
|
|
1556
|
+
* ```ts
|
|
1557
|
+
* class Blame {
|
|
1558
|
+
* getHunkCount(): number;
|
|
1559
|
+
* }
|
|
1560
|
+
* ```
|
|
1561
|
+
*
|
|
1562
|
+
* @returns The number of hunks in the blame result
|
|
1563
|
+
*/
|
|
1564
|
+
getHunkCount(): number
|
|
1565
|
+
/**
|
|
1566
|
+
* Checks if the blame result is empty
|
|
1567
|
+
*
|
|
1568
|
+
* @category Blame/Methods
|
|
1569
|
+
* @signature
|
|
1570
|
+
* ```ts
|
|
1571
|
+
* class Blame {
|
|
1572
|
+
* isEmpty(): boolean;
|
|
1573
|
+
* }
|
|
1574
|
+
* ```
|
|
1575
|
+
*
|
|
1576
|
+
* @returns True if the blame result contains no hunks
|
|
1577
|
+
*/
|
|
1578
|
+
isEmpty(): boolean
|
|
1579
|
+
/**
|
|
1580
|
+
* Gets blame information for the specified index
|
|
1581
|
+
*
|
|
1582
|
+
* @category Blame/Methods
|
|
1583
|
+
* @signature
|
|
1584
|
+
* ```ts
|
|
1585
|
+
* class Blame {
|
|
1586
|
+
* getHunkByIndex(index: number): BlameHunk;
|
|
1587
|
+
* }
|
|
1588
|
+
* ```
|
|
1589
|
+
*
|
|
1590
|
+
* @param {number} index - Index of the hunk to get (0-based)
|
|
1591
|
+
* @returns Blame information for the specified index
|
|
1592
|
+
* @throws If no hunk is found at the index
|
|
1593
|
+
*/
|
|
1594
|
+
getHunkByIndex(index: number): BlameHunk
|
|
1595
|
+
/**
|
|
1596
|
+
* Gets blame information for the specified line
|
|
1597
|
+
*
|
|
1598
|
+
* @category Blame/Methods
|
|
1599
|
+
* @signature
|
|
1600
|
+
* ```ts
|
|
1601
|
+
* class Blame {
|
|
1602
|
+
* getHunkByLine(line: number): BlameHunk;
|
|
1603
|
+
* }
|
|
1604
|
+
* ```
|
|
1605
|
+
*
|
|
1606
|
+
* @param {number} line - Line number to get blame information for (1-based)
|
|
1607
|
+
* @returns Blame information for the specified line
|
|
1608
|
+
* @throws If no hunk is found for the line
|
|
1609
|
+
*/
|
|
1610
|
+
getHunkByLine(line: number): BlameHunk
|
|
1611
|
+
/**
|
|
1612
|
+
* Gets all blame hunks as an iterator
|
|
1613
|
+
*
|
|
1614
|
+
* @category Blame/Methods
|
|
1615
|
+
* @signature
|
|
1616
|
+
* ```ts
|
|
1617
|
+
* class Blame {
|
|
1618
|
+
* iter(): Generator<BlameHunk>;
|
|
1619
|
+
* }
|
|
1620
|
+
* ```
|
|
1621
|
+
*
|
|
1622
|
+
* @returns Iterator of all blame hunks
|
|
1623
|
+
* @example
|
|
1624
|
+
* ```ts
|
|
1625
|
+
* // Using for...of loop
|
|
1626
|
+
* for (const hunk of blame.iter()) {
|
|
1627
|
+
* console.log(hunk.finalCommitId);
|
|
1628
|
+
* }
|
|
1629
|
+
*
|
|
1630
|
+
* // Using spread operator to collect all hunks
|
|
1631
|
+
* const hunks = [...blame.iter()];
|
|
1632
|
+
* ```
|
|
1633
|
+
*/
|
|
1634
|
+
iter(): BlameHunks
|
|
1635
|
+
/**
|
|
1636
|
+
* Collects blame hunks by scanning file lines as an iterator
|
|
1637
|
+
*
|
|
1638
|
+
* @category Blame/Methods
|
|
1639
|
+
* @signature
|
|
1640
|
+
* ```ts
|
|
1641
|
+
* class Blame {
|
|
1642
|
+
* iterByLine(): Generator<BlameHunk>;
|
|
1643
|
+
* }
|
|
1644
|
+
* ```
|
|
1645
|
+
*
|
|
1646
|
+
* @returns Iterator of blame hunks collected by line scanning
|
|
1647
|
+
* @example
|
|
1648
|
+
* ```ts
|
|
1649
|
+
* // Using for...of loop
|
|
1650
|
+
* for (const hunk of blame.iterByLine()) {
|
|
1651
|
+
* console.log(hunk.finalCommitId);
|
|
1652
|
+
* }
|
|
1653
|
+
*
|
|
1654
|
+
* // Using spread operator to collect all hunks
|
|
1655
|
+
* const hunks = [...blame.iterByLine()];
|
|
1656
|
+
* ```
|
|
1657
|
+
*/
|
|
1658
|
+
iterByLine(): BlameHunksByLine
|
|
1659
|
+
/**
|
|
1660
|
+
* Generates blame information from an in-memory buffer
|
|
1661
|
+
*
|
|
1662
|
+
* @category Blame/Methods
|
|
1663
|
+
* @signature
|
|
1664
|
+
* ```ts
|
|
1665
|
+
* class Blame {
|
|
1666
|
+
* buffer(buffer: Buffer): Blame;
|
|
1667
|
+
* }
|
|
1668
|
+
* ```
|
|
1669
|
+
*
|
|
1670
|
+
* @example
|
|
1671
|
+
* ```ts
|
|
1672
|
+
* const buffer = Buffer.from('modified content');
|
|
1673
|
+
* const bufferBlame = blame.buffer(buffer);
|
|
1674
|
+
* ```
|
|
1675
|
+
*
|
|
1676
|
+
* @param {Buffer} buffer - Buffer containing file content to blame
|
|
1677
|
+
* @returns A new Blame object for the buffer content
|
|
1678
|
+
*/
|
|
1679
|
+
buffer(buffer: Buffer): Blame
|
|
1680
|
+
}
|
|
1681
|
+
/** An iterator over blame hunks. */
|
|
1682
|
+
export declare class BlameHunks {
|
|
1683
|
+
[Symbol.iterator](): Iterator<BlameHunk, void, void>
|
|
1684
|
+
}
|
|
1685
|
+
/** Iterator over blame hunks collected line by line. */
|
|
1686
|
+
export declare class BlameHunksByLine {
|
|
1687
|
+
[Symbol.iterator](): Iterator<BlameHunk, void, void>
|
|
1688
|
+
}
|
|
1423
1689
|
/**
|
|
1424
1690
|
* A class to represent a git [blob][1].
|
|
1425
1691
|
* [1]: https://git-scm.com/book/en/Git-Internals-Git-Objects
|
|
@@ -3413,6 +3679,35 @@ export declare class Remote {
|
|
|
3413
3679
|
* This class corresponds to a git repository in libgit2.
|
|
3414
3680
|
*/
|
|
3415
3681
|
export declare class Repository {
|
|
3682
|
+
/**
|
|
3683
|
+
* Creates a blame object for the file at the given path
|
|
3684
|
+
*
|
|
3685
|
+
* @category Repository/Methods
|
|
3686
|
+
* @signature
|
|
3687
|
+
* ```ts
|
|
3688
|
+
* class Repository {
|
|
3689
|
+
* blameFile(path: string, options?: BlameOptions): Blame;
|
|
3690
|
+
* }
|
|
3691
|
+
* ```
|
|
3692
|
+
*
|
|
3693
|
+
* @example
|
|
3694
|
+
* ```ts
|
|
3695
|
+
* // Blame the entire file
|
|
3696
|
+
* const blame = repo.blameFile('path/to/file.js');
|
|
3697
|
+
*
|
|
3698
|
+
* // Blame a single line
|
|
3699
|
+
* const lineBlame = repo.blameFile('path/to/file.js', { minLine: 10, maxLine: 10 });
|
|
3700
|
+
*
|
|
3701
|
+
* // Blame a range of lines
|
|
3702
|
+
* const rangeBlame = repo.blameFile('path/to/file.js', { minLine: 5, maxLine: 15 });
|
|
3703
|
+
* ```
|
|
3704
|
+
*
|
|
3705
|
+
* @param {string} path - Path to the file to blame
|
|
3706
|
+
* @param {BlameOptions} [options] - Options to control blame behavior
|
|
3707
|
+
* @returns Blame object for the specified file
|
|
3708
|
+
* @throws If the file doesn't exist or can't be opened
|
|
3709
|
+
*/
|
|
3710
|
+
blameFile(path: string, options?: BlameOptions | undefined | null): Blame
|
|
3416
3711
|
/**
|
|
3417
3712
|
* Create a new branch pointing at a target commit
|
|
3418
3713
|
*
|
|
@@ -4079,6 +4374,108 @@ export declare class Repository {
|
|
|
4079
4374
|
* @returns Revwalk to traverse the commit graph in this repository.
|
|
4080
4375
|
*/
|
|
4081
4376
|
revwalk(): Revwalk
|
|
4377
|
+
/**
|
|
4378
|
+
* Test if the ignore rules apply to a given file.
|
|
4379
|
+
*
|
|
4380
|
+
* This function checks the ignore rules to see if they would apply to the
|
|
4381
|
+
* given file. This indicates if the file would be ignored regardless of
|
|
4382
|
+
* whether the file is already in the index or committed to the repository.
|
|
4383
|
+
*
|
|
4384
|
+
* One way to think of this is if you were to do "git add ." on the
|
|
4385
|
+
* directory containing the file, would it be added or not?
|
|
4386
|
+
*
|
|
4387
|
+
* @category Repository/Methods
|
|
4388
|
+
* @signature
|
|
4389
|
+
* ```ts
|
|
4390
|
+
* class Repository {
|
|
4391
|
+
* statusShouldIgnore(path: string): boolean;
|
|
4392
|
+
* }
|
|
4393
|
+
* ```
|
|
4394
|
+
*
|
|
4395
|
+
* @param {string} path - A given file path.
|
|
4396
|
+
* @returns Returns `true` if the ignore rules apply to a given file.
|
|
4397
|
+
*/
|
|
4398
|
+
statusShouldIgnore(path: string): boolean
|
|
4399
|
+
/**
|
|
4400
|
+
* Get file status for a single file.
|
|
4401
|
+
*
|
|
4402
|
+
* This tries to get status for the filename that you give. If no files
|
|
4403
|
+
* match that name (in either the HEAD, index, or working directory), this
|
|
4404
|
+
* returns NotFound.
|
|
4405
|
+
*
|
|
4406
|
+
* If the name matches multiple files (for example, if the path names a
|
|
4407
|
+
* directory or if running on a case- insensitive filesystem and yet the
|
|
4408
|
+
* HEAD has two entries that both match the path), then this returns
|
|
4409
|
+
* Ambiguous because it cannot give correct results.
|
|
4410
|
+
*
|
|
4411
|
+
* This does not do any sort of rename detection. Renames require a set of
|
|
4412
|
+
* targets and because of the path filtering, there is not enough
|
|
4413
|
+
* information to check renames correctly. To check file status with rename
|
|
4414
|
+
* detection, there is no choice but to do a full `statuses` and scan
|
|
4415
|
+
* through looking for the path that you are interested in.
|
|
4416
|
+
*
|
|
4417
|
+
* @category Repository/Methods
|
|
4418
|
+
* @signature
|
|
4419
|
+
* ```ts
|
|
4420
|
+
* class Repository {
|
|
4421
|
+
* getStatusFile(path: string): Status;
|
|
4422
|
+
* }
|
|
4423
|
+
* ```
|
|
4424
|
+
*
|
|
4425
|
+
* @param {string} path - A single file path.
|
|
4426
|
+
* @returns The `Status` of this single file.
|
|
4427
|
+
* @throws Throws error if the status file does not exist.
|
|
4428
|
+
*/
|
|
4429
|
+
getStatusFile(path: string): Status
|
|
4430
|
+
/**
|
|
4431
|
+
* Get file status for a single file.
|
|
4432
|
+
*
|
|
4433
|
+
* This tries to get status for the filename that you give. If no files
|
|
4434
|
+
* match that name (in either the HEAD, index, or working directory), this
|
|
4435
|
+
* returns NotFound.
|
|
4436
|
+
*
|
|
4437
|
+
* If the name matches multiple files (for example, if the path names a
|
|
4438
|
+
* directory or if running on a case- insensitive filesystem and yet the
|
|
4439
|
+
* HEAD has two entries that both match the path), then this returns
|
|
4440
|
+
* Ambiguous because it cannot give correct results.
|
|
4441
|
+
*
|
|
4442
|
+
* This does not do any sort of rename detection. Renames require a set of
|
|
4443
|
+
* targets and because of the path filtering, there is not enough
|
|
4444
|
+
* information to check renames correctly. To check file status with rename
|
|
4445
|
+
* detection, there is no choice but to do a full `statuses` and scan
|
|
4446
|
+
* through looking for the path that you are interested in.
|
|
4447
|
+
*
|
|
4448
|
+
* @category Repository/Methods
|
|
4449
|
+
* @signature
|
|
4450
|
+
* ```ts
|
|
4451
|
+
* class Repository {
|
|
4452
|
+
* findStatusFile(path: string): Status | null;
|
|
4453
|
+
* }
|
|
4454
|
+
* ```
|
|
4455
|
+
*
|
|
4456
|
+
* @param {string} path - A single file path.
|
|
4457
|
+
* @returns The `Status` of this single file. If the status file does not exists, returns `null`.
|
|
4458
|
+
*/
|
|
4459
|
+
findStatusFile(path: string): Status | null
|
|
4460
|
+
/**
|
|
4461
|
+
* Gather file status information and populate the returned structure.
|
|
4462
|
+
*
|
|
4463
|
+
* Note that if a pathspec is given in the options to filter the
|
|
4464
|
+
* status, then the results from rename detection (if you enable it) may
|
|
4465
|
+
* not be accurate. To do rename detection properly, this must be called
|
|
4466
|
+
* with no pathspec so that all files can be considered.
|
|
4467
|
+
*
|
|
4468
|
+
* @category Repository/Methods
|
|
4469
|
+
* @signature
|
|
4470
|
+
* ```ts
|
|
4471
|
+
* class Repository {
|
|
4472
|
+
* statuses(): Statuses;
|
|
4473
|
+
* }
|
|
4474
|
+
* ```
|
|
4475
|
+
*
|
|
4476
|
+
* @returns A container for a list of status information about a repository.
|
|
4477
|
+
*/
|
|
4478
|
+
statuses(): Statuses
|
|
4082
4479
|
/**
|
|
4083
4480
|
* Lookup a tag object by prefix hash from the repository.
|
|
4084
4481
|
*
|
|
@@ -4524,6 +4921,123 @@ export declare class Revwalk {
|
|
|
4524
4921
|
*/
|
|
4525
4922
|
hideRef(reference: string): this
|
|
4526
4923
|
}
|
|
4924
|
+
/**
|
|
4925
|
+
* A container for a list of status information about a repository.
|
|
4926
|
+
*
|
|
4927
|
+
* Each instance appears as if it were a collection, having a length and
|
|
4928
|
+
* allowing indexing, as well as providing an iterator.
|
|
4929
|
+
*/
|
|
4930
|
+
export declare class Statuses {
|
|
4931
|
+
/**
|
|
4932
|
+
* Gets a status entry from this list at the specified index.
|
|
4933
|
+
*
|
|
4934
|
+
* @category Status/Statuses
|
|
4935
|
+
* @signature
|
|
4936
|
+
* ```ts
|
|
4937
|
+
* class Statuses {
|
|
4938
|
+
* get(index: number): StatusEntry | null;
|
|
4939
|
+
* }
|
|
4940
|
+
* ```
|
|
4941
|
+
*
|
|
4942
|
+
* @param {number} index - Index of the status entry to get.
|
|
4943
|
+
* @returns A status entry from this list at the specified index. Returns `null` if the status
|
|
4944
|
+
* entry does not exist.
|
|
4945
|
+
*/
|
|
4946
|
+
get(index: number): StatusEntry | null
|
|
4947
|
+
/**
|
|
4948
|
+
* Gets the count of status entries in this list.
|
|
4949
|
+
*
|
|
4950
|
+
* @category Status/Statuses
|
|
4951
|
+
* @signature
|
|
4952
|
+
* ```ts
|
|
4953
|
+
* class Statuses {
|
|
4954
|
+
* len(): number;
|
|
4955
|
+
* }
|
|
4956
|
+
* ```
|
|
4957
|
+
*
|
|
4958
|
+
* @returns If there are no changes in status (according to the options given
|
|
4959
|
+
* when the status list was created), this should return 0.
|
|
4960
|
+
*/
|
|
4961
|
+
len(): bigint
|
|
4962
|
+
/**
|
|
4963
|
+
* @category Status/Statuses
|
|
4964
|
+
* @signature
|
|
4965
|
+
* ```ts
|
|
4966
|
+
* class Statuses {
|
|
4967
|
+
* isEmpty(): boolean;
|
|
4968
|
+
* }
|
|
4969
|
+
* ```
|
|
4970
|
+
*
|
|
4971
|
+
* @returns Return `true` if there is no status entry in this list.
|
|
4972
|
+
*/
|
|
4973
|
+
isEmpty(): boolean
|
|
4974
|
+
/** Returns an iterator over the statuses in this list. */
|
|
4975
|
+
iter(): StatusesIter
|
|
4976
|
+
}
|
|
4977
|
+
export declare class StatusesIter {
|
|
4978
|
+
[Symbol.iterator](): Iterator<StatusEntry, void, void>
|
|
4979
|
+
}
|
|
4980
|
+
/** A structure representing an entry in the `Statuses` structure. */
|
|
4981
|
+
export declare class StatusEntry {
|
|
4982
|
+
/**
|
|
4983
|
+
* Access this entry's path name as a string.
|
|
4984
|
+
*
|
|
4985
|
+
* @category Status/StatusEntry
|
|
4986
|
+
* @signature
|
|
4987
|
+
* ```ts
|
|
4988
|
+
* class StatusEntry {
|
|
4989
|
+
* path(): string;
|
|
4990
|
+
* }
|
|
4991
|
+
* ```
|
|
4992
|
+
*
|
|
4993
|
+
* @returns The path of this entry.
|
|
4994
|
+
*/
|
|
4995
|
+
path(): string
|
|
4996
|
+
/**
|
|
4997
|
+
* Access the status for this file.
|
|
4998
|
+
*
|
|
4999
|
+
* @category Status/StatusEntry
|
|
5000
|
+
* @signature
|
|
5001
|
+
* ```ts
|
|
5002
|
+
* class StatusEntry {
|
|
5003
|
+
* status(): Status;
|
|
5004
|
+
* }
|
|
5005
|
+
* ```
|
|
5006
|
+
*
|
|
5007
|
+
* @returns Status data for this entry.
|
|
5008
|
+
*/
|
|
5009
|
+
status(): Status
|
|
5010
|
+
/**
|
|
5011
|
+
* Access detailed information about the differences between the file in
|
|
5012
|
+
* `HEAD` and the file in the index.
|
|
5013
|
+
*
|
|
5014
|
+
* @category Status/StatusEntry
|
|
5015
|
+
* @signature
|
|
5016
|
+
* ```ts
|
|
5017
|
+
* class StatusEntry {
|
|
5018
|
+
* headToIndex(): DiffDelta | null;
|
|
5019
|
+
* }
|
|
5020
|
+
* ```
|
|
5021
|
+
*
|
|
5022
|
+
* @returns The differences between the file in `HEAD` and the file in the index.
|
|
5023
|
+
*/
|
|
5024
|
+
headToIndex(): DiffDelta | null
|
|
5025
|
+
/**
|
|
5026
|
+
* Access detailed information about the differences between the file in
|
|
5027
|
+
* the index and the file in the working directory.
|
|
5028
|
+
*
|
|
5029
|
+
* @category Status/StatusEntry
|
|
5030
|
+
* @signature
|
|
5031
|
+
* ```ts
|
|
5032
|
+
* class StatusEntry {
|
|
5033
|
+
* indexToWorkdir(): DiffDelta | null;
|
|
5034
|
+
* }
|
|
5035
|
+
* ```
|
|
5036
|
+
*
|
|
5037
|
+
* @returns Differences between the file in the index and the file in the working directory.
|
|
5038
|
+
*/
|
|
5039
|
+
indexToWorkdir(): DiffDelta | null
|
|
5040
|
+
}
|
|
4527
5041
|
/**
|
|
4528
5042
|
* A class to represent a git [tag][1].
|
|
4529
5043
|
*
|
package/index.js
CHANGED
|
@@ -310,8 +310,11 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { Blob, isValidBranchName, Branch, Branches, BranchType, Commit, ConfigLevel, ConfigEntries, Config, openConfig, openDefaultConfig, findGlobalConfigPath, findSystemConfigPath, findXdgConfigPath, parseConfigBool, parseConfigI32, parseConfigI64, DiffFlags, diffFlagsContains, DeltaType, DiffFormat, Diff, DiffStats, Deltas, DiffDelta, FileMode, DiffFile, IndexStage, Index, IndexEntries, ObjectType, GitObject, isValidOid, isZeroOid, zeroOid, hashObjectOid, hashFileOid, ReferenceType, Reference, isValidReferenceName, ReferenceFormat, normalizeReferenceName, Direction, CredentialType, FetchPrune, AutotagOption, RemoteRedirect, Remote, RepositoryState, RepositoryInitMode, Repository, initRepository, openRepository, discoverRepository, cloneRepository, RevparseMode, revparseModeContains, RevwalkSort, Revwalk, createSignature, isValidTagName, Tag, TreeWalkMode, Tree, TreeIter, TreeEntry } = nativeBinding
|
|
313
|
+
const { Blame, BlameHunks, BlameHunksByLine, Blob, isValidBranchName, Branch, Branches, BranchType, Commit, ConfigLevel, ConfigEntries, Config, openConfig, openDefaultConfig, findGlobalConfigPath, findSystemConfigPath, findXdgConfigPath, parseConfigBool, parseConfigI32, parseConfigI64, DiffFlags, diffFlagsContains, DeltaType, DiffFormat, Diff, DiffStats, Deltas, DiffDelta, FileMode, DiffFile, IndexStage, Index, IndexEntries, ObjectType, GitObject, isValidOid, isZeroOid, zeroOid, hashObjectOid, hashFileOid, ReferenceType, Reference, isValidReferenceName, ReferenceFormat, normalizeReferenceName, Direction, CredentialType, FetchPrune, AutotagOption, RemoteRedirect, Remote, RepositoryState, RepositoryInitMode, Repository, initRepository, openRepository, discoverRepository, cloneRepository, RevparseMode, revparseModeContains, RevwalkSort, Revwalk, createSignature, StatusShow, Statuses, StatusesIter, StatusEntry, isValidTagName, Tag, TreeWalkMode, Tree, TreeIter, TreeEntry } = nativeBinding
|
|
314
314
|
|
|
315
|
+
module.exports.Blame = Blame
|
|
316
|
+
module.exports.BlameHunks = BlameHunks
|
|
317
|
+
module.exports.BlameHunksByLine = BlameHunksByLine
|
|
315
318
|
module.exports.Blob = Blob
|
|
316
319
|
module.exports.isValidBranchName = isValidBranchName
|
|
317
320
|
module.exports.Branch = Branch
|
|
@@ -372,6 +375,10 @@ module.exports.revparseModeContains = revparseModeContains
|
|
|
372
375
|
module.exports.RevwalkSort = RevwalkSort
|
|
373
376
|
module.exports.Revwalk = Revwalk
|
|
374
377
|
module.exports.createSignature = createSignature
|
|
378
|
+
module.exports.StatusShow = StatusShow
|
|
379
|
+
module.exports.Statuses = Statuses
|
|
380
|
+
module.exports.StatusesIter = StatusesIter
|
|
381
|
+
module.exports.StatusEntry = StatusEntry
|
|
375
382
|
module.exports.isValidTagName = isValidTagName
|
|
376
383
|
module.exports.Tag = Tag
|
|
377
384
|
module.exports.TreeWalkMode = TreeWalkMode
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-git",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.115+0a7a680",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"vitest": "^3.0.5"
|
|
58
58
|
},
|
|
59
59
|
"optionalDependencies": {
|
|
60
|
-
"es-git-darwin-x64": "0.2.0-next.
|
|
61
|
-
"es-git-darwin-arm64": "0.2.0-next.
|
|
62
|
-
"es-git-win32-x64-msvc": "0.2.0-next.
|
|
63
|
-
"es-git-win32-arm64-msvc": "0.2.0-next.
|
|
64
|
-
"es-git-linux-x64-gnu": "0.2.0-next.
|
|
65
|
-
"es-git-linux-x64-musl": "0.2.0-next.
|
|
66
|
-
"es-git-android-arm64": "0.2.0-next.
|
|
67
|
-
"es-git-linux-arm64-gnu": "0.2.0-next.
|
|
68
|
-
"es-git-linux-arm64-musl": "0.2.0-next.
|
|
69
|
-
"es-git-android-arm-eabi": "0.2.0-next.
|
|
60
|
+
"es-git-darwin-x64": "0.2.0-next.115+0a7a680",
|
|
61
|
+
"es-git-darwin-arm64": "0.2.0-next.115+0a7a680",
|
|
62
|
+
"es-git-win32-x64-msvc": "0.2.0-next.115+0a7a680",
|
|
63
|
+
"es-git-win32-arm64-msvc": "0.2.0-next.115+0a7a680",
|
|
64
|
+
"es-git-linux-x64-gnu": "0.2.0-next.115+0a7a680",
|
|
65
|
+
"es-git-linux-x64-musl": "0.2.0-next.115+0a7a680",
|
|
66
|
+
"es-git-android-arm64": "0.2.0-next.115+0a7a680",
|
|
67
|
+
"es-git-linux-arm64-gnu": "0.2.0-next.115+0a7a680",
|
|
68
|
+
"es-git-linux-arm64-musl": "0.2.0-next.115+0a7a680",
|
|
69
|
+
"es-git-android-arm-eabi": "0.2.0-next.115+0a7a680"
|
|
70
70
|
}
|
|
71
71
|
}
|