import { VorionError } from '../../common/errors.js';
import type { KMSProvider, KMSConfig, KMSAuditCallback } from './types.js';
import { KMSProviderType } from './types.js';
export * from './types.js';
export { AWSKMSProvider, AWSKMSError } from './aws-kms.js';
export { HashiCorpVaultProvider, VaultKMSError } from './vault.js';
export { LocalKMSProvider, LocalKMSError } from './local.js';
/**
 * KMS configuration error
 */
export declare class KMSConfigError extends VorionError {
    code: "KMS_INVALID_CONFIG";
    statusCode: number;
    constructor(message: string, details?: Record<string, unknown>);
}
/**
 * Create a KMS provider based on configuration
 *
 * @param config - KMS configuration
 * @returns KMS provider instance (not initialized)
 *
 * @example
 * ```typescript
 * // Create AWS KMS provider
 * const awsProvider = createKMSProvider({
 *   provider: 'aws',
 *   region: 'us-west-2',
 *   keyArn: 'arn:aws:kms:us-west-2:123456789:key/abc-123',
 * });
 *
 * // Create Vault provider
 * const vaultProvider = createKMSProvider({
 *   provider: 'vault',
 *   address: 'https://vault.example.com:8200',
 *   token: process.env.VAULT_TOKEN,
 *   keyName: 'my-key',
 * });
 *
 * // Create local provider for development
 * const localProvider = createKMSProvider({
 *   provider: 'local',
 *   keyEnvVar: 'VORION_LOCAL_KMS_KEY',
 * });
 *
 * await provider.initialize();
 * ```
 */
export declare function createKMSProvider(config: KMSConfig): KMSProvider;
/**
 * Create a KMS provider from environment variables
 *
 * Environment variables:
 * - VORION_KMS_PROVIDER: 'aws' | 'vault' | 'local'
 *
 * AWS-specific:
 * - AWS_KMS_KEY_ARN: KMS key ARN
 * - AWS_REGION: AWS region (optional)
 * - AWS_KMS_ENDPOINT: Custom endpoint (optional, for LocalStack)
 *
 * Vault-specific:
 * - VAULT_ADDR: Vault server address
 * - VAULT_TOKEN: Vault token
 * - VAULT_TRANSIT_KEY: Key name in transit engine
 * - VAULT_TRANSIT_MOUNT: Transit mount path (default: 'transit')
 * - VAULT_NAMESPACE: Vault namespace (optional)
 *
 * Local-specific:
 * - VORION_LOCAL_KMS_KEY: Base64-encoded master key
 *
 * @returns KMS provider instance (not initialized)
 */
export declare function createKMSProviderFromEnv(): KMSProvider;
/**
 * Get the default KMS provider instance
 *
 * Creates the provider from environment variables if not already set.
 * Returns null if no provider is configured and creation fails.
 *
 * @returns The default KMS provider or null
 */
export declare function getKMSProvider(): KMSProvider | null;
/**
 * Get and initialize the default KMS provider
 *
 * Creates the provider from environment variables if not already set,
 * and ensures it is initialized.
 *
 * @returns Promise resolving to the initialized KMS provider
 * @throws KMSConfigError if provider creation or initialization fails
 */
export declare function getInitializedKMSProvider(): Promise<KMSProvider>;
/**
 * Set a custom KMS provider as the default
 *
 * @param provider - The KMS provider to use as default
 */
export declare function setKMSProvider(provider: KMSProvider): void;
/**
 * Reset the default KMS provider
 *
 * Shuts down the current provider if one exists.
 */
export declare function resetKMSProvider(): Promise<void>;
/**
 * KMS health status
 */
export interface KMSHealthStatus {
    /** Whether the provider is healthy */
    healthy: boolean;
    /** Provider name */
    provider: string;
    /** Whether the provider is initialized */
    initialized: boolean;
    /** Error message if unhealthy */
    error?: string;
    /** Cache statistics */
    cacheStats?: {
        size: number;
        ttlMs: number;
        maxUsages: number;
    };
}
/**
 * Check KMS provider health
 *
 * @param provider - Optional specific provider to check (defaults to global)
 * @returns Health status
 */
export declare function checkKMSHealth(provider?: KMSProvider): Promise<KMSHealthStatus>;
/**
 * Register an audit callback on the default KMS provider
 *
 * @param callback - Audit callback function
 */
export declare function onKMSAudit(callback: KMSAuditCallback): void;
/**
 * Determine KMS provider type from configuration or environment
 *
 * @returns The provider type that would be used
 */
export declare function detectKMSProviderType(): KMSProviderType;
/**
 * Check if a KMS provider is configured in the environment
 *
 * @returns True if a KMS provider can be created from environment
 */
export declare function isKMSConfigured(): boolean;
//# sourceMappingURL=index.d.ts.map