import type { Middleware } from '../api/generated/default'; import type { OAuth } from '../oauth/OAuth'; /** * Middleware that transparently refreshes an expired access token on 401. * * When a response comes back with HTTP 401 the middleware delegates to * `OAuth.refreshAccessToken()` which checks for a refresh token, performs the * HTTP exchange, and updates the token store. On success the original request * is retried with the fresh access token. On failure the 401 propagates. * * When the client is unauthenticated (no refresh token stored) the middleware * short-circuits immediately, avoiding noisy error callbacks. */ export declare const addTokenRefreshMiddleware: ({ oauth }: { oauth: OAuth; }) => Middleware;