import { PuiCoreServiceConfig } from '../'; import { PuiClickstreamEvent, PuiClickstreamPageView } from './clickstream.model'; import { PuiApplicationInsightsService } from '../application-insights/application-insights.service'; import { PuiLoggingService } from '../logging/logging.service'; export declare class PuiClickstreamService { private telemetryServiceLocator; private logger; private static EVENT_KEY; private static PAGE_VIEW_KEY; private config; private validConfig; private currentPage; private readonly aiService; private authenticatedContextSet; /** * True after PuiClickstreamService#setAuthenticatedUserContext has been called * False after PuiClickstreamService#clearAuthenticatedUserContext has been called */ readonly isAuthenticatedContextSet: boolean; readonly isConfigured: boolean; private defaultProperties; logContext: { appName: string; appModuleName: string; appModuleType: "Service"; }; constructor(telemetryServiceLocator: PuiApplicationInsightsService, config: PuiCoreServiceConfig, logger: PuiLoggingService); private configure(config); /** * Set default properties to send with all telemetry of the specified type. Use this to reduce redundant code. * @param {{ [propname: string]: string }} props Default properties to add to all telemetry sent of this type * @param {'pageview' | 'event' | 'all'} type Type of telemetry to scope the properties to */ setDefaultProperties(props: { [propname: string]: string; }, type?: 'pageview' | 'event' | 'all'): void; /** * Clear all default properties being sent with all telemetry */ resetDefaultProperties(): void; /** * Returns a copy the current default properties sent with all telemetry of the specified type * @param type Type of telemetry to scope the properties with */ getDefaultProperties(type?: 'pageview' | 'event' | 'all'): { [propname: string]: string; }; /** * Logs that a page or similar container was displayed to the user * @param {PuiClickstreamPageView} pv PageView info * * @memberof PuiClickstreamService */ trackPageView(pv: PuiClickstreamPageView): void; /** * Starts the timer for tracking a page view. Use this if you want to control when the page view timer starts * but don't want to calculate the duration yourself. DOES NOT SEND ANY TELEMETRY. * * @param {string} [name] The name used to identify the page. Defaults to the document title. * @memberof PuiClickstreamService */ startTrackPage(name?: string): void; /** * Stops the timer started via startTrackPage and sends the page view telemetry. * The duration of the page view will be the time between calling startTrackPage and stopTrackPage. * * @param {PuiClickstreamPageView} pv Page view info. Duration is ignored. * @memberof PuiClickstreamService */ stopTrackPage(pv: PuiClickstreamPageView): void; /** * Log a user action or other occurrence. * * @param {PuiClickstreamEvent} event Event Info. If capturing Page Views, leaving url blank will default the value to the current page * * @memberof PuiClickstreamService */ trackEvent(event: PuiClickstreamEvent): void; private hasCurrentPage(); private setCurrentPage(pv); private isValidConfig(config); }