Loader.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { Material } from './../materials/Material';
  2. import { LoaderHandler } from './FileLoader';
  3. // Loaders //////////////////////////////////////////////////////////////////////////////////
  4. /**
  5. * Base class for implementing loaders.
  6. *
  7. * Events:
  8. * load
  9. * Dispatched when the image has completed loading
  10. * content — loaded image
  11. *
  12. * error
  13. *
  14. * Dispatched when the image can't be loaded
  15. * message — error message
  16. */
  17. export class Loader {
  18. constructor();
  19. /**
  20. * Will be called when load starts.
  21. * The default is a function with empty body.
  22. */
  23. onLoadStart: () => void;
  24. /**
  25. * Will be called while load progresses.
  26. * The default is a function with empty body.
  27. */
  28. onLoadProgress: () => void;
  29. /**
  30. * Will be called when load completes.
  31. * The default is a function with empty body.
  32. */
  33. onLoadComplete: () => void;
  34. /**
  35. * default — null.
  36. * If set, assigns the crossOrigin attribute of the image to the value of crossOrigin, prior to starting the load.
  37. */
  38. crossOrigin: string;
  39. /**
  40. * @deprecated Use THREE.LoaderUtils.extractUrlBase() instead.
  41. */
  42. extractUrlBase( url: string ): string;
  43. initMaterials( materials: Material[], texturePath: string ): Material[];
  44. createMaterial(
  45. m: Material,
  46. texturePath: string,
  47. crossOrigin?: string
  48. ): boolean;
  49. static Handlers: LoaderHandler;
  50. }
粤ICP备19079148号