UNPKG

@universis/common

Version:

Universis - common directives and services

49 lines (48 loc) 1.16 kB
import { BehaviorSubject, Observable } from 'rxjs'; /** * * @interface UserActivityEntry * * UserActivityEntry is a single entry at the user activity list * */ export declare interface UserActivityEntry { category: string; description: string; url: string; dateCreated: Date; } /** * UserActivityService * * Handles the user activity tracking. * */ export declare class UserActivityService { protected userActivityEntries$: BehaviorSubject<Array<UserActivityEntry>>; protected maxItems: number; protected list: Array<UserActivityEntry>; constructor(); /** * * Adds a single item at the userActivity service. * * @param {UserActivityEntry} entry The entry to be written * */ setItem(entry: UserActivityEntry): Promise<void>; /** * * Get the list of the user activity. * * @returns {Array<UserActivityEntry>} The list of the entries * */ getItems(): Promise<Array<UserActivityEntry>>; /** * * Get the list of the user activity as observable * */ getItemsAsObservable(): Promise<Observable<Array<UserActivityEntry>>>; }