/** * @license EUPL-1.2+ * Copyright Gemeente Amsterdam */ import type { ReactNode } from 'react'; type UseCollapsibleItemProps = { children: ReactNode; defaultExpanded?: boolean; expanded?: boolean; onToggle?: (expanded: boolean) => void; }; /** * Drives the collapsible behaviour of a `TableOfContents.Link` that wraps a nested list: it tracks the * expanded state (controlled via `expanded` or uncontrolled via `defaultExpanded`), links the toggle * button to the nested list through a stable `aria-controls` id, and restores focus to the toggle when * collapsing a subtree that holds focus. * * When uncontrolled, the initial expanded state follows the nested list's `defaultExpanded` prop, * falling back to the default inherited from the surrounding list; an explicit `defaultExpanded` on the * Link overrides both. This resolved default seeds the shared `useCollapsible` state once, on mount. * * Returns the refs, state, and rendered children the link needs; it deliberately leaves the markup and * the accessible label text to the component. */ export declare const useCollapsibleItem: ({ children, defaultExpanded, expanded, onToggle }: UseCollapsibleItemProps) => { buttonRef: import("react").RefObject; handleToggle: () => void; isExpandable: boolean; isExpanded: boolean; itemRef: import("react").RefObject; nestedListId: string; renderedChildren: ReactNode; }; export {};