import { AssetLoaderRegistry } from './registry.cjs'; import { AssetHandle, type AbortSignalLike, type AssetCacheEntrySnapshot, type AssetDefinition, type AssetFailure, type AssetLoadOptions, type AssetManifestDiff, type AssetManifestForAdapters, type AssetProgress, type AssetResults, type AssetRetry, type NamedAssetHandles, type NamedAssetPromises } from './types.cjs'; export type AssetSleep = (milliseconds: number, signal: AbortSignalLike) => Promise; export interface AssetManagerOptions { readonly concurrency?: number; readonly retry?: AssetRetry; readonly device?: 'desktop' | 'mobile'; readonly includeFonts?: boolean; readonly supportedAudioFormats?: readonly string[]; readonly defaultWeight?: number; readonly sleep?: AssetSleep; readonly onDisposeError?: (error: unknown) => void; } interface InternalLoadRecord { readonly name: string; readonly type: string; readonly required: boolean; readonly handle: AssetHandle; } declare class ProgressTracker { #private; readonly totalWeight: number; constructor(definitions: Readonly>, defaultWeight: number, onProgress: ((progress: AssetProgress) => void) | undefined); get current(): number; update(name: string, progress: number): void; } export declare class AssetLoad implements PromiseLike { #private; readonly named: NamedAssetPromises; readonly handles: NamedAssetHandles; readonly result: Promise; constructor(records: readonly InternalLoadRecord[], progress: ProgressTracker); get progress(): number; get optionalFailures(): readonly AssetFailure[]; get released(): boolean; release(): void; then(onfulfilled?: ((value: TResult) => TResult1 | PromiseLike) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null): PromiseLike; } /** A direct-await ownership object that keeps the underlying reference handles reachable. */ export declare class AssetLease { readonly assets: TResult; readonly request: AssetLoad; constructor(assets: TResult, request: AssetLoad); get released(): boolean; release(): void; } /** * Scene-lifetime facade used as `context.assets`. It preserves the ergonomic direct-await * API while retaining every request until the owning scene is disposed. */ export declare class AssetScope { #private; constructor(manager: AssetManager); get disposed(): boolean; get activeLoads(): number; load>(manifest: TManifest, options?: AssetLoadOptions): Promise>; dispose(): void; } export declare class AssetManager { #private; readonly registry: AssetLoaderRegistry; constructor(registry: AssetLoaderRegistry, options?: AssetManagerOptions); get disposed(): boolean; /** Create one ownership scope per scene or other hot-replaceable lifetime. */ createScope(): AssetScope; /** Keep the returned request and call release(); use lease() for an explicit direct-await owner. */ load>(manifest: TManifest, options?: AssetLoadOptions): AssetLoad>; lease>(manifest: TManifest, options?: AssetLoadOptions): Promise>>; replace>(current: AssetLoad, manifest: TManifest, options?: AssetLoadOptions): AssetLoad>; diff(previous: Readonly>, next: Readonly>): AssetManifestDiff; cacheSnapshot(): readonly AssetCacheEntrySnapshot[]; evict(key: string): boolean; shutdown(): Promise; } export declare function createAssetManager(registry: AssetLoaderRegistry, options?: AssetManagerOptions): AssetManager; export {};