import type { AuthStrategy, AccessTokenResponse, DecodedJWT, FetchInit } from './types.js';
export interface OAuthConfig {
    clientId: string;
    clientSecret: string;
    scopes?: string[];
    accountManagerHost?: string;
}
/**
 * Decodes a JWT token without verification
 */
declare function decodeJWT(jwt: string): DecodedJWT;
export declare class OAuthStrategy implements AuthStrategy {
    private config;
    private accountManagerHost;
    private _hasHadSuccess;
    constructor(config: OAuthConfig);
    fetch(url: string, init?: FetchInit): Promise<Response>;
    getAuthorizationHeader(): Promise<string>;
    /**
     * Gets the decoded JWT payload
     */
    getJWT(): Promise<DecodedJWT>;
    /**
     * Gets the full token response including expiration and scopes.
     * Useful for commands that need to display or return token metadata.
     */
    getTokenResponse(): Promise<AccessTokenResponse>;
    /**
     * Invalidates the cached token, forcing re-authentication on next request
     */
    invalidateToken(): void;
    /**
     * Creates a new OAuthStrategy with additional scopes merged in.
     * Used by clients that have specific scope requirements.
     *
     * @param additionalScopes - Scopes to add to this strategy's existing scopes
     * @returns A new OAuthStrategy instance with merged scopes
     */
    withAdditionalScopes(additionalScopes: string[]): OAuthStrategy;
    /**
     * Gets an access token, using cache if valid
     */
    private getAccessToken;
    /**
     * Performs client credentials grant flow
     */
    private clientCredentialsGrant;
}
export { decodeJWT };
