/**
 * @file Configuration and content reader for APIDoc
 *
 * Handles reading project configuration files (apidoc.json, package.json),
 * header/footer content files, and manages project metadata.
 *
 * @author Href Spa <hola@apidoc.app>
 * @copyright 2025 Href SpA
 * @license MIT
 */
import { ApiDocProject, AppContext } from '../src/types';
/**
 * Default configuration values for APIDoc projects
 */
interface DefaultConfig {
    /** Default project name */
    name: string;
    /** Default version number */
    version: string;
    /** Default project description */
    description: string;
}
/**
 * Configuration for header and footer content files
 */
interface HeaderFooterConfig {
    /** Path to the markdown file containing content */
    filename?: string;
    /** Title for the header/footer section */
    title?: string;
    /** Font Awesome icon class (e.g., 'fa-home', 'fa-info-circle') */
    icon?: string;
}
/**
 * Logo configuration for custom branding
 */
interface LogoConfig {
    /** Logo image URL (can be relative path, absolute URL, or data URL) */
    url?: string;
    /** Alternative text for the logo image */
    alt?: string;
    /** Font Awesome icon class to use instead of image (e.g., 'fa-code', 'fa-api') */
    icon?: string;
    /** Width of the logo in CSS units (e.g., '32px', '2rem') */
    width?: string;
    /** Height of the logo in CSS units (e.g., '32px', '2rem') */
    height?: string;
}
/**
 * Group configuration for custom icons and titles
 */
interface GroupSettings {
    /** Font Awesome icon class (e.g., 'fa-user', 'fa-shield') */
    icon?: string;
    /** Custom title for the group */
    title?: string;
}
/**
 * Extended configuration interface combining project settings with file-specific options
 */
interface Config extends Partial<ApiDocProject> {
    /** Header configuration */
    header?: HeaderFooterConfig;
    /** Footer configuration */
    footer?: HeaderFooterConfig;
    /** Logo configuration for sidebar branding */
    logo?: LogoConfig;
    /** Input directories (legacy support) */
    input?: string[];
    /** APIDoc-specific configuration */
    apidoc?: any;
    /** Custom settings for groups (icons, titles, etc.) */
    settings?: Record<string, GroupSettings>;
}
/**
 * Default configuration values used when no config file is found
 */
declare const defaultConfig: DefaultConfig;
/**
 * Configuration and content reader for APIDoc projects
 *
 * The Reader class is responsible for:
 * - Reading and parsing configuration files (apidoc.json, package.json)
 * - Loading header and footer content from markdown files
 * - Merging configuration from multiple sources with proper precedence
 * - Providing validated project metadata for documentation generation
 *
 * @example Basic usage
 * ```typescript
 * const reader = new Reader(appContext);
 * const projectInfo = reader.read();
 * console.log('Project:', projectInfo.name, 'v' + projectInfo.version);
 * ```
 *
 * @example Configuration precedence
 * ```
 * 1. apidoc.json (highest priority)
 * 2. package.json (apidoc field)
 * 3. Default values (lowest priority)
 * ```
 *
 * @since 4.0.0
 * @public
 */
declare class Reader {
    private app;
    private log;
    private opt;
    /**
     * Initialize the Reader instance
     *
     * Sets up the reader with application context including logger and options.
     * The reader will use the provided configuration for file paths and processing options.
     *
     * @param app - Application context containing logger, options, and other shared state
     *
     * @example
     * ```typescript
     * const appContext: AppContext = {
     *   log: logger,
     *   options: { src: ['./src'], dest: './docs' },
     *   markdownParser: parser
     * };
     * const reader = new Reader(appContext);
     * ```
     */
    constructor(app: AppContext);
    /**
     * Reads and merges configuration from multiple sources
     *
     * This method searches for configuration files in the following order of precedence:
     * 1. `apidoc.json` - Dedicated APIDoc configuration file (highest priority)
     * 2. `apidoc.config.js` - JavaScript configuration file
     * 3. `package.json` - NPM package file with 'apidoc' field
     * 4. Default values - Built-in fallback configuration (lowest priority)
     *
     * The method also reads header and footer content files if specified in the configuration.
     *
     * @returns Merged configuration object containing:
     *   - Project metadata (name, version, description, etc.)
     *   - Header content and title (if specified)
     *   - Footer content and title (if specified)
     *   - API base URL and sample URL
     *   - Template and styling options
     *
     * @throws {Error} When configuration files exist but contain invalid JSON
     *
     * @example Configuration file precedence
     * ```
     * // 1. apidoc.json (if exists)
     * {
     *   "name": "My API",
     *   "version": "1.0.0",
     *   "header": { "filename": "header.md" }
     * }
     *
     * // 2. package.json (if apidoc.json doesn't exist)
     * {
     *   "name": "my-package",
     *   "version": "1.0.0",
     *   "apidoc": {
     *     "name": "My API Documentation"
     *   }
     * }
     * ```
     *
     * @example Return value structure
     * ```typescript
     * const config = reader.read();
     * // Returns:
     * {
     *   name: "My API",
     *   version: "1.0.0",
     *   description: "API documentation",
     *   header: {
     *     title: "Introduction",
     *     content: "<markdown content>"
     *   },
     *   footer: {
     *     title: "Contact",
     *     content: "<markdown content>"
     *   }
     * }
     * ```
     *
     * @since 4.0.0
     * @public
     */
    read(): Config;
    /**
     * Search for API documentation configuration files in specified directories.
     *
     * @returns Merged configuration object
     */
    search(): Config;
    /**
     * Get json.header / json.footer title and markdown content
     *
     * Retrieves and processes header and footer configurations by reading content from the specified files
     * and rendering it with a Markdown parser if available.
     *
     * @param config - Configuration object containing details about header and footer settings.
     * @returns Object containing processed header and footer content, including their titles.
     * @throws If the header or footer file cannot be read.
     */
    getHeaderFooter(config: Config): {
        header?: any;
        footer?: any;
    };
    /**
     * Search for a configuration file in a specified directory.
     *
     * @param filename - Name of the configuration file to locate.
     * @param dir - Directory to scan
     * @returns Configuration data if the file is found, or an empty object if not found.
     */
    findConfigFileInDir(filename: string, dir: string): Config;
    /**
     * Look for a file in each of the input folders.
     *
     * If multiple files with the same name exist in different directories, the method returns the first valid file it finds.
     *
     * @param filename - Name of the file to search for
     * @returns Resolved path of the found file, or an empty string if not.
     */
    findFileInSrc(filename: string): string;
}
export { defaultConfig, Reader };
//# sourceMappingURL=reader.d.ts.map