/**
 * Markdown File Processor
 *
 * Processes Markdown files with structure extraction and analysis.
 * Markdown files are analyzed to extract metadata about their structure
 * including headings, code blocks, and tables.
 *
 * Features:
 * - Original content preservation
 * - Line count calculation
 * - Code block detection
 * - Table detection
 * - Heading extraction (all levels)
 *
 * @module processors/markup/MarkdownProcessor
 *
 * @example
 * ```typescript
 * import { markdownProcessor, processMarkdown, isMarkdownFile } from "./markup/MarkdownProcessor.js";
 *
 * // Check if file is Markdown
 * if (isMarkdownFile(mimetype, filename)) {
 *   const result = await processMarkdown(fileInfo);
 *   if (result.success) {
 *     console.log('Line count:', result.data.lineCount);
 *     console.log('Headings:', result.data.headings);
 *     console.log('Has code blocks:', result.data.hasCodeBlocks);
 *   }
 * }
 * ```
 */
import { BaseFileProcessor } from "../base/BaseFileProcessor.js";
import type { FileInfo, ProcessorFileProcessingResult, ProcessOptions, ProcessedMarkdown } from "../../types/index.js";
/**
 * Markdown Processor - processes Markdown files with structure analysis.
 *
 * This processor analyzes Markdown documents to extract structural metadata
 * including headings, code blocks, and tables. The original content is
 * preserved for AI processing.
 *
 * Priority: 40 (before JSON at 50, before generic text at 110)
 *
 * @example
 * ```typescript
 * const processor = new MarkdownProcessor();
 *
 * const result = await processor.processFile({
 *   id: 'md-123',
 *   name: 'README.md',
 *   mimetype: 'text/markdown',
 *   size: 4096,
 *   url: 'https://example.com/README.md',
 * });
 *
 * if (result.success) {
 *   console.log('Headings:', result.data.headings);
 *   console.log('Has code blocks:', result.data.hasCodeBlocks);
 * }
 * ```
 */
export declare class MarkdownProcessor extends BaseFileProcessor<ProcessedMarkdown> {
    constructor();
    /**
     * Validate downloaded Markdown file.
     * Markdown is very permissive - almost any text is valid.
     *
     * @param buffer - Downloaded file content
     * @param _fileInfo - Original file information
     * @returns null if valid, error message if invalid
     */
    protected validateDownloadedFile(buffer: Buffer, _fileInfo: FileInfo): Promise<string | null>;
    /**
     * Build processed Markdown result with structure analysis.
     *
     * Processing steps:
     * 1. Preserve original content
     * 2. Count lines
     * 3. Detect fenced code blocks
     * 4. Detect tables
     * 5. Extract headings
     *
     * @param buffer - Downloaded file content
     * @param fileInfo - Original file information
     * @returns Processed Markdown result
     */
    protected buildProcessedResult(buffer: Buffer, fileInfo: FileInfo): ProcessedMarkdown;
}
/**
 * Singleton Markdown processor instance.
 * Use this for most processing needs.
 *
 * @example
 * ```typescript
 * import { markdownProcessor } from "./markup/MarkdownProcessor.js";
 *
 * const result = await markdownProcessor.processFile(fileInfo);
 * ```
 */
export declare const markdownProcessor: MarkdownProcessor;
/**
 * Check if a file is a Markdown file.
 *
 * @param mimetype - MIME type of the file
 * @param filename - Filename (for extension-based detection)
 * @returns true if the file is a Markdown file
 *
 * @example
 * ```typescript
 * if (isMarkdownFile('text/markdown', 'README.md')) {
 *   // Handle as Markdown
 * }
 *
 * // Also works with just filename
 * if (isMarkdownFile('', 'CHANGELOG.markdown')) {
 *   // Handle as Markdown based on extension
 * }
 * ```
 */
export declare function isMarkdownFile(mimetype: string, filename: string): boolean;
/**
 * Validate Markdown file size against configured limit.
 *
 * @param sizeBytes - File size in bytes
 * @returns true if size is within the allowed limit
 *
 * @example
 * ```typescript
 * if (!validateMarkdownSize(fileInfo.size)) {
 *   console.error('Markdown file is too large');
 * }
 * ```
 */
export declare function validateMarkdownSize(sizeBytes: number): boolean;
/**
 * Process a single Markdown file.
 * Convenience function that uses the singleton processor.
 *
 * @param fileInfo - File information (can include URL or buffer)
 * @param options - Optional processing options (auth headers, timeout, retry config)
 * @returns Processing result with Markdown content and structure analysis
 *
 * @example
 * ```typescript
 * const result = await processMarkdown({
 *   id: 'md-123',
 *   name: 'README.md',
 *   mimetype: 'text/markdown',
 *   size: 4096,
 *   buffer: markdownBuffer,
 * });
 *
 * if (result.success) {
 *   console.log('Line count:', result.data.lineCount);
 *   console.log('Headings:', result.data.headings);
 *   if (result.data.hasCodeBlocks) {
 *     console.log('Document contains code examples');
 *   }
 * } else {
 *   console.error('Processing failed:', result.error.userMessage);
 * }
 * ```
 */
export declare function processMarkdown(fileInfo: FileInfo, options?: ProcessOptions): Promise<ProcessorFileProcessingResult<ProcessedMarkdown>>;
