export declare type ResultFunction = (param: T) => T | Promise | void; export declare type InterceptorHandler = { id: number; fulfilled?: ResultFunction; rejected?: ResultFunction; synchronous?: boolean; runWhen?: any; }; export declare class InterceptorManager { private handlers; /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * * @return {Number} An ID used to remove interceptor later */ use(fulfilled?: ResultFunction, rejected?: ResultFunction, options?: { synchronous?: boolean; runWhen?: any; }): number; /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` */ eject(id: number): void; /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor */ forEach(fn: (h: any) => unknown): void; }