import { RequestPredicate } from '../types'; interface InternalRequestPattern { method?: Set | RegExp; url?: string | RegExp; } export interface RequestPattern { /** HTTP methods to match. */ method?: InternalRequestPattern['method'] | string | string[]; /** URL to match. */ url?: InternalRequestPattern['url']; } /** * Creates a predicate that matches requests based on the given pattern. * @param pattern The pattern to match. * * @example * createHttpRetryInterceptorFn({ * ... * shouldHandleRequest: matchPattern({method: 'GET' }), * ... * }) * * @example * createHttpRetryInterceptorFn({ * ... * shouldHandleRequest: matchPattern({method: ['GET', 'POST'] }), * ... * }) * * @example * createHttpRetryInterceptorFn({ * ... * shouldHandleRequest: matchPattern({method: /GET|POST/ }), * ... * }) * * @example * createHttpRetryInterceptorFn({ * ... * shouldHandleRequest: matchPattern({url: 'https://example.com' }), * ... * }) * * @example * createHttpRetryInterceptorFn({ * ... * shouldHandleRequest: matchPattern({url: /example.com/ }), * ... * }) * * @example * createHttpRetryInterceptorFn({ * ... * shouldHandleRequest: matchPattern({method: 'GET', url: 'https://example.com' }), * ... * }) */ export declare function matchPattern(pattern: RequestPattern): RequestPredicate; export {};