@atproto/repo
Version:
atproto repo and MST implementation
32 lines • 1.08 kB
TypeScript
import { CID } from 'multiformats/cid';
import { LexValue } from '@atproto/lexicon';
export declare class BlockMap implements Iterable<[cid: CID, bytes: Uint8Array]> {
private map;
constructor(entries?: Iterable<readonly [cid: CID, bytes: Uint8Array]>);
add(value: LexValue): Promise<CID>;
set(cid: CID, bytes: Uint8Array): BlockMap;
get(cid: CID): Uint8Array | undefined;
delete(cid: CID): BlockMap;
getMany(cids: CID[]): {
blocks: BlockMap;
missing: CID[];
};
has(cid: CID): boolean;
clear(): void;
forEach(cb: (bytes: Uint8Array, cid: CID) => void): void;
entries(): Entry[];
cids(): CID[];
addMap(toAdd: BlockMap): BlockMap;
get size(): number;
get byteSize(): number;
equals(other: BlockMap): boolean;
keys(): Generator<CID, void, unknown>;
values(): Generator<Uint8Array, void, unknown>;
[Symbol.iterator](): Generator<[CID, Uint8Array], void, unknown>;
}
type Entry = {
cid: CID;
bytes: Uint8Array;
};
export default BlockMap;
//# sourceMappingURL=block-map.d.ts.map