/**
 * API Key Management
 *
 * Handles API key generation, validation, and storage.
 */
import type { ApiKey, ApiScope } from '../types.js';
/**
 * Generate a new API key
 */
export declare function generateApiKey(): {
    key: string;
    keyHash: string;
};
/**
 * Hash an API key for secure storage
 */
export declare function hashApiKey(key: string): string;
/**
 * Create and store a new API key
 */
export declare function createApiKey(options: {
    name: string;
    userId: string;
    scopes?: ApiScope[];
    rateLimit?: number;
    expiresIn?: number;
}): {
    key: string;
    apiKey: ApiKey;
};
/**
 * Validate an API key
 */
export declare function validateApiKey(key: string): ApiKey | null;
/**
 * Check if API key has required scope
 */
export declare function hasScope(apiKey: ApiKey, scope: ApiScope): boolean;
/**
 * Check if API key has any of the required scopes
 */
export declare function hasAnyScope(apiKey: ApiKey, scopes: ApiScope[]): boolean;
/**
 * Revoke an API key
 */
export declare function revokeApiKey(keyId: string): boolean;
/**
 * List API keys for a user
 */
export declare function listApiKeys(userId: string): Omit<ApiKey, 'keyHash'>[];
/**
 * Delete an API key
 */
export declare function deleteApiKey(keyId: string, userId: string): boolean;
/**
 * Get API key by ID
 */
export declare function getApiKeyById(keyId: string): ApiKey | null;
/**
 * Update API key scopes
 */
export declare function updateApiKeyScopes(keyId: string, scopes: ApiScope[]): boolean;
/**
 * Get stats about API keys
 */
export declare function getApiKeyStats(): {
    total: number;
    active: number;
    expired: number;
};
