UNPKG

550 BTypeScriptView Raw
1import { Object } from "./object";
2import { OdbExpandId } from "./odb-expand-id";
3import { OdbObject } from "./odb-object";
4import { Oid } from "./oid";
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 read(id: Oid): Promise<OdbObject>;
20 write(data: Buffer, len: number, type: Object.TYPE): Promise<Oid>;
21 expandIds(ids: OdbExpandId, count: number): number;
22}