import { DefaultProjectorFn, MemoizedSelector } from '@ngrx/store'; import { NoIntersection } from '../utils'; import { LoadingActions } from './loading-state-actions'; import { FailureAction, LoadAction, LoadingStates, WithLoadingStatesOnly } from './loading-state-types'; export declare function load>(): Load; export declare function success(): Success; export declare function failure>(): Failure; /** * Creates a set of load, success, failure actions. Selectors and reducers are always bundled into * the same structure. * * @param type The "type" of the action. * @param _load See usage example * @param _success See usage example * @param _failure See usage example * @returns An instance of LoadingActions class that bundles together actions, selectors and reducers. * @example * export const fetchItem = createLoadingActions( * 'Fetch Item', * load<{ itemId: number }>(), // Action type is: 'Fetch Item' * success<{ item: object }>(), // Action type is: 'Fetch Item Success' * failure<{}>() // Action type is: 'Fetch Item Failure' * ); */ export declare function createLoadingActions(type: string, _load: Load, _success: Success, _failure: Failure): LoadingActions; /** * * @param featureSelector Selector that selects the current feature slice of the store. * @returns Selector that selects the loadingStates field from the store * @example * // Using ngrx's createFeatureSelector to select the feature slice from global store. * const selectState = createFeatureSelector(SIMPLE_FEATURE_KEY); * const selectLoadingStates = createLoadingStatesSelector(selectState); * * You can then use selectLoadingStates to compose other selectors. eg. * * export const fetchItem = createLoadingActions( * 'Fetch Item', * load<{ itemId: number }>(), * success<{ item: object }>(), * failure<{}>() * ); * * export const fetchItemSelectors = fetchItem.createSelectors(selectLoadingStates); * */ export declare function createLoadingStatesSelector(featureSelector: MemoizedSelector>): MemoizedSelector>; declare class Load<_LoadPayloadType> { type: 'LOAD'; } declare class Success<_SuccessPayloadType> { type: 'SUCCESS'; } declare class Failure<_FailurePayloadType> { type: 'FAILURE'; } declare type NotLoadingAction = NoIntersection; declare type NotFailureAction = NoIntersection; export {};