/**
 * OAuth strategy that uses stateful (persisted) tokens from the same store as sfcc-ci.
 * Uses stateful auth only when present and valid; on 401 attempts refresh when renew
 * credentials or refresh_token are stored.
 *
 * @module auth/stateful-oauth-strategy
 */
import type { AuthStrategy, AccessTokenResponse, DecodedJWT, FetchInit } from './types.js';
import { type StatefulSession } from './stateful-store.js';
export interface StatefulOAuthStrategyOptions {
    accountManagerHost: string;
    scopes?: string[];
}
/**
 * Auth strategy that uses the stateful store (sfcc-ci compatible).
 * On 401, attempts to refresh using stored refresh_token or client_credentials (renew base);
 * on refresh failure clears the stored session.
 */
export declare class StatefulOAuthStrategy implements AuthStrategy {
    private accountManagerHost;
    private scopes;
    private _session;
    private _hasHadSuccess;
    constructor(session: StatefulSession, options: StatefulOAuthStrategyOptions);
    fetch(url: string, init?: FetchInit): Promise<Response>;
    getAuthorizationHeader(): Promise<string>;
    /**
     * Returns the current token as AccessTokenResponse (expires/scopes from JWT).
     */
    getTokenResponse(): Promise<AccessTokenResponse>;
    getJWT(): Promise<DecodedJWT>;
    invalidateToken(): void;
    private getAccessToken;
    /**
     * Attempts to refresh the access token using stored refresh_token or client_credentials (renew base).
     * Requires SFCC_CLIENT_RENEW_BASE (client:secret) for both flows; updates store on success.
     */
    private tryRefresh;
}
