import type { RefreshableAccount, RefreshResult, TokenPersistTarget } from "../types/index.js";
export declare function needsRefresh(account: RefreshableAccount): boolean;
export declare function isPermanentRefreshFailure(result: RefreshResult): boolean;
/**
 * Serialize refreshes by refresh-token value. OAuth refresh tokens may rotate,
 * so concurrent refreshes with the same old token can make all but the first
 * request fail with invalid_grant. A short success cache covers callers that
 * loaded either the old token or the newly rotated token around persistence.
 */
export declare function refreshToken(account: RefreshableAccount): Promise<RefreshResult>;
export declare function clearRefreshStateForTests(): void;
export declare function persistTokens(target: TokenPersistTarget, account: RefreshableAccount): Promise<void>;
