UNPKG

568 BTypeScriptView Raw
1import { Oid } from './oid';
2import { OdbObject } from './odb-object';
3import { OdbExpandId } from './odb-expand-id';
4import { Object } from './object';
5
6export namespace Odb {
7 const enum STREAM {
8 RDONLY = 2,
9 WRONLY = 4,
10 RW = 6,
11 }
12}
13
14export class Odb {
15 static open(objectsDir: string): Promise<Odb>;
16
17 addDiskAlternate(path: string): number;
18
19 free(): void;
20 read(id: Oid): Promise<OdbObject>;
21 write(data: Buffer, len: number, type: Object.TYPE): Promise<Oid>;
22 expandIds(ids: OdbExpandId, count: number): number;
23}