UNPKG

1.05 kBTypeScriptView Raw
1import { Tree } from './tree';
2import { Oid } from './oid';
3import { Blob } from './blob';
4import { Repository } from './repository';
5
6export namespace TreeEntry {
7 const enum FILEMODE {
8 UNREADABLE = 0,
9 TREE = 16384,
10 BLOB = 33188,
11 EXECUTABLE = 33261,
12 LINK = 40960,
13 COMMIT = 57344,
14 }
15}
16
17export class TreeEntry {
18 filemode(): TreeEntry.FILEMODE;
19 filemodeRaw(): TreeEntry.FILEMODE;
20 free(): void;
21 getBlob(): Promise<Blob>;
22 getTree(): Promise<Tree>;
23 id(): Oid;
24 isBlob(): boolean;
25 isFile(): boolean;
26 isTree(): boolean;
27 isDirectory(): boolean;
28 isSubmodule(): boolean;
29 /**
30 * Retrieve the SHA for this TreeEntry.
31 */
32 sha(): string;
33 name(): string;
34 /**
35 * Retrieve the SHA for this TreeEntry. Alias for sha
36 */
37 oid(): string;
38 /**
39 * Returns the path for this entry.
40 */
41 path(): string;
42 /**
43 * Alias for path
44 */
45 toString(): string;
46 toObject(repo: Repository): Object;
47 type(): number;
48}