import { ReactNode } from 'react'; type TToggleCallback = (toggleState?: boolean) => void; export type TCollapsibleProps = { /** * This is only used to initialize the `isOpen` state once, when the component mounts. * Therefore there should not be any `componentWillReceiveProps` to update the state * from an external source. */ isDefaultClosed?: boolean; /** * A render-prop function. *
* `children` will be called with `options: { isOpen: boolean; toggle: TToggleCallback }` *
* `options.toggle` will be defined given that Collapsible is a controlled component. */ children: (options: { isOpen: boolean; toggle?: TToggleCallback; }) => ReactNode; /** * Passing this prop makes the component a controlled component. * Controlled components also require to pass a `onToggle` callback function. */ isClosed?: boolean; /** * A callback function, called when the consumer calls the `toggle` function. * This function is only required when the component is controlled. */ onToggle?: TToggleCallback; }; declare const Collapsible: { ({ isDefaultClosed, ...props }: TCollapsibleProps): import("@emotion/react/jsx-runtime").JSX.Element; displayName: string; }; export default Collapsible;