import type { TurboModule } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; export interface Spec extends TurboModule { // Image image_compress(imagePath: string, optionMap: Object): Promise; getImageMetaData(filePath: string): Promise; // Video compress(fileUrl: string, optionMap: Object): Promise; cancelCompression(uuid: string): void; getVideoMetaData(filePath: string): Promise; activateBackgroundTask(options: Object): Promise; deactivateBackgroundTask(options: Object): Promise; //Audio compress_audio(fileUrl: string, optionMap: Object): Promise; // Upload upload(fileUrl: string, options: Object): Promise; // Cancel upload cancelUpload(uuid: string, shouldCancelAll: boolean): void; // Download download(fileUrl: string, options: Object): Promise; // Others generateFilePath(_extension: string): Promise; getRealPath(path: string, type: string): Promise; getFileSize(filePath: string): Promise; addListener(eventName: string): void; removeListeners(count: number): void; createVideoThumbnail( fileUrl: string, options: Object ): Promise<{ path: string; size: number; mime: string; width: number; height: number; }>; clearCache(cacheDir: string | null): Promise; } export default TurboModuleRegistry.getEnforcing('Compressor');