import { MatDialog } from '@angular/material/dialog'; import { BaseUserService } from '@mtna/lib-ui/base-user-service'; import { MtnaLogger } from '@mtna/lib-ui/logger'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; import { MtnaTimeoutData } from './timeout-data.model'; import * as i0 from "@angular/core"; export declare class MtnaTimeoutService { protected dialog: MatDialog; protected logger: MtnaLogger; protected userService: BaseUserService; protected data: MtnaTimeoutData; /** Subject used to alert root observer when features have completed their pre-timeout actions */ protected proceed: Subject; /** Subject to notify features timeout is in progress */ protected alert: Subject; /** Map of subscribed features */ protected registeredFeatures: { [featureId: string]: boolean; }; /** Handles the starting/stopping of the timer */ protected start: BehaviorSubject; /** * Whether timer is currently running. */ get hasTimer(): boolean; /** * Observable whether timer is currently running. */ hasTimer$: Observable; /** * Observable to notify root observer that all registered features have completed pre-timeout actions * and logout may proceed. */ timeout$: Observable; constructor(dialog: MatDialog, logger: MtnaLogger, userService: BaseUserService, data: MtnaTimeoutData); /** * Registers a feature to the service & returns the alert observable * @param id unique id for a feature * @returns observable for timeout alerts */ registerFeature(id: string): Observable; /** * Resets the timeout countdown. */ resetTimer(): void; /** * Starts the countdown for timeout. */ startTimer(): void; /** * Stops the timeout countdown. */ stopTimer(): void; /** * Informs the service to proceed with timeout. * This should be called by any registered features after they complete their pre-timeout actions. * @param id feature id registered to the service. */ timeoutProceed(id: string): void; /** * Removes a feature from registration * @param id registered id for the feature. */ unregister(id: string): void; /** * Dispatches the final alert to timeout. */ protected _proceedWithTimeout(): void; /** * Initiates the timeout process. If features are registered, triggers an alert and waits for 'timeoutProceed' */ protected _timeout(): void; /** * Triggers the warning dialog before throwing a timeout alert */ protected _triggerWarn(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }