/**
 * Authentication Methods Mixin
 *
 * Public key authentication using ECDSA signatures.
 * No passwords required - authentication is done via challenge-response.
 */
import type { User } from '../../models/interfaces';
import type { SessionLoginResponse } from '../../models/session';
import type { OxyServicesBase } from '../OxyServices.base';
export interface ChallengeResponse {
    challenge: string;
    expiresAt: string;
}
export interface RegistrationRequest {
    publicKey: string;
    username: string;
    email?: string;
    signature: string;
    timestamp: number;
}
export interface ChallengeVerifyRequest {
    publicKey: string;
    challenge: string;
    signature: string;
    timestamp: number;
    deviceName?: string;
    deviceFingerprint?: string;
}
export interface PublicKeyCheckResponse {
    registered: boolean;
    message: string;
}
export declare function OxyServicesAuthMixin<T extends typeof OxyServicesBase>(Base: T): {
    new (...args: any[]): {
        /**
         * Register a new identity with public key authentication
         * Identity is purely cryptographic - username and profile data are optional
         *
         * @param publicKey - The user's ECDSA public key (hex)
         * @param signature - Signature of the registration request
         * @param timestamp - Timestamp when the signature was created
         */
        register(publicKey: string, signature: string, timestamp: number): Promise<{
            message: string;
            user: User;
        }>;
        /**
         * Request an authentication challenge
         * The client must sign this challenge with their private key
         *
         * @param publicKey - The user's public key
         */
        requestChallenge(publicKey: string): Promise<ChallengeResponse>;
        /**
         * Verify a signed challenge and create a session
         *
         * @param publicKey - The user's public key
         * @param challenge - The challenge string from requestChallenge
         * @param signature - Signature of the auth message
         * @param timestamp - Timestamp when the signature was created
         * @param deviceName - Optional device name
         * @param deviceFingerprint - Optional device fingerprint
         */
        verifyChallenge(publicKey: string, challenge: string, signature: string, timestamp: number, deviceName?: string, deviceFingerprint?: string): Promise<SessionLoginResponse>;
        /**
         * Check if a public key is already registered
         */
        checkPublicKeyRegistered(publicKey: string): Promise<PublicKeyCheckResponse>;
        /**
         * Get user by public key
         */
        getUserByPublicKey(publicKey: string): Promise<User>;
        /**
         * Get user by session ID
         */
        getUserBySession(sessionId: string): Promise<User>;
        /**
         * Batch get multiple user profiles by session IDs
         */
        getUsersBySessions(sessionIds: string[]): Promise<Array<{
            sessionId: string;
            user: User | null;
        }>>;
        /**
         * Get access token by session ID
         */
        getTokenBySession(sessionId: string): Promise<{
            accessToken: string;
            expiresAt: string;
        }>;
        /**
         * Get sessions by session ID
         */
        getSessionsBySessionId(sessionId: string): Promise<any[]>;
        /**
         * Logout from a specific session
         */
        logoutSession(sessionId: string, targetSessionId?: string): Promise<void>;
        /**
         * Logout from all sessions
         */
        logoutAllSessions(sessionId: string): Promise<void>;
        /**
         * Validate session
         */
        validateSession(sessionId: string, options?: {
            deviceFingerprint?: string;
            useHeaderValidation?: boolean;
        }): Promise<{
            valid: boolean;
            expiresAt: string;
            lastActivity: string;
            user: User;
            sessionId?: string;
            source?: string;
        }>;
        /**
         * Check username availability
         */
        checkUsernameAvailability(username: string): Promise<{
            available: boolean;
            message: string;
        }>;
        /**
         * Check email availability
         */
        checkEmailAvailability(email: string): Promise<{
            available: boolean;
            message: string;
        }>;
        /**
         * @deprecated Use register() with public key authentication instead
         */
        signUp(username: string, email: string, password: string): Promise<{
            message: string;
            token: string;
            user: User;
        }>;
        /**
         * @deprecated Use requestChallenge() and verifyChallenge() instead
         */
        signIn(username: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<SessionLoginResponse | {
            mfaRequired: true;
            mfaToken: string;
            expiresAt: string;
        }>;
        httpService: import("../HttpService").HttpService;
        cloudURL: string;
        config: import("../OxyServices.base").OxyConfig;
        makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
        getBaseURL(): string;
        getClient(): import("../HttpService").HttpService;
        getMetrics(): {
            totalRequests: number;
            successfulRequests: number;
            failedRequests: number;
            cacheHits: number;
            cacheMisses: number;
            averageResponseTime: number;
        };
        clearCache(): void;
        clearCacheEntry(key: string): void;
        getCacheStats(): {
            size: number;
            hits: number;
            misses: number;
            hitRate: number;
        };
        getCloudURL(): string;
        setTokens(accessToken: string, refreshToken?: string): void;
        clearTokens(): void;
        getCurrentUserId(): string | null;
        hasValidToken(): boolean;
        getAccessToken(): string | null;
        waitForAuth(timeoutMs?: number): Promise<boolean>;
        withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
            maxRetries?: number;
            retryDelay?: number;
            authTimeoutMs?: number;
        }): Promise<T_1>;
        validate(): Promise<boolean>;
        handleError(error: unknown): Error;
        healthCheck(): Promise<{
            status: string;
            users?: number;
            timestamp?: string;
            [key: string]: any;
        }>;
    };
    __resetTokensForTests(): void;
} & T;
//# sourceMappingURL=OxyServices.auth.d.ts.map