import { file } from 'opfs-tools';
export declare enum ResourceStatus {
    PENDING = "pending",
    LOADING = "loading",
    COMPLETED = "completed",
    FAILED = "failed"
}
export interface ResourceItem {
    url: string;
    status: ResourceStatus;
    localFile?: ReturnType<typeof file>;
    error?: Error;
}
/**
 * ResourceManager handles asset preloading and caching in OPFS.
 * It ensures that resources are downloaded only once and reused across sessions.
 */
export declare class ResourceManager {
    private resources;
    private loadingPromises;
    /**
     * Preload a batch of URLs in parallel.
     * @param urls Array of URLs to preload
     */
    preload(urls: string[]): Promise<void>;
    /**
     * Get a ReadableStream for the given URL, with transparent caching.
     * @param url URL to fetch
     */
    static getReadableStream(url: string): Promise<ReadableStream<Uint8Array>>;
    /**
     * Get an ImageBitmap for the given URL, with transparent caching.
     */
    static getImageBitmap(url: string): Promise<ImageBitmap>;
    /**
     * Load a single resource, using cache if available.
     * @param url URL to load
     */
    loadResource(url: string): Promise<ResourceItem>;
    /**
     * Resolve a URL to its local OPFS file if available.
     * @param url URL to resolve
     */
    resolve(url: string): Promise<ReturnType<typeof file> | string>;
    /**
     * Get the status of a specific resource.
     */
    getStatus(url: string): ResourceItem | undefined;
    /**
     * Clear instance state (not OPFS cache).
     */
    clear(): void;
}
