/** * @typedef {Response & { body: import('node:stream').Readable | null }} NodeCompatibleResponse */ /** * Native fetch wrapper that returns a Response with Node.js Readable stream body. * * This solves the brotli decompression issue in sparql-http-client: * - sparql-http-client uses nodeify-fetch -> node-fetch v3.x * - node-fetch advertises brotli support but has decompression bugs * - Native Node.js fetch (18+) properly handles brotli/gzip/deflate * * The wrapper uses a Proxy to maintain full Response interface compatibility * while converting only the body from Web ReadableStream to Node.js Readable. * This is necessary because sparql-http-client calls response.body.pipe() * which requires Node.js streams. * * @param {string | URL | Request} url - The URL to fetch * @param {RequestInit} [options] - Fetch options * @returns {Promise} Response with Node.js Readable body * * @example * import { nodeCompatibleFetch } from '@lindas/trifid-core' * import ParsingClient from 'sparql-http-client/ParsingClient.js' * * const client = new ParsingClient({ * endpointUrl: 'https://example.org/sparql', * fetch: nodeCompatibleFetch, * }) */ export function nodeCompatibleFetch(url: string | URL | Request, options?: RequestInit): Promise; export type NodeCompatibleResponse = Response & { body: import("node:stream").Readable | null; }; //# sourceMappingURL=fetch.d.ts.map