import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners'; import { INSMSession } from './insm-session'; import type { ExperienceProperties, INSMOptions } from './types'; import { AnimationFPSIM } from './period-measurers/afps'; import { INPTracker } from './inp-measurers/inp'; export declare class INSM { analyticsWebClient?: AnalyticsWebClient; runningSession?: INSMSession; options: INSMOptions; periodMeasurers: [AnimationFPSIM, INPTracker]; /** * Heavy tasks are tracked at the insm layer as heavy tasks * are expected at times to be unrelated to the current * page session. */ runningHeavyTasks: Set; constructor(options: INSMOptions); /** * Starts a heavy task in the currently running session. * * This also pauses measurement. * * For PageLoads using the key 'PageLoad' will mean the heavy task duration * is added to the insm session event as pageLoadTime. */ startHeavyTask(heavyTaskName: string): void; /** * Ends a heavy task in the currently running session */ endHeavyTask(heavyTaskName: string): void; /** * Call this when starting a new experience. This is expected to be wired to the product * routing solution. * * It's expected this call will be paired with a `insm.session.startHeavyTask('PageLoad')` and * subsequent `insm.session.endHeavyTask('PageLoad')` so that performance degradations linked * to the page initialisation are excluded from the active interactivity monitoring. * * Using the key 'PageLoad' is special and will result in the heavy task duration being added to the * insm session event as pageLoadTime. * * * ```ts * insm.start('edit-page', { initial: true, contentId: '9001' }) * insm.session.startHeavyTask('PageLoad') * // ... heavy initialisation work * insm.session.endHeavyTask('PageLoad') * ``` */ start(experienceKey: string, experienceProperties: ExperienceProperties): void; private lastStartedExperienceProperties; /** * Call this to update the name of the running session after it's started * In the case it's been started with an unregistered name, and there is not running * session. This will also trigger the session being started. */ overrideExperienceKey(experienceKey: string): void; /** * This prematurely halts any running experience measurement. It's expected to be used in * scenarios such as when error boundaries are hit. */ stopEarly(reasonKey: string, description: string): void; /** * Gets the current running session details */ get session(): INSMSession | undefined; }