import type { XFetchBaseOptions, XFetchMiddleware } from './types.js'; export type * from './types.js'; export * from './utils.js'; /** * Creates an isolated x-fetch instance with its own middleware chain. * @param fetch — custom fetch implementation (defaults to `globalThis.fetch`) */ export declare const createXFetch: (fetch?: typeof globalThis.fetch) => { middlewares: { /** Register middleware(s) to run before every request. Returns `this` for chaining. */ use(...middlewares: XFetchMiddleware[]): /*elided*/ any; /** Remove a previously registered middleware. Returns `true` if it was removed. */ eject(middleware: XFetchMiddleware): boolean; }; xfetch: { (url: string, options: XFetchBaseOptions & { type: null; }): Promise; (url: string, options: XFetchBaseOptions & { type: "arrayBuffer"; }): Promise; (url: string, options: XFetchBaseOptions & { type: "blob"; }): Promise; (url: string, options: XFetchBaseOptions & { type: "text"; }): Promise; (url: string, options?: XFetchBaseOptions & { type?: "json"; }): Promise; }; }; /** Default instance — shared middleware chain, uses `globalThis.fetch`. */ export declare const middlewares: { /** Register middleware(s) to run before every request. Returns `this` for chaining. */ use(...middlewares: XFetchMiddleware[]): /*elided*/ any; /** Remove a previously registered middleware. Returns `true` if it was removed. */ eject(middleware: XFetchMiddleware): boolean; }, xfetch: { (url: string, options: XFetchBaseOptions & { type: null; }): Promise; (url: string, options: XFetchBaseOptions & { type: "arrayBuffer"; }): Promise; (url: string, options: XFetchBaseOptions & { type: "blob"; }): Promise; (url: string, options: XFetchBaseOptions & { type: "text"; }): Promise; (url: string, options?: XFetchBaseOptions & { type?: "json"; }): Promise; };