UNPKG

657 BTypeScriptView Raw
1import { Texture } from "../textures/Texture.js";
2import { Loader } from "./Loader.js";
3import { LoadingManager } from "./LoadingManager.js";
4
5/**
6 * Class for loading a texture.
7 * 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.
8 */
9export class TextureLoader extends Loader<Texture> {
10 constructor(manager?: LoadingManager);
11
12 load(
13 url: string,
14 onLoad?: (data: Texture) => void,
15 onProgress?: (event: ProgressEvent) => void,
16 onError?: (err: unknown) => void,
17 ): Texture;
18}