vevet
Version:
Vevet is a JavaScript library for creative development that simplifies crafting rich interactions like split text animations, carousels, marquees, preloading, and more.
73 lines • 2.8 kB
TypeScript
import { Module, TModuleOnCallbacksProps } from '../../base/Module';
import { TRequiredProps } from '../../internal/requiredProps';
import { IPreloaderCallbacksMap, IPreloaderMutableProps, IPreloaderStaticProps } from './types';
export * from './types';
/**
* Page preloader component that manages the visibility and lifecycle of a loading screen.
* The module does not provide styling for the container.
*
* [Documentation](https://vevetjs.com/docs/Preloader)
*
* @group Components
*/
export declare class Preloader<C extends IPreloaderCallbacksMap = IPreloaderCallbacksMap, S extends IPreloaderStaticProps = IPreloaderStaticProps, M extends IPreloaderMutableProps = IPreloaderMutableProps> extends Module<C, S, M> {
/**
* Retrieves the default static properties.
*/
_getStatic(): TRequiredProps<S>;
/**
* Retrieves the default mutable properties.
*/
_getMutable(): TRequiredProps<M>;
/** Indicates if the preloader is in the process of being hidden. */
private _shouldHide;
/** Indicates if the preloader has already been hidden. */
private _isHidden;
/** Indicates if the page is fully loaded. */
private _isLoaded;
constructor(props?: S & M & TModuleOnCallbacksProps<C, Preloader<C, S, M>>, onCallbacks?: TModuleOnCallbacksProps<C, Preloader<C, S, M>>);
/**
* Returns whether the preloader is currently hidden.
*/
get isHidden(): boolean;
/**
* Handles the page load event, triggering when the page is fully loaded.
*/
protected _onLoaded(callback: () => void): void;
/**
* Handles the logic that occurs after the page is fully loaded.
*/
private _handleLoaded;
/**
* Hides the preloader with a custom animation duration.
*
* @param duration - The duration of the hide animation (in milliseconds). Applies only when the container is used.
* @param callback - The callback to execute when the hide animation is complete.
*
* @returns Returns an action destructor.
*/
hide(duration: number, callback?: () => void): (() => void) | undefined;
/**
* Executes the hiding animation for the preloader container.
*/
private _hideContainer;
/**
* Handles actions when the preloader is fully hidden.
*/
private _onHidden;
/**
* Registers a callback for when the preloader starts hiding.
*
* @param action - The callback function to execute.
* @returns A destructor.
*/
onHide(action: () => void): () => void;
/**
* Registers a callback for when the preloader is fully hidden.
*
* @param action - The callback function to execute.
* @returns A destructor.
*/
onHidden(action: () => void): () => void;
}
//# sourceMappingURL=index.d.ts.map