File size: 1,407 Bytes
6cd9596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { Material } from './../materials/Material';
import { LoaderHandler } from './FileLoader';

// Loaders //////////////////////////////////////////////////////////////////////////////////

/**
 * Base class for implementing loaders.
 *
 * Events:
 *     load
 *         Dispatched when the image has completed loading
 *         content — loaded image
 *
 *     error
 *
 *          Dispatched when the image can't be loaded
 *          message — error message
 */
export class Loader {
  constructor();

  /**
   * Will be called when load starts.
   * The default is a function with empty body.
   */
  onLoadStart: () => void;

  /**
   * Will be called while load progresses.
   * The default is a function with empty body.
   */
  onLoadProgress: () => void;

  /**
   * Will be called when load completes.
   * The default is a function with empty body.
   */
  onLoadComplete: () => void;

  /**
   * default — null.
   * If set, assigns the crossOrigin attribute of the image to the value of crossOrigin, prior to starting the load.
   */
  crossOrigin: string;

  /**
   * @deprecated Use THREE.LoaderUtils.extractUrlBase() instead.
   */
  extractUrlBase(url: string): string;
  initMaterials(materials: Material[], texturePath: string): Material[];
  createMaterial(
    m: Material,
    texturePath: string,
    crossOrigin?: string
  ): boolean;

  static Handlers: LoaderHandler;
}