message: Update TextureLoader for 0.8.9
diff: +import type { ConfiguredDocumentClassForName } from '../../types/helperTypes';
  +
  +declare global {
  /**
  * A Loader class which helps with loading video and image textures
  */
  -declare class TextureLoader {
  - constructor();
  + class TextureLoader {
  + /**
  + * The cached mapping of textures
  + */
  + cache: Map<string, { tex: PIXI.Texture; time: number }>;
  - cache: Map<string, PIXI.Texture>;
  + /**
  + * The duration in milliseconds for which a texture will remain cached
  + * @defaultValue `1000`
  + */
  + static CACHE_TTL: number;
  /**
  * Load all the textures which are required for a particular Scene
  * @param scene - The Scene to load
  + * @param options - Additional options that configure texture loading
  + * (default: `{}`)
  */
  - static loadSceneTextures(scene: Scene): Promise<void>;
  + static loadSceneTextures(
  + scene: InstanceType<ConfiguredDocumentClassForName<'Scene'>>,
  + options?: Partial<TextureLoader.LoadSceneTextureOptions>
  + ): Promise<void[]>;
  /**
  * Load an Array of provided source URL paths
  * @param sources - The source URLs to load
  - * @param message - The status message to display in the load bar
  + * @param options - Additional options which modify loading
  * @returns A Promise which resolves once all textures are loaded
  */
  - load(sources: string[], { message }?: { message?: string }): Promise<void>;
  + load(sources: string[], options?: Partial<TextureLoader.LoadOptions>): Promise<void[]>;
  /**
  * Load a single texture on-demand from a given source URL path
  - * @param src -
  + * @param src - The source texture path to load
  + * @returns The loaded texture object
  */
  loadTexture(src: string): Promise<PIXI.Texture>;
  /**
  * Log texture loading progress in the console and in the Scene loading bar
  + * @internal
  */
  - protected _onProgress(src: string, progress: TextureLoader.Progress, message: string): void;
  + protected _onProgress(src: string, progress: TextureLoader.Progress): void;
  /**
  * Log failed texture loading
  + * @internal
  */
  protected _onError(src: string, progress: TextureLoader.Progress, error: Error): void;
  /**
  * Load an image texture from a provided source url
  - * @param src -
  */
  loadImageTexture(src: string): Promise<PIXI.Texture>;
  @@ -48,12 +65,13 @@ declare class TextureLoader {
  * @param src - The source URL being attempted
  * @param resolve - Resolve the promise
  * @param reject - Reject the promise
  + * @internal
  */
  protected _attemptCORSReload<T>(
  src: string,
  - resolve: (texture: PIXI.Texture) => void,
  + resolve: (tex: PIXI.Texture) => void,
  reject: () => T
  - ): Promise<PIXI.Texture> | T;
  + ): Promise<PIXI.Texture | T>;
  /**
  * Load a video texture from a provided source url
  @@ -74,13 +92,39 @@ declare class TextureLoader {
  */
  getCache(src: string): PIXI.Texture | undefined;
  + /**
  + * Expire (and destroy) textures from the cache which have not been used for more than CACHE_TTL milliseconds.
  + */
  + expireCache(): void;
  +
  /**
  * A global reference to the singleton texture loader
  */
  static loader: TextureLoader;
  }
  -declare namespace TextureLoader {
  + namespace TextureLoader {
  + interface LoadSceneTextureOptions {
  + /**
  + * Destroy other expired textures
  + * @defaultValue `true`
  + */
  + expireCache: boolean;
  + }
  +
  + interface LoadOptions {
  + /**
  + * The status message to display in the load bar
  + */
  + message?: string | undefined;
  +
  + /**
  + * Expire other cached textures?
  + * @defaultValue `true`
  + */
  + expireCache: boolean;
  + }
  +
  interface Progress {
  message: string;
  loaded: number;
  @@ -89,3 +133,4 @@ declare namespace TextureLoader {
  pct: number;
  }
  }
  +}
  