import { Action } from '@ngrx/store/src/models'; import { ActionFactoryResult, CombinedLoadingState, FailureAction, FailureHandlerState, LoadAction, LoadingState } from './loading-state-types'; /** * See if a new API fetch should be issued. * * @param currentState The current loading state. * @param action The the LoadAction dispatched by the user. * @returns True if a new API fetch should be issued. */ export declare function shouldIssueFetch(currentState: Readonly, action: Readonly): boolean; /** * Return the type of error handler that should be used. * * @param currentState the current state * @param action the load action dispatched by the user * @param issueFetch whether the load action should issue a new API call. * @returns */ export declare function getFailureHandlerState(currentState: Readonly, action: Readonly, issueFetch: boolean): FailureHandlerState; /** * This function make it easier to define the type of prop. Internal use only. * * T extends object meets the condition of props function * * ref: https://stackoverflow.com/questions/65888508/how-to-use-generic-type-in-ngrx-createaction-props * * @param type String type of the action * @returns An action creator function */ export declare function actionFactory(type: string): ActionFactoryResult; /** * Make a clone of any object that implements the LoadingState interface, but copy over only * those fields that are in the LoadingState interface. * * @param src Any object that implements the LoadingState interface * @returns A copy of src with only fields from LoadingState */ export declare function cloneLoadingState(src: LoadingState): LoadingState; /** * Combine the currentState and the user dispatched LoadAction into newState. * * @param action User dispatched LoadAction * @param currentState Current store state * @returns A new state if the state should change, null otherwise. */ export declare function getNewLoadState(action: LoadAction & Action, currentState: LoadingState): Readonly | null; /** * @returns Always returns a new success state. */ export declare function getNewSuccessState(): Readonly; /** * Returns a new FailureState. * * @param action User dispatched FailureAction * @param currentState Current loading state * @returns A new loading state. */ export declare function getNewFailureState(action: FailureAction & Action, currentState: LoadingState): Readonly; export declare function combineLoadingStates(loadingStates: LoadingState[]): CombinedLoadingState;