import { Agent as Undici6Agent } from 'undici_v6'; import { Agent as Undici7Agent } from 'undici_v7'; import { Agent as Undici8Agent } from 'undici_v8'; export type UndiciAgent = Undici6Agent | Undici7Agent | Undici8Agent; /** * The subset of undici's `Agent.Options` that is stable across the undici major * versions supported here. */ export type UndiciAgentOptions = { /** Milliseconds allowed for the connection phase (TCP + TLS). */ connectTimeout?: number; }; /** * Builds an undici {@link UndiciAgent} from the same major version of undici as * the one embedded in the running NodeJS. * * @note Major versions of undici are not guaranteed to be backwards compatible, * so a dispatcher can only be passed to a `fetch()` backed by the same major * version. Since `globalThis.fetch` is backed by the undici NodeJS embeds, the * dispatcher must be built from that same major version, which is not * necessarily the version this package depends on. */ export declare function createUndiciAgent(options?: UndiciAgentOptions): UndiciAgent; /** * Wraps the global fetch so that every request is issued through the given * undici dispatcher. */ export declare function dispatcherFetch(dispatcher: UndiciAgent): typeof globalThis.fetch; //# sourceMappingURL=undici.d.ts.map