/** Set the token refresh implementation (called during daemon startup). */
export declare function setRefreshFn(fn: (refreshToken: string) => Promise<{
    access_token: string;
    refresh_token: string;
    expires_at: number;
}>): void;
/**
 * Check whether the stored access token is expired (or will expire within the buffer window).
 * Uses the expires_at field (epoch seconds) from auth.json.
 */
export declare function isTokenExpired(expiresAt: number): boolean;
/**
 * Refresh the token if it is expired or about to expire.
 * Loads tokens from auth.json, checks expiry, refreshes via Gateway if needed,
 * and saves the updated tokens back to auth.json.
 *
 * Returns true if tokens were refreshed, false if they were still valid.
 * Throws if no tokens are stored.
 */
export declare function refreshTokenIfNeeded(): Promise<boolean>;
/**
 * Get a valid access token, refreshing if needed.
 * Returns the current access_token string.
 * Throws if no tokens are stored or refresh fails.
 */
export declare function getValidAccessToken(): Promise<string>;
/**
 * Start the periodic token monitor. Checks token expiry every 60 seconds
 * and refreshes 5 minutes before expiry.
 */
export declare function startTokenMonitor(): void;
/**
 * Stop the periodic token monitor.
 */
export declare function stopTokenMonitor(): void;
//# sourceMappingURL=token-refresh.d.ts.map