/** * Get trustless content behind IPFS CID depending on requested format. * * @param {Request} request - The incoming HTTP request. * @param {{ hashStreamer: import('@hash-stream/streamer').HashStreamer }} context - Context object providing the hash streamer. * @param {API.IpfsGetOptions} [options] * @returns {Promise} HTTP Response containing the CAR stream or error. */ export function ipfsGet(request: Request, context: { hashStreamer: import("@hash-stream/streamer").HashStreamer; }, options?: API.IpfsGetOptions): Promise; /** * Get trustless content behind IPFS CID as a CAR file. * * @param {Request} request - The incoming HTTP request. * @param {{ hashStreamer: import('@hash-stream/streamer').HashStreamer }} context - Context object providing the hash streamer. * @param {API.IpfsGetOptions} [options] * @returns {Promise} HTTP Response containing the CAR stream or error. */ export function carGet(request: Request, context: { hashStreamer: import("@hash-stream/streamer").HashStreamer; }, options?: API.IpfsGetOptions): Promise; /** * Get trustless content behind IPFS CID as raw bytes. * * @param {Request} request - The incoming HTTP request. * @param {{ hashStreamer: import('@hash-stream/streamer').HashStreamer }} context - Context object providing the hash streamer. * @param {API.IpfsGetOptions} [options] * @returns {Promise} HTTP Response containing the raw content or an error. */ export function rawGet(request: Request, context: { hashStreamer: import("@hash-stream/streamer").HashStreamer; }, options?: API.IpfsGetOptions): Promise; /** * Build a HTTP response with the content behind a given CID in CAR format. * * @param {CID} cid - The CID of the content to serve. * @param {ReadableStream | Uint8Array} body - The body of data to serve. * @param {API.CarResponseOptions} options - Options for the CAR response. */ export function buildCarHTTPResponse(cid: CID, body: ReadableStream | Uint8Array, options: API.CarResponseOptions): Response; /** * Build a HTTP response with the content behind a given CID in RAW format. * * @param {CID} cid - The CID of the content to serve. * @param {Uint8Array} body - The body of data to serve. * @param {API.ResponseOptions} options - Options for the RAW response. */ export function buildRawHTTPResponse(cid: CID, body: Uint8Array, options: API.ResponseOptions): Response; /** * @param {Headers} headers * @returns {API.CarParams} */ export function getCarAcceptParams(headers: Headers): API.CarParams; /** * Resolves the requested format (either 'car' or 'raw') based on query param or Accept header. * * @param {Request} request - The incoming HTTP request. * @returns {'car' | 'raw' | undefined} The resolved format or undefined if none matched. */ export function resolveRequestedFormat(request: Request): "car" | "raw" | undefined; /** * Extracts the file name from the request's `filename` query parameter. * * @param {Request} request - The incoming HTTP request. * @returns {string|undefined} The filename if provided, or null. */ export function extractFileNameFromRequest(request: Request): string | undefined; /** * Extracts and normalizes a CID from the request params. * * @param {Request} request - Request with potential `cid` in `params`. * @returns {Promise} The normalized CID. * @throws {Error} If CID is missing or invalid. */ export function extractCidFromRequest(request: Request): Promise; export namespace FormatMime { let car: string; let raw: string; } import * as API from './api.js'; import { CID } from 'multiformats/cid'; //# sourceMappingURL=http.d.ts.map