/**
 * @typedef {import('./api.js').Block} Block
 * @typedef {import('./api.js').BlockHeader} BlockHeader
 * @typedef {import('./api.js').BlockIndex} BlockIndex
 * @typedef {import('./coding.js').BytesReader} BytesReader
 * @typedef {import('./coding.js').CarHeader} CarHeader
 * @typedef {import('./coding.js').CarV2Header} CarV2Header
 * @typedef {import('./coding.js').CarV2FixedHeader} CarV2FixedHeader
 * @typedef {import('./coding.js').CarDecoder} CarDecoder
 */
/**
 * Reads header data from a `BytesReader`. The header may either be in the form
 * of a `CarHeader` or `CarV2Header` depending on the CAR being read.
 *
 * @name async decoder.readHeader(reader)
 * @param {BytesReader} reader
 * @param {number} [strictVersion]
 * @returns {Promise<CarHeader|CarV2Header>}
 */
export function readHeader(reader: BytesReader, strictVersion?: number): Promise<CarHeader | CarV2Header>;
/**
 * Reads the leading data of an individual block from CAR data from a
 * `BytesReader`. Returns a `BlockHeader` object which contains
 * `{ cid, length, blockLength }` which can be used to either index the block
 * or read the block binary data.
 *
 * @name async decoder.readBlockHead(reader)
 * @param {BytesReader} reader
 * @returns {Promise<BlockHeader>}
 */
export function readBlockHead(reader: BytesReader): Promise<BlockHeader>;
/**
 * Creates a `CarDecoder` from a `BytesReader`. The `CarDecoder` is as async
 * interface that will consume the bytes from the `BytesReader` to yield a
 * `header()` and either `blocks()` or `blocksIndex()` data.
 *
 * @name decoder.createDecoder(reader)
 * @param {BytesReader} reader
 * @returns {CarDecoder}
 */
export function createDecoder(reader: BytesReader): CarDecoder;
/**
 * Creates a `BytesReader` from a `Uint8Array`.
 *
 * @name decoder.bytesReader(bytes)
 * @param {Uint8Array} bytes
 * @returns {BytesReader}
 */
export function bytesReader(bytes: Uint8Array): BytesReader;
/**
 * reusable reader for streams and files, we just need a way to read an
 * additional chunk (of some undetermined size) and a way to close the
 * reader when finished
 *
 * @param {() => Promise<Uint8Array|null>} readChunk
 * @returns {BytesReader}
 */
export function chunkReader(readChunk: () => Promise<Uint8Array | null>): BytesReader;
/**
 * Creates a `BytesReader` from an `AsyncIterable<Uint8Array>`, which allows for
 * consumption of CAR data from a streaming source.
 *
 * @name decoder.asyncIterableReader(asyncIterable)
 * @param {AsyncIterable<Uint8Array>} asyncIterable
 * @returns {BytesReader}
 */
export function asyncIterableReader(asyncIterable: AsyncIterable<Uint8Array>): BytesReader;
/**
 * Wraps a `BytesReader` in a limiting `BytesReader` which limits maximum read
 * to `byteLimit` bytes. It _does not_ update `pos` of the original
 * `BytesReader`.
 *
 * @name decoder.limitReader(reader, byteLimit)
 * @param {BytesReader} reader
 * @param {number} byteLimit
 * @returns {BytesReader}
 */
export function limitReader(reader: BytesReader, byteLimit: number): BytesReader;
export type Block = import("./api.js").Block;
export type BlockHeader = import("./api.js").BlockHeader;
export type BlockIndex = import("./api.js").BlockIndex;
export type BytesReader = import("./coding.js").BytesReader;
export type CarHeader = import("./coding.js").CarHeader;
export type CarV2Header = import("./coding.js").CarV2Header;
export type CarV2FixedHeader = import("./coding.js").CarV2FixedHeader;
export type CarDecoder = import("./coding.js").CarDecoder;
//# sourceMappingURL=decoder.d.ts.map