/** * Format Detector for Virtual Filesystem * Detects data format from extension, content-type, or content inspection */ /** * Supported data formats */ export type DataFormat = 'csv' | 'json' | 'parquet' | 'arrow' | 'excel' | 'text' | 'binary' | 'unknown'; /** * DuckDB reader function for each format */ export interface FormatReader { format: DataFormat; readerFunction: string; requiresQuotes: boolean; supportsGlob: boolean; } /** * Detects data format from various sources */ export declare class FormatDetector { private static readonly EXTENSION_MAP; private static readonly CONTENT_TYPE_MAP; /** * Detect format from file extension * @param filename The filename or path * @returns Detected format or 'unknown' */ static fromExtension(filename: string): DataFormat; /** * Detect format from MIME content-type * @param contentType The MIME content-type * @returns Detected format or 'unknown' */ static fromContentType(contentType: string): DataFormat; /** * Detect format from content inspection (magic numbers) * @param content Buffer or first bytes of content * @returns Detected format or 'unknown' */ static fromContent(content: Buffer | Uint8Array): DataFormat; /** * Detect format using all available information * @param options Detection options * @returns Detected format with confidence */ static detect(options: { filename?: string; contentType?: string; content?: Buffer | Uint8Array; }): { format: DataFormat; confidence: number; }; /** * Get DuckDB reader function for format * @param format The data format * @returns Reader function details */ static getReader(format: DataFormat): FormatReader; /** * Build DuckDB query for reading a file * @param path The file path * @param format The data format * @returns SQL fragment for reading the file */ static buildReadQuery(path: string, format: DataFormat): string; /** * Check if text looks like CSV */ private static looksLikeCSV; /** * Check if text looks like JSON */ private static looksLikeJSON; /** * Get MIME type for format * @param format The data format * @returns MIME content-type */ static getMimeType(format: DataFormat): string; /** * Get file extension for format * @param format The data format * @returns Recommended file extension */ static getExtension(format: DataFormat): string; } //# sourceMappingURL=FormatDetector.d.ts.map