UNPKG

@helia/verified-fetch

Version:

A fetch-like API for obtaining verified & trustless IPFS content on the web

18 lines 877 B
import type { ParseUrlStringOptions, ParsedUrlStringResults } from './parse-url-string.js'; import type { Resource } from '../index.js'; import type { IPNS } from '@helia/ipns'; import type { ComponentLogger } from '@libp2p/interface'; export interface ParseResourceComponents { ipns: IPNS; logger: ComponentLogger; } export interface ParseResourceOptions extends ParseUrlStringOptions { withServerTiming?: boolean; } /** * Handles the different use cases for the `resource` argument. * The resource can represent an IPFS path, IPNS path, or CID. * If the resource represents an IPNS path, we need to resolve it to a CID. */ export declare function parseResource(resource: Resource, { ipns, logger }: ParseResourceComponents, { withServerTiming, ...options }?: ParseResourceOptions): Promise<ParsedUrlStringResults>; //# sourceMappingURL=parse-resource.d.ts.map