Retrieves the module's callbacks instance.
Indicates whether the instance has been destroyed.
After destruction, destroy is a no-op.
Whether the hide animation has completed and hidden has fired.
Whether hide has started but hidden has not fired yet.
Whether the load signal has fired and loaded was emitted.
Sum of all resource loaded values.
Actual weighted progress (0–1), not interpolated.
Updates immediately when a resource resolves.
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Smoothed progress (0–1) for UI animations.
Follows loadProgress via Raf.damp using lerp.
Preloader.loaded waits for progress >= 1, not loadProgress.
Current properties. Do not mutate these directly, use updateProps instead.
DOM root for scanning images, videos, and IProgressPreloaderStaticProps.customSelector.
All tracked resources (DOM elements and virtual ids).
Sum of all resource weight values.
Protected_addAdds prefixed classes to an element and removes them on destroy.
Skips classes that are already present on the element.
Target DOM element.
Unprefixed class name segments.
Protected_cnBuilds one or more prefixed class names.
Unprefixed class name segments.
Space-separated prefixed class string.
Protected_destroyInternal method to handle the destruction of the module. It removes all callbacks, destroys properties, and cleans up event listeners and class names.
Protected_emitEmits a callback event with a fixed payload.
Set default mutable props
Get default static props
The container for the preloader. Set it to null if you only need the preloader logic.
Selector for custom resources to preload. Elements should include data-weight and data-loaded attributes.
Example: data-weight="10" for a weight of 10, data-loaded="10" when loaded.
Duration (ms) to complete the preloader if resources are loaded but progress < 1.
Defines whether to automatically hide the preloader container.
false: Disables the hiding animation, allowing you to manage it manually.number: Specifies the animation duration in milliseconds.
This works only if the container is an HTML element.Class name for elements to exclude from preloading.
Linear interpolation factor for smooth progress updates. 1 disables interpolation for instant updates.
Enables automatic preloading of images.
Enables automatic preloading of videos.
Container source for preloader resources.
Protected_handleMethod that is called when the module's properties mutate. In most cases, used to handle callbacks.
Protected_onWaits for smoothed progress >= 1, then runs Preloader load handling.
Overrides Preloader._onLoaded — does not use initVevet().onLoad directly.
Registers a virtual resource by id.
Hides the preloader with a fade on container.
Works only after load and when not already hiding. The returned destructor
cancels the optional callback only — the fade still runs.
Optionalcallback: () => voidAdds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Registers a function to run when the instance is destroyed.
If the instance is already destroyed, action runs immediately.
Cleanup function (for example remove listeners or DOM classes).
Registers a one-shot listener for hidden, or runs immediately if already hidden.
A destructor that removes the listener.
Registers a one-shot listener for hide, or runs immediately if already hiding.
A destructor that removes the listener.
Updates loaded weight for a resource and emits IProgressPreloaderCallbacksMap.resource.
For custom DOM elements, call as data-loaded changes (or use partial weights).
OptionalloadedWeight: numberChange module's mutable properties
Resource-aware page preloader with smooth progress display.
loadProgressand smoothedprogressfor UIloadedProgress pipeline
resolveResource→ weightedloadProgress→ Raf damp (lerp) →progress→ optional Timeline finish (endDuration) →loaded.Documentation