{"version":3,"sources":["../src/config/types.ts"],"names":["AssetType","ServiceWorkerMessageType"],"mappings":";AAYO,IAAK,SAAA,qBAAAA,UAAAA,KAAL;AACL,EAAAA,WAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,WAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,WAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,WAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,WAAA,OAAA,CAAA,GAAQ,OAAA;AALE,EAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAwEL,IAAK,wBAAA,qBAAAC,yBAAAA,KAAL;AACL,EAAAA,0BAAA,aAAA,CAAA,GAAc,aAAA;AACd,EAAAA,0BAAA,kBAAA,CAAA,GAAmB,kBAAA;AACnB,EAAAA,0BAAA,gBAAA,CAAA,GAAiB,gBAAA;AACjB,EAAAA,0BAAA,aAAA,CAAA,GAAc,aAAA;AACd,EAAAA,0BAAA,iBAAA,CAAA,GAAkB,iBAAA;AAClB,EAAAA,0BAAA,aAAA,CAAA,GAAc,aAAA;AANJ,EAAA,OAAAA,yBAAAA;AAAA,CAAA,EAAA,wBAAA,IAAA,EAAA","file":"types.mjs","sourcesContent":["/**\n * Asset Cache Type Definitions\n * Centralized type definitions for the entire asset cache system\n */\n\n// ============================================================================\n// CORE ASSET TYPES\n// ============================================================================\n\n/**\n * Asset types that can be cached\n */\nexport enum AssetType {\n  IMAGE = \"image\",\n  VIDEO = \"video\",\n  FONT = \"font\",\n  AUDIO = \"audio\",\n  OTHER = \"other\",\n}\n\n// ============================================================================\n// CACHE OPERATION TYPES\n// ============================================================================\n\n/**\n * Options for asset cache operations\n */\nexport interface CacheOptions {\n  ttl?: number; // Time to live in seconds\n  revalidate?: boolean; // Whether to revalidate on access\n  tags?: string[]; // Cache tags for invalidation\n  priority?: \"high\" | \"medium\" | \"low\"; // Priority for preloading\n}\n\n/**\n * Cache entry with metadata\n */\nexport interface CacheEntry<T> {\n  data: T;\n  timestamp: number;\n  expires?: number;\n  type: AssetType;\n  tags?: string[];\n  version?: string;\n}\n\n/**\n * Result of a cache operation\n */\nexport interface CacheResult<T> {\n  success: boolean;\n  data?: T;\n  fromCache: boolean;\n  error?: Error;\n}\n\n/**\n * Asset metadata for cache manifest\n */\nexport interface AssetMetadata {\n  url: string;\n  type: AssetType;\n  version: string;\n  lastModified: string;\n  size?: number;\n  tags?: string[];\n}\n\n/**\n * Cache manifest structure\n */\nexport interface CacheManifest {\n  version: string;\n  generatedAt: string;\n  assets: Record<string, AssetMetadata>;\n}\n\n// ============================================================================\n// SERVICE WORKER TYPES\n// ============================================================================\n\n/**\n * Service worker message types\n */\nexport enum ServiceWorkerMessageType {\n  CACHE_ASSET = \"CACHE_ASSET\",\n  INVALIDATE_ASSET = \"INVALIDATE_ASSET\",\n  INVALIDATE_TAG = \"INVALIDATE_TAG\",\n  CLEAR_CACHE = \"CLEAR_CACHE\",\n  UPDATE_MANIFEST = \"UPDATE_MANIFEST\",\n  CHECK_ASSET = \"CHECK_ASSET\",\n}\n\n// Service Worker Global Scope Types (simplified to avoid DOM conflicts)\nexport interface ExtendableEvent extends Event {\n  waitUntil(promise: Promise<any>): void;\n}\n\nexport interface FetchEvent extends ExtendableEvent {\n  request: Request;\n  respondWith(response: Promise<Response> | Response): void;\n}\n\nexport interface ExtendableMessageEvent extends ExtendableEvent {\n  data: any;\n  source: Client | MessagePort | ServiceWorker | null;\n}\n\nexport interface ServiceWorkerGlobalScope {\n  caches: CacheStorage;\n  clients: Clients;\n  registration: ServiceWorkerRegistration;\n  location: Location;\n  addEventListener(\n    type: \"install\",\n    listener: (event: ExtendableEvent) => void\n  ): void;\n  addEventListener(\n    type: \"activate\",\n    listener: (event: ExtendableEvent) => void\n  ): void;\n  addEventListener(type: \"fetch\", listener: (event: FetchEvent) => void): void;\n  addEventListener(\n    type: \"message\",\n    listener: (event: ExtendableMessageEvent) => void\n  ): void;\n  skipWaiting(): Promise<void>;\n}\n\nexport interface Client {\n  id: string;\n  type: \"window\" | \"worker\" | \"sharedworker\";\n  url: string;\n  postMessage(message: any, transfer?: Transferable[]): void;\n}\n\nexport interface Clients {\n  get(id: string): Promise<Client | undefined>;\n  matchAll(options?: ClientQueryOptions): Promise<Client[]>;\n  openWindow(url: string): Promise<WindowClient | null>;\n  claim(): Promise<void>;\n}\n\nexport interface ClientQueryOptions {\n  includeUncontrolled?: boolean;\n  type?: \"window\" | \"worker\" | \"sharedworker\" | \"all\";\n}\n\nexport interface WindowClient extends Client {\n  focused: boolean;\n  visibilityState: \"hidden\" | \"visible\" | \"prerender\" | \"unloaded\";\n  focus(): Promise<WindowClient>;\n  navigate(url: string): Promise<WindowClient | null>;\n}\n\n// ============================================================================\n// CONFIGURATION TYPES\n// ============================================================================\n\n/**\n * Asset Cache Configuration Interface\n * Simplified configuration interface containing only implemented features\n */\nexport interface AssetCacheConfig {\n  /** Enable or disable the asset cache system */\n  enabled?: boolean;\n  /** Cache version for invalidation */\n  version?: string;\n  /** Enable debug logging */\n  debug?: boolean;\n  /**\n   * Name of the cache storage (used with browser Cache API)\n   * Should be a unique identifier for your application's cache\n   * Examples: \"my-app-cache-v1\", \"storefront-assets\", \"asset-cache-prod\"\n   */\n  storageName?: string;\n  /** Maximum cache size in MB */\n  maxSize?: number;\n  /** Maximum age for cached assets in seconds */\n  maxAge?: number;\n  /** Enable service worker for caching */\n  serviceWorkerEnabled?: boolean;\n  /** Service worker file path */\n  serviceWorkerPath?: string;\n  /** Cache manifest file path */\n  manifestPath?: string;\n}\n\n/**\n * Asset loader configuration\n */\nexport interface AssetLoaderConfig {\n  cacheName?: string;\n  defaultTTL?: number;\n  maxSize?: number; // Maximum size in bytes for cacheable assets\n  enableServiceWorker?: boolean;\n  manifestPath?: string;\n  debug?: boolean;\n}\n"]}