/** * Current configuration schema version. * Increment when making breaking changes to the config schema. */ export declare const CURRENT_CONFIG_VERSION = "1.0.0"; /** * Version history for migrations. */ export declare const CONFIG_VERSIONS: readonly ["1.0.0"]; export interface LayerDefinition { name: string; patterns: string[]; color?: string; } export interface DomainDefinition { name: string; patterns: string[]; critical?: boolean; } export interface ExternalServiceDefinition { name: string; patterns: string[]; type?: string; } export type OutputFormat = 'markdown' | 'html' | 'svg'; /** * Selects which companion artifacts are written alongside the JSON graph. * * The JSON itself is not listed: it is the `-o` target, so it is always * written. Output location is likewise `-o`'s job — a `directory` here could * only contradict it. */ export interface OutputConfig { formats: OutputFormat[]; } /** * Full project configuration, including all optional advanced fields. * The minimal subset (rootDir, include, exclude) is compatible with * the ProjectConfig used by FileDiscovery. */ export interface FullProjectConfig { /** Configuration schema version */ version?: string; rootDir: string; include: string[]; exclude: string[]; layers: LayerDefinition[]; domains: DomainDefinition[]; externalServices: ExternalServiceDefinition[]; output: OutputConfig; } export interface ValidationResult { valid: boolean; errors: string[]; warnings?: string[]; } /** * Config file names searched for, in order, when no explicit path is given. */ export declare const CONFIG_FILE_NAMES: readonly ["architecture-config.json", "architecture-config.yaml", "architecture-config.yml"]; export declare const DEFAULT_CONFIG: FullProjectConfig; /** * Loads, validates, and merges architecture diagram generator configuration. * * - Supports JSON config files (YAML support requires js-yaml dependency) * - Returns defaults when config file is not found * - Warns to console and returns defaults on malformed config * - Supports configuration versioning and migrations * - Requirements: 4.3, 7.1, 7.6, 7.7, 9.6 */ export declare class ConfigurationLoader { /** * Loads configuration from the given path (or searches for defaults). * Falls back to DEFAULT_CONFIG on missing or malformed files. * * @param configPath - Optional explicit path to config file * @returns Merged FullProjectConfig */ load(configPath?: string, rootDir?: string): Promise; /** * Recursively interpolates environment variables (format: ${VAR_NAME}) in the config object. * * @param obj - Object or value to interpolate * @returns Interpolated object or value */ private interpolateEnvVars; /** * Validates the structure of a config object. * * @param config - Object to validate * @returns ValidationResult with valid flag and error messages */ validate(config: unknown): ValidationResult; /** * Merges user-provided partial config with defaults. * User values override defaults (Req 7.6). * * @param userConfig - Partial config from user * @param defaults - Default config to fill missing fields * @returns Complete FullProjectConfig */ merge(userConfig: Partial, defaults: FullProjectConfig): FullProjectConfig; /** * Migrates a config to the current version. * Applies all migrations from the config's version to the current version. * This is a public method for testing and advanced use cases. * * @param config - Config object to migrate * @returns Migrated config object */ migrate(config: Record): Record; /** * Returns the path of the first config file that actually exists under * `rootDir`, or undefined when the project has no config file. * * Callers use the undefined case to distinguish "no config" from "config * that happens to match the defaults" — only the former should leave * discovery unfiltered. * * @param rootDir - Directory to search (defaults to the current working directory) */ resolveConfigPath(rootDir?: string): Promise; /** * Gets the current configuration version. */ getCurrentVersion(): string; /** * Checks if a version is supported. * @param version - Version to check */ isVersionSupported(version: string): boolean; /** * Parses a config file based on its extension. * Currently supports JSON; YAML requires the js-yaml package. */ private parseFile; private isStringArray; } //# sourceMappingURL=ConfigurationLoader.d.ts.map