import type { BytesSource } from "./bytes-source"; import { CID, type MultihashDigest } from "multiformats/cid"; import { EOF_MARK } from "./eof-mark.js"; import type { Opaque } from "../ancillary/opaque"; import type { IBlock } from "../block.js"; import { CarVersion } from "../car-version.js"; import type { HasherContainer } from "../codename-container.js"; export type IBlockHeader = { cid: CID; payloadLength: number; encodedLength: number; }; export declare function readVarint(bytesSource: BytesSource): number; export declare function readVarintSafe(bytesSource: BytesSource): number | EOF_MARK; export declare function readMultihash(bytesSource: BytesSource): MultihashDigest; export declare function readCID(bytesSource: BytesSource): CID; export type HeaderV1 = { version: 1; roots: Array; }; export type HeaderV2Characteristics = Opaque<[bigint, bigint], "HeaderV2Characteristics">; export type HeaderV2 = { version: 2; roots: Array; characteristics: HeaderV2Characteristics; dataOffset: number; dataSize: number; indexOffset: number; }; export type CarHeader = HeaderV1 | HeaderV2; export declare function readHeader(bytesSource: BytesSource): CarHeader; export declare function readHeader(bytesSource: BytesSource, version: CarVersion.TWO): HeaderV2; export declare function readHeader(bytesSource: BytesSource, version: CarVersion.ONE): HeaderV1; export declare function readBlockHeader(bytesSource: BytesSource): IBlockHeader | EOF_MARK; export declare function readBlock(bytesSource: BytesSource, hashers: HasherContainer, verify?: boolean): IBlock | EOF_MARK; export declare function readBlocks(bytesSource: BytesSource, hashers: HasherContainer, verify?: boolean): Generator; //# sourceMappingURL=decoding.d.ts.map