import { type z } from '@frontmcp/lazy-zod'; import { type DottedPath, type PathValue } from '../../../common/providers/base-config.provider'; /** * Error thrown when a required config key is missing. */ export declare class ConfigMissingError extends Error { readonly key: string; constructor(key: string); } /** * Error thrown when config validation fails. */ export declare class ConfigValidationError extends Error { readonly zodError: z.ZodError; constructor(message: string, zodError: z.ZodError); } /** * Type-safe configuration service with convict-like nested path access. * * Provides typed access to configuration values using dot notation paths. * When used with a Zod schema, provides full type inference and autocomplete. * * @example * ```typescript * const schema = z.object({ * database: z.object({ * url: z.string(), * port: z.number().default(5432), * }), * debug: z.boolean().default(false), * }); * * type Config = z.infer; * const config = new ConfigService(loadedConfig); * * // Full autocomplete and type inference * config.get('database.url'); // string | undefined * config.get('database.port'); // number | undefined * config.getOrThrow('debug'); // boolean * ``` */ export declare class ConfigService> { private readonly config; constructor(config: TConfig); /** * Get a configuration value using dot notation path. * Returns undefined if not found. * * @param path - Dot notation path (e.g., 'database.url') * @returns Value at path or undefined * * @example * config.get('database.url') // string | undefined * config.get('server.port', 3000) // number */ get

>(path: P): PathValue | undefined; get

>(path: P, defaultValue: PathValue): PathValue; /** * Get a required configuration value. Throws if not found. * * @param path - Dot notation path (e.g., 'database.url') * @returns Value at path * @throws ConfigMissingError if not defined * * @example * config.getOrThrow('database.url') // string (throws if missing) */ getOrThrow

>(path: P): PathValue; /** * Alias for getOrThrow. */ getRequired

>(path: P): PathValue; /** * Check if a configuration path exists and has a value. * * @param path - Dot notation path (e.g., 'database.url') * @returns True if path exists and has a defined value */ has(path: string): boolean; /** * Get the entire configuration object. */ getAll(): TConfig; /** * Get the parsed configuration with a specific type. * Useful when you need to cast to a known type. */ getParsed(): T; /** * Get a number value from configuration. * Parses string values to numbers if needed. * * @param path - Dot notation path * @param defaultValue - Default value if not found or not a number * @returns Number value or NaN */ getNumber(path: string, defaultValue?: number): number; /** * Get a boolean value from configuration. * Parses string values: 'true', '1', 'yes', 'on' -> true (case-insensitive) * * @param path - Dot notation path * @param defaultValue - Default value if not found * @returns Boolean value */ getBoolean(path: string, defaultValue?: boolean): boolean; } //# sourceMappingURL=config.service.d.ts.map