1 | import { Buf } from "./buf";
|
2 | import { Oid } from "./oid";
|
3 | import { Repository } from "./repository";
|
4 |
|
5 | export class Object {
|
6 | static size(type: Object.TYPE): number;
|
7 | static lookup(repo: Repository, id: Oid, type: Object.TYPE): Promise<Object>;
|
8 | static lookupPrefix(repo: Repository, id: Oid, len: number, type: Object.TYPE): Promise<Object>;
|
9 | static string2Type(str: string): Object.TYPE;
|
10 | static type2String(type: Object.TYPE): string;
|
11 | static typeisloose(type: Object.TYPE): number;
|
12 |
|
13 | dup(): Promise<Object>;
|
14 |
|
15 | id(): Oid;
|
16 | lookupByPath(path: string, type: Object.TYPE): Promise<Object>;
|
17 | owner(): Repository;
|
18 | peel(targetType: number): Promise<Object>;
|
19 | shortId(): Promise<Buf>;
|
20 | type(): number;
|
21 | }
|
22 |
|
23 | export namespace Object {
|
24 | const enum TYPE {
|
25 | ANY = -2,
|
26 | BAD = -1,
|
27 | EXT1 = 0,
|
28 | COMMIT = 1,
|
29 | TREE = 2,
|
30 | BLOB = 3,
|
31 | TAG = 4,
|
32 | EXT2 = 5,
|
33 | OFS_DELTA = 6,
|
34 | REF_DELTA = 7,
|
35 | }
|
36 | }
|