Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/threejs_4_deno/src/Three.d.ts>LoadingManager

A simple transformation of three.js for use within a Deno workflow
Go to Latest
class LoadingManager
Re-export
import { LoadingManager } from "https://deno.land/x/threejs_4_deno@v121/src/Three.d.ts";

Handles and keeps track of loaded and pending data.

Constructors

new
LoadingManager(
onLoad?: () => void,
onProgress?: (
url: string,
loaded: number,
total: number,
) => void
,
onError?: (url: string) => void,
)

Properties

onError: (url: string) => void

Will be called when item loading fails. The default is a function with empty body.

onLoad: () => void

Will be called when all items finish loading. The default is a function with empty body.

onProgress: (
url: string,
loaded: number,
total: number,
) => void

Will be called for each loaded item. The default is a function with empty body.

optional
onStart: (
url: string,
loaded: number,
total: number,
) => void

Will be called when loading of an item starts.

Methods

addHandler(regex: RegExp, loader: Loader): this
getHandler(file: string): Loader | null
itemEnd(url: string): void
itemError(url: string): void
itemStart(url: string): void
removeHandler(regex: RegExp): this
resolveURL(url: string): string

Given a URL, uses the URL modifier callback (if any) and returns a resolved URL. If no URL modifier is set, returns the original URL.

setURLModifier(callback?: (url: string) => string): this

If provided, the callback will be passed each resource URL before a request is sent. The callback may return the original URL, or a new URL to override loading behavior. This behavior can be used to load assets from .ZIP files, drag-and-drop APIs, and Data URIs.