import React from 'react'; /** * @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 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 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 | RealtimeDashboardWidget | 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 DashboardBuilder * @package @geenius/analytics/react-css * @description Renders the React CSS 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 while preserving the standalone CSS implementation. */ type ReactCssDashboardSpan = DashboardWidget["span"]; /** Time range option shown by the React CSS dashboard builder toolbar. */ interface DashboardBuilderTimeRangeOption { value: string; label: string; } interface ReactCssDashboardWidgetBase { id: string; title: string; description?: string; span?: ReactCssDashboardSpan; } /** React CSS dashboard widget that renders the variant's funnel chart component. */ interface ReactCssFunnelDashboardWidget extends ReactCssDashboardWidgetBase { kind: "funnel"; result: FunnelResult; } /** React CSS dashboard widget that renders the variant's realtime badge component. */ interface ReactCssRealtimeDashboardWidget extends ReactCssDashboardWidgetBase { kind: "realtime"; stats: RealtimeStats | null; isLoading?: boolean; } /** React CSS dashboard widget that renders the variant's consent banner component. */ interface ReactCssConsentDashboardWidget extends ReactCssDashboardWidgetBase { kind: "consent"; onAccept?: (settings: ConsentSettings) => void; onReject?: (settings: ConsentSettings) => void; show?: boolean; } /** React CSS dashboard widget that renders the variant's recent-activity timeline. */ interface ReactCssTimelineDashboardWidget extends ReactCssDashboardWidgetBase { kind: "timeline"; events: TimelineEvent[]; maxVisible?: number; } /** Full widget vocabulary accepted by the React CSS dashboard builder. */ type ReactCssDashboardWidget = DashboardWidget | ReactCssFunnelDashboardWidget | ReactCssRealtimeDashboardWidget | ReactCssConsentDashboardWidget | ReactCssTimelineDashboardWidget; /** Dashboard layout accepted by the React CSS dashboard builder. */ interface ReactCssDashboardLayout extends Omit { widgets: ReactCssDashboardWidget[]; } /** * Props for rendering the React CSS dashboard builder. * * @property layout Shared dashboard layout definition or a raw widget array. * @property className Optional class name merged into the section wrapper. */ interface DashboardBuilderProps { layout: ReactCssDashboardLayout | ReactCssDashboardWidget[]; editable?: boolean; timeRange?: string; timeRangeOptions?: DashboardBuilderTimeRangeOption[]; selectedWidgetId?: string; onLayoutChange?: (widgets: ReactCssDashboardWidget[]) => void; onTimeRangeChange?: (timeRange: string) => void; onWidgetSelect?: (widget: ReactCssDashboardWidget) => void; className?: string; } /** * Renders the React CSS dashboard builder from a shared layout definition. * * @param props Dashboard layout data and an optional wrapper className. * @returns A section element containing the resolved analytics widget grid. */ declare function DashboardBuilder({ layout, editable, timeRange, timeRangeOptions, selectedWidgetId, onLayoutChange, onTimeRangeChange, onWidgetSelect, className, }: DashboardBuilderProps): React.ReactElement; /** * @module ErrorState * @package @geenius/analytics/react-css * @description Internal recovery surface shared by React CSS analytics data * components when a fetch or rendering boundary fails. */ /** Error value accepted by React CSS data-rendering components. */ type AnalyticsErrorStateValue = Error | string | null | undefined; /** * @module AnalyticsDashboardPage * @package @geenius/analytics/react-css * @description Composes the primary React analytics dashboard page for the * vanilla-CSS variant. The page exposes a ready-to-render overview surface for * traffic and engagement reporting without relying on Tailwind utilities. */ type AnalyticsSeoMeta = ReturnType; type AnalyticsDashboardBuilderLayout = ReactCssDashboardLayout | ReactCssDashboardWidget[]; /** * Props for rendering the React CSS 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 realtimeStats Optional realtime activity snapshot rendered in the builder section. * @property funnelResult Optional funnel result rendered in the builder section. * @property cohortAnalysis Optional cohort analysis rendered in the builder section. * @property builderLayout Optional explicit builder layout for custom dashboard widgets. * @property error Optional page-level error surfaced before dashboard data sections. * @property onRetry Optional recovery callback shown in the page-level error state. * @property isLoading Whether child widgets should render loading placeholders instead of content. * @property renderSeoMeta Optional renderer for host apps that mount SEO metadata. * @property className Optional class name merged into the page wrapper. */ interface AnalyticsDashboardPageProps { data?: AnalyticsDashboardData | null; recentEvents?: AnalyticsEvent[]; realtimeStats?: RealtimeStats | null; funnelResult?: FunnelResult | null; cohortAnalysis?: CohortAnalysis | null; builderLayout?: AnalyticsDashboardBuilderLayout | null; builderEditable?: boolean; builderTimeRange?: string; builderTimeRangeOptions?: DashboardBuilderTimeRangeOption[]; error?: AnalyticsErrorStateValue; onRetry?: () => void; onBuilderLayoutChange?: (widgets: ReactCssDashboardWidget[]) => void; onBuilderTimeRangeChange?: (timeRange: string) => void; isLoading?: boolean; renderSeoMeta?: (meta: AnalyticsSeoMeta) => React.ReactNode; className?: string; } /** * Renders the React CSS 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 React analytics dashboard composition. */ declare function AnalyticsDashboardPage({ builderEditable, builderLayout, builderTimeRange, builderTimeRangeOptions, cohortAnalysis, data, error, funnelResult, recentEvents, realtimeStats, isLoading, onRetry, onBuilderLayoutChange, onBuilderTimeRangeChange, renderSeoMeta, className, }: AnalyticsDashboardPageProps): React.ReactElement; /** * @module AnalyticsDashboard * @package @geenius/analytics/react-css * @description Publishes the React CSS dashboard composition through the * component catalog while delegating rendering to the route-ready dashboard * page implementation. */ /** Props accepted by the public React CSS analytics dashboard component. */ type AnalyticsDashboardProps = AnalyticsDashboardPageProps; /** * Renders the canonical React CSS analytics dashboard as a component export. * * @param props Dashboard data, realtime state, and page composition options. * @returns The React CSS analytics dashboard surface. */ declare function AnalyticsDashboard(props: AnalyticsDashboardProps): React.ReactElement; /** * @module ChartCard * @package @geenius/analytics/react-css * @description Renders the React CSS 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 React CSS 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 isLoading Whether the chart should render placeholder bars. * @property className Optional class name merged into the card wrapper. */ interface ChartCardProps { title: string; data: readonly ChartDataPoint[]; type?: "bar" | "line"; height?: number; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders a React CSS 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 function ChartCard(props: ChartCardProps): React.ReactElement; /** * @module CohortTable * @package @geenius/analytics/react-css * @description Renders the React CSS cohort-retention table for comparing * cohort sizes, retention checkpoints, and last activity across segments. */ /** * Props for rendering the React CSS 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 className Optional class name merged into the card wrapper. */ interface CohortTableProps { analysis: CohortAnalysis | null; title?: string; maxRows?: number; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders a cohort retention table for the React CSS 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 function CohortTable({ analysis, className, error, isLoading, maxRows, onRetry, title, }: CohortTableProps): React.ReactElement; /** * @module ConsentBanner * @package @geenius/analytics/react-css * @description Renders the React CSS consent banner used to capture analytics * cookie preferences. The component keeps the vanilla-CSS class contract stable * while emitting consent results through callbacks. */ /** * Props for rendering the React CSS 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 className Optional class name merged into the banner wrapper. */ interface ConsentBannerProps { onAccept: (settings: ConsentSettings) => void; onReject: (settings: ConsentSettings) => void; show?: boolean; className?: string; } /** * Renders the React CSS consent banner with accept and reject actions. * * @param props Banner callbacks for accept and reject actions. * @returns A consent banner element, or `null` after the user dismisses it. */ declare function ConsentBanner(props: ConsentBannerProps): React.ReactElement | null; /** * @module ConsentPreferences * @package @geenius/analytics/react-css * @description Renders granular consent category controls for the React CSS * analytics variant. */ type ConsentPreferenceScope = "analytics" | "marketing" | "personalization"; type ConsentPreferenceValues = Pick; /** * Props for rendering the granular React CSS 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 className Optional class name merged into the fieldset. */ interface ConsentPreferencesProps { value?: Partial; onChange?: (preferences: ConsentPreferenceValues) => void; onSave?: (settings: ConsentSettings) => void; showActions?: boolean; className?: 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 function ConsentPreferences(props: ConsentPreferencesProps): React.ReactElement; /** * @module DeviceBreakdown * @package @geenius/analytics/react-css * @description Renders the React CSS 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 React CSS device-breakdown widget. * * @property breakdown Device counts grouped by desktop, tablet, and mobile. * @property isLoading Whether the widget should render placeholder rows. * @property className Optional class name merged into the wrapper. */ interface DeviceBreakdownProps { breakdown: { desktop: number; tablet: number; mobile: number; }; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders the React CSS device-breakdown widget. * * @param props Device counts and optional wrapper className. * @returns A device distribution widget for analytics dashboards. */ declare function DeviceBreakdown({ breakdown, className, error, isLoading, onRetry, }: DeviceBreakdownProps): React.ReactElement; /** * @module EventTable * @package @geenius/analytics/react-css * @description Renders the React CSS 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. */ /** * Props for rendering the React CSS 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 showControls Whether filter and sort controls should render. * @property className Optional class name merged into the wrapper. */ interface EventTableProps { events: AnalyticsEvent[]; isLoading?: boolean; error?: AnalyticsErrorStateValue; maxRows?: number; onRetry?: () => void; showControls?: boolean; className?: string; } /** * Renders the React CSS 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 function EventTable({ error, events, isLoading, maxRows, onRetry, showControls, className, }: EventTableProps): React.ReactElement; /** * @module FunnelChart * @package @geenius/analytics/react-css * @description Renders the React CSS 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 React CSS funnel chart. * * @property result Funnel analysis result to visualize. * @property isLoading Whether the chart should render placeholder steps. * @property className Optional class name merged into the chart wrapper. */ interface FunnelChartProps { result: FunnelResult | null; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders the React CSS 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 function FunnelChart(props: FunnelChartProps): React.ReactElement; /** * @module MetricCard * @package @geenius/analytics/react-css * @description Renders the React CSS 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 React CSS metric card. * * @property metric Metric summary payload rendered by the card. * @property isLoading Whether the card should render placeholder content. * @property className Optional class name merged into the card wrapper. */ interface MetricCardProps { metric: MetricSummary; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders a React CSS 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 function MetricCard(props: MetricCardProps): React.ReactElement; /** * @module RealtimeBadge * @package @geenius/analytics/react-css * @description Renders the React CSS realtime-visitor badge used by * dashboards to surface current activity at a glance. The badge handles * loading, empty, and active states without requiring consumer branching. */ /** * Props for rendering the React CSS realtime activity badge. * * @property stats Latest realtime stats snapshot, or `null` when unavailable. * @property isLoading Whether the realtime fetch is still pending. * @property className Optional class name merged into the badge wrapper. */ interface RealtimeBadgeProps { stats: RealtimeStats | null; isLoading: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders a React CSS 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 function RealtimeBadge(props: RealtimeBadgeProps): React.ReactElement; /** * @module StatsCard * @package @geenius/analytics/react-css * @description Renders the React CSS 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 React CSS 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 className 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; className?: string; } /** * Renders the React CSS summary-stat card. * * @param props Metric label, value, and optional trend presentation props. * @returns A card element showing the supplied summary metric. */ declare function StatsCard({ label, value, icon, change, error, onRetry, trend, sparkline, sparklineLabel, className, }: StatsCardProps): React.ReactElement; /** * @module Timeline * @package @geenius/analytics/react-css * @description Renders the React CSS 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 React CSS analytics timeline. * * @property events Timeline events to render in descending recency order. * @property maxVisible Maximum number of timeline rows to display. * @property ariaLabel Accessible label for the timeline log. * @property isLoading Whether the timeline should render placeholder rows. * @property className Optional class name merged into the timeline wrapper. */ interface TimelineProps { events: TimelineEvent[]; maxVisible?: number; ariaLabel?: string; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders a React CSS timeline for recent analytics events. * * @param props Timeline events and the optional visible-row limit. * @returns A timeline log element for analytics activity. */ declare function Timeline(props: TimelineProps): React.ReactElement; /** * @module TopPagesTable * @package @geenius/analytics/react-css * @description Renders the React CSS top-pages table used by analytics * dashboards to compare the most-visited routes. The component includes * loading and empty states while preserving the standalone CSS class contract. */ /** Summary row rendered by the React CSS top-pages table. */ interface TopPageSummary { url: string; views: number; uniqueVisitors?: number; averageTimeMs?: number; averageTimeSeconds?: number; averageTime?: string; } /** * Props for rendering the React CSS top-pages table. * * @property pages Ordered page summary rows with visit and engagement counts. * @property isLoading Whether the table should render placeholder rows. * @property className Optional class name merged into the table wrapper. */ interface TopPagesTableProps { pages: TopPageSummary[]; isLoading?: boolean; error?: AnalyticsErrorStateValue; onRetry?: () => void; className?: string; } /** * Renders the React CSS 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 function TopPagesTable({ error, pages, isLoading, className, onRetry, }: TopPagesTableProps): React.ReactElement; /** * @module useAnalytics * @package @geenius/analytics/react-css * @description Exposes the primary analytics hook for the React CSS variant. * The hook prefers an enclosing provider-backed tracker and falls back to a * lazily created standalone tracker when used outside provider context. */ /** * Stable analytics actions returned by {@link useAnalytics}. * * @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 consent Updates analytics consent settings for the tracker. * @property deleteUserData Deletes a user from storage/provider integrations. * @property forgetUser Alias for deleteUserData for right-to-forget flows. */ interface UseAnalyticsReturn { track: (name: string, props?: Record, options?: TrackerTrackOptions) => Promise; page: (url: string, props?: Record) => Promise; identify: (userId: string, traits?: UserTraits) => Promise; reset: () => Promise; consent: (settings: ConsentSettings) => void; deleteUserData: (userId: string) => Promise; forgetUser: (userId: string) => Promise; } /** * Returns the analytics actions for the current React CSS subtree. * * When no provider is mounted above the caller, the hook creates a lazy local * tracker from the supplied configuration so isolated components can still * record events. * * @param config Optional fallback tracker configuration used outside provider context. * @returns Stable analytics action functions for the active tracker. * * @example * ```tsx * function OpenReportButton() { * const { track } = useAnalytics() * return * } * ``` */ declare function useAnalytics(config?: TrackerConfigInput): UseAnalyticsReturn; /** * @module useAnalyticsDashboard * @package @geenius/analytics/react-css * @description Normalizes dashboard page inputs into a stable React state * object for hosts that compose the React CSS analytics dashboard manually. */ /** Input data consumed by {@link useAnalyticsDashboard}. */ interface UseAnalyticsDashboardOptions { data?: AnalyticsDashboardData | null; recentEvents?: AnalyticsEvent[]; realtimeStats?: RealtimeStats | null; funnelResult?: FunnelResult | null; cohortAnalysis?: CohortAnalysis | null; isLoading?: boolean; error?: AnalyticsErrorStateValue; } /** Numeric dashboard summary derived by {@link useAnalyticsDashboard}. */ interface AnalyticsDashboardSummary { totalPageViews: number; uniqueVisitors: number; topPageCount: number; recentEventCount: number; activeVisitors: number; } /** Reactive dashboard state returned by {@link useAnalyticsDashboard}. */ interface UseAnalyticsDashboardReturn { data: AnalyticsDashboardData | null; recentEvents: AnalyticsEvent[]; realtimeStats: RealtimeStats | null; funnelResult: FunnelResult | null; cohortAnalysis: CohortAnalysis | null; isLoading: boolean; error: AnalyticsErrorStateValue; hasDashboardData: boolean; hasRealtimeData: boolean; isEmpty: boolean; summary: AnalyticsDashboardSummary; pageProps: Pick; } /** * Builds a stable dashboard view model for the React CSS dashboard component. * * @param options Dashboard data, realtime stats, events, and state flags. * @returns Normalized dashboard state and page-ready props. */ declare function useAnalyticsDashboard(options?: UseAnalyticsDashboardOptions): UseAnalyticsDashboardReturn; /** * @module useConsent * @package @geenius/analytics/react-css * @description Exposes provider-backed analytics consent state and * category-level helpers for the React CSS variant. */ type ConsentScope = "essential" | "analytics" | "marketing" | "personalization"; /** * Stable consent state and actions returned by {@link useConsent}. * * @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 UseConsentReturn { 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 useConsent(): UseConsentReturn; /** * @module useFunnel * @package @geenius/analytics/react-css * @description Provides the React CSS funnel-analysis hook used by dashboard * components to evaluate ordered conversion steps against captured analytics * events. */ /** * Reactive funnel-analysis state returned by {@link useFunnel}. * * @property result The most recently computed funnel result. * @property isAnalyzing Indicates whether the hook is computing a funnel result. * @property analyze Computes and stores the next funnel result from raw events. */ interface UseFunnelReturn { result: FunnelResult | null; isAnalyzing: boolean; analyze: (events: AnalyticsEvent[]) => Promise; } /** * 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 Stateful helpers for running funnel analysis against event streams. * * @example * ```tsx * const { result, analyze } = useFunnel('signup', signupSteps) * const next = await analyze(events) * ``` */ declare function useFunnel(name: string, steps: FunnelStep[]): UseFunnelReturn; /** * @module useIdentify * @package @geenius/analytics/react-css * @description Wraps identity-management actions for the React CSS variant so * consumers can identify or reset a user without re-plumbing tracker access. */ /** * Identity-management helpers returned by {@link useIdentify}. * * @property identify Associates the current session with a user and traits. * @property reset Clears the current analytics identity and session state. */ interface UseIdentifyReturn { identify: (userId: string, traits?: UserTraits) => Promise; reset: () => Promise; } /** * Returns identify and reset helpers backed by the active analytics tracker. * * @returns Stable identity-management functions for the active tracker. * * @example * ```tsx * const { identify } = useIdentify() * void identify('user_123', { plan: 'pro' }) * ``` */ declare function useIdentify(): UseIdentifyReturn; /** * @module usePageView * @package @geenius/analytics/react-css * @description Tracks page-view transitions for the React CSS variant. The * hook is intended for route-level components that should emit an impression * on mount and again when their tracked URL 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 UsePageViewOptions { url?: string; properties?: PageViewRouteProperties; router?: TanStackRouterLike | null; routerEvent?: "onResolved" | "onLoad"; getUrl?: (location: TanStackRouterLocationLike) => string; } /** * Records a page-view event when the calling component mounts or the supplied * URL changes. Re-rendering with the same URL does not emit a duplicate view. * * @param input Optional explicit URL or router-aware tracking options. * @returns Nothing. The hook records page-view side effects only. * * @example * ```tsx * function DashboardRoute() { * usePageView('/analytics/dashboard') * return * } * ``` */ declare function usePageView(input?: string | UsePageViewOptions): void; /** * @module useRealtimeStats * @package @geenius/analytics/react-css * @description Polls realtime analytics data for the React CSS variant. The * hook manages loading state and interval cleanup for dashboard widgets that * need continuously refreshed traffic summaries. */ /** * Realtime polling state returned by {@link useRealtimeStats}. * * @property stats The latest successfully fetched realtime statistics. * @property isLoading Indicates whether the first fetch is still in flight. * @property error The latest polling error as an Error instance, cleared after the next successful fetch. */ interface UseRealtimeStatsReturn { 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 The latest realtime stats, loading state, and normalized polling error. * * @example * ```tsx * const { stats, isLoading } = useRealtimeStats(fetchRealtimeStats, 30_000) * ``` */ declare function useRealtimeStats(fetcher: () => Promise, interval?: number): UseRealtimeStatsReturn; /** * @module EventExplorerPage * @package @geenius/analytics/react-css * @description Page-level React CSS 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; } /** * Props for rendering the React CSS 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 surfaced before event data sections. * @property onRetry Optional recovery callback shown in the page-level error state. * @property maxRows Maximum number of table rows to render. * @property renderSeoMeta Optional renderer for host apps that mount SEO metadata. * @property className 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?: AnalyticsErrorStateValue; onRetry?: () => void; maxRows?: number; renderSeoMeta?: (meta: AnalyticsSeoMeta) => React.ReactNode; className?: string; } /** * Renders an event explorer with filters, property inspection, and export. * * @param props Event rows, initial filters, and export callback. * @returns A React CSS page composition for event exploration workflows. */ declare function EventExplorerPage({ events, initialFilters, onFiltersChange, onExport, isLoading, error, onRetry, maxRows, renderSeoMeta, className, }: EventExplorerPageProps): React.ReactElement; /** * @module FunnelAnalysisPage * @package @geenius/analytics/react-css * @description Page-level React CSS composition for configuring and reviewing * analytics funnel analysis. */ /** * Props for rendering the React CSS 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 surfaced before funnel data sections. * @property onRetry Optional recovery callback shown in the page-level error state. * @property renderSeoMeta Optional renderer for host apps that mount SEO metadata. * @property className 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?: AnalyticsErrorStateValue; onRetry?: () => void; renderSeoMeta?: (meta: AnalyticsSeoMeta) => React.ReactNode; className?: string; } /** * Renders a page-level funnel builder and conversion analysis surface. * * @param props Funnel configuration, raw events, and optional precomputed result. * @returns A React CSS page composition for funnel analysis workflows. */ declare function FunnelAnalysisPage({ name, steps, events, result, onAnalyze, isLoading, error, onRetry, renderSeoMeta, className, }: FunnelAnalysisPageProps): React.ReactElement; /** * @module AnalyticsProvider * @package @geenius/analytics/react-css * @description Defines the provider boundary for the React CSS analytics * variant. The provider creates a tracker instance and exposes it to hooks and * components rendered within the subtree. */ 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 React 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; children: React.ReactNode; 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 `null` instead of throwing outside a provider. */ interface UseAnalyticsContextOptions { optional?: boolean; } /** * React context carrying an optional host-app copy translator for analytics UI. */ declare const AnalyticsCopyContext: React.Context; declare const AnalyticsConsentContext: React.Context; /** * Reads the current analytics tracker from context. * * @param options Controls whether a missing provider should throw or return `null`. * @returns The active tracker instance, or `null` when `optional` is enabled. * @throws {AnalyticsContextError} When called outside a provider without `optional`. */ declare function useAnalyticsContext(options?: UseAnalyticsContextOptions): TrackerInstance | null; declare function useAnalyticsCopyTranslator(): AnalyticsCopyTranslator | null; declare function useAnalyticsConsent(): AnalyticsConsentContextValue | null; /** * Provides a tracker instance to the React CSS subtree. * * @param props Provider configuration and descendant content. * @returns A context provider wrapping the supplied children. */ declare function AnalyticsProvider(props: AnalyticsProviderProps): React.ReactElement; export { AnalyticsConsentContext, type AnalyticsConsentContextValue, AnalyticsCopyContext, type AnalyticsCopyTranslator, AnalyticsDashboard, AnalyticsDashboardPage, type AnalyticsDashboardPageProps, type AnalyticsDashboardProps, type AnalyticsDashboardSummary, AnalyticsProvider, type AnalyticsProviderProps, type AnalyticsSeoMeta, ChartCard, type ChartCardProps, CohortTable, type CohortTableProps, ConsentBanner, type ConsentBannerProps, type ConsentPreferenceScope, type ConsentPreferenceValues, ConsentPreferences, type ConsentPreferencesProps, 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 ReactCssConsentDashboardWidget, type ReactCssDashboardLayout, type ReactCssDashboardWidget, type ReactCssFunnelDashboardWidget, type ReactCssRealtimeDashboardWidget, type ReactCssTimelineDashboardWidget, RealtimeBadge, type RealtimeBadgeProps, StatsCard, type StatsCardProps, type TanStackRouterLike, type TanStackRouterLocationLike, type TanStackRouterNavigationEventLike, Timeline, type TimelineProps, type TopPageSummary, TopPagesTable, type TopPagesTableProps, type UseAnalyticsContextOptions, type UseAnalyticsDashboardOptions, type UseAnalyticsDashboardReturn, type UseAnalyticsReturn, type UseConsentReturn, type UseFunnelReturn, type UseIdentifyReturn, type UsePageViewOptions, type UseRealtimeStatsReturn, useAnalytics, useAnalyticsConsent, useAnalyticsContext, useAnalyticsCopyTranslator, useAnalyticsDashboard, useConsent, useFunnel, useIdentify, usePageView, useRealtimeStats };