import { Observable } from 'rxjs'; import { RequestPredicate } from '../types'; export interface DisableablePredicate { /** Returns the predicate wrapped by this disableable predicate */ requestPredicate: RequestPredicate; /** Disables the predicate */ disable: () => void; /** Enables the predicate */ enable: () => void; /** Sets the disabled state of the predicate */ setDisabled: (disabled: boolean) => void; /** Toggles the disabled state of the predicate */ toggleDisabled: () => void; /** Returns an observable that emits the disabled state of the predicate */ observeDisabledState: () => Observable; } /** * Wraps a request predicate and allows it to be disabled * @param predicate The predicate to wrap * @param initiallyDisabled The initial disabled state of the predicate, defaults to false (enabled) * * @example * const disableablePredicate = createDisableablePredicate(matchPattern({method: 'GET' })); * createHttpRetryInterceptorFn({ * shouldHandleRequest: disableablePredicate.requestPredicate, * ... * }) */ export declare function createDisableablePredicate(predicate: RequestPredicate, initiallyDisabled?: boolean): DisableablePredicate;