import type { PostHog } from 'posthog-js'; export declare const POSTHOG_FEATURE_FLAG_READY_TIMEOUT_MS = 2500; export declare const POSTHOG_SCOPED_FLAG_RELOAD_RETRY_MS = 300; export declare const shouldRecordPostHogSession: (distinctId: string, sampleRate: number) => boolean; type BootstrapConfig = { apiKey: string; apiHost: string; distinctId: string; projectId?: string; funnelId?: string; /** Complete server evaluation for this page; keep the rendered assignment stable. */ featureFlags?: Record; sessionReplay?: { enabled: boolean; sampleRate: number; }; }; export declare const bootstrapPostHog: (config: BootstrapConfig) => Promise; export declare const isPostHogReady: () => boolean; /** A publication update needs a fresh evaluation, not onFeatureFlags' immediate * cached callback. The caller publishes config and these flags atomically. */ export declare function refreshPostHogFeatureFlags(): Promise>; /** * Aliases an anonymous distinct id to a server-side user id after the user * has been identified (e.g. once bootstrapSession resolves). Preserves the * anonymous user's feature-flag bucket assignments via PostHog's * ensure_experience_continuity behaviour, so they don't get re-bucketed to * a different variant mid-session. * * No-op if PostHog has not finished initializing or if the ids already match. */ export declare const identifyPostHog: (serverUserId: string, anonymousId: string) => void; /** * Returns the variant key for the flag, or undefined if: * - PostHog SDK has not finished loading feature flags yet (see isPostHogReady) * - OR no flag of that key exists * * Callers that render experiment variants should gate on isPostHogReady() first, * otherwise users may see the fallback (control) variant on first paint and * flip once the SDK loads. Task 8's controller handles this gate. */ export declare const resolveExperimentVariant: (flagKey: string) => string | undefined; export declare const getPostHog: () => PostHog | null; export {};