This commit is contained in:
unfunny
2026-09-12 23:57:45 -04:00
parent 986c0af682
commit dfe4cc537f
1775 changed files with 246421 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
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