import * as React from 'react';
import { Analytics, AnalyticsContext, AnalyticsProperties, CallOptions } from '../analytics/index.js';
export { Analytics, AnalyticsConfig, AnalyticsContext, AnalyticsEvent, AnalyticsEventType, AnalyticsProperties, AnalyticsSink, CallOptions, createAnalytics } from '../analytics/index.js';
export { ConsentState, GA4ClientSdkOptions, GA4ConsentBridge, GA4HttpOptions, GA4SinkOptions, GtagFn, createGA4ClientSdkSink, createGA4HttpSink, createGA4Sink } from '../analytics-sink-ga4/index.js';
export { AppInsightsLike, AppInsightsSinkMode, AppInsightsSinkOptions, ClientSdkOptions, HttpOptions, createAppInsightsSink } from '../analytics-sink-app-insights/index.js';
export { PostHogClientSdkSinkOptions, PostHogHttpSinkOptions, PostHogSinkMode, PostHogSinkOptions, createPostHogClientSdkSink, createPostHogHttpSink, createPostHogSink } from '../analytics-sink-posthog/index.js';
export { SessionReplayHandle, SessionReplayOptions, startSessionReplay } from '../analytics-sink-posthog/replay.js';

interface AnalyticsProviderProps {
    children: React.ReactNode;
    /**
     * The `Analytics` instance to expose. Construct it once with
     * `createAnalytics(...)` from `@refraction-ui/analytics`.
     */
    value: Analytics;
}
/**
 * AnalyticsProvider — wraps your app with analytics context.
 *
 * ```tsx
 * <AnalyticsProvider value={createAnalytics({ app: 'my-app', env: 'production' })}>
 *   <App />
 * </AnalyticsProvider>
 * ```
 */
declare function AnalyticsProvider({ children, value }: AnalyticsProviderProps): React.FunctionComponentElement<React.ProviderProps<Analytics | null>>;
interface UseAnalyticsOptions {
    /** When set, returns a `with({ ...scope })` child bound to the context. */
    scope?: Partial<AnalyticsContext>;
}
/**
 * useAnalytics — access the `Analytics` instance from context.
 *
 * Pass `{ scope }` to receive a `with(...)` child whose context is merged
 * into every event. If called outside an `<AnalyticsProvider>` it does NOT
 * throw: it returns a shared no-op `Analytics` (a dev-only warn-once hint is
 * emitted). Instrumenting a component with analytics must never crash the
 * host (incl. in tests).
 */
declare function useAnalytics(options?: UseAnalyticsOptions): Analytics;
/**
 * useTrackEvent — a stable, bound `track` for the current context.
 *
 * ```tsx
 * const track = useTrackEvent()
 * track('Signup Clicked', { plan: 'pro' })
 * ```
 */
declare function useTrackEvent(options?: UseAnalyticsOptions): (event: string, properties?: AnalyticsProperties, opts?: CallOptions) => void;

export { AnalyticsProvider, type AnalyticsProviderProps, type UseAnalyticsOptions, useAnalytics, useTrackEvent };
