Files
matrix-quotes-bot/node_modules/matrix-js-sdk/lib/oauth/tokenRefresher.d.ts
unfunny dfe4cc537f init
2026-09-13 00:29:11 -04:00

21 lines
834 B
TypeScript

import { type AccessTokens, type TokenRefreshFunction } from "../http-api/index.ts";
import { type OAuth2 } 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) => Promise<void>);
/**
* Attempt token refresh using given refresh token
* @param refreshToken - refresh token to use in request with token issuer
* @returns tokens - Promise that resolves with new access and refresh tokens
* @throws when token refresh fails
*/
tokenRefreshFunction: TokenRefreshFunction;
private shouldLogoutOnError;
private getNewTokens;
}
//# sourceMappingURL=tokenRefresher.d.ts.map