/**
 * @file Output writer and asset bundler for APIDoc
 *
 * Handles the generation of HTML documentation files, bundling of assets,
 * and management of output directory structure.
 *
 * @author Href Spa <hola@apidoc.app>
 * @copyright 2025 Href SpA
 * @license MIT
 */
import fs from 'fs-extra';
import path from 'path';
/**
 * Documentation output writer and asset bundler
 *
 * The Writer class is responsible for:
 * - Generating HTML documentation files from parsed API data
 * - Bundling JavaScript and CSS assets using esbuild
 * - Managing output directory structure and file copying
 * - Handling template processing and content generation
 * - Cache busting for static assets
 *
 * @example Basic usage
 * ```typescript
 * const writer = new Writer(apiData, appContext);
 * await writer.write();
 * console.log('Documentation generated successfully');
 * ```
 *
 * @example Custom cache busting
 * ```typescript
 * const writer = new Writer(apiData, appContext, 'v=1.2.0');
 * await writer.write();
 * ```
 *
 * @since 4.0.0
 * @public
 */
declare class Writer {
    api: any;
    log: any;
    opt: any;
    cacheBustingQueryParam: string;
    fs: typeof fs;
    path: typeof path;
    private authProcessor;
    /**
     * Creates a new Writer instance for generating documentation output
     *
     * @param api - Parsed API data and project information from the core parser
     * @param api.data - JSON string containing the parsed API endpoints and documentation
     * @param api.project - JSON string containing project metadata (name, version, etc.)
     * @param app - Application context containing shared instances and configuration
     * @param app.log - Logger instance for output and debugging
     * @param app.options - Application options including source paths, destination, etc.
     * @param cacheBustingQueryParam - Cache-busting query parameter for static assets.
     *   Defaults to current timestamp to ensure fresh assets on each build.
     *
     * @example
     * ```typescript
     * const writer = new Writer(
     *   { data: '[]', project: '{}' },
     *   { log: logger, options: { dest: './docs' } }
     * );
     * ```
     *
     * @example With custom cache busting
     * ```typescript
     * const writer = new Writer(apiData, appContext, 'v=2.1.0');
     * ```
     */
    constructor(api: any, app: any, cacheBustingQueryParam?: string);
    /**
     * Initialize authentication system if login configuration is present
     */
    private initializeAuthentication;
    /**
     * Write output files based on configuration.
     *
     * If dry run mode is enabled, no files are created, and the method simply logs the operation and
     * resolves the promise. Otherwise, it creates the necessary files either as a single file or
     * multiple output files based on the specified options.
     *
     * @returns {Promise<void>} Promise that resolves when file writing is complete.
     * @memberof Writer
     */
    write(): Promise<any>;
    /**
     * Attempt to locate the specified asset file path and retrieve its resolved path.
     * If the file cannot be resolved, an error is logged.
     *
     * @param {string} assetPath - Relative file path of the asset to find.
     * @returns {string|undefined} Return the resolved file path
     * @memberof Writer
     */
    findAsset(assetPath: any): string;
    /**
     * Generate OpenAPI 3.0 specification file (swagger.json)
     *
     * @memberof Writer
     */
    writeOpenApiSpec(): void;
    /**
     * Create output files in the destination directory
     *
     * Performs the following tasks:
     * - Creates the destination directory where the output files will be generated.
     * - Copies a template `index.html` file into the destination directory.
     * - Creates an `assets` folder within the destination directory.
     * - Optionally saves a parsed API file as `api-data.json` into the assets folder if the `writeJson` option is enabled.
     * - Generates OpenAPI specification if requested
     * - Executes a bundler operation for the assets folder.
     *
     * @returns {Promise<string>} Resolves as the bundling operation assets folder.
     * @memberof Writer
     */
    createOutputFiles(): Promise<any>;
    /**
     * Run the bundler to create a bundled JS file using esbuild.
     *
     * @param {string} outputPath - Path where the bundler will output
     * @returns {Promise<string>} Resolves with the output path upon successful bundling,
     *     or rejects with an error if the bundling process fails.
     * @memberof Writer
     */
    runBundler(outputPath: any): Promise<unknown>;
    /**
     * Read image files from a directory, then convert them to Base64 strings and map them to tokens.
     * - The tokens are used as keys to represent the Base64-encoded strings of the images.
     * - Images are sourced from the "img" subdirectory of the specified template path.
     * - Only valid files within the directory are processed. And the MIME type is determined based on the file extension.
     *
     * @returns {object} A mapping of token keys to Base64-encoded image strings, where each
     *     key is in the format "IMAGE_LINK_TOKEN_<filename>".
     * @memberof Writer
     */
    getBase64HeaderImages(): {};
    /**
     * Generate and return the content of the `index.html` file for the API documentation.
     *
     * Replaces predefined tokens with dynamic values such as the project title, description,
     * and cache-busting query parameters.
     *
     * @returns {string} Processed HTML content for the index page of the API documentation.
     * @memberof Writer
     */
    getIndexContent(): string;
    /**
     * Create a self-contained single HTML file by bundling CSS and JS into the file
     * - modify the main index HTML content to embed CSS, JS directly
     * - remove external links to assets
     * - save the final file to the destination directory
     *
     * @returns {Promise<void>} A promise that resolves once the single HTML file is successfully created.
     * @memberof Writer
     */
    createSingleFile(): Promise<void>;
    /**
     * Write a JSON file with the provided data.
     *
     * @param {string} dest - Destination file path where the file will be written.
     * @param {string} data - File data
     * @memberof Writer
     */
    writeJsonFile(dest: any, data: any): void;
    /**
     * Write a JS file with the provided data.
     *
     * @param {string} dest - Destination file path where the file will be written.
     * @param {string} data - File data
     * @memberof Writer
     */
    writeJSFile(dest: any, data: any): void;
    /**
     * Create a directory
     *
     * @param {string} dir - Path of the directory to create
     * @memberof Writer
     */
    createDir(dir: any): void;
}
export default Writer;
//# sourceMappingURL=writer.d.ts.map