import * as solid_js from 'solid-js'; import { Component, Accessor, ParentComponent } from 'solid-js'; import * as class_variance_authority_types from 'class-variance-authority/types'; import clsx from 'clsx'; /** * @module AnalyticsTypes * @package @geenius/analytics * @description Defines the shared analytics domain model used across the core * tracker, provider integrations, UI variants, and Convex support package. * These types establish the public contract that every variant builds on. */ /** * Analytics event category used by the shared tracker and validators. */ type EventType = "page_view" | "click" | "form_submit" | "custom"; /** * Browser and device metadata captured alongside analytics events. * * @property device Canonical device bucket derived from the client environment. */ interface DeviceInfo { browser: string; os: string; device: "desktop" | "tablet" | "mobile"; screenWidth: number; screenHeight: number; language: string; } /** * Normalized analytics event payload tracked by the shared runtime. * * @property properties Optional event-specific metadata payload. * @property ipAddress Optional client IP address, truncated before storage when IP masking is enabled. * @property sessionId Session identifier associated with the event. */ interface AnalyticsEvent { id: string; type: EventType; name: string; properties?: Record; url: string; referrer: string; ipAddress?: string; sessionId: string; userId?: string; traits?: UserTraits; device: DeviceInfo; timestamp: number; } /** * Normalized page-view payload tracked by the shared runtime. * * @property properties Optional page-view metadata such as campaign or route data. * @property duration Optional dwell time in milliseconds for the page. * @property ipAddress Optional client IP address, truncated before storage when IP masking is enabled. * @property sessionId Session identifier associated with the page view. */ interface PageView { url: string; title: string; referrer: string; properties?: Record; duration?: number; ipAddress?: string; sessionId: string; userId?: string; timestamp: number; } /** * Shared tracker configuration toggles for privacy and event collection. * * @property allowPreConsentTracking Explicitly permits tracking before a consent choice. * @property batchSize Number of queued track/page payloads that triggers a flush. * @property flushIntervalMs Optional interval that flushes queued payloads. * @property eventThrottleMs Optional per-event-name throttle window for custom events. * @property persistOfflineQueue Whether queued track/page payloads should survive reloads. * @property offlineQueueKey Storage key used for the durable offline queue. * @property replayOnReconnect Whether the tracker should replay queued payloads on browser reconnect. * @property retentionDays Optional number of days to retain analytics records and aggregates. * @property excludePaths Route prefixes that should be skipped by automatic page tracking. * @property respectDnt Whether the browser Do Not Track signal should suppress collection. * @property maskPii Whether sensitive payload values are masked before dispatch; user IDs become stable pseudonymous IDs. * @property maskIp Whether IP-shaped payload fields should be truncated before storage or provider sync. * @property anonymize Whether identifiers and sensitive values should use anonymous hashes instead of readable masks. */ interface AnalyticsConfig { trackPageViews?: boolean; trackClicks?: boolean; trackErrors?: boolean; trackPerformance?: boolean; trackSessionStart?: boolean; trackNavigation?: boolean; allowPreConsentTracking?: boolean; batchSize?: number; flushIntervalMs?: number; eventThrottleMs?: number; persistOfflineQueue?: boolean; offlineQueueKey?: string; replayOnReconnect?: boolean; retentionDays?: number; respectDnt?: boolean; sessionTimeout?: number; excludePaths?: string[]; debug?: boolean; maskPii?: boolean; maskIp?: boolean; anonymize?: boolean; } /** * Ranked page summary row consumed by top-page tables. * * @property uniqueVisitors Distinct user or session count for the route. * @property averageTimeMs Average dwell time for the route, in milliseconds. */ interface TopPageSummary$1 { url: string; views: number; uniqueVisitors?: number; averageTimeMs?: number; averageTimeSeconds?: number; averageTime?: string; } /** * Aggregated analytics dashboard payload consumed by UI variants. * * @property topPages Ranked page summary rows by view count, visitors, and dwell time. * @property deviceBreakdown Device counts grouped by canonical device bucket. */ interface AnalyticsDashboardData { totalPageViews: number; uniqueVisitors: number; topPages: TopPageSummary$1[]; topReferrers: Array<{ referrer: string; visits: number; }>; deviceBreakdown: { desktop: number; tablet: number; mobile: number; }; browserBreakdown: Record; } /** * Provider identifier supported by the shared package. */ type ProviderName = "posthog" | "mixpanel" | "google-analytics" | "plausible"; /** * Provider configuration used when registering analytics integrations. * * @property provider Provider identifier used to select the integration. * @property apiKey Provider API key, measurement ID, or equivalent identifier. */ interface ProviderConfig { provider: ProviderName; apiKey: string; host?: string; enabled?: boolean; } /** * Canonical consent categories exposed by the public analytics contract. */ type ConsentCategory = "essential" | "analytics" | "marketing" | "personalization"; /** * Consent payload controlling which categories of tracking are allowed. * * @property essential Required product and privacy operations that stay enabled. * @property personalization Product personalization and feature preference tracking. * @property functional Deprecated alias retained for existing integrations. * @property timestamp Time at which the consent decision was recorded. */ interface ConsentSettings { essential: boolean; analytics: boolean; marketing: boolean; personalization: boolean; functional?: boolean; timestamp: number; } /** * User traits forwarded to analytics providers during identification. */ interface UserTraits { email?: string; name?: string; plan?: string; company?: string; avatar?: string; [key: string]: unknown; } /** * Paginated read result returned by storage adapters. * * @property items Records returned for the current page. * @property nextCursor Cursor supplied when another page is available. * @property total Optional total count when the provider can calculate one cheaply. */ interface AnalyticsReadResult { items: TRecord[]; nextCursor?: string; total?: number; } /** * Query options for reading stored analytics events. */ interface AnalyticsEventQuery { userId?: string; sessionId?: string; eventName?: string; eventType?: EventType; timeRange?: TimeRange; limit?: number; cursor?: string; } /** * Query options for reading stored page-view records. */ interface AnalyticsPageViewQuery { url?: string; userId?: string; sessionId?: string; timeRange?: TimeRange; limit?: number; cursor?: string; } /** * Query options for materializing dashboard aggregate data. */ interface AnalyticsDashboardQuery { timeRange?: TimeRange; limit?: number; cursor?: string; } /** * Query options for realtime aggregate reads. */ interface RealtimeStatsQuery { since?: number; now?: number; windowMs?: number; topPageLimit?: number; } /** * Query options for funnel aggregate reads. */ interface FunnelResultsQuery { steps: FunnelStep[]; timeRange?: TimeRange; limit?: number; } /** * Query options for cohort aggregate reads. */ interface CohortAnalysisQuery { cohortType?: "user" | "session"; intervals?: number[]; timeRange?: TimeRange; segment?: Record; } /** * Self-hosted analytics storage contract used before optional outbound provider sync. */ interface AnalyticsStorageAdapter { trackEvent(event: AnalyticsEvent): Promise; trackPageView(pageView: PageView): Promise; getEvents?(query?: AnalyticsEventQuery): Promise>; getPageViews?(query?: AnalyticsPageViewQuery): Promise>; getDashboardData?(query?: AnalyticsDashboardQuery): Promise; getRealtimeStats?(query?: RealtimeStatsQuery): Promise; getFunnelResults?(query: FunnelResultsQuery): Promise; getCohortAnalysis?(query?: CohortAnalysisQuery): Promise; identifyUser?(userId: string, traits?: UserTraits): Promise; setUserProperties?(userId: string, traits: UserTraits): Promise; flush?(): Promise; shutdown?(): Promise; purgeExpiredData?(cutoffTimestamp: number): Promise; deleteUserData?(userId: string): Promise; } /** * Declarative definition of a funnel step in shared analytics analysis. * * @property properties Optional event-property filter that must match the step. */ interface FunnelStep { name: string; event: string; properties?: Record; } /** * Computed analytics result for a single funnel step. * * @property dropoffRate Percentage of entries lost before reaching the step. * @property conversionRate Percentage of initial entries that reached the step. * @property averageTimeFromPreviousMs Average elapsed time from the previous completed step. */ interface FunnelStepResult { name: string; event: string; count: number; dropoffRate: number; conversionRate: number; averageTimeFromPreviousMs?: number; } /** * Aggregated result for a complete funnel analysis. * * @property steps Ordered funnel step results from entry to conversion. * @property overallConversionRate Percentage of entries that completed the funnel. * @property averageTimeToConvertMs Average elapsed time from first to final step. */ interface FunnelResult { name: string; steps: FunnelStepResult[]; totalEntries: number; totalConversions: number; overallConversionRate: number; averageTimeToConvertMs?: number; analyzedAt: number; } /** * Snapshot of realtime visitor and page activity. * * @property activeSessions Number of currently active analytics sessions. * @property eventsPerSecond Recent event throughput for live dashboards. * @property conversions Number of conversion events in the active realtime window. * @property conversionRate Conversion percentage in the active realtime window. * @property deviceBreakdown Live visitor distribution by device bucket. * @property topActivePages Ranked active pages with live visitor counts. * @property lastUpdated Timestamp at which the snapshot was produced. */ interface RealtimeStats { activeVisitors: number; currentPageViews: number; activeSessions?: number; eventsPerSecond?: number; conversions?: number; conversionRate?: number; deviceBreakdown?: AnalyticsDashboardData["deviceBreakdown"]; topActivePages: Array<{ url: string; visitors: number; }>; lastUpdated: number; } /** * Inclusive analytics time range used by filters and queries. */ interface TimeRange { start: number; end: number; } /** * Computed metric summary rendered by dashboard cards and tables. * * @property trend Direction of movement relative to the previous value. * @property format Presentation mode used to format the numeric value. */ interface MetricSummary { label: string; value: number; previousValue?: number; change?: number; changePercent?: number; trend: "up" | "down" | "flat"; format: "number" | "percent" | "duration" | "currency"; } /** * Single chart datapoint rendered by analytics visualizations. */ interface ChartDataPoint { label: string; value: number; timestamp?: number; } /** * Timeline event rendered in recent-activity views. * * @property properties Optional event metadata associated with the timeline entry. */ interface TimelineEvent { id: string; event: string; userId?: string; properties?: Record; timestamp: number; } /** * Retention datapoint for a single cohort interval. * * @property retainedUsers Number of users retained for the interval. * @property retentionRate Percentage retained at the interval boundary. */ interface CohortRetentionPoint { day: number; retainedUsers: number; retentionRate: number; } /** * Cohort bucket produced by the shared cohort analysis helpers. * * @property retained Retention datapoints for the cohort over time. */ interface CohortBucket { cohort: string; size: number; retained: CohortRetentionPoint[]; lastActivity: number; } /** * Full retention cohort analysis returned by the shared analytics helpers. * * @property intervals Day intervals included in the analysis. * @property cohorts Cohort buckets included in the analysis. */ interface CohortAnalysis { name: string; cohortType: "user" | "session"; intervals: number[]; cohorts: CohortBucket[]; generatedAt: number; } /** * Single frame in a shared session replay snapshot. * * @property deltaMs Milliseconds elapsed since the previous replay frame. */ interface SessionReplayFrame { id: string; kind: "event" | "page_view"; label: string; url: string; timestamp: number; deltaMs: number; sessionId: string; userId?: string; properties?: Record; } /** * Ordered session replay snapshot produced from tracked analytics activity. * * @property frames Ordered replay frames associated with the captured session. * @property activePages Unique page URLs touched during the session. */ interface SessionReplaySnapshot { sessionId: string; startedAt: number; endedAt: number; duration: number; frames: SessionReplayFrame[]; activePages: string[]; userId?: string; } /** * Inputs used to build SEO metadata for analytics page compositions. */ interface BuildAnalyticsSeoMetaOptions { title: string; description: string; path: string; keywords: string[]; } /** * SEO metadata emitted by the shared analytics page metadata builder. */ interface SEOMeta { title: string; description: string; canonical: string; keywords: string[]; image: { url: string; alt: string; }; type: "website"; jsonLd: Record; } /** * Builds canonical SEO metadata for analytics dashboard pages. * * @param options Page title, description, route path, and keyword list. * @returns Metadata object containing canonical URL, Open Graph image, and JSON-LD. */ declare function buildAnalyticsSeoMeta(options: BuildAnalyticsSeoMetaOptions): SEOMeta; /** * @module AnalyticsConfig * @package @geenius/analytics * @description Provides the shared analytics configuration builder and the * default environment presets used by the tracker and provider integrations. * The fluent builder keeps package consumers on a typed, privacy-aware config path. */ type AnalyticsConfigurationBundle = { analytics: AnalyticsConfig; providers: Partial>; storage?: AnalyticsStorageAdapter | AnalyticsStorageAdapter[]; }; /** * @module Dashboard * @package @geenius/analytics * @description Shared dashboard widget contracts and aggregation helpers used * by the React, SolidJS, and Storybook surfaces. This module normalizes raw * analytics data into the consistent dashboard model exposed by the package. */ /** Supported dashboard widget kinds rendered by the shared analytics dashboards. */ type DashboardWidgetKind = "metric" | "chart" | "top-pages" | "device-breakdown" | "events" | "funnel" | "realtime" | "cohort" | "replay"; /** * Shared metadata present on every dashboard widget model. * * @property id Stable widget identifier used for rendering and diffing. * @property kind Widget kind that determines the renderer and data payload. * @property title Human-readable widget title shown in dashboards and Storybook fixtures. * @property description Optional supporting description for the widget card. * @property span Optional grid span used by composed dashboard layouts. */ interface DashboardWidgetBase { id: string; kind: DashboardWidgetKind; title: string; description?: string; span?: 1 | 2 | 3; } /** * Dashboard widget that renders a single summary metric. * * @property metric Metric payload shown by metric-focused dashboard cards. */ interface MetricDashboardWidget extends DashboardWidgetBase { kind: "metric"; metric: MetricSummary; } /** * Dashboard widget that renders a chart-backed series. * * @property chartType Optional visualization type used by the chart renderer. * @property data Ordered chart points consumed by the visual component. */ interface ChartDashboardWidget extends DashboardWidgetBase { kind: "chart"; chartType?: "bar" | "line"; data: ChartDataPoint[]; } /** * Dashboard widget that lists the top-performing pages. * * @property pages Ranked page summary entries derived from analytics traffic. */ interface TopPagesDashboardWidget extends DashboardWidgetBase { kind: "top-pages"; pages: AnalyticsDashboardData["topPages"]; } /** * Dashboard widget that summarizes device distribution. * * @property breakdown Device-count aggregate broken out by desktop, tablet, and mobile. */ interface DeviceBreakdownDashboardWidget extends DashboardWidgetBase { kind: "device-breakdown"; breakdown: AnalyticsDashboardData["deviceBreakdown"]; } /** * Dashboard widget that renders a recent-event stream. * * @property events Event rows shown in the widget. * @property maxRows Optional row cap used by compact dashboard layouts. */ interface EventDashboardWidget extends DashboardWidgetBase { kind: "events"; events: AnalyticsEvent[]; maxRows?: number; } /** * Dashboard widget that renders funnel conversion output. * * @property result Funnel analysis payload rendered by the widget. */ interface FunnelDashboardWidget$1 extends DashboardWidgetBase { kind: "funnel"; result: FunnelResult; } /** * Dashboard widget that renders realtime activity output. * * @property stats Latest realtime analytics snapshot. * @property isLoading Optional loading state for live polling UIs. */ interface RealtimeDashboardWidget$1 extends DashboardWidgetBase { kind: "realtime"; stats: RealtimeStats | null; isLoading?: boolean; } /** * Dashboard widget that renders cohort-retention output. * * @property analysis Cohort analysis payload rendered by the widget. */ interface CohortDashboardWidget extends DashboardWidgetBase { kind: "cohort"; analysis: CohortAnalysis; } /** * Dashboard widget that previews a session-replay snapshot. * * @property replay Session replay material used for the widget preview. */ interface ReplayDashboardWidget extends DashboardWidgetBase { kind: "replay"; replay: SessionReplaySnapshot; } /** Union of all dashboard widgets supported by the shared dashboard model. */ type DashboardWidget = MetricDashboardWidget | ChartDashboardWidget | TopPagesDashboardWidget | DeviceBreakdownDashboardWidget | EventDashboardWidget | FunnelDashboardWidget$1 | RealtimeDashboardWidget$1 | CohortDashboardWidget | ReplayDashboardWidget; /** * Shared dashboard layout consumed by the React, SolidJS, and Storybook surfaces. * * @property title Optional dashboard heading. * @property description Optional supporting copy describing the dashboard purpose. * @property widgets Ordered widget collection rendered by the dashboard builders. */ interface DashboardLayout { title?: string; description?: string; widgets: DashboardWidget[]; } /** * @module AnalyticsProviderInterface * @package @geenius/analytics * @description Defines the provider contract and base implementation used by * all shared analytics provider integrations. These types keep the tracker * runtime provider-agnostic while still supporting provider-specific setup. */ /** * Provider name token supported by the shared analytics package. */ type AnalyticsProviderName = ProviderName; /** * Provider-specific configuration required to initialize an analytics client. * * @property provider Provider identifier used to select the integration. * @property apiKey Provider API key, measurement ID, or equivalent identifier. * @property host Optional host override for self-hosted analytics backends. */ interface AnalyticsProviderConfig extends AnalyticsConfig { provider: AnalyticsProviderName; apiKey: string; host?: string; } /** * Contract implemented by all analytics providers used by the shared tracker. * * @property name Stable provider identifier exposed by the implementation. */ interface AnalyticsProvider$1 { readonly name: AnalyticsProviderName; init(config: AnalyticsProviderConfig): void; trackEvent(event: AnalyticsEvent): Promise; trackPageView(pageView: PageView): Promise; identify(userId: string, traits?: UserTraits): Promise; setUserProperties(userId: string, traits: UserTraits): Promise; flush(): Promise; reset(): Promise; shutdown(): Promise; purgeExpiredData?(cutoffTimestamp: number): Promise; deleteUserData?(userId: string): Promise; } /** * @module GoogleAnalyticsProvider * @package @geenius/analytics * @description Implements the shared Google Analytics 4 provider using the * global `gtag.js` browser script. The provider injects the runtime script on * demand and adapts shared event/page payloads to GA4 conventions. */ declare global { interface Window { dataLayer: unknown[]; gtag: (...args: unknown[]) => void; } } /** * @module Tracker * @package @geenius/analytics * @description Shared tracker factory that coordinates provider dispatch, * consent checks, and privacy sanitization for every published analytics * variant. Framework bindings wrap this tracker rather than reimplementing the * dispatch lifecycle themselves. */ type TrackerProviderInput = AnalyticsProvider$1 | ProviderConfig; type TrackerProviderRegistry = Partial>; interface TrackerConfig extends AnalyticsConfig { providers?: TrackerProviderInput[] | TrackerProviderRegistry; storage?: AnalyticsStorageAdapter | AnalyticsStorageAdapter[]; } type TrackerConfigInput = TrackerConfig | AnalyticsConfigurationBundle; /** * Options for categorizing manual events against granular consent settings. * * @property scope Consent category required before the tracker dispatches the event. * * @example * ```ts * await tracker.track("campaign_cta_clicked", {}, { scope: "marketing" }) * ``` */ interface TrackerTrackOptions { scope?: ConsentCategory; } /** * Public tracker contract shared by framework bindings and standalone consumers. * * @property track Dispatches a custom analytics event with optional consent scope. * @property page Dispatches a page-view record when tracking is enabled for the URL. * @property pageView Dispatches a page-view record using the canonical public method name. * @property identify Associates subsequent events with a known user identity. * @property setUserProperties Updates user traits attached to later events and provider profiles. * @property flush Dispatches queued track/page payloads to storage and providers. * @property reset Clears identity state and rolls the session identifier forward. * @property shutdown Flushes queued work and shuts down initialized providers. * @property purgeExpiredData Purges records and aggregates outside the retention window. * @property consent Updates the in-memory consent gate used before dispatching analytics. * @property deleteUserData Deletes a known user from self-hosted storage and provider integrations. * @property forgetUser Alias for deleteUserData, useful for right-to-forget UI copy. * @property startAutoTracking Installs browser listeners for configured automatic tracking. * @property getSessionId Returns the current session identifier used for new events. * @property isReady Indicates whether the tracker instance is initialized and usable. */ interface TrackerInstance { track: (name: string, properties?: Record, options?: TrackerTrackOptions) => Promise; page: (url: string, properties?: Record) => Promise; pageView: (url: string, properties?: Record) => Promise; identify: (userId: string, traits?: UserTraits) => Promise; setUserProperties: (traits: UserTraits) => Promise; flush: () => Promise; reset: () => Promise; shutdown: () => Promise; purgeExpiredData: (now?: number) => Promise; consent: (settings: ConsentSettings) => void; deleteUserData: (userId: string) => Promise; forgetUser: (userId: string) => Promise; startAutoTracking: () => () => void; getSessionId: () => string; isReady: () => boolean; } /** * @module ErrorState * @package @geenius/analytics/solidjs * @description Internal recovery surface shared by SolidJS analytics data * components when a fetch or render boundary fails. */ /** Error value accepted by SolidJS data-rendering components. */ type AnalyticsErrorStateValue = Error | string | null | undefined; /** * @module AnalyticsDashboardPage * @package @geenius/analytics/solidjs * @description Composes the primary SolidJS analytics dashboard page from the * shared metric, table, and device widgets. The page exposes a ready-to-render * overview surface for traffic and engagement reporting. */ /** * Props for rendering the SolidJS analytics dashboard page. * * @property data Optional aggregate dashboard data rendered across the page sections. * @property recentEvents Optional list of recent analytics events shown in the event table. * @property funnelResult Optional funnel analysis rendered in the conversion section. * @property cohortAnalysis Optional cohort-retention payload rendered in the cohort section. * @property realtimeStats Optional realtime visitor summary for the page header. * @property timelineEvents Optional event timeline rows. * @property consentSettings Optional persisted consent state summary. * @property isLoading Whether child widgets should render loading placeholders instead of content. * @property error Optional page-level error surfaced before dashboard data sections. * @property onRetry Optional recovery callback shown in the page-level error state. * @property class Optional class name merged into the page wrapper. */ interface AnalyticsDashboardPageProps { data?: AnalyticsDashboardData | null; recentEvents?: AnalyticsEvent[]; funnelResult?: FunnelResult | null; cohortAnalysis?: CohortAnalysis | null; realtimeStats?: RealtimeStats | null; timelineEvents?: TimelineEvent[]; consentSettings?: ConsentSettings | null; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders the SolidJS analytics dashboard page with summary cards and detail tables. * * @param props Page props containing dashboard aggregates, recent events, and loading state. * @returns A full-page SolidJS analytics dashboard composition. */ declare const AnalyticsDashboardPage: Component; /** * @module AnalyticsDashboard * @package @geenius/analytics/solidjs * @description Publishes the SolidJS analytics dashboard through the component * catalog while delegating rendering to the page implementation. */ /** Props accepted by the public SolidJS analytics dashboard component. */ type AnalyticsDashboardProps = AnalyticsDashboardPageProps; /** * Renders the canonical SolidJS analytics dashboard as a component export. * * @param props Dashboard data, realtime state, and page composition options. * @returns The SolidJS analytics dashboard surface. */ declare const AnalyticsDashboard: Component; /** * @module ChartCard * @package @geenius/analytics/solidjs * @description Renders the SolidJS chart card used to visualize simple * analytics series such as trends, counts, and comparisons. The component * converts shared chart points into a lightweight bar-style presentation. */ /** * Props for rendering the SolidJS chart card. * * @property title Section heading displayed above the chart body. * @property data Ordered data points rendered as bars. * @property type Optional chart mode metadata for consumers. * @property height Optional pixel height for the chart body. * @property error Optional error value rendered instead of the chart body. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the card wrapper. */ interface ChartCardProps { title: string; data: ChartDataPoint[]; type?: "bar" | "line"; height?: number; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders a SolidJS chart card for a list of analytics datapoints. * * @param props Chart metadata and datapoints to visualize. * @returns A chart card element with proportional bars. */ declare const ChartCard: Component; /** * @module CohortTable * @package @geenius/analytics/solidjs * @description Renders the SolidJS cohort-retention table for comparing * cohort sizes, retention checkpoints, and last activity across segments. */ /** * Props for rendering the SolidJS cohort retention table. * * @property analysis Cohort analysis payload produced by shared helpers. * @property title Optional section title override. * @property maxRows Maximum cohort rows to render. * @property isLoading Whether the table should render placeholder rows. * @property error Optional error state rendered with retry recovery. * @property onRetry Optional retry callback for error states. * @property class Optional class name merged into the card wrapper. */ interface CohortTableProps { analysis: CohortAnalysis | null; title?: string; maxRows?: number; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders a cohort retention table for the SolidJS analytics variant. * * @param props Cohort analysis data and optional loading/error controls. * @returns A card-framed cohort table with accessible row and column labels. */ declare const CohortTable: Component; /** * @module ConsentBanner * @package @geenius/analytics/solidjs * @description Renders the SolidJS consent banner used to capture analytics * cookie preferences. The component updates provider-backed consent state and * emits the resulting settings through the provided callbacks. */ /** * Props for rendering the SolidJS analytics consent banner. * * @property onAccept Called when the user grants analytics consent. * @property onReject Called when the user rejects analytics consent. * @property show Whether the banner should be visible on first render. * @property class Optional class name merged into the banner wrapper. */ interface ConsentBannerProps { onAccept: (settings: ConsentSettings) => void; onReject: (settings: ConsentSettings) => void; show?: boolean; class?: string; } /** * Renders the SolidJS consent banner with accept and reject actions. * * @param props Banner callbacks for accept and reject actions. * @returns A consent banner element that hides itself after dismissal. */ declare const ConsentBanner: Component; /** * @module ConsentPreferences * @package @geenius/analytics/solidjs * @description Renders granular consent category controls for the SolidJS * analytics variant. */ type ConsentPreferenceScope = "analytics" | "marketing" | "personalization"; type ConsentPreferenceValues = Pick; /** * Props for rendering the granular SolidJS consent preferences control. * * @property value Optional controlled preference values. * @property onChange Called whenever a category toggle changes. * @property onSave Called when the user saves the current category choices. * @property showActions Whether to show the built-in save button. * @property class Optional class name merged into the fieldset. */ interface ConsentPreferencesProps { value?: Partial; onChange?: (preferences: ConsentPreferenceValues) => void; onSave?: (settings: ConsentSettings) => void; showActions?: boolean; class?: string; } /** * Renders category-level consent controls for analytics, marketing, and * personalization scopes. * * @param props Controlled values and callbacks for the consent controls. * @returns A fieldset containing category toggles and an optional save action. */ declare const ConsentPreferences: Component; /** * @module DashboardBuilder * @package @geenius/analytics/solidjs * @description Renders the SolidJS dashboard builder that composes * heterogeneous analytics widgets into a page-ready grid. The builder consumes * the shared dashboard layout vocabulary so consumers can declare dashboards as * data. */ interface FunnelDashboardWidget extends Omit { kind: "funnel"; result: FunnelResult; } interface RealtimeDashboardWidget extends Omit { kind: "realtime"; stats: RealtimeStats | null; isLoading?: boolean; } interface ConsentDashboardWidget extends Omit { kind: "consent"; settings?: ConsentSettings | null; onAccept?: (settings: ConsentSettings) => void; onReject?: (settings: ConsentSettings) => void; } interface TimelineDashboardWidget extends Omit { kind: "timeline"; events: TimelineEvent[]; maxVisible?: number; } type SolidDashboardWidget = DashboardWidget | FunnelDashboardWidget | RealtimeDashboardWidget | ConsentDashboardWidget | TimelineDashboardWidget; type SolidDashboardLayout = Omit & { widgets: SolidDashboardWidget[]; }; /** Time range option shown by the SolidJS dashboard builder toolbar. */ interface DashboardBuilderTimeRangeOption { value: string; label: string; } /** * Props for rendering the SolidJS dashboard builder. * * @property layout Shared dashboard layout definition or a raw widget array. * @property editable Whether to render dashboard editing and reordering controls. * @property timeRange Controlled selected dashboard time range. * @property timeRangeOptions Options shown in the dashboard time-range control. * @property selectedWidgetId Controlled selected widget identifier for the editor. * @property onLayoutChange Called with the next widget order after reordering. * @property onTimeRangeChange Called when the user selects a new time range. * @property onWidgetSelect Called when the user opens a widget in the editor. * @property class Optional class name merged into the section wrapper. */ interface DashboardBuilderProps { layout: DashboardLayout | SolidDashboardLayout | SolidDashboardWidget[]; editable?: boolean; timeRange?: string; timeRangeOptions?: DashboardBuilderTimeRangeOption[]; selectedWidgetId?: string; onLayoutChange?: (widgets: SolidDashboardWidget[]) => void; onTimeRangeChange?: (timeRange: string) => void; onWidgetSelect?: (widget: SolidDashboardWidget) => void; class?: string; } /** * Renders the SolidJS dashboard builder from a shared layout definition. * * @param props Dashboard layout data and an optional wrapper class. * @returns A section element containing the resolved analytics widget grid. */ declare const DashboardBuilder: Component; /** * @module DeviceBreakdown * @package @geenius/analytics/solidjs * @description Renders the SolidJS device-breakdown visualization that * compares desktop, tablet, and mobile traffic. The component pairs a * proportional bar with a simple legend for quick distribution scans. */ /** * Props for rendering the SolidJS device-breakdown widget. * * @property breakdown Device counts grouped by desktop, tablet, and mobile. * @property error Optional error value rendered instead of the device rows. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the wrapper. */ interface DeviceBreakdownProps { breakdown: { desktop: number; tablet: number; mobile: number; }; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders the SolidJS device-breakdown widget. * * @param props Device counts and optional wrapper class. * @returns A device distribution widget for analytics dashboards. */ declare const DeviceBreakdown: Component; /** * @module EventTable * @package @geenius/analytics/solidjs * @description Renders the SolidJS recent-events table for analytics * dashboards. The component formats event metadata into a compact grid and * includes loading skeletons plus an empty state for low-traffic views. */ type EventTypeFilter = AnalyticsEvent["type"] | "all"; type EventTableFilterDevice = DeviceInfo["device"] | "all"; /** * Props for rendering the SolidJS analytics event table. * * @property events Event rows to display in the table. * @property isLoading Whether the table should render loading skeleton rows. * @property maxRows Maximum number of event rows to render. * @property filterText Controlled search text used to filter event rows. * @property eventType Controlled event-type filter used to filter event rows. * @property showFilters Whether the table should render search and type controls. * @property error Optional error value rendered instead of the table. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the wrapper. */ interface EventTableProps { events: AnalyticsEvent[]; isLoading?: boolean; error?: AnalyticsErrorStateValue; maxRows?: number; filterText?: string; eventType?: EventTypeFilter; device?: EventTableFilterDevice; onFilterTextChange?: (value: string) => void; onEventTypeChange?: (value: EventTypeFilter) => void; onDeviceChange?: (value: EventTableFilterDevice) => void; onRetry?: () => void; showFilters?: boolean; class?: string; } /** * Renders the SolidJS analytics event table. * * @param props Event rows, loading state, and row limit for the table. * @returns An event table element with loading and empty states. */ declare const EventTable: Component; /** * @module FunnelChart * @package @geenius/analytics/solidjs * @description Renders the SolidJS funnel visualization for a shared funnel * analysis result. The component presents each step's conversion bar plus the * overall conversion summary for onboarding and checkout flows. */ /** * Props for rendering the SolidJS funnel chart. * * @property result Funnel analysis result to visualize. * @property error Optional error value rendered instead of the funnel body. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the chart wrapper. */ interface FunnelChartProps { result: FunnelResult; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders the SolidJS funnel chart for a shared funnel result. * * @param props Funnel result payload for the chart. * @returns A funnel chart element, or an empty-state element when no steps exist. */ declare const FunnelChart: Component; /** * @module MetricCard * @package @geenius/analytics/solidjs * @description Renders the SolidJS metric card for a single computed summary * metric. The card formats percentages and raw counts while exposing trend * coloring from the shared analytics tokens. */ /** * Props for rendering the SolidJS metric card. * * @property metric Metric summary payload rendered by the card. * @property error Optional error value rendered instead of the metric body. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the card wrapper. */ interface MetricCardProps { metric: MetricSummary; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders a SolidJS metric card for one summary metric. * * @param props Summary metric payload for the card. * @returns A metric card element with formatted value and optional trend. */ declare const MetricCard: Component; /** * @module RealtimeBadge * @package @geenius/analytics/solidjs * @description Renders the SolidJS realtime-visitor badge used by dashboards * to surface current activity at a glance. The badge handles loading, empty, * and active states without requiring consumers to branch around it. */ /** * Props for rendering the SolidJS realtime activity badge. * * @property stats Latest realtime stats snapshot, or `null` when unavailable. * @property isLoading Whether the realtime fetch is still pending. * @property error Optional realtime fetch error shown as an alert state. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the badge wrapper. */ interface RealtimeBadgeProps { stats: RealtimeStats | null; isLoading: boolean; error?: Error | string | null; onRetry?: () => void; class?: string; } /** * Renders a SolidJS badge showing the current active-visitor count. * * @param props Realtime stats and loading state for the badge. * @returns A badge element representing loading, empty, or active realtime state. */ declare const RealtimeBadge: Component; /** * @module StatsCard * @package @geenius/analytics/solidjs * @description Renders the SolidJS summary-stat card used across analytics * page headers and dashboard compositions. The component combines an optional * icon, headline value, and trend indicator into a compact card surface. */ /** * Props for rendering the SolidJS stats card. * * @property label Human-readable label for the metric being displayed. * @property value Formatted or raw metric value to display prominently. * @property icon Optional icon shown beside the metric content. * @property change Optional change string rendered below the main value. * @property trend Optional direction token used for the change indicator. * @property sparkline Optional numeric series rendered as a compact trend line. * @property sparklineLabel Accessible label for the sparkline image. * @property error Optional error value rendered instead of the metric body. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the card wrapper. */ interface StatsCardProps { label: string; value: string | number; icon?: string; change?: string; trend?: "up" | "down" | "neutral"; sparkline?: number[]; sparklineLabel?: string; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders the SolidJS summary-stat card. * * @param props Metric label, value, and optional trend presentation props. * @returns A card element showing the supplied summary metric. */ declare const StatsCard: Component; /** * @module Timeline * @package @geenius/analytics/solidjs * @description Renders the SolidJS analytics timeline for recent event * activity. The component maps shared timeline events into a compact log view * with event icons and localized timestamps. */ /** * Props for rendering the SolidJS analytics timeline. * * @property events Timeline events to render in descending recency order. * @property maxVisible Maximum number of timeline rows to display. * @property error Optional error value rendered instead of the timeline. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the timeline wrapper. */ interface TimelineProps { events: TimelineEvent[]; maxVisible?: number; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders a SolidJS timeline for recent analytics events. * * @param props Timeline events and the optional visible-row limit. * @returns A timeline log element for analytics activity. */ declare const Timeline: Component; /** * @module TopPagesTable * @package @geenius/analytics/solidjs * @description Renders the SolidJS top-pages table used by analytics dashboards * to compare the most-visited routes. The component includes loading and empty * states so it can be mounted directly in page layouts. */ /** Summary row rendered by the SolidJS top-pages table. */ interface TopPageSummary { url: string; views: number; uniqueVisitors?: number; averageTimeMs?: number; averageTimeSeconds?: number; averageTime?: string; } /** * Props for rendering the SolidJS top-pages table. * * @property pages Ordered page summary rows with visit and engagement counts. * @property isLoading Whether the table should render placeholder rows. * @property error Optional error value rendered instead of the table body. * @property onRetry Optional recovery callback shown with the error state. * @property class Optional class name merged into the table wrapper. */ interface TopPagesTableProps { pages: TopPageSummary[]; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; class?: string; } /** * Renders the SolidJS top-pages table with proportional view bars. * * @param props Table props containing page rows and optional loading state. * @returns A top-pages table element for analytics dashboards. */ declare const TopPagesTable: Component; /** * @module EventExplorerPage * @package @geenius/analytics/solidjs * @description Page-level SolidJS composition for filtering, inspecting, and * exporting analytics events. */ interface EventExplorerFilters { types?: EventType[]; startTime?: number; endTime?: number; url?: string; userId?: string; sessionId?: string; device?: DeviceInfo["device"]; search?: string; } type AnalyticsSeoMeta = ReturnType; /** * Props for rendering the SolidJS event explorer page. * * @property events Event rows available to browse and export. * @property initialFilters Optional initial filters for the local controls. * @property onFiltersChange Called whenever local filters change. * @property onExport Called with the current filtered event rows. * @property isLoading Whether the table should render loading placeholders. * @property error Optional page-level error message or error object. * @property onRetry Optional retry handler rendered with the error state. * @property maxRows Maximum number of table rows to render. * @property renderSeoMeta Optional renderer for host apps that mount SEO metadata. * @property class Optional class name merged into the page wrapper. */ interface EventExplorerPageProps { events?: AnalyticsEvent[]; initialFilters?: EventExplorerFilters; onFiltersChange?: (filters: EventExplorerFilters) => void; onExport?: (events: AnalyticsEvent[]) => void; isLoading?: boolean; error?: Error | string | null; onRetry?: () => void; maxRows?: number; renderSeoMeta?: (meta: AnalyticsSeoMeta) => unknown; class?: string; } /** * Renders an event explorer with filters, property inspection, and export. * * @param props Event rows, initial filters, and export callback. * @returns A SolidJS page composition for event exploration workflows. */ declare const EventExplorerPage: Component; /** * @module FunnelAnalysisPage * @package @geenius/analytics/solidjs * @description Page-level SolidJS composition for configuring and reviewing * analytics funnel analysis. */ /** * Props for rendering the SolidJS funnel analysis page. * * @property name Human-readable funnel name used when analyzing raw events. * @property steps Ordered funnel step configuration shown in the builder. * @property events Optional raw events used by the built-in analyze action. * @property result Optional precomputed funnel result to visualize. * @property onAnalyze Called after the built-in analyze action computes a result. * @property isLoading Whether the analysis surface should show loading state. * @property error Optional page-level error message or error object. * @property onRetry Optional retry handler rendered with the error state. * @property renderSeoMeta Optional renderer for host apps that mount SEO metadata. * @property class Optional class name merged into the page wrapper. */ interface FunnelAnalysisPageProps { name?: string; steps?: FunnelStep[]; events?: AnalyticsEvent[]; result?: FunnelResult | null; onAnalyze?: (result: FunnelResult) => void; isLoading?: boolean; error?: Error | string | null; onRetry?: () => void; renderSeoMeta?: (meta: AnalyticsSeoMeta) => unknown; class?: string; } /** * Renders a page-level funnel builder and conversion analysis surface. * * @param props Funnel configuration, raw events, and optional precomputed result. * @returns A SolidJS page composition for funnel analysis workflows. */ declare const FunnelAnalysisPage: Component; /** * @module createAnalyticsDashboard * @package @geenius/analytics/solidjs * @description Normalizes dashboard page inputs into reactive SolidJS * accessors for hosts that compose the analytics dashboard manually. */ type DashboardInput = T | Accessor; type AnalyticsDashboardPageViewProps = Pick; /** Input data consumed by {@link createAnalyticsDashboard}. */ interface CreateAnalyticsDashboardOptions { data?: DashboardInput; recentEvents?: DashboardInput; realtimeStats?: DashboardInput; funnelResult?: DashboardInput; cohortAnalysis?: DashboardInput; timelineEvents?: DashboardInput; consentSettings?: DashboardInput; isLoading?: DashboardInput; isRealtimeLoading?: DashboardInput; error?: DashboardInput; onRetry?: AnalyticsDashboardPageProps["onRetry"]; } /** Numeric dashboard summary derived by {@link createAnalyticsDashboard}. */ interface AnalyticsDashboardSummary { totalPageViews: number; uniqueVisitors: number; topPageCount: number; recentEventCount: number; activeVisitors: number; } /** Reactive dashboard state returned by {@link createAnalyticsDashboard}. */ interface CreateAnalyticsDashboardReturn { data: Accessor; recentEvents: Accessor; realtimeStats: Accessor; funnelResult: Accessor; cohortAnalysis: Accessor; timelineEvents: Accessor; consentSettings: Accessor; isLoading: Accessor; isRealtimeLoading: Accessor; error: Accessor; hasDashboardData: Accessor; hasRealtimeData: Accessor; isEmpty: Accessor; summary: Accessor; pageProps: Accessor; } /** * Builds a reactive dashboard view model for the SolidJS analytics dashboard. * * @param options Dashboard data, realtime stats, events, and state flags. * @returns Normalized dashboard accessors and page-ready props. */ declare function createAnalyticsDashboard(options?: CreateAnalyticsDashboardOptions): CreateAnalyticsDashboardReturn; /** * @module createAnalytics * @package @geenius/analytics/solidjs * @description Exposes the primary SolidJS analytics primitive for the * Tailwind-based variant. The primitive prefers provider context and falls * back to a local tracker when used in isolated component trees. */ /** * Reactive analytics actions returned by {@link createAnalytics}. * * @property track Tracks a named analytics event with optional consent scope. * @property page Tracks a page view for a URL with optional properties. * @property identify Associates the current session with a user identity. * @property reset Clears the current analytics session state. * @property deleteUserData Deletes persisted analytics data for a known user. * @property forgetUser Alias for `deleteUserData` for right-to-forget flows. * @property consent Updates analytics consent settings for the tracker. * @property sessionId Signal accessor for the active tracker session identifier. */ interface CreateAnalyticsReturn { track: (name: string, props?: Record, options?: TrackerTrackOptions) => Promise; page: (url: string, props?: Record) => Promise; identify: (userId: string, traits?: UserTraits) => Promise; reset: () => Promise; deleteUserData: (userId: string) => Promise; forgetUser: (userId: string) => Promise; consent: (settings: ConsentSettings) => void; sessionId: () => string; } /** * Returns analytics actions for the current SolidJS subtree. * * @param config Optional fallback tracker configuration used outside provider context. * @returns Analytics actions and a session-id accessor for the active tracker. */ declare function createAnalytics(config?: TrackerConfigInput): CreateAnalyticsReturn; /** * @module createConsent * @package @geenius/analytics/solidjs * @description Exposes provider-backed consent state and category helpers for * the SolidJS analytics variant. */ type ConsentScope = "essential" | "analytics" | "marketing" | "personalization"; /** * Consent state and actions returned by {@link createConsent}. * * @property consentSettings Current category-level consent settings. * @property updateConsent Updates all consent settings and persists them to the tracker. * @property setConsent Alias for `updateConsent` for consumer ergonomics. * @property hasConsent Returns whether a specific category is currently granted. */ interface CreateConsentReturn { consentSettings: () => ConsentSettings | null; updateConsent: (settings: ConsentSettings) => void; setConsent: (settings: ConsentSettings) => void; hasConsent: (scope: ConsentScope) => boolean; } /** * Reads and updates analytics consent state from the nearest provider. * * @returns Consent state, write actions, and category-level helpers. * @throws {AnalyticsContextError} When called outside an ``. */ declare function createConsent(): CreateConsentReturn; /** * @module createFunnel * @package @geenius/analytics/solidjs * @description Provides reactive funnel-analysis state for the SolidJS * variant so dashboards can evaluate ordered conversion steps against captured * events. */ /** * Reactive funnel-analysis state returned by {@link createFunnel}. * * @property result Signal accessor for the latest computed funnel result. * @property isAnalyzing Signal accessor for the in-flight analysis flag. * @property analyze Computes and stores the next funnel result from raw events. */ interface CreateFunnelReturn { result: () => FunnelResult | null; isAnalyzing: () => boolean; analyze: (events: AnalyticsEvent[]) => FunnelResult; } /** * Creates funnel-analysis state for a named conversion journey. * * @param name Human-readable funnel name used in computed result metadata. * @param steps Ordered conversion steps that define the funnel. * @returns Reactive helpers for running funnel analysis against event streams. */ declare function createFunnel(name: string, steps: FunnelStep[]): CreateFunnelReturn; /** * @module createIdentify * @package @geenius/analytics/solidjs * @description Wraps identity-management actions for the SolidJS variant so * consumers can identify or reset a user without re-plumbing tracker access. */ /** * Identity-management helpers returned by {@link createIdentify}. * * @property identify Associates the current session with a user and traits. * @property reset Clears the current analytics identity and session state. */ interface CreateIdentifyReturn { identify: (userId: string, traits?: UserTraits) => Promise; reset: () => Promise; } /** * Returns identify and reset helpers backed by the active analytics tracker. * * @returns Identity-management functions for the active tracker. */ declare function createIdentify(): CreateIdentifyReturn; /** * @module createPageView * @package @geenius/analytics/solidjs * @description Tracks page-view transitions for route-level SolidJS * components. Static URLs emit once on mount, while accessor URLs emit when the * tracked route value changes. */ interface TanStackRouterLocationLike { href?: string; pathname?: string; searchStr?: string; hash?: string; publicHref?: string; } interface TanStackRouterNavigationEventLike { toLocation?: TanStackRouterLocationLike; } interface TanStackRouterLike { state?: { location?: TanStackRouterLocationLike; }; subscribe?: (eventType: "onResolved" | "onLoad", listener: (event: TanStackRouterNavigationEventLike) => void) => () => void; } type PageViewRouteProperties = Record | ((location: TanStackRouterLocationLike | null) => Record); interface CreatePageViewOptions { url?: string | Accessor; properties?: PageViewRouteProperties; router?: TanStackRouterLike | null; routerEvent?: "onResolved" | "onLoad"; getUrl?: (location: TanStackRouterLocationLike) => string; } type PageViewUrlInput = string | Accessor | CreatePageViewOptions; /** * Records a page-view event on mount and when a reactive route URL changes. * * @param input Optional explicit URL, Solid accessor, or router-aware tracking options. * @returns Nothing. The primitive records page-view side effects only. * * @example * ```tsx * function DashboardRoute() { * createPageView('/analytics/dashboard') * return * } * ``` */ declare function createPageView(input?: PageViewUrlInput): void; /** * @module createRealtimeStats * @package @geenius/analytics/solidjs * @description Polls realtime analytics data for the SolidJS variant. The * primitive manages loading state and interval cleanup for widgets that need * continuously refreshed traffic summaries. */ /** * Realtime polling state returned by {@link createRealtimeStats}. * * @property stats Signal accessor for the latest realtime statistics snapshot. * @property isLoading Signal accessor for the initial loading state. * @property error Signal accessor for the latest polling error. */ interface CreateRealtimeStatsReturn { stats: () => RealtimeStats | null; isLoading: () => boolean; error: () => Error | null; } /** * Polls realtime analytics statistics on a fixed interval. * * @param fetcher Async function that returns the current realtime statistics snapshot. * @param interval Poll interval in milliseconds. Defaults to the shared realtime interval. * @returns Reactive realtime stats state for the polling lifecycle. */ declare function createRealtimeStats(fetcher: () => Promise, interval?: number): CreateRealtimeStatsReturn; type AnalyticsCopyTranslator = (key: string, params?: Record) => string; /** * Props accepted by {@link AnalyticsProvider}. * * @property config Tracker configuration used to create the provider instance. * @property translator Optional app-level copy translator used by analytics UI helpers. * @property children Descendant SolidJS nodes that consume analytics context. * @property initialConsent Optional initial consent settings to apply on mount. * @property storage Optional self-hosted storage adapter used before outbound provider sync. */ interface AnalyticsProviderProps { config: TrackerConfigInput; translator?: AnalyticsCopyTranslator; initialConsent?: ConsentSettings | null; storage?: AnalyticsStorageAdapter | AnalyticsStorageAdapter[]; } interface AnalyticsConsentContextValue { consentSettings: () => ConsentSettings | null; updateConsent: (settings: ConsentSettings) => void; } /** * Options for {@link useAnalyticsContext}. * * @property optional When true, returns `undefined` instead of throwing outside a provider. */ interface UseAnalyticsContextOptions { optional?: boolean; } /** * Solid context carrying an optional host-app copy translator for analytics UI. */ declare const AnalyticsCopyContext: solid_js.Context; /** * Solid context carrying the consent state and update callback. */ declare const AnalyticsConsentContext: solid_js.Context; /** * Reads the current analytics tracker from Solid context. * * @param options Controls whether a missing provider should throw or return `undefined`. * @returns The active tracker instance, or `undefined` when `optional` is enabled. * @throws {AnalyticsContextError} When called outside a provider without `optional`. */ declare function useAnalyticsContext(options?: UseAnalyticsContextOptions): TrackerInstance | undefined; /** * Reads the current copy translator from Solid context. * * @returns The active copy translator, or `null` when no translator is provided. */ declare function useAnalyticsCopyTranslator(): AnalyticsCopyTranslator | null; /** * Reads the current consent context from Solid context. * * @returns The consent context value, or `null` when outside a provider. */ declare function useAnalyticsConsent(): AnalyticsConsentContextValue | null; /** * Provides a tracker instance to the SolidJS subtree. * * @param props Provider configuration and descendant content. * @returns A Solid context provider wrapping the supplied children. */ declare const AnalyticsProvider: ParentComponent; /** * @module cn * @package @geenius/analytics/solidjs * @description Provides the Tailwind-aware class composition helper used by * the SolidJS analytics variant. The helper combines `clsx` with * `tailwind-merge` so authored utility-class contracts remain deterministic. */ type ClassValue = Parameters[number]; /** * Merges conditional class fragments into a single Tailwind-safe class string. * * @param inputs Conditional class fragments, objects, arrays, and other clsx-compatible values. * @returns A merged class string with conflicting Tailwind utilities deduplicated. */ declare function cn(...inputs: ClassValue[]): string; /** * Tailwind class recipe for analytics card containers. */ declare const cardVariants: (props?: ({ tone?: "default" | "muted" | null | undefined; } & class_variance_authority_types.ClassProp) | undefined) => string; /** * Tailwind class recipe for analytics action buttons. */ declare const buttonVariants: (props?: ({ variant?: "secondary" | "primary" | "ghost" | null | undefined; size?: "sm" | "md" | null | undefined; } & class_variance_authority_types.ClassProp) | undefined) => string; export { AnalyticsConsentContext, type AnalyticsConsentContextValue, AnalyticsCopyContext, AnalyticsDashboard, AnalyticsDashboardPage, type AnalyticsDashboardPageProps, type AnalyticsDashboardProps, type AnalyticsDashboardSummary, AnalyticsProvider, ChartCard, type ChartCardProps, CohortTable, type CohortTableProps, ConsentBanner, type ConsentBannerProps, ConsentPreferences, type ConsentPreferencesProps, type CreateAnalyticsDashboardOptions, type CreateAnalyticsDashboardReturn, type CreateAnalyticsReturn, type CreateConsentReturn, type CreateFunnelReturn, type CreateIdentifyReturn, type CreateRealtimeStatsReturn, DashboardBuilder, type DashboardBuilderProps, type DashboardBuilderTimeRangeOption, DeviceBreakdown, type DeviceBreakdownProps, type EventExplorerFilters, EventExplorerPage, type EventExplorerPageProps, EventTable, type EventTableProps, FunnelAnalysisPage, type FunnelAnalysisPageProps, FunnelChart, type FunnelChartProps, MetricCard, type MetricCardProps, type PageViewRouteProperties, type PageViewUrlInput, RealtimeBadge, type RealtimeBadgeProps, StatsCard, type StatsCardProps, type TanStackRouterLike, type TanStackRouterLocationLike, type TanStackRouterNavigationEventLike, Timeline, type TimelineProps, TopPagesTable, type TopPagesTableProps, type UseAnalyticsContextOptions, buttonVariants, cardVariants, cn, createAnalytics, createAnalyticsDashboard, createConsent, createFunnel, createIdentify, createPageView, createRealtimeStats, useAnalyticsConsent, useAnalyticsContext, useAnalyticsCopyTranslator };