import { Subject } from 'rxjs'; import { Sentinel } from './index'; export declare type TOnlineStatus = 'unknown' | 'online' | 'offline' | 'pending'; /** * This class exposes a redux store that can be used when EVA or even the * entire internet is unavailable. * It is aimed at providing a way to process order with a heavily reduced * functionality set * * @export * @class SentinelOffline */ export declare class SentinelOffline { private parent; /** * Indicates we are currently in offline mode * * @type {TOnlineStatus} */ status: TOnlineStatus; /** * The status change stream * * @type {Subject} * @memberof SentinelStatus */ changes$: Subject; /** * The list of available services available on the sentinel * * @private * @type {(EVA.Core.GetAvailableServicesResponse | undefined)} */ availableServices: EVA.Core.GetAvailableServicesResponse | undefined; /** * Returns the current amount of available services * * @readonly */ get availableServiceCount(): number; /** * The subscription to sentinel status changes * * @private * @type {(Subscription|undefined)} */ private statusSubscription; /** * Creates an instance of SentinelOffline * * @param {Sentinel} parent The parent sentinel class */ constructor(parent: Sentinel); /** * Start the support for using the sentinel for an offline limited Redux store * */ start(): Promise; /** * Stop the support for the offline usage of the Redux store * */ stop(): Promise; /** * Checks if a service is available if offline mode * * @param {string} serviceName * @returns {boolean} */ isServiceAvailableOffline(url: string): boolean; /** * Helper message to infer the service name from the url * * @param {string} url The input URL * @returns The service name */ getServiceNameFromUrl(url: string): string | undefined; /** * Stop using the sentinel for offline support and resume using online EVA * */ goOnline(): Promise; /** * Stop using online EVA and start relying on the sentinel * */ goOffline(): Promise; /** * Private helper to reset the Redux store * * @private */ private bootstrapStore; /** * Helper method to emit a status change * * @private */ private emitStatusChange; }