/**
 * File Processor Integration
 *
 * Provides integration between the ProcessorRegistry and message building.
 * This module allows for automatic file type detection and processing
 * using the registered file processors.
 *
 * @module processors/integration/FileProcessorIntegration
 *
 * @example
 * ```typescript
 * import {
 *   processFileWithRegistry,
 *   processBatchWithRegistry,
 *   getSupportedFileTypes,
 *   isFileTypeSupported,
 *   getProcessorForFile,
 * } from "./integration/index.js";
 *
 * // Process a single file
 * const { processorName, result } = await processFileWithRegistry(fileInfo);
 * if (result?.success) {
 *   console.log(`Processed with ${processorName}:`, result.data);
 * }
 *
 * // Process multiple files
 * const batchResult = await processBatchWithRegistry(files, { maxFiles: 50 });
 * console.log(`Successful: ${batchResult.successful.length}`);
 * console.log(`Failed: ${batchResult.failed.length}`);
 * console.log(`Skipped: ${batchResult.skipped.length}`);
 *
 * // Check if a file type is supported
 * if (isFileTypeSupported("application/pdf", "document.pdf")) {
 *   console.log("PDF files are supported");
 * }
 * ```
 */
import type { FileInfo, FileProcessingResult, ProcessedFileBase, ProcessOptions, ProcessorMatch } from "../base/types.js";
/**
 * Options for processing files through the registry.
 * Extends base ProcessOptions with registry-specific options.
 *
 * @example
 * ```typescript
 * const options: FileProcessingOptions = {
 *   // Base options
 *   authHeaders: { Authorization: "Bearer token" },
 *   timeout: 60000,
 *
 *   // Registry-specific options
 *   preferredProcessor: "pdf",      // Use specific processor
 *   allowFallback: true,            // Allow fallback if no processor found
 *   maxFiles: 50,                   // Limit batch processing
 * };
 * ```
 */
export type FileProcessingOptions = ProcessOptions & {
    /** Preferred processor name (bypasses auto-detection) */
    preferredProcessor?: string;
    /** Whether to fall back to default processing if no processor found */
    allowFallback?: boolean;
    /** Maximum number of files to process (default: 100) */
    maxFiles?: number;
};
/**
 * Result of processing multiple files through the registry.
 * Categorizes files into successful, failed, and skipped.
 *
 * @example
 * ```typescript
 * const result = await processBatchWithRegistry(files);
 *
 * // Handle successful files
 * for (const { fileInfo, processorName, result } of result.successful) {
 *   console.log(`${fileInfo.name}: processed by ${processorName}`);
 * }
 *
 * // Handle failed files
 * for (const { fileInfo, error } of result.failed) {
 *   console.error(`${fileInfo.name}: ${error}`);
 * }
 *
 * // Handle skipped files
 * for (const { fileInfo, reason } of result.skipped) {
 *   console.warn(`${fileInfo.name}: ${reason}`);
 * }
 * ```
 */
export type BatchFileProcessingResult = {
    /** Successfully processed files */
    successful: Array<{
        fileInfo: FileInfo;
        processorName: string;
        result: FileProcessingResult<ProcessedFileBase>;
    }>;
    /** Files that failed to process */
    failed: Array<{
        fileInfo: FileInfo;
        error: string;
    }>;
    /** Files that were skipped (no processor found or over limit) */
    skipped: Array<{
        fileInfo: FileInfo;
        reason: string;
    }>;
};
/**
 * Process a single file using the ProcessorRegistry.
 * Automatically detects the appropriate processor based on MIME type and filename.
 *
 * @param fileInfo - File information including content/URL
 * @param options - Processing options (preferred processor, auth headers, timeout)
 * @returns Object containing processor name (null if none found) and processing result
 *
 * @example
 * ```typescript
 * // Basic usage - auto-detect processor
 * const { processorName, result } = await processFileWithRegistry({
 *   id: "file-123",
 *   name: "document.pdf",
 *   mimetype: "application/pdf",
 *   size: 1024000,
 *   url: "https://example.com/document.pdf",
 * });
 *
 * if (result?.success) {
 *   console.log(`Processed by ${processorName}:`, result.data);
 * }
 *
 * // Use a specific processor
 * const { result } = await processFileWithRegistry(fileInfo, {
 *   preferredProcessor: "pdf",
 * });
 *
 * // With authentication and timeout
 * const { result } = await processFileWithRegistry(fileInfo, {
 *   authHeaders: { Authorization: "Bearer token123" },
 *   timeout: 60000,
 * });
 * ```
 */
