import type { Action, SliceHelper, Reducer } from './types'; export declare type LoadingStatus = 'loading' | 'success' | 'error' | 'idle'; export interface LoadingItemState = Record> { status: LoadingStatus; message: string; lastRun: number; lastSuccess: number; meta: M; } export declare type LoadingPayload = Record> = Partial<{ message: string; timestamp: number; meta: M; }>; interface LoadingActions = Record> { loading: LoadingPayload; success: LoadingPayload; error: LoadingPayload; reset: never; } export declare function defaultLoadingItem = Record>(li?: Partial>): LoadingItemState; export declare function loadingReducers = Record>(initialState: LoadingItemState): { success: (state: LoadingItemState | undefined, payload?: LoadingPayload) => LoadingItemState; error: (state: LoadingItemState | undefined, payload?: LoadingPayload) => LoadingItemState; loading: (state: LoadingItemState | undefined, payload?: LoadingPayload) => LoadingItemState; reset: () => LoadingItemState; }; export default function createLoader = Record>({ name, initialState, extraReducers, }: SliceHelper>): { name: string; reducer: Reducer, Action>; actions: { [key in keyof LoadingActions]: LoadingActions[key] extends never ? () => Action : (payload?: LoadingActions[key]) => Action[key]>; }; toString: () => string; }; export default function createLoader = Record>({ name, initialState, extraReducers, }: SliceHelper>): { name: string; reducer: Reducer, Action>; actions: { [key in keyof LoadingActions]: LoadingActions[key] extends never ? () => Action : (payload?: LoadingActions[key]) => Action; }; toString: () => string; }; export {};