import { AbstractSkeletosState } from "../../extendible/AbstractSkeletosState"; import { SkeletosCursor } from "../../base/SkeletosCursor"; /** * Convenience class to show loading state in your application. */ export declare class LoadingState extends AbstractSkeletosState { /** * Convenience method to check if this props is loading. */ isLoading(): boolean; /** * Because multiple actions can be executed asynchronously (for example, multiple server fetches can happen * asynchronously), we need a way to track how many times the loading indicator has been called so we don't * run into race conditions. For example, if we only had a boolean field to indicate loading, then * if one action completes before the other action then we would incorrectly hide the loading, even though we * are still loading. By having a numerical field, we avoid that race condition. * * Use isLoading to figure out if you need to display a loading sign in your UI. * */ readonly loadingCountCursor: SkeletosCursor; /** * Because multiple actions can be executed asynchronously (for example, multiple server fetches can happen * asynchronously), we need a way to track how many times the loading indicator has been called so we don't * run into race conditions. For example, if we only had a boolean field to indicate loading, then * if one action completes before the other action then we would incorrectly hide the loading, even though we * are still loading. By having a numerical field, we avoid that race condition. * * Use isLoading to figure out if you need to display a loading sign in your UI. * */ /** * Because multiple actions can be executed asynchronously (for example, multiple server fetches can happen * asynchronously), we need a way to track how many times the loading indicator has been called so we don't * run into race conditions. For example, if we only had a boolean field to indicate loading, then * if one action completes before the other action then we would incorrectly hide the loading, even though we * are still loading. By having a numerical field, we avoid that race condition. * * Use isLoading to figure out if you need to display a loading sign in your UI. * */ loadingCount: number; /** * Helper method to decrement the loading count. Minimum possible value to decrement to is 0. By default, the * amount will be decremented by 1, unless an amount is specified. */ decrementLoadingCount(decrementAmount?: number): void; /** * Helper method to increment the loading count. By default, the amount will be incremented by 1, unless an amount * is specified. */ incrementLoadingCount(incrementAmount?: number): void; /** * Show a loading message in the UI. * * @returns {SkeletosCursor} */ readonly loadingMessageCursor: SkeletosCursor; /** * Show a loading message in the UI. * * @returns {any} */ /** * Show a loading message in the UI. * * @param loadingMessage */ loadingMessage: string; }