/** * Session Recording Utilities * * Utility functions for session recording. * Based on PostHog's sessionrecording-utils.ts */ import { IncrementalSource, eventWithTime } from "@rrweb/types"; import type { MaskInputFn, SnapshotBuffer } from "./types"; /** * rrweb `maskInputFn` used when `maskAllInputs` is false. * Always masks passwords (also via maskInputOptions), sensitive name/id fields, * CC/SSN-shaped values, and vt-sensitive / vt-no-capture / vt-mask trees. */ export declare function createSensitiveMaskInputFn(): MaskInputFn; export declare const INCREMENTAL_SNAPSHOT_EVENT_TYPE = 3; export declare const ONE_KB = 1024; export declare const ONE_MB: number; export declare const SEVEN_MB: number; export declare const RECORDING_MAX_EVENT_SIZE: number; export declare const RECORDING_BUFFER_TIMEOUT = 2000; export declare const RECORDING_IDLE_THRESHOLD_MS: number; /** * Selectors passed to rrweb `blockSelector` by default so common non-visible * template / screen-reader / Webflow CMS nodes are not serialized (they replay * as same-sized placeholders). Reduces payload size and keeps hidden form copy * out of recordings. Stylesheet-only `display:none` is not detectable here. */ export declare const DEFAULT_INVISIBLE_TEMPLATE_BLOCK_SELECTOR: string; /** * Merge comma-separated CSS selector lists with de-duplication. * When `skipDefaults` is true, omit {@link DEFAULT_INVISIBLE_TEMPLATE_BLOCK_SELECTOR}. */ export declare function mergeBlockSelectors(skipDefaults: boolean | undefined, ...sources: (string | undefined | null)[]): string | undefined; /** Active interaction sources */ export declare const ACTIVE_SOURCES: IncrementalSource[]; /** * Estimate the size of an object in bytes */ export declare function estimateSize(obj: unknown): number; /** * Truncate large console log payloads to prevent excessive data */ export declare function truncateLargeConsoleLogs(event: eventWithTime): eventWithTime; /** * Split a large buffer into smaller chunks for transmission */ export declare function splitBuffer(buffer: SnapshotBuffer, sizeLimit?: number): SnapshotBuffer[]; /** * Check if an event is a session idle custom event */ export declare function isSessionIdleEvent(event: eventWithTime): event is eventWithTime & { data: { tag: string; payload: unknown; }; }; /** * Check if an event is a recording paused custom event */ export declare function isRecordingPausedEvent(event: eventWithTime): boolean; /** * Check if an event represents user interaction */ export declare function isInteractiveEvent(event: eventWithTime): boolean; /** * Canonical page key for SPA page-boundary detection: origin + pathname. * Hash and query are ignored so `/trial?utm=x` and `/trial#faq` are the same page. */ export declare function pathnameKeyFromUrl(url: string): string | null; /** * True when `nextHref` is a different page from `prevHref` (origin+pathname). * Used to decide whether an SPA `$pageview` should take a FullSnapshot. */ export declare function isPathnameSignificantChange(prevHref: string | undefined | null, nextHref: string): boolean; /** * Clamp a value to a range with logging */ export declare function clampToRange(value: number, min: number, max: number, label: string, defaultValue: number): number;