import type { OxyServices } from '../../core';
import type { ClientSession } from '../../models/session';
interface DeviceSession {
    sessionId: string;
    deviceId?: string;
    deviceName?: string;
    expiresAt?: string;
    lastActive?: string;
    user?: {
        id?: string;
        _id?: {
            toString(): string;
        };
    };
    userId?: string;
    isCurrent?: boolean;
}
export interface FetchSessionsWithFallbackOptions {
    fallbackDeviceId?: string;
    fallbackUserId?: string;
    logger?: (message: string, error?: unknown) => void;
}
export interface ValidateSessionBatchOptions {
    useHeaderValidation?: boolean;
    maxConcurrency?: number;
}
export interface SessionValidationResult {
    sessionId: string;
    valid: boolean;
    user?: unknown;
    raw?: unknown;
    error?: unknown;
}
/**
 * Normalize backend session payloads into `ClientSession` objects.
 *
 * @param sessions - Raw session array returned from the API
 * @param fallbackDeviceId - Device identifier to use when missing from payload
 * @param fallbackUserId - User identifier to use when missing from payload
 */
export declare const mapSessionsToClient: (sessions: DeviceSession[], fallbackDeviceId?: string, fallbackUserId?: string) => ClientSession[];
/**
 * Fetch device sessions with fallback to the legacy session endpoint when needed.
 *
 * @param oxyServices - Oxy service instance
 * @param sessionId - Session identifier to fetch
 * @param options - Optional fallback options
 */
export declare const fetchSessionsWithFallback: (oxyServices: Pick<OxyServices, "getDeviceSessions" | "getSessionsBySessionId">, sessionId: string, { fallbackDeviceId, fallbackUserId, logger, }?: FetchSessionsWithFallbackOptions) => Promise<ClientSession[]>;
/**
 * Validate multiple sessions concurrently with configurable concurrency.
 *
 * @param oxyServices - Oxy service instance
 * @param sessionIds - Session identifiers to validate
 * @param options - Validation options
 */
export declare const validateSessionBatch: (oxyServices: Pick<OxyServices, "validateSession">, sessionIds: string[], { useHeaderValidation, maxConcurrency }?: ValidateSessionBatchOptions) => Promise<SessionValidationResult[]>;
export {};
//# sourceMappingURL=sessionHelpers.d.ts.map