@invariantly/cli 0.0.0-stage → 0.0.3

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/dist/git.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ /** Every unsupported or missing case; the message names the reason. */
2
+ export declare class GitError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ /** A located repository. `root` is the work-tree root. */
6
+ export interface Repo {
7
+ gitDir: string;
8
+ commonDir: string;
9
+ root: string;
10
+ }
11
+ /** Finds the repository that contains `startDir`, searching upwards. */
12
+ export declare function openRepo(startDir: string): Promise<Repo>;
13
+ /** Resolves a ref (or a full 40-hex id) to a commit id, in git's documented order. */
14
+ export declare function resolveRef(repo: Repo, ref: string): Promise<string>;
15
+ /** Reads a commit's tree and parents. */
16
+ export declare function readCommit(repo: Repo, id: string): Promise<{
17
+ tree: string;
18
+ parents: string[];
19
+ }>;
20
+ /**
21
+ * A best common ancestor of two commits (breadth-first over parents). When several exist
22
+ * (criss-cross merges) the one with the newest committer date wins, ties broken by id.
23
+ */
24
+ export declare function mergeBase(repo: Repo, a: string, b: string): Promise<string>;
25
+ /**
26
+ * Sorted repo-relative paths of every added, removed or modified non-tree entry between two
27
+ * trees. Compares entry id and mode; no rename detection.
28
+ */
29
+ export declare function diffTrees(repo: Repo, a: string, b: string): Promise<string[]>;
30
+ /** Lists directories and regular files below a committed directory, relative to it. */
31
+ export declare function listTreePaths(repo: Repo, treeId: string, directory: string, descend: (name: string) => boolean): Promise<Set<string>>;
32
+ /**
33
+ * The content of the blob at `path` ("/"-separated) in a tree, or undefined when the path is
34
+ * absent there or is not a blob (a tree or a gitlink). A symlink's blob is its target text.
35
+ */
36
+ export declare function readBlob(repo: Repo, treeId: string, path: string): Promise<Buffer | undefined>;