/** * Metadata Extraction Plugin * Extract comprehensive metadata from various file types * * @module @plyaz/storage/plugins/metadata-extraction * * @example * ```typescript * import { MetadataExtractionPlugin } from '@plyaz/storage/plugins'; * * const metadataPlugin = new MetadataExtractionPlugin({ * extractExif: true, * extractId3: true, * extractVideoMeta: true, * extractDocMeta: true, * stripSensitiveData: true, * priority: 30, * }); * ``` */ import { BasePlugin } from '../../base/BasePlugin'; import type { StoragePluginContext, StoragePluginHealth, BeforeUploadResult, StoragePluginFile, MetadataExtractionPluginConfig, StorageMetadataExtractionPluginStatistics } from '@plyaz/types/storage'; /** * Metadata Extraction Plugin * Extract comprehensive metadata from various file types * * Features: * - Image EXIF data (camera, location, date) * - Audio ID3 tags (artist, album, genre) * - Video metadata (codec, resolution, duration, fps) * - Document properties (author, title, page count) * - Privacy features (strip GPS, serial numbers) */ export declare class MetadataExtractionPlugin extends BasePlugin { private readonly extractExif; private readonly extractId3; private readonly extractVideoMeta; private readonly extractDocMeta; private readonly stripSensitiveData; private readonly preserveOriginal; private readonly supportedMimeTypes; private filesProcessed; private metadataExtracted; constructor(config?: MetadataExtractionPluginConfig); /** * Extract metadata before upload */ beforeUpload(file: StoragePluginFile, _context: StoragePluginContext): Promise; /** * Extract metadata from file based on mime type */ private extractMetadata; /** * Categorize file based on mime type */ private categorizeFile; /** * Extract EXIF data from images * Uses exifr to extract metadata from images */ private extractExifData; /** * Extract ID3 tags from audio files * Uses music-metadata to extract tags from various audio formats // eslint-disable-next-line complexity */ private extractId3Data; /** * Extract metadata from video files // eslint-disable-next-line complexity * Uses fluent-ffmpeg to extract video metadata via ffprobe */ private extractVideoMetadata; /** // eslint-disable-next-line complexity * Extract metadata from documents * Uses pdf-parse to extract metadata from PDF files */ private extractDocumentMetadata; /** * Parse frame rate string (e.g., "30/1" -> 30) */ private parseFrameRate; /** * Strip sensitive metadata (GPS coordinates, serial numbers) */ private stripSensitiveMetadata; /** * Health check */ healthCheck(): Promise; /** * Get processing statistics */ getStatistics(): StorageMetadataExtractionPluginStatistics; }