UNPKG

634 BTypeScriptView Raw
1import { Loader } from "./Loader.js";
2import { LoadingManager } from "./LoadingManager.js";
3
4/**
5 * A loader for loading an image.
6 * Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object.
7 */
8export class ImageLoader extends Loader<HTMLImageElement> {
9 constructor(manager?: LoadingManager);
10
11 load(
12 url: string,
13 onLoad?: (data: HTMLImageElement) => void,
14 onProgress?: (event: ProgressEvent) => void,
15 onError?: (err: unknown) => void,
16 ): HTMLImageElement;
17}