@helia/verified-fetch
Version:
A fetch-like API for obtaining verified & trustless IPFS content on the web
22 lines • 987 B
TypeScript
import type { VerifiedFetchPlugin, PluginContext, PluginOptions } from './types.js';
import type { Logger } from '@libp2p/interface';
/**
* Base class for verified-fetch plugins. This class provides a basic implementation of the `FetchHandlerPlugin`
* interface.
*
* Subclasses must implement the `id` property and the `canHandle` and `handle` methods.
* Subclasses may override the `codes` and `log` properties.
*
* If your plugin adds/edits the context supplied in `handle`, you should increment the `context.modified` property.
*/
export declare abstract class BasePlugin implements VerifiedFetchPlugin {
readonly codes: number[];
readonly pluginOptions: PluginOptions;
abstract readonly id: string;
protected _log?: Logger;
get log(): Logger;
constructor(options: PluginOptions);
abstract canHandle(context: PluginContext): boolean;
abstract handle(context: PluginContext): Promise<Response | null>;
}
//# sourceMappingURL=plugin-base.d.ts.map