UNPKG

@robotical/appv2-analytics-gatherer

Version:

A tool that gathers data from the Apps and sends it to the Analytics server

25 lines (24 loc) 752 B
import { HeartbeatTypeEnum, VisitedActivityType, VisitedScreenEnum } from "../types/types"; export type HeartbeatProps = { id: string; sessionId: string; interval: number; type: HeartbeatTypeEnum; activity?: VisitedActivityType; screen?: VisitedScreenEnum; }; declare class Heartbeat { private interval; private timeoutId; private sessionId; type: HeartbeatTypeEnum; screen: VisitedScreenEnum | undefined; activity: VisitedActivityType | undefined; isActive: boolean; id: string; constructor({ interval, type, id, activity, screen, sessionId }: HeartbeatProps); start(): Promise<boolean | null>; stop(onStop?: () => void): void; private sendHeartbeat; } export default Heartbeat;