UNPKG

observation-js

Version:

A fully-typed TypeScript client for the waarneming.nl API.

26 lines (25 loc) 752 B
import type { ObservationClient } from './client.js'; /** * @internal * Interceptor that automatically refreshes access tokens when a 401 error occurs. */ export declare class RefreshTokenInterceptor { private client; private isRefreshing; private refreshPromise; private readonly maxRetries; private failedQueue; constructor(client: ObservationClient); /** * Creates the response error handler for automatic token refresh. */ createResponseErrorHandler(): (error: unknown) => Promise<unknown>; /** * Process all queued requests after token refresh */ private processQueue; /** * Retries the original request with the new access token. */ private retryOriginalRequest; }