import React, { ReactNode } from 'react'; import { OnboardingContext as OnboardingContextType } from '@onboardjs/core'; import { type OnboardingProviderProps } from '../context/OnboardingProvider'; import { type OnboardingErrorBoundaryProps } from './OnboardingErrorBoundary'; /** * Props for OnboardingContainer component * * @example With analytics before_send hook * ```tsx * import { AnalyticsBeforeSendHook } from '@onboardjs/core' * * const beforeSend: AnalyticsBeforeSendHook = (event) => { * // Drop events with sensitive data * if (event.properties.includes_password) { * return null * } * return event * } * * * * * ``` */ export interface OnboardingContainerProps extends Omit, 'children'> { /** * Children to render inside the provider and error boundary */ children: ReactNode; /** * Enable Suspense support for async engine initialization * @default false */ suspense?: boolean; /** * Fallback UI shown while Suspense is pending */ suspenseFallback?: ReactNode; /** * Enable the error boundary wrapper * @default true */ errorBoundary?: boolean; /** * Props to pass to the error boundary (if enabled) */ errorBoundaryProps?: Omit; /** * Callback fired when error boundary catches an error */ onError?: (error: Error, errorInfo: React.ErrorInfo) => void; } /** * All-in-one container component that combines: * - OnboardingProvider (engine initialization) * - OnboardingErrorBoundary (error handling) * - Suspense boundary (async initialization) * * This is a convenient wrapper for users who want the full onboarding setup * without manually composing the components. * * @example * ```tsx * * * * ``` * * @example With custom error handling * ```tsx * , * onError: (error) => logToService(error) * }} * > * * * ``` */ export declare function OnboardingContainer({ children, suspense, suspenseFallback, errorBoundary, errorBoundaryProps, onError, ...providerProps }: OnboardingContainerProps): React.ReactNode;