UNPKG

1 kBTypeScriptView Raw
1import { Oid } from './oid';
2import { Repository } from './repository';
3import { Buf } from './buf';
4
5export 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 free(): void;
16 id(): Oid;
17 lookupByPath(path: string, type: Object.TYPE): Promise<Object>;
18 owner(): Repository;
19 peel(targetType: number): Promise<Object>;
20 shortId(): Promise<Buf>;
21 type(): number;
22}
23
24export namespace Object {
25 const enum TYPE {
26 ANY = -2,
27 BAD = -1,
28 EXT1 = 0,
29 COMMIT = 1,
30 TREE = 2,
31 BLOB = 3,
32 TAG = 4,
33 EXT2 = 5,
34 OFS_DELTA = 6,
35 REF_DELTA = 7,
36 }
37}