import type { OxyConfig as OxyConfigBase } from '../models/interfaces';
import { HttpService, type RequestOptions } from './HttpService';
export interface OxyConfig extends OxyConfigBase {
    cloudURL?: string;
}
/**
 * Base class for OxyServices with core infrastructure
 */
export declare class OxyServicesBase {
    httpService: HttpService;
    cloudURL: string;
    config: OxyConfig;
    constructor(...args: any[]);
    static __resetTokensForTests(): void;
    /**
     * Make a request with all performance optimizations
     * This is the main method for all API calls - ensures authentication and performance features
     */
    makeRequest<T>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', url: string, data?: any, options?: RequestOptions): Promise<T>;
    /**
     * Get the configured Oxy API base URL
     */
    getBaseURL(): string;
    /**
     * Get the HTTP service instance
     * Useful for advanced use cases where direct access to the HTTP service is needed
     */
    getClient(): HttpService;
    /**
     * Get performance metrics
     */
    getMetrics(): {
        totalRequests: number;
        successfulRequests: number;
        failedRequests: number;
        cacheHits: number;
        cacheMisses: number;
        averageResponseTime: number;
    };
    /**
     * Clear request cache
     */
    clearCache(): void;
    /**
     * Clear specific cache entry
     */
    clearCacheEntry(key: string): void;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        size: number;
        hits: number;
        misses: number;
        hitRate: number;
    };
    /**
     * Get the configured Oxy Cloud (file storage/CDN) URL
     */
    getCloudURL(): string;
    /**
     * Set authentication tokens
     */
    setTokens(accessToken: string, refreshToken?: string): void;
    /**
     * Clear stored authentication tokens
     */
    clearTokens(): void;
    /**
     * Get the current user ID from the access token
     */
    getCurrentUserId(): string | null;
    /**
     * Check if the client has a valid access token (public method)
     */
    hasValidToken(): boolean;
    /**
     * Get the raw access token (for constructing anchor URLs when needed)
     */
    getAccessToken(): string | null;
    /**
     * Wait for authentication to be ready
     *
     * Optimized for high-scale usage with immediate synchronous check and adaptive polling.
     * Returns immediately if token is already available (0ms delay), otherwise uses
     * adaptive polling that starts fast (50ms) and gradually increases to reduce CPU usage.
     *
     * @param timeoutMs Maximum time to wait in milliseconds (default: 5000ms)
     * @returns Promise that resolves to true if authentication is ready, false if timeout
     *
     * @example
     * ```typescript
     * const isReady = await oxyServices.waitForAuth(3000);
     * if (isReady) {
     *   // Proceed with authenticated operations
     * }
     * ```
     */
    waitForAuth(timeoutMs?: number): Promise<boolean>;
    /**
     * Execute a function with automatic authentication retry logic
     * This handles the common case where API calls are made before authentication completes
     */
    withAuthRetry<T>(operation: () => Promise<T>, operationName: string, options?: {
        maxRetries?: number;
        retryDelay?: number;
        authTimeoutMs?: number;
    }): Promise<T>;
    /**
     * Validate the current access token with the server
     */
    validate(): Promise<boolean>;
    /**
     * Centralized error handling
     */
    handleError(error: unknown): Error;
    /**
     * Health check endpoint
     */
    healthCheck(): Promise<{
        status: string;
        users?: number;
        timestamp?: string;
        [key: string]: any;
    }>;
}
//# sourceMappingURL=OxyServices.base.d.ts.map