mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
38 lines
1004 B
TypeScript
38 lines
1004 B
TypeScript
import { Oid } from './oid';
|
|
import { Repository } from './repository';
|
|
import { Buf } from './buf';
|
|
|
|
export class Object {
|
|
static size(type: Object.TYPE): number;
|
|
static lookup(repo: Repository, id: Oid, type: Object.TYPE): Promise<Object>;
|
|
static lookupPrefix(repo: Repository, id: Oid, len: number, type: Object.TYPE): Promise<Object>;
|
|
static string2Type(str: string): Object.TYPE;
|
|
static type2String(type: Object.TYPE): string;
|
|
static typeisloose(type: Object.TYPE): number;
|
|
|
|
dup(): Promise<Object>;
|
|
|
|
free(): void;
|
|
id(): Oid;
|
|
lookupByPath(path: string, type: Object.TYPE): Promise<Object>;
|
|
owner(): Repository;
|
|
peel(targetType: number): Promise<Object>;
|
|
shortId(): Promise<Buf>;
|
|
type(): number;
|
|
}
|
|
|
|
export namespace Object {
|
|
const enum TYPE {
|
|
ANY = -2,
|
|
BAD = -1,
|
|
EXT1 = 0,
|
|
COMMIT = 1,
|
|
TREE = 2,
|
|
BLOB = 3,
|
|
TAG = 4,
|
|
EXT2 = 5,
|
|
OFS_DELTA = 6,
|
|
REF_DELTA = 7
|
|
}
|
|
}
|