@helia/verified-fetch
Version:
A fetch-like API for obtaining verified & trustless IPFS content on the web
27 lines • 1.15 kB
TypeScript
import { CID } from 'multiformats/cid';
import { BasePlugin } from './plugin-base.js';
import type { PluginContext, VerifiedFetchPluginFactory } from './types.js';
import type { ObjectNode } from 'ipfs-unixfs-exporter';
/**
* Handles `dag-cbor` content where the Accept: `text/html` header is present.
*/
export declare class DagCborHtmlPreviewPlugin extends BasePlugin {
readonly id = "dag-cbor-plugin-html-preview";
readonly codes: 113[];
canHandle({ cid, accept, pathDetails }: PluginContext): boolean;
handle(context: PluginContext & Required<Pick<PluginContext, 'byteRangeContext' | 'pathDetails'>> & {
pathDetails: {
terminalElement: ObjectNode;
};
}): Promise<Response>;
getHtml({ path, obj, cid }: {
path: string;
obj: Record<string, any>;
cid: CID;
}): string;
valueHTML(value: any, link: string | null): string;
private renderValue;
renderRows(obj: Record<string, any>, currentPath?: string): string;
}
export declare const dagCborHtmlPreviewPluginFactory: VerifiedFetchPluginFactory;
//# sourceMappingURL=plugin-handle-dag-cbor-html-preview.d.ts.map