import * as dagCbor from "@ipld/dag-cbor"; import { CID } from "multiformats"; import { type Block } from "multiformats/block"; import * as raw from "multiformats/codecs/raw"; import type { MultihashHasher } from "multiformats/hashes/interface"; export declare const defaultHasher: import("multiformats/hashes/hasher").Hasher<"sha2-256", 18>; export declare const codecCodes: { 113: typeof dagCbor; 85: typeof raw; }; export declare const codecMap: { raw: typeof raw; "dag-cbor": typeof dagCbor; }; export type VerifyBlockBytesOptions = { hasher?: MultihashHasher; /** * The codec expected by the caller. Only its multicodec code is consulted; * verification deliberately does not decode untrusted block bytes. */ codec?: { code: number; }; }; export declare const cidifyString: (str: string) => CID; export declare const stringifyCid: (cid: any) => string; /** * Verify that bytes match a CID without decoding their logical value. * * This is the appropriate boundary for transports and block stores that only * move opaque bytes. In particular, it prevents a mismatching DAG-CBOR payload * from allocating a decoded object graph before its digest is rejected. */ export declare const verifyBlockBytes: (expectedCID: CID | string, bytes: Uint8Array, options?: VerifyBlockBytesOptions) => Promise; export declare const checkDecodeBlock: (expectedCID: CID | string, bytes: Uint8Array, options: { hasher?: any; codec?: any; }) => Promise>; export declare const getBlockValue: (block: Block, links?: string[]) => Promise; export declare const prepareBlockWrite: (value: any, codec: any, links?: string[]) => any; export declare const createBlock: (value: any, format: string, options?: { hasher?: MultihashHasher; links?: string[]; }) => Promise>; export declare const calculateRawCid: (bytes: Uint8Array) => Promise<{ block: Block, 85, number, 1>; cid: string; }>; //# sourceMappingURL=block.d.ts.map