UNPKG

741 BTypeScriptView Raw
1import { Loader } from './Loader';
2import { LoadingManager } from './LoadingManager';
3import { Texture } from './../textures/Texture';
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 {
10 constructor(manager?: LoadingManager);
11
12 load(
13 url: string,
14 onLoad?: (texture: Texture) => void,
15 onProgress?: (event: ProgressEvent) => void,
16 onError?: (event: ErrorEvent) => void,
17 ): Texture;
18
19 loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<Texture>;
20}