import type { ElasticsearchConfig, AuthConfig, SecretProvider } from './types.js'; import { LogLevel } from '../observability/logger.js'; /** * Configuration builder for fluent Elasticsearch configuration * * @example * ```typescript * const config = new ConfigurationBuilder() * .nodes(['http://localhost:9200', 'http://localhost:9201']) * .auth({ type: 'basic', username: 'elastic', password: 'changeme' }) * .timeout(30000) * .retries(3) * .build(); * ``` */ export declare class ConfigurationBuilder { private config; private secretProvider?; /** * Set Elasticsearch node(s) */ nodes(nodes: string | string[]): this; /** * Set authentication configuration */ auth(auth: AuthConfig): this; /** * Set basic authentication */ basicAuth(username: string, password: string): this; /** * Set API key authentication */ apiKeyAuth(apiKey: string): this; /** * Set bearer token authentication */ bearerAuth(token: string): this; /** * Set cloud ID authentication */ cloudAuth(id: string, options?: { username?: string; password?: string; apiKey?: string; }): this; /** * Set request timeout */ timeout(timeoutMs: number): this; /** * Set maximum retries */ retries(maxRetries: number): this; /** * Enable compression */ compression(enabled?: boolean): this; /** * Set connection pool size */ poolSize(max: number, min?: number): this; /** * Enable node discovery/sniffing */ discovery(enabled?: boolean, options?: { interval?: number; }): this; /** * Set log level */ logLevel(level: LogLevel): this; /** * Enable request/response logging */ enableRequestLogging(enabled?: boolean): this; /** * Enable metrics collection */ enableMetrics(enabled?: boolean, prefix?: string): this; /** * Enable tracing */ enableTracing(enabled?: boolean, options?: { serviceName?: string; serviceVersion?: string; }): this; /** * Set proxy URL */ proxy(proxyUrl: string): this; /** * Load configuration from environment variables * * Supported environment variables: * - ELASTICSEARCH_URL or ELASTICSEARCH_NODES (comma-separated) * - ELASTICSEARCH_USERNAME * - ELASTICSEARCH_PASSWORD * - ELASTICSEARCH_API_KEY * - ELASTICSEARCH_CLOUD_ID * - ELASTICSEARCH_TIMEOUT * - ELASTICSEARCH_MAX_RETRIES * - ELASTICSEARCH_LOG_LEVEL * - ELASTICSEARCH_PROXY */ fromEnv(): this; /** * Load configuration from JSON file */ fromFile(filePath: string): this; /** * Load configuration from object */ fromObject(configObject: Partial): this; /** * Set secret provider for fetching credentials */ withSecrets(provider: SecretProvider): this; /** * Resolve secrets using the configured secret provider */ private resolveSecrets; /** * Validate the configuration */ private validate; /** * Build and validate the configuration */ buildAsync(): Promise; /** * Build and validate the configuration (synchronous) */ build(): ElasticsearchConfig; } /** * Create a new configuration builder */ export declare function createConfig(): ConfigurationBuilder;