interface ModalItemsProps { /** * /onboarding/*.svg */ src: string; /** * Image Companion text */ alt: string; /** * Text below image */ text: string; /** * Title of the item */ title?: string; } interface ModalOptionsProps { /** * Modal title */ title?: string; /** * Prev button text */ prevText?: string; /** * Next button text */ nextText?: string; /** * Close button text */ closeText?: string; } export interface OnboardingModalRef { setIsOpen: (isOpen: boolean) => void; handleSavePreference: () => void; } /** * Result of a custom display check. Must contain the following data : * - display: a boolean indicating whether the modal should be shown when truthy or hidden if falsy; * - nextState: the next state to persist when onboarding is done. */ export interface DisplayRuleCheckResult { display: boolean; nextState: T; } export interface OnboardingProps { id: string; items: ModalItemsProps[]; modalOptions?: ModalOptionsProps; isOnboardingChange?: (isOnboarding: boolean) => void; /** * Allow the parent component to control the rule for showing/hiding the modal. * * If undefined, the component will manage a visible/hidden state on its own. * * If defined, this function is called with the previously known state (if any). * It can then compute the next state and return a DisplayRuleCheckResult. * * Note that the user may close the modal without finishing their onboarding. * In this case, the next state is not persisted. */ onDisplayRuleCheck?: (previousState?: T) => DisplayRuleCheckResult; } declare const OnboardingModalInner: ({ id, items, modalOptions, isOnboardingChange, onDisplayRuleCheck, }: OnboardingProps, ref: React.Ref) => import('react').ReactPortal | null; declare const OnboardingModal: ((props: OnboardingProps & { ref?: React.Ref; }) => ReturnType) & { displayName?: string; }; export default OnboardingModal;