import { type AccessTokens } from "../http-api/interface.ts"; import { type OAuth2, type OAuth2RequestOptions } from "./index.ts"; /** * Class responsible for refreshing OAuth2 access tokens */ export declare class TokenRefresher { private readonly auth; private readonly onRefresh; private inflightRefreshRequest?; constructor(auth: OAuth2, onRefresh: (tokens: AccessTokens) => void | Promise); /** * Attempt token refresh using given refresh token * @param refreshToken - refresh token to use in request with token issuer * @param opts - optional settings for the request. If a refresh is already in flight, that request's * settings apply and these are ignored. * @throws when token refresh fails */ refreshTokens(refreshToken: string, opts?: OAuth2RequestOptions): Promise; /** * Revoke a token with the OP, e.g. as part of logging out. * @param token - the token to revoke * @param type - the type of token, acts as a hint to the OP * @param opts - optional settings for the request * @throws when revocation fails */ revokeToken(token: string, type?: "access_token" | "refresh_token", opts?: OAuth2RequestOptions): Promise; private shouldLogoutOnError; private getNewTokens; } //# sourceMappingURL=tokenRefresher.d.ts.map