UNPKG

@universis/common

Version:

Universis - common directives and services

55 lines (54 loc) 1.53 kB
import { UserStorageService } from './../user-storage'; import { UserActivityService, UserActivityEntry } from './../user-activity/user-activity.service'; import { Observable } from 'rxjs'; /** * * PersistentUserActivityService * * Handles and store the user activity at the userStorage * */ export declare class PersistentUserActivityService extends UserActivityService { protected userStorage: UserStorageService; private initialized; constructor(userStorage: UserStorageService); /** * * Fetches existing userActivity data from the userStorage * */ private initialize; /** * * Adds a new user activity entry on userStorage * * @param {UserActivityEntry} entry The entry to be stored * */ setItem(entry: UserActivityEntry): Promise<void>; /** * * @override * Get the list of user activity entries * * @returns {Array<UserActivityEntry>} The list of user activity entries */ getItems(): Promise<Array<UserActivityEntry>>; /** * * Get the initialization status of the service. * When the service is initialized, the userActivity is fetched and the * service is ready to use * * @returns {boolean} A flag to tell whether the service is ready to use * */ isInitialized(): boolean; /** * * @override * Get the list of the user activity as observable * */ getItemsAsObservable(): Promise<Observable<Array<UserActivityEntry>>>; }