UNPKG

posthog-js

Version:

Posthog-js allows you to automatically capture usage and send events to PostHog.

32 lines (31 loc) • 1.02 kB
import { PostHog } from '../posthog-core'; import type { Extension } from './types'; /** * Captures pageviews when selected URL components change through the history API, browser back/forward navigation, * or hash navigation. */ export declare class HistoryAutocapture implements Extension { private _instance; private _popstateListener; private _hashchangeListener; private _lastLocation; private _pendingPageview; private _isFlushingPageview; constructor(instance: PostHog); initialize(): void; get isEnabled(): boolean; startIfEnabled(): void; startIfEnabledOrStop(): void; stop(): void; monitorHistoryChanges(): void; private _patchHistoryMethod; private _getCurrentLocation; private _getCaptureOptions; private _shouldCaptureHashChanges; private _hasLocationChanged; private _capturePageview; private _isUrlChanging; private _flushPendingPageview; private _setupPopstateListener; private _setupHashchangeListener; }