/** * @type {Component[]} */ export const components: Component[]; declare namespace _default { export { startMonitoring }; export { stopMonitoring }; export { stopVideoComponentMonitoring }; export { getAttentionTimes }; export let registerComponent: (...args: [name: string, element: HTMLElement, visibilityThreshold: number, reportingInterval: number, isTrackingVideo?: boolean | undefined]) => void; } export default _default; declare class Component { /** * Component constructor. * @param {string} name - The name of the component. * @param {HTMLElement} element - The DOM element of the component. * @param {number} visibilityThreshold - * visibilityThreshold represents the fraction of each component that must * be in the viewport before it is considered visible. * e.g. 0.5 means that half the height or width must be in the viewport * 1 means that the entire element must be in the viewport * @param {number} reportingInterval - How often attention is reported. * @param {boolean} isTrackingVideo - Whether this component is a video. */ constructor(name: string, element: HTMLElement, visibilityThreshold: number, reportingInterval: number, isTrackingVideo?: boolean); name: string; element: HTMLElement; visibilityThreshold: number; reportingInterval: number; isTrackingVideo: boolean; visible: boolean; totalAttentionMs: number; unrecordedAttentionStarted: number | null; reportedTotalAttentionMs: number; handleVisibilityChange(isNowVisible: any): void; makeActive(): void; makeInactive(): void; incrementTotalAttentionTimeByUnrecordedAmount(): void; hadAttentionSinceLastGet(): boolean; getAttentionTime(): number; } /** * Begins monitoring the components on the page for attention time. * We begin monitoring if the following conditions are met * 1. the component is visible within the threshold set. * 2. the component is not a video OR is a video which is playing * @returns {Array} Array of results from makeActive() for each visible component. */ declare function startMonitoring(videoPlaying?: boolean): any[]; /** * Stops monitoring the components on the page for attention time. * @returns {Array} Array of results from makeInactive() for each component. */ declare function stopMonitoring(): any[]; /** * Stops monitoring a video on the page for attention time. * This allows us to bypass the decay timer and explicitly stop monitoring video * when the user is not playing the video (ie on video pause or video end) if * the user is explicitly tracking a video component. * @returns {Array} Array of results from makeInactive() for each component. */ declare function stopVideoComponentMonitoring(): any[]; /** * Retrieves the attention times for all components. * @returns {Object} */ declare function getAttentionTimes(): Object;