import * as fatcher from 'fatcher'; import { Context } from 'fatcher'; declare type RoadSign = { abort: () => void; signal: AbortSignal; }; declare type RoadMap = Record; interface AborterMiddlewareContext extends Readonly { /** * Provides with aborter * * @require `@fatcherjs/middleware-aborter` */ abort: () => void; signal: AbortSignal; } interface AborterOptions { /** * Request timeout * * `ms` * * @default 0 */ timeout?: number; /** * Callback with aborted request. * * @default null */ onAbort?: (() => void) | null; /** * Request concurrency restrictions * * @default false */ concurrency?: boolean; /** * Concurrency key. */ groupBy?: (context: Readonly) => string; } /** * A middleware for aborting fatcher request. * @param options * @returns */ declare function aborter(options?: AborterOptions): fatcher.Middleware[]; /** * Confirm an error whether is DOMException * @param error * @returns */ declare function isAbortError(error: unknown): error is DOMException; export { AborterMiddlewareContext, AborterOptions, RoadMap, RoadSign, aborter, isAbortError };