Platform-specific TypeScript declarations for NativeScript for accessing native objects
84
Build a simple image gallery downloader that fetches multiple images from URLs and saves them to the local file system with metadata tracking.
Your task is to implement a utility that:
@generates
/**
* Configuration for the image gallery downloader
*/
export interface DownloadConfig {
/** Array of image URLs to download */
imageUrls: string[];
/** Directory path where images should be saved */
targetDirectory: string;
/** File path where metadata JSON should be written */
metadataPath: string;
}
/**
* Result for a single image download operation
*/
export interface DownloadResult {
/** Original image URL */
url: string;
/** Local file path where image was saved (or attempted) */
localPath: string;
/** Whether the download succeeded */
success: boolean;
/** Error message if download failed */
error?: string;
}
/**
* Downloads multiple images and saves them with metadata
* @param config - Download configuration
* @param onComplete - Callback invoked when all downloads finish
*/
export function downloadImageGallery(
config: DownloadConfig,
onComplete: (results: DownloadResult[]) => void
): void;Provides Android platform declarations for NativeScript, including async operations for image downloads and file writes.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-tns-platform-declarationsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10