import { U as UserRole } from './enums-Dume-V5Y.js';

/**
 * Auth Services - Types
 * 认证服务类型定义
 */

/**
 * 认证服务配置
 */
interface AuthServiceConfig {
    /**
     * Drizzle 数据库实例
     */
    db: any;
    /**
     * JWT 密钥
     */
    jwtSecret: string;
    /**
     * JWT 过期时间 (默认: '7d')
     */
    jwtExpiresIn?: string;
    /**
     * bcrypt 加密轮数 (默认: 12)
     */
    saltRounds?: number;
    /**
     * 是否在生产环境检查密钥强度 (默认: true)
     */
    checkSecretStrength?: boolean;
}
/**
 * 用户信息（返回给客户端的精简版）
 */
interface UserInfo {
    id: string;
    email: string;
    username: string;
    role: UserRole;
}
/**
 * 认证结果
 */
interface AuthResult {
    user: UserInfo;
    token: string;
}
/**
 * 会话信息
 */
interface SessionInfo {
    id: string;
    userId: string;
    token: string;
    expiresAt: string;
    ipAddress?: string | null;
    userAgent?: string | null;
}
/**
 * 验证结果
 */
interface VerifyResult {
    user: UserInfo;
    session: SessionInfo;
}

/**
 * Auth Services - Drizzle Auth Service
 * 基于 Drizzle ORM 的认证服务
 */

/**
 * Drizzle 认证服务类
 *
 * @example
 * ```typescript
 * import { DrizzleAuthService } from '@qhr123/sa2kit/auth/services';
 * import { db } from './db';
 *
 * const authService = new DrizzleAuthService({
 *   db,
 *   jwtSecret: process.env.JWT_SECRET!,
 *   jwtExpiresIn: '7d',
 * });
 *
 * // 用户注册
 * const result = await authService.signUp('user@example.com', 'password123', 'username');
 *
 * // 用户登录
 * const loginResult = await authService.signIn('user@example.com', 'password123');
 * ```
 */
declare class DrizzleAuthService {
    private config;
    constructor(config: AuthServiceConfig);
    /**
     * 验证配置
     */
    private validateConfig;
    /**
     * 用户注册
     */
    signUp(email: string, password: string, username?: string, role?: UserRole): Promise<AuthResult>;
    /**
     * 用户登录
     */
    signIn(email: string, password: string): Promise<AuthResult>;
    /**
     * 验证 Token
     */
    verifyToken(token: string): Promise<VerifyResult>;
    /**
     * 创建会话
     */
    createSession(userId: string, token: string, ipAddress?: string, userAgent?: string): Promise<void>;
    /**
     * 删除会话（登出）
     */
    signOut(token: string): Promise<{
        success: boolean;
    }>;
    /**
     * 获取会话
     */
    getSession(token: string): Promise<VerifyResult | null>;
    /**
     * 检查管理员权限
     */
    requireAdmin(token: string): Promise<VerifyResult>;
    /**
     * 检查超级管理员权限
     */
    requireSuperAdmin(token: string): Promise<VerifyResult>;
    /**
     * 通过用户 ID 获取用户信息
     */
    getUserById(userId: string): Promise<UserInfo | null>;
    /**
     * 通过邮箱获取用户信息
     */
    getUserByEmail(email: string): Promise<UserInfo | null>;
}

export { type AuthResult as A, DrizzleAuthService as D, type SessionInfo as S, type UserInfo as U, type VerifyResult as V, type AuthServiceConfig as a };
