export type RequiredCreateOptions = { cid: CID; }; export type ByteView = import('./codecs/interface').ByteView; export type BlockEncoder = import('./codecs/interface').BlockEncoder; export type BlockDecoder = import('./codecs/interface').BlockDecoder; export type Hasher = import('./hashes/interface').MultihashHasher; /** * @template T * @template {number} Code * @template {number} Algorithm * @param {Object} options * @param {T} options.value * @param {BlockEncoder} options.codec * @param {Hasher} options.hasher * @returns {Promise>} */ export function encode({ value, codec, hasher }: { value: T; codec: import("./codecs/interface").BlockEncoder; hasher: Hasher; }): Promise>; /** * @template T * @template {number} Code * @template {number} Algorithm * @param {Object} options * @param {ByteView} options.bytes * @param {BlockDecoder} options.codec * @param {Hasher} options.hasher * @returns {Promise>} */ export function decode({ bytes, codec, hasher }: { bytes: ByteView; codec: import("./codecs/interface").BlockDecoder; hasher: Hasher; }): Promise>; /** * @template T * @template {number} Code * @template {number} Algorithm * @param {Object} options * @param {CID} options.cid * @param {ByteView} options.bytes * @param {BlockDecoder} options.codec * @param {Hasher} options.hasher * @returns {Promise>} */ export function create({ bytes, cid, hasher, codec }: { cid: CID; bytes: ByteView; codec: import("./codecs/interface").BlockDecoder; hasher: Hasher; }): Promise>; /** * @typedef {Object} RequiredCreateOptions * @property {CID} options.cid */ /** * @template T * @template {number} Code * @param {{ cid: CID, value:T, codec?: BlockDecoder, bytes: ByteView }|{cid:CID, bytes:ByteView, value?:void, codec:BlockDecoder}} options * @returns {Block} */ export function createUnsafe({ bytes, cid, value: maybeValue, codec }: { cid: CID; value: T; codec?: import("./codecs/interface").BlockDecoder | undefined; bytes: ByteView; } | { cid: CID; bytes: ByteView; value?: void | undefined; codec: import("./codecs/interface").BlockDecoder; }): Block; /** * @template T */ export class Block { /** * @param {Object} options * @param {CID} options.cid * @param {ByteView} options.bytes * @param {T} options.value */ constructor({ cid, bytes, value }: { cid: CID; bytes: ByteView; value: T; }); cid: CID; bytes: ByteView; value: T; asBlock: Block; links(): Iterable<[string, CID]>; tree(): Iterable; /** * @param {string} [path] */ get(path?: string | undefined): { value: CID; remaining: string; } | { value: Record; remaining?: undefined; }; } import { CID } from "./index.js"; //# sourceMappingURL=block.d.ts.map