@helia/verified-fetch
Version:
A fetch-like API for obtaining verified & trustless IPFS content on the web
40 lines • 1.46 kB
TypeScript
import { CID } from 'multiformats/cid';
import { ServerTiming } from './utils/server-timing.ts';
import type { ResolveURLResult, URLResolver as URLResolverInterface } from './index.ts';
import type { DNSLink } from '@helia/dnslink';
import type { IPNSResolver } from '@helia/ipns';
import type { AbortOptions } from '@libp2p/interface';
import type { Helia } from 'helia';
import type { Blockstore } from 'interface-blockstore';
import type { UnixFSEntry } from 'ipfs-unixfs-exporter';
export interface WalkPathResult {
ipfsRoots: CID[];
terminalElement: UnixFSEntry;
blockstore: Blockstore;
}
export interface URLResolverComponents {
helia: Helia;
ipnsResolver: IPNSResolver;
dnsLink: DNSLink;
}
export interface URLResolverInit {
sessionCacheSize?: number;
sessionTTLms?: number;
}
export interface ResolveURLOptions extends AbortOptions {
session?: boolean;
isRawBlockRequest?: boolean;
onlyIfCached?: boolean;
}
export declare class URLResolver implements URLResolverInterface {
private readonly components;
private readonly blockstoreSessions;
constructor(components: URLResolverComponents, init?: URLResolverInit);
resolve(url: URL, serverTiming?: ServerTiming, options?: ResolveURLOptions): Promise<ResolveURLResult>;
private getBlockstore;
private resolveDNSLink;
private resolveIPNSName;
private resolveIPFSPath;
private walkPath;
}
//# sourceMappingURL=url-resolver.d.ts.map