import { AnyAction } from 'redux'; import { ForkEffect } from 'redux-saga/effects'; import { Observable, Subject } from 'rxjs'; import { IStoreFetchableDataState, StoreFetchableData } from './base'; import { TGetApplicationConfigurationChainData } from './get-application-configuration'; import { TGetAvailableServicesChainData } from './get-available-services'; import { TListStationsForOrganizationUnitChainData } from './list-stations-for-organization-unit'; export declare type TGetCurrentUserChainData = [EVA.Core.GetCurrentUserResponse, TListStationsForOrganizationUnitChainData | undefined, TGetApplicationConfigurationChainData, TGetAvailableServicesChainData]; /** * Implements GetCurrentUser fetch for the Redux store * * @export * @class GetCurrentUser * @extends {StoreFetchableData} */ export declare class GetCurrentUser extends StoreFetchableData { /** * User token expiration stream * Will emit when a service returns a 401 and the user token has expired * * @memberof GetCurrentUser */ expired$: Subject; /** * Creates an instance of GetCurrentUser * * @memberof GetCurrentUser */ constructor(); /** * The saga listener for this store section * * @memberof GetCurrentUser */ saga(): Generator; /** * Initial state with extended properties * * @type {IGetCurrentUserState} * @memberof GetCurrentUser */ get initialState(): IGetCurrentUserState; /** * Called when a 401 response is received to expire the current user token and state * * @memberof GetCurrentUser */ expire(): void; /** * Return an observable that contains the current user if it is of type employee * * @returns {(Observable)} * @memberof GetCurrentUser */ getEmployee$(): Observable; /** * Return an observable that contains the current user if it is of type customer * * @returns {(Observable)} * @memberof GetCurrentUser */ getCustomer$(): Observable; /** * Return an observable that contains the current user if it is of type customer or employee * * @returns {(Observable)} * @memberof GetCurrentUser */ getLoggedInUser$(): Observable; /** * Return an observable that contains the current user if it is of type anonymous * * @returns {(Observable)} * @memberof GetCurrentUser */ getAnonymous$(): Observable; /** * The extended collection of reducer functions * * @protected * @returns {{ [ reducerName: string ]: ( state: any, action: AnyAction ) => any }} * @memberof GetCurrentUser */ protected getReducerFunctions(): { [reducerName: string]: (state: any, action: AnyAction) => any; }; /** * Helper function to check for certain user type * * @private * @param {('isCustomer' | 'isEmployee' | 'isAnonymous' | 'isLoggedIn')} typeCheck Type of user to check for * @returns {(Observable)} * @memberof GetCurrentUser */ private getUserType$; } export interface IGetCurrentUserState extends IStoreFetchableDataState { isAnonymous: boolean; isLoggedIn: boolean; isCustomer: boolean; isEmployee: boolean; } export declare const getCurrentUser: GetCurrentUser;