import { Actions } from '@ngrx/effects'; import { Action, DefaultProjectorFn, MemoizedSelector } from '@ngrx/store'; import { TypedAction } from '@ngrx/store/src/models'; import { catchError, Observable, UnaryFunction } from 'rxjs'; import { ActionFactoryResult, LoadingActionsReducerTypes, OnState } from '../loading-state/loading-state-types'; import { Id, IdFailureAction, IdLoadAction, IdLoadingState, IdLoadingStates, IdSuccessAction, WithIdLoadingStatesOnly } from './id-loading-state-types'; /** * IdLoadingAction is similar to LoadingAction with the difference that it's parameterized on a user provided ID. * */ export declare class IdLoadingActions { readonly idLoad: ActionFactoryResult; readonly idSuccess: ActionFactoryResult; readonly idFailure: ActionFactoryResult; constructor(options: { idLoad: ActionFactoryResult; idSuccess: ActionFactoryResult; idFailure: ActionFactoryResult; }); instanceOfIdLoad(action: Action): action is ReturnType>; instanceOfIdSuccess(action: Action): action is ReturnType>; instanceOfIdFailure(action: Action): action is ReturnType>; reducer(options?: { onLoad?: (state: OnState, action: IdLoadAction & LoadPayloadType & TypedAction) => State; onSuccess?: (state: OnState, action: IdSuccessAction & SuccessPayloadType & TypedAction) => State; onFailure?: (state: OnState, action: IdFailureAction & FailurePayloadType & TypedAction) => State; }): [ LoadingActionsReducerTypes, LoadingActionsReducerTypes, LoadingActionsReducerTypes ]; catchError(id: Id): ReturnType; /** * Returns a map of selectors for loading, success, error, and the entire state. * The advantage of doing it in a bundle is that we can share the result of createStateSelector(), * if we separated into individual functions, each function might need to call createStateSelector() * to create a new instance of the selector. We can't cache any created selectors because will cause * memory leak since the cached references are always help in this class and hence does not get released. * @param selectLoadingStates Selector that returns the loadingStats of the feature slice. You can use createLoadingStatesSelector() * to create it. * @returns A collection of selectors * state: the LoadingState * loading: True if loading * success: True if last load was successful * error: LrError2 object if previous loading failed. * */ createIdSelectors(selectIdLoadingStates: MemoizedSelector>): { state: (id: Id) => MemoizedSelector>; loading: (id: Id) => MemoizedSelector>; success: (id: Id) => MemoizedSelector>; error: (id: Id) => MemoizedSelector>; combinedState: MemoizedSelector>; }; idLoadHandler(fetch: (idActions$: Observable>, id: Id) => Observable): UnaryFunction, Observable>; createEffect(actions$: Actions, fetch: (idActions$: Observable>, id: Id) => Observable): Observable & import("@ngrx/effects").CreateEffectMetadata; private get key(); private getIdLoadingState; private setState; }