import { type ReactNode, type FunctionComponent, type PropsWithChildren } from 'react'; /** * Callback for handling navigation/refresh when content is saved. * @param url - Target URL to navigate to * @param isSameUrl - True if URL matches current location (refresh), false if different (navigate) */ export type NavigateCallback = (url: string, isSameUrl: boolean) => void | Promise; export interface PreviewComponentProps { /** * Custom navigation handler. If not provided, uses window.location.replace. * @example Next.js * const router = useRouter(); * { * if (isSameUrl) { * router.refresh(); * } else { * const parsed = new URL(url); * router.push(parsed.pathname + parsed.search); * } * }} /> */ onNavigate?: NavigateCallback; /** * Delay in ms before triggering navigation. False to disable. * Useful for debouncing rapid saves. * @default 300 */ refreshTimeout?: number | false; /** * Optional loading indicator shown during refresh delay. */ children?: ReactNode; } /** * Listens for Optimizely CMS content saved events and triggers navigation/refresh. * Deduplication prevents duplicate refreshes. */ export declare const PreviewComponent: FunctionComponent>;