import { TextureCache, type PreparedTexture } from './texture.js'; import { AudioRegistry, type DecodedAudio } from './audio.js'; import { type Md2Model } from './md2.js'; import { type Md3Model } from './md3.js'; import { type SpriteModel } from './sprite.js'; import { VirtualFileSystem, VirtualFileHandle } from './vfs.js'; import { type BspMap } from './bsp.js'; import { ResourceLoadTracker } from './resourceTracker.js'; export type AssetType = 'texture' | 'model' | 'sound' | 'sprite' | 'map'; export interface MemoryUsage { textures: number; audio: number; heapTotal?: number; heapUsed?: number; } export interface MemoryBudget { textureMemoryLimit?: number; textureCacheCapacity?: number; audioCacheSize?: number; } export declare class AssetDependencyError extends Error { readonly missing: readonly string[]; constructor(missing: readonly string[], message?: string); } export declare class AssetDependencyTracker { private readonly nodes; register(assetKey: string, dependencies?: readonly string[]): void; markLoaded(assetKey: string): void; markUnloaded(assetKey: string): void; isLoaded(assetKey: string): boolean; missingDependencies(assetKey: string): string[]; reset(): void; private getMissingDependencies; } export interface AssetManagerOptions { readonly textureCacheCapacity?: number; readonly textureMemoryLimit?: number; readonly audioCacheSize?: number; readonly dependencyTracker?: AssetDependencyTracker; readonly resourceTracker?: ResourceLoadTracker; readonly maxConcurrentLoads?: number; readonly bspWorkerPath?: string; readonly audioWorkerPath?: string; } export declare class AssetManager { private readonly vfs; readonly textures: TextureCache; readonly audio: AudioRegistry; readonly dependencyTracker: AssetDependencyTracker; readonly resourceTracker?: ResourceLoadTracker; private readonly md2; private readonly md3; private readonly sprite; private readonly bsp; private palette; private readonly maps; private readonly loadQueue; private activeLoads; private readonly maxConcurrentLoads; constructor(vfs: VirtualFileSystem, options?: AssetManagerOptions); /** * Loads the global palette (pics/colormap.pcx) if available. * This is required for loading WAL textures. */ loadPalette(path?: string): Promise; isAssetLoaded(type: AssetType, path: string): boolean; registerTexture(path: string, texture: PreparedTexture): void; loadTexture(path: string): Promise; loadSound(path: string): Promise; loadMd2Model(path: string, textureDependencies?: readonly string[]): Promise; getMd2Model(path: string): Md2Model | undefined; loadMd3Model(path: string, textureDependencies?: readonly string[]): Promise; getMd3Model(path: string): Md3Model | undefined; loadSprite(path: string): Promise; loadMap(path: string): Promise; getMap(path: string): BspMap | undefined; listFiles(extension: string): VirtualFileHandle[]; resetForLevelChange(): void; getMemoryUsage(): MemoryUsage; enforceMemoryBudget(budget: MemoryBudget): void; clearCache(type: AssetType): void; /** * Preload a list of assets with low priority. */ preloadAssets(paths: string[]): Promise; /** * Queue an asset for loading. * @param path The path to the asset. * @param type The type of asset. * @param priority Higher priority assets are loaded first. Default 1 (High). */ queueLoad(path: string, type: AssetType, priority?: number): Promise; private processQueue; private detectAssetType; private makeKey; } //# sourceMappingURL=manager.d.ts.map