import { BootstrapConfig, CaptureResult, FeatureFlagResult, JsonType, PostHog, PostHog as PostHog$1, PostHogConfig } from "posthog-js"; import React, { ErrorInfo, FunctionComponent, ReactElement } from "react"; //#region src/context/shared-state.d.ts type PostHogContextValue = { client: PostHog$1; bootstrap?: BootstrapConfig; }; //#endregion //#region src/context/PostHogContext.d.ts declare const PostHogContext: import("react").Context; //#endregion //#region src/context/PostHogProvider.d.ts type WithOptionalChildren = T & { children?: React.ReactNode | undefined; }; type PostHogProviderProps = { client: PostHog; apiKey?: never; options?: never; } | { apiKey: string; options?: Partial; client?: never; }; declare function PostHogProvider({ children, client, apiKey, options }: WithOptionalChildren): ReactElement; //#endregion //#region src/hooks/useFeatureFlagEnabled.d.ts declare function useFeatureFlagEnabled(flag: string): boolean | undefined; declare function useFeatureFlagEnabled(flag: string, defaultValue: boolean): boolean; //#endregion //#region src/hooks/useFeatureFlagPayload.d.ts declare function useFeatureFlagPayload(flag: string): JsonType; //#endregion //#region src/hooks/useFeatureFlagResult.d.ts declare function useFeatureFlagResult(flag: string): FeatureFlagResult | undefined; //#endregion //#region src/hooks/useActiveFeatureFlags.d.ts declare function useActiveFeatureFlags(): string[]; //#endregion //#region src/hooks/useFeatureFlagVariantKey.d.ts declare function useFeatureFlagVariantKey(flag: string): string | boolean | undefined; //#endregion //#region src/hooks/usePostHog.d.ts declare const usePostHog: () => PostHog; //#endregion //#region src/components/PostHogFeature.d.ts type PostHogFeatureProps = Omit, 'children'> & { flag: string; children: React.ReactNode | ((payload: any) => React.ReactNode); fallback?: React.ReactNode; match?: string | boolean; visibilityObserverOptions?: IntersectionObserverInit; trackInteraction?: boolean; trackView?: boolean; }; declare function PostHogFeature({ flag, match, children, fallback, visibilityObserverOptions, trackInteraction, trackView, ...props }: PostHogFeatureProps): ReactElement | null; type CaptureFeatureOptions = { flag: string; posthog: PostHog; flagVariant?: string | boolean; }; declare function captureFeatureInteraction(options: CaptureFeatureOptions): void; declare function captureFeatureView(options: CaptureFeatureOptions): void; //#endregion //#region src/components/PostHogCaptureOnViewed.d.ts type PostHogCaptureOnViewedProps = React.HTMLProps & { name?: string; properties?: Record; observerOptions?: IntersectionObserverInit; trackAllChildren?: boolean; }; declare function PostHogCaptureOnViewed({ name, properties, observerOptions, trackAllChildren, children, ...props }: PostHogCaptureOnViewedProps): ReactElement; //#endregion //#region src/components/PostHogErrorBoundary.d.ts type Properties = Record; type PostHogErrorBoundaryFallbackProps = { error: unknown; exceptionEvent: unknown; componentStack: string; resetError?: () => void; }; type PostHogErrorBoundaryProps = { children?: React.ReactNode | (() => React.ReactNode); fallback?: React.ReactNode | FunctionComponent; additionalProperties?: Properties | ((error: unknown, errorInfo: React.ErrorInfo) => Properties); }; type PostHogErrorBoundaryState = { componentStack: string | null; exceptionEvent: unknown; error: unknown; }; declare class PostHogErrorBoundary extends React.Component { static contextType: React.Context; context: React.ContextType; constructor(props: PostHogErrorBoundaryProps); componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void; private _resetError; render(): React.ReactNode; } //#endregion //#region src/helpers/error-helpers.d.ts declare const setupReactErrorHandler: (client: PostHog, callback?: (event: CaptureResult | undefined, error: any, errorInfo: ErrorInfo) => void) => (error: any, errorInfo: ErrorInfo) => void; //#endregion export { type PostHog, PostHogCaptureOnViewed, PostHogCaptureOnViewedProps, PostHogContext, PostHogErrorBoundary, type PostHogErrorBoundaryFallbackProps, type PostHogErrorBoundaryProps, PostHogFeature, PostHogFeatureProps, PostHogProvider, captureFeatureInteraction, captureFeatureView, setupReactErrorHandler, useActiveFeatureFlags, useFeatureFlagEnabled, useFeatureFlagPayload, useFeatureFlagResult, useFeatureFlagVariantKey, usePostHog };