UNPKG

@ducor/react

Version:

admin template ui interface

30 lines (29 loc) 978 B
import { ReactNode, ReactElement } from "react"; export interface LoadingOptions { duration?: null | number; message?: ReactNode | undefined; } interface LoadingState { duration: null | number; loadingCount: number; message: ReactNode | undefined; } export interface LoadingContextState { background: React.RefObject<LoadingRefState>; page: React.RefObject<LoadingRefState>; screen: React.RefObject<LoadingRefState>; } export declare const LoadingContext: import("react").Context<LoadingContextState | undefined>; export type LoadingRefState = { isLoading: boolean; start: () => void; update: (options?: LoadingOptions) => void; finish: () => void; force: (state: Partial<LoadingState>) => void; } & LoadingState; interface LoadingProviderProps { children?: ReactNode | ReactElement; defaultLoading?: "screen" | "page" | "background"; } export declare const LoadingProvider: React.FC<LoadingProviderProps>; export {};