UNPKG

nano-analytics

Version:

A lightweight and framework-agnostic analytics component to track user events and sessions in your web applications.

39 lines (32 loc) 880 B
import { LitElement } from 'lit'; /*=============*/ /* global.d.ts */ /*=============*/ /* Global type declarations to allow TypeScript and JSX to recognize <nano-analytics> */ /* without requiring framework-specific type dependencies.*/ interface HTMLNanoAnalyticsElement extends HTMLElement { projectKey?: string; userId?: string; } declare global { interface HTMLElementTagNameMap { "nano-analytics": HTMLNanoAnalyticsElement; } namespace JSX { interface IntrinsicElements { "nano-analytics": HTMLNanoAnalyticsElement; } } } declare class NanoAnalytics extends LitElement { projectKey: string | null; userId: string | null; private sessionId; constructor(); connectedCallback(): void; disconnectedCallback(): void; private trackPageView; private trackEvent; private sendToApi; } export { NanoAnalytics };