import { S as StorageAdapter } from './types-BaZccpvk.js';
import { R as RequestAdapter } from './types-CbTsi9CZ.js';
import { I as IAuthClient, a as User, b as ApiResponse, A as AuthResponse } from './types-Dlu52uDy.js';

/**
 * Auth Client - Base API Client
 * 基础 API 客户端
 */

/**
 * 基础 API 客户端
 * 提供统一的 API 调用逻辑，通过适配器模式支持多平台
 *
 * @example
 * ```typescript
 * import { BaseApiClient } from '@qhr123/sa2kit/auth/client';
 * import { WebStorageAdapter } from '@qhr123/sa2kit/storage';
 * import { WebRequestAdapter } from '@qhr123/sa2kit/request';
 *
 * const apiClient = new BaseApiClient(
 *   new WebStorageAdapter(),
 *   new WebRequestAdapter(),
 *   '/api'
 * );
 *
 * await apiClient.init();
 * const result = await apiClient.login('user@example.com', 'password');
 * ```
 */
declare class BaseApiClient implements IAuthClient {
    private storage;
    private request;
    private baseUrl;
    private token;
    private user;
    constructor(storage: StorageAdapter, request: RequestAdapter, baseUrl: string);
    /**
     * 初始化 - 从存储中加载 token 和用户信息
     */
    init(): Promise<void>;
    /**
     * 设置认证 token
     */
    setToken(token: string | null): Promise<void>;
    /**
     * 设置用户信息
     */
    setUser(user: User | null): Promise<void>;
    /**
     * 获取当前 token
     */
    getToken(): string | null;
    /**
     * 获取当前用户
     */
    getUser(): User | null;
    /**
     * 检查是否已登录
     */
    isAuthenticated(): Promise<boolean>;
    /**
     * 清除用户数据
     */
    clearUserData(): Promise<void>;
    /**
     * 发送请求的通用方法
     */
    private sendRequest;
    /**
     * 用户注册
     */
    register(email: string, password: string, username: string): Promise<ApiResponse<AuthResponse>>;
    /**
     * 用户登录
     */
    login(email: string, password: string): Promise<ApiResponse<AuthResponse>>;
    /**
     * 用户退出登录
     */
    logout(): Promise<void>;
    /**
     * 获取当前用户信息
     */
    getCurrentUser(): Promise<ApiResponse<User>>;
    /**
     * 发送 GET 请求
     */
    get<T = any>(url: string, params?: Record<string, any>): Promise<ApiResponse<T>>;
    /**
     * 发送 POST 请求
     */
    post<T = any>(url: string, body?: any): Promise<ApiResponse<T>>;
    /**
     * 发送 PUT 请求
     */
    put<T = any>(url: string, body?: any): Promise<ApiResponse<T>>;
    /**
     * 发送 DELETE 请求
     */
    delete<T = any>(url: string): Promise<ApiResponse<T>>;
}

export { BaseApiClient as B };
