import type { Config, Nullable } from "../types/index.js"; /** * CLI override map. Keys are dot-separated CONFIG_METADATA paths (e.g., "server.port", "paths.chromeDataDir"). Values are the parsed CLI flag values. Applied as the * highest-priority merge pass in mergeConfiguration(). */ export type CliOverrides = Record; export declare let CONFIG: Config; /** * Indicates whether a user config file parse error occurred during initialization. The web UI displays a warning when this is true. */ export declare let configParseError: boolean; /** * The parse error message if configParseError is true. */ export declare let configParseErrorMessage: string | undefined; /** * Initializes the configuration by loading the user config file, merging with defaults, applying environment variable overrides, and applying CLI overrides. This * must be called at startup before any code accesses CONFIG. After initialization, the CONFIG object contains the final merged values. * @param cliOverrides - Optional CLI flag overrides, applied at the highest priority level. */ export declare function initializeConfiguration(cliOverrides?: CliOverrides): Promise; /** * Returns a deep copy of the default configuration. Used by the web UI to display default values and handle reset operations. * @returns A copy of the default configuration. */ export declare function getDefaults(): Config; /** * Validates that a configuration value is a positive integer within an optional range. This helper performs the common validation pattern of checking for valid * integers and enforcing minimum/maximum bounds. It returns an error message if validation fails, allowing the caller to collect all errors before reporting them. * @param name - The configuration name for error messages, typically the environment variable name. * @param value - The value to validate, typically parsed from an environment variable. * @param min - Optional minimum allowed value (inclusive). * @param max - Optional maximum allowed value (inclusive). * @returns Error message if invalid, null if valid. */ export declare function validatePositiveInt(name: string, value: number, min?: number, max?: number): Nullable; /** * Validates that a configuration value is a positive number (including floats) within an optional range. * @param name - The configuration name for error messages. * @param value - The value to validate. * @param min - Optional minimum allowed value (inclusive). * @param max - Optional maximum allowed value (inclusive). * @returns Error message if invalid, null if valid. */ export declare function validatePositiveNumber(name: string, value: number, min?: number, max?: number): Nullable; /** * Validates all configuration values and throws an error if any are invalid. This function runs at startup after configuration initialization. We collect all * validation errors before throwing to provide complete feedback rather than failing on the first error and requiring multiple restart cycles to find all problems. * @throws If any configuration value is invalid. The error message lists all invalid values. */ export declare function validateConfiguration(): void; /** * Displays the active configuration at startup. This helps operators verify their settings and diagnose connection issues. We log only the most commonly adjusted * values to keep output concise while providing useful debugging information. * * This function also checks for preset degradation and logs a warning if the configured preset exceeds display capabilities. The warning helps users understand why * their stream resolution may be lower than configured. */ export declare function displayConfiguration(): void;