import { type ComponentType, type ReactNode } from "react"; /** * This component creates an island of interactivity on the page, following the [Island * Architecture](https://www.jahia.com/blog/leveraging-the-island-architecture-in-jahia-cms) * paradigm. * * ```tsx * *
If MyComponent takes children, it will receive them here.
*
; * ``` * * It takes an optional `clientOnly` prop: * * - By default or when set to `false`, the component will be rendered on the server and hydrated in * the browser. In this case, children are passed to the component. * - When set to `true`, the component will be rendered only in the browser, skipping the server-side * rendering step. This is useful for components that cannot be rendered on the server. In this * case, children are used as a placeholder until the component is hydrated. */ export declare function Island(props: { /** The React component to render. */ component: ComponentType; } & (keyof Omit extends never ? { props?: never; } : Partial> extends Omit ? { /** Props to forward to the component. */ props?: Omit; } : { /** Props to forward to the component. */ props: Omit; }) & (Props extends { children: infer Children; } ? { /** * If false or undefined, the component will be rendered on the server. If true, * server-side rendering will be skipped. */ clientOnly?: false; /** The children to render inside the component. */ children: Children; } : "children" extends keyof Props ? { /** * If false or undefined, the component will be rendered on the server. If true, * server-side rendering will be skipped. */ clientOnly?: false; /** The children to render inside the component. */ children?: Props["children"]; } | { /** * If false or undefined, the component will be rendered on the server. If true, * server-side rendering will be skipped. */ clientOnly: true; /** Placeholder content until the component is rendered on the client. */ children?: ReactNode; } : { /** * If false or undefined, the component will be rendered on the server. If true, * server-side rendering will be skipped. */ clientOnly?: false; children?: never; } | { /** * If false or undefined, the component will be rendered on the server. If true, * server-side rendering will be skipped. */ clientOnly: true; /** Placeholder content until the component is rendered on the client. */ children?: ReactNode; })): ReactNode;