export declare function processFileWithRegistry(fileInfo: FileInfo, options?: FileProcessingOptions): Promise<{
    processorName: string | null;
    result: FileProcessingResult<ProcessedFileBase> | null;
}>;
/**
 * Process multiple files using the ProcessorRegistry.
 * Files are processed sequentially and categorized by outcome.
 *
 * @param files - Array of file information objects
 * @param options - Processing options (max files, auth headers, timeout)
 * @returns Batch result with successful, failed, and skipped files
 *
 * @example
 * ```typescript
 * const files: FileInfo[] = [
 *   { id: "1", name: "image.jpg", mimetype: "image/jpeg", size: 512000 },
 *   { id: "2", name: "doc.pdf", mimetype: "application/pdf", size: 1024000 },
 *   { id: "3", name: "unknown.xyz", mimetype: "application/octet-stream", size: 100 },
 * ];
 *
 * const result = await processBatchWithRegistry(files, {
 *   maxFiles: 50,
 *   timeout: 60000,
 * });
 *
 * console.log(`Processed ${result.successful.length} files successfully`);
 * console.log(`Failed: ${result.failed.length}`);
 * console.log(`Skipped: ${result.skipped.length}`);
 *
 * // Access individual results
 * for (const { fileInfo, processorName, result } of result.successful) {
 *   console.log(`${fileInfo.name}: ${result.data?.size} bytes`);
 * }
 * ```
 */
export declare function processBatchWithRegistry(files: FileInfo[], options?: FileProcessingOptions): Promise<BatchFileProcessingResult>;
/**
 * Get a list of supported file types from the registry.
 * Returns information about each registered processor including
 * supported MIME types, extensions, and priority.
 *
 * @returns Array of processor information objects
 *
 * @example
 * ```typescript
 * const supportedTypes = getSupportedFileTypes();
 *
 * for (const { name, mimeTypes, extensions, priority } of supportedTypes) {
 *   console.log(`${name} (priority: ${priority})`);
 *   console.log(`  MIME types: ${mimeTypes.join(", ")}`);
 *   console.log(`  Extensions: ${extensions.join(", ")}`);
 * }
 * ```
 */
export declare function getSupportedFileTypes(): Promise<Array<{
    name: string;
    mimeTypes: string[];
    extensions: string[];
    priority: number;
}>>;
/**
 * Check if a file type is supported by any registered processor.
 *
 * @param mimetype - MIME type of the file
 * @param filename - Filename (for extension-based detection)
 * @returns true if a processor exists for this file type
 *
 * @example
 * ```typescript
 * // Check by MIME type and filename
 * if (isFileTypeSupported("application/pdf", "document.pdf")) {
 *   console.log("PDF files are supported");
 * }
 *
 * // Useful for validation before upload
 * function validateFile(file: File): boolean {
 *   return isFileTypeSupported(file.type, file.name);
 * }
 * ```
 */
export declare function isFileTypeSupported(mimetype: string, filename: string): Promise<boolean>;
/**
 * Get the processor that would handle a specific file.
 * Returns the full processor match including confidence score.
 *
 * @param mimetype - MIME type of the file
 * @param filename - Filename (for extension-based detection)
 * @returns Processor match or null if no processor found
 *
 * @example
 * ```typescript
 * const match = getProcessorForFile("image/jpeg", "photo.jpg");
 *
 * if (match) {
 *   console.log(`Would use ${match.name} processor`);
 *   console.log(`Priority: ${match.priority}`);
 *   console.log(`Confidence: ${match.confidence}%`);
 * } else {
 *   console.log("No processor available for this file type");
 * }
 * ```
 */
export declare function getProcessorForFile(mimetype: string, filename: string): Promise<ProcessorMatch | null>;
