UNPKG

@toast-studios/asset-manager

Version:

A React Native asset management library with intelligent caching and loading strategies

85 lines (84 loc) 3.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AssetManagerEvent = exports.DownloadStatus = exports.DownloadStrategy = exports.NetworkType = exports.DownloadPriority = exports.AssetQuality = exports.AssetType = void 0; /** * Asset types supported by the manager */ var AssetType; (function (AssetType) { AssetType["LOTTIE"] = "lottie"; AssetType["IMAGE"] = "image"; AssetType["VIDEO"] = "video"; })(AssetType = exports.AssetType || (exports.AssetType = {})); /** * Asset quality levels for prioritization */ var AssetQuality; (function (AssetQuality) { AssetQuality["MEDIUM"] = "720p"; AssetQuality["HIGH"] = "1080p"; })(AssetQuality = exports.AssetQuality || (exports.AssetQuality = {})); /** * Download priorities */ var DownloadPriority; (function (DownloadPriority) { DownloadPriority[DownloadPriority["CRITICAL"] = 0] = "CRITICAL"; DownloadPriority[DownloadPriority["HIGH"] = 1] = "HIGH"; DownloadPriority[DownloadPriority["MEDIUM"] = 2] = "MEDIUM"; DownloadPriority[DownloadPriority["LOW"] = 3] = "LOW"; DownloadPriority[DownloadPriority["BACKGROUND"] = 4] = "BACKGROUND"; })(DownloadPriority = exports.DownloadPriority || (exports.DownloadPriority = {})); /** * Network connection types */ var NetworkType; (function (NetworkType) { NetworkType["WIFI"] = "wifi"; NetworkType["CELLULAR"] = "cellular"; NetworkType["ETHERNET"] = "ethernet"; NetworkType["UNKNOWN"] = "unknown"; })(NetworkType = exports.NetworkType || (exports.NetworkType = {})); /** * Download strategies */ var DownloadStrategy; (function (DownloadStrategy) { DownloadStrategy["DEFAULT"] = "default"; DownloadStrategy["NETWORK_AWARE"] = "network-aware"; DownloadStrategy["DEVICE_AWARE"] = "device-aware"; DownloadStrategy["HYBRID"] = "hybrid"; DownloadStrategy["BANDWIDTH_OPTIMIZED"] = "bandwidth-optimized"; })(DownloadStrategy = exports.DownloadStrategy || (exports.DownloadStrategy = {})); /** * Download status */ var DownloadStatus; (function (DownloadStatus) { DownloadStatus["PENDING"] = "pending"; DownloadStatus["DOWNLOADING"] = "downloading"; DownloadStatus["EXTRACTING"] = "extracting"; DownloadStatus["COMPLETED"] = "completed"; DownloadStatus["FAILED"] = "failed"; DownloadStatus["CANCELLED"] = "cancelled"; DownloadStatus["PAUSED"] = "paused"; })(DownloadStatus = exports.DownloadStatus || (exports.DownloadStatus = {})); /** * Event types for asset manager */ var AssetManagerEvent; (function (AssetManagerEvent) { AssetManagerEvent["DOWNLOAD_STARTED"] = "download_started"; AssetManagerEvent["DOWNLOAD_PROGRESS"] = "download_progress"; AssetManagerEvent["DOWNLOAD_COMPLETED"] = "download_completed"; AssetManagerEvent["DOWNLOAD_FAILED"] = "download_failed"; AssetManagerEvent["EXTRACTION_STARTED"] = "extraction_started"; AssetManagerEvent["EXTRACTION_COMPLETED"] = "extraction_completed"; AssetManagerEvent["EXTRACTION_FAILED"] = "extraction_failed"; AssetManagerEvent["GAME_READY"] = "game_ready"; AssetManagerEvent["MANIFEST_LOADED"] = "manifest_loaded"; AssetManagerEvent["MANIFEST_FAILED"] = "manifest_failed"; AssetManagerEvent["NETWORK_CHANGED"] = "network_changed"; AssetManagerEvent["STORAGE_WARNING"] = "storage_warning"; AssetManagerEvent["CLEANUP_COMPLETED"] = "cleanup_completed"; })(AssetManagerEvent = exports.AssetManagerEvent || (exports.AssetManagerEvent = {}));