import { CodecType, NormalizedDagNode, NormalizedDagLink, dagNode } from '../types.js'; import { PBLink, PBNode } from '@ipld/dag-pb'; /** * Provide a uniform shape for all^ node types. * * Spare the rest of the codebase from having to cope with all possible node * shapes. * * ^: currently dag-cbor and dag-pb are supported. * * @function normaliseDagNode * @param {dagNode|import('@ipld/dag-pb').PBNode} node - the `value` prop from `ipfs.dag.get` response. * @param {string} cidStr - the cid string passed to `ipfs.dag.get` * @returns {import('../types').NormalizedDagNode} */ export declare function normaliseDagNode(node: dagNode | PBNode, cidStr: string): NormalizedDagNode; export default normaliseDagNode; /** * Normalize links and add type info. Add unixfs info where available */ export declare function normaliseDagPb(node: PBNode, cid: string, type: CodecType): NormalizedDagNode; /** * Convert DagLink shape into normalized form that can be used interchangeably * with links found in dag-cbor */ export declare function normaliseDagPbLinks(links: PBLink[], sourceCid: string): NormalizedDagLink[]; /** * Find links and add type and cid info * * @function normaliseDagCbor * @param {import('../types').NormalizedDagNode['data']} data - The data object * @param {string} cid - The string representation of the CID * @param {number} code - multicodec code, see https://github.com/multiformats/multicodec/blob/master/table.csv * @returns {import('../types').NormalizedDagNode} */ export declare function normaliseDagCbor(data: NormalizedDagNode['data'], cid: string, code: number): NormalizedDagNode; /** * A valid IPLD link in a dag-cbor node is an object with single "/" property. */ export declare function findAndReplaceDagCborLinks(obj: unknown, sourceCid: string, path?: string): NormalizedDagLink[];