import type { CodegenTypes, TurboModule } from "react-native"; import { TurboModuleRegistry } from "react-native"; type NativeOfflinePackDownloadState = "inactive" | "active" | "complete"; export type NativeOfflinePack = { id: string; bounds: CodegenTypes.Double[]; metadata: string; }; type NativeOfflinePackCreateOptions = { mapStyle: string; bounds: CodegenTypes.Double[]; minZoom: CodegenTypes.Double; maxZoom: CodegenTypes.Double; metadata: string; }; type NativeOfflinePackStatus = { id: string; state: NativeOfflinePackDownloadState; percentage: CodegenTypes.Double; completedResourceCount: CodegenTypes.Int32; completedResourceSize: CodegenTypes.Int32; completedTileCount: CodegenTypes.Int32; completedTileSize: CodegenTypes.Int32; requiredResourceCount: CodegenTypes.Int32; }; type NativeOfflinePackError = { id: string; message: string; }; export interface Spec extends TurboModule { createPack( options: NativeOfflinePackCreateOptions, ): Promise; getPacks(): Promise; deletePack(id: string): Promise; invalidatePack(id: string): Promise; pausePackDownload(id: string): Promise; resumePackDownload(id: string): Promise; getPackStatus(id: string): Promise; setPackObserver(id: string): Promise; invalidateAmbientCache(): Promise; clearAmbientCache(): Promise; setMaximumAmbientCacheSize(size: number): Promise; resetDatabase(): Promise; mergeOfflineRegions(path: string): Promise; setTileCountLimit(limit: number): void; setProgressEventThrottle(throttleValue: number): void; readonly onProgress: CodegenTypes.EventEmitter; readonly onError: CodegenTypes.EventEmitter; } export default TurboModuleRegistry.getEnforcing("MLRNOfflineModule");