import type { CreateImageBitmapSupport } from '../lib/validateImageBitmap.js'; import { type TextureData } from '../textures/Texture.js'; type MessageCallback = [(value: any) => void, (reason: any) => void]; export declare class ImageWorkerManager { messageManager: Record; workers: Worker[]; workerLoad: number[]; nextId: number; /** Upper bound on the pool size, from the `numImageWorkers` setting. */ private readonly maxWorkers; /** Retained so the worker source is serialized once, when the pool spawns. */ private workerBlob; private readonly createImageBitmapSupport; constructor(numImageWorkers: number, createImageBitmapSupport: CreateImageBitmapSupport); /** * Build the shared worker source once and spawn the full pool in a single * burst. Scheduled from the constructor via `setTimeout`; also called * lazily from `getImage` if a request arrives first. No-op once spawned. */ private spawnWorkers; private handleMessage; private handleWorkerError; private createWorkerBlob; /** * Spawn a single worker from the shared blob and wire up its handlers. * No-op once the pool has reached `maxWorkers`. */ private spawnWorker; private getNextWorkerIndex; getImage(src: string, premultiplyAlpha: boolean | null, sx: number | null, sy: number | null, sw: number | null, sh: number | null): Promise; } export {